Ruckus
01/04/2019, 7:00 PMopen class Parent(val num: Int)
class Child : Parent
println(Child().num) // What should this print?
karelpeeters
01/04/2019, 7:09 PMstart until start + count
aarjav
01/05/2019, 8:14 PMpoohbar
01/06/2019, 12:05 AM.map
?
return sequence {
// some code
yield(thing)
}
.map { it.something }
.toList()
Am i formatting it wrong? How would you format it?Egor
01/06/2019, 8:09 PMfun main(args: Array<String>) {
println("ab" in "aa".."az")
println("ba" in "aa".."az")
}
/* Output:
true
false
*/
I can understand that you can validate the range between 'a'..'z'. I'm just not quite able to grasp the idea of validating 'aa'..'az'serebit
01/06/2019, 11:38 PMRomain
01/07/2019, 9:19 AMinit()
but when I call the function doSomething()
I have the exception "lateinit property c has not been initialized". I don't really get why as it has been initialized before. This is on Android. Thank youdG
01/07/2019, 4:39 PMany
(inline fun <reified T : Any> any()
). What would be appropriate syntax here, to include a class T?Matheus
01/08/2019, 3:12 PMval item1: String = ""
val item2: String? = getItem2()
val map = mapOf(1 to item1, 2 to item2) //only if item2 is not null
dvlwj
01/09/2019, 3:47 AMMatch.ceil
feature for this, to predict they payment the buyer gonna use.
The problem is for use Match.ceil
i need to have the number in float
, but then i read this https://stackoverflow.com/a/3730040 , which is telling that a bad one to use float
for financial purpose.
What i need to do?
My code is something like this :
val a: Double = valueInput1.toDouble()
val b: Double = 5000.toDouble()
val c = Math.ceil(a/b)*5000
println(c)
A Gamal
01/09/2019, 10:24 AMlateinit
? I use isInitialized
everytime I access lateinit
, so I wonder if I could optimize that and only do the check once. In case of a nullable type, I could do something like that.bodiam
01/09/2019, 12:41 PMpoohbar
01/09/2019, 6:22 PMpoohbar
01/09/2019, 6:27 PMChild
oday
01/12/2019, 1:27 PMMichaelMalus
01/13/2019, 12:21 AMval samplemessage = json {
"decodes" to {
"ref" to 43989
"vrm" to "AV11LPR"
"frameID" to 12029991
"spacedVRM" to "AV11 LPR"
"seenCount" to 18
"cameraName" to "Test_MAV_IQ"
"decodeID" to 44606
"repeatedPlate" to false
"timeStamp" to
{"Time" to 1473670749
"ms" to 64
"LocalTime" to 1473677949}
"timeSync" to
{"timeMode" to 0
"lastSyncTime" to 1473062065
"lastSyncSource" to "SNTP"
"lastSyncInfo" to "192.53.103.108"}
"direction" to 126
"motion" to "towards"
"frameTimeRef" to 606284767
}
}
aarjav
01/13/2019, 5:02 PMgaspard
01/13/2019, 9:23 PMconstructor(param1: String, param2 : string) : this(param1, param2 = "default value")
Kevin
01/16/2019, 4:01 AMedwardwongtl
01/16/2019, 6:01 AModay
01/16/2019, 2:52 PMKevin
01/16/2019, 6:53 PMnerdstone
01/16/2019, 7:59 PMreified
modifier but don't seem to be getting it well could someone please explain it or rather send a link with its usage? That will be helpfulShawn
01/16/2019, 9:39 PMMain.kt
?febs
01/16/2019, 9:49 PMBernhard
01/17/2019, 10:21 AMursus
01/17/2019, 5:22 PMbytes[0].toInt() shl 24 or (bytes[1].toInt() and 0xFF shl 16) or (bytes[2].toInt() and 0xFF shl 8) or (bytes[3].toInt() and 0xFF);
any sane person would write it alteast as
fun byteArrayToInt(bytes: ByteArray): Int {
return bytes[0].toInt() shl 24
or (bytes[1].toInt() and 0xFF shl 16)
or (bytes[2].toInt() and 0xFF shl 8)
or (bytes[3].toInt() and 0xFF);
}
amiracam
01/17/2019, 11:12 PMTsvetozar Bonev
01/18/2019, 10:54 AMUzi Landsmann
01/18/2019, 12:22 PMUzi Landsmann
01/18/2019, 12:22 PMkarelpeeters
01/18/2019, 12:23 PMUzi Landsmann
01/18/2019, 12:27 PMAlowaniak
01/18/2019, 12:27 PM${'$'}foo
Uzi Landsmann
01/18/2019, 12:28 PMAlowaniak
01/18/2019, 12:29 PM"""
“${'$'}{somthing}”
"""
Uzi Landsmann
01/18/2019, 12:29 PMkarelpeeters
01/18/2019, 12:29 PMUzi Landsmann
01/18/2019, 12:56 PM{'$'}
in the wrong place and omits them where needed. But I guess it’s a question for another channel. Thanks again!