Hullaballoonatic
09/11/2018, 11:46 PM^
as a power operatorValV
09/13/2018, 2:13 AMaddListener { ... }
?
Java's example shows something like addListener((obs, oldVal, newVal) -> { ... })
Sam
09/13/2018, 2:29 PMclass Container< T : Number > (private var value : T ) {
fun getContainedValue() : T = value
}
fun <T : Number > processContainer( container : Container<T> ) {
container.getContainedValue()
}
fun processContainer1( container : Container<Number> ) {
container.getContainedValue()
}
fun main(args: Array<String>) {
val intContainer = Container(2)
processContainer( intContainer )
processContainer1( intContainer ) // Errors
}
ursus
09/13/2018, 2:55 PMjdn
09/13/2018, 6:01 PMGlobalScope.launch { dao.insert(note) }
for simple background work where I don't expect a result.
Also, would thread { dao.insert(note) }
be an appropriate alternative?Hullaballoonatic
09/13/2018, 6:03 PMwith
and how do I make use of it?supotuco
09/13/2018, 11:07 PMprivate Foo foo;
to private Foo mFoo;
ValV
09/13/2018, 11:42 PMDaniele Segato
09/14/2018, 4:18 PMin Int.MIN_VALUE until 0
I also know I can save the value and compare to 0 using a when
with no parameter.
But are these really the only ways? Can't I do something similar to the code below?
And to check !0 with ranges I would have to write:
!in in 1..Int.MAX_VALUE && !in -1 downTo Int.MIN_VALUE
But this doesn't look right, there must be another way, right?Hullaballoonatic
09/15/2018, 5:25 PMclass BasePerson : Person
Interface Person
?ValV
09/15/2018, 6:01 PM{
someFun()
"Some Text"
anything + else
}
In order to "catch" some specific statementsotakusenpai
09/16/2018, 1:25 PMVladyslav Sitalo
09/16/2018, 2:02 PMfun processStrings(vararg strings: String)...
When I try to call it from Java though it’s seen as a function that accepts an array of strings instead of vararg function.
Is there a way to make this function accept vararg from Java’s perspective?otakusenpai
09/16/2018, 8:48 PMotakusenpai
09/16/2018, 10:46 PMclass StrawHat {
constructor() : Wearable(name = "Straw Hat") {
}
}
The constructor of this class gives an error: Expecting a this or super constructor call....
How do i call this type of constructors?v79
09/17/2018, 8:38 AMChris
09/17/2018, 9:35 AMDouble
? I would like the exact number of deciaml digits, ie. 424.234 would return 3 or “234” (either would be good) thanks in advance.karelpeeters
09/17/2018, 10:09 AM0b_1100_0000
should just work like that.Slackbot
09/17/2018, 11:27 AMSomeCat
09/17/2018, 12:44 PMSudhir Singh Khanger
09/17/2018, 2:20 PMfun isFavorite(otherIceCream: IceCream) = iceCream == otherIceCream
What is going on in this syntax? We have one equality operator and another is assignment.Sam
09/17/2018, 3:40 PMsubashz
09/17/2018, 4:29 PMsubashz
09/17/2018, 4:30 PMHullaballoonatic
09/17/2018, 6:29 PMHullaballoonatic
09/18/2018, 12:14 AMSlackbot
09/18/2018, 11:08 AMCamilleBC
09/19/2018, 1:31 PMotakusenpai
09/19/2018, 7:27 PMobject BasicSoldier {
fun init() {
this.meleeWeapon = BasicSword
.....
}
lateinit var meleeWeapon : MeleeWeapon
How do i instantiiate the BasicSword object ? It has a fun init() method which is used to instantiate it.
Pls helpGuschinaglia
09/20/2018, 11:58 AM