Marc Knaup
11/29/2018, 9:51 PMHullaballoonatic
11/29/2018, 9:59 PMHullaballoonatic
11/29/2018, 11:11 PMShawn
11/29/2018, 11:14 PMinfix fun <http://Int.cat|Int.cat>(other: Int): Int = (toString() + other.toString()).toInt()
diesieben07
11/29/2018, 11:14 PMa * pow(10, log10(b)) + b
Shawn
11/29/2018, 11:15 PMHullaballoonatic
11/29/2018, 11:36 PMagrosner
11/30/2018, 2:30 AMkschlesselmann
11/30/2018, 7:42 AMenum class
looks like
enum class Condition {
EXACT {
override fun evaluate(actual: Set<String>, expected: Set<String>) = actual == expected
},
//....
abstract fun evaluate(actual: Set<String>, expected: Set<String>): Boolean
}
coder82
11/30/2018, 8:47 AMthijs
11/30/2018, 10:50 AMprivate val journeyId by DetailFragmentArgs.journeyId
And I would like to make this lazybartvh
11/30/2018, 1:01 PMwhen (v) {
is Enum<*> -> {
val ev: Enum<*> = v
val kc: KClass<Enum<*>> = ev.javaClass.kotlin
val ser: EnumSerializer<*> =
// EnumSerializer(kc)
EnumSerializer::class.primaryConstructor!!.call(kc)
Does anybody know a combination of casts/suppressions/*/magical incantations that could allow the commented out line to work?Yogesh Gosavi
11/30/2018, 4:27 PMAlowaniak
11/30/2018, 9:32 PMAndrew Gazelka
12/01/2018, 4:28 AMDelegateClass<A>
and inline operator fun <reified T> getValue
which would look really messy since we are assuming A
and T
are the same. I would need to do this, because I need to input the default value into the class, but classes can't be reified.Yutsa
12/01/2018, 6:12 PM@SpringBootTest
class ParsingIntegrationTest(@Autowired val cardPriceService: CardPriceService) {
It gives me this error :
java.lang.Exception: Test class should have exactly one public zero-argument constructor
hudsonb
12/01/2018, 6:30 PMMarcin Wisniowski
12/01/2018, 11:43 PMkarelpeeters
12/02/2018, 11:23 AMrrader
12/02/2018, 1:14 PMobject Users {
val id: Long = 10
val name : String ="name"
val cityId : Long = 42
}
fun main(args: Array<String>) {
slice(Users::name)
}
fun slice(vararg properties: KProperty<Users>) {
properties.forEach { println(it.name) }
}
what should be properties
type that will accept only Users properties?bod
12/02/2018, 4:40 PMmyObj.foo { bar() }
where bar
is a method on some class passed as the receiver of the lambda - but foo
is declared/implemented in Java. Ideas? 🙂keturn
12/02/2018, 8:00 PMsilas.schwarz
12/03/2018, 10:25 AMmiguelsesma
12/03/2018, 12:47 PMPaul Woitaschek
12/03/2018, 2:05 PMPaul Woitaschek
12/03/2018, 2:08 PMAny
but the subtypes are not directly related so they can't be sealed classes.Joe
12/03/2018, 3:26 PMclass PhaseDefinition<C: GameContextBase, T: GamePhaseBase<C>>(val init: PhaseDefinition<C, T>.() -> Unit) {...}
APXEOLOG
12/03/2018, 4:26 PM...
once { some code ... }
...
APXEOLOG
12/03/2018, 4:54 PMAPXEOLOG
12/03/2018, 5:09 PMprivate val checkPoints: MutableSet<String> = HashSet()
fun once(action: () -> Unit) {
val stackTrace = Throwable().stackTrace[1]
val key = "${stackTrace.fileName}_${stackTrace.methodName}_${stackTrace.lineNumber}"
if (!checkPoints.contains(key)) {
checkPoints.add(key)
action()
}
}
fun main() {
repeat(100) {
once { print("Say hi!") }
}
}
APXEOLOG
12/03/2018, 5:09 PMprivate val checkPoints: MutableSet<String> = HashSet()
fun once(action: () -> Unit) {
val stackTrace = Throwable().stackTrace[1]
val key = "${stackTrace.fileName}_${stackTrace.methodName}_${stackTrace.lineNumber}"
if (!checkPoints.contains(key)) {
checkPoints.add(key)
action()
}
}
fun main() {
repeat(100) {
once { print("Say hi!") }
}
}
karelpeeters
12/03/2018, 7:12 PM!checkPoints.contains(key)
is key !in checkPoints
Alan Evans
12/03/2018, 9:40 PMadd
returns a boolean https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/add.html.
if (checkPoints.add(key)) {
action()
}
rnpy
12/03/2018, 10:19 PMThread.currentThread().stackTrace
can give you current stacktrace without creation a Throwable