jackmiras
07/21/2017, 3:33 PMmat
07/22/2017, 2:00 PMegoscio
07/22/2017, 8:03 PMmpcjanssen
07/23/2017, 8:58 AMkevinmost
07/23/2017, 1:56 PMdumptruckman
07/23/2017, 5:55 PMsupaham
07/23/2017, 7:57 PMfun args(args: Iterable<String>)
and i pass it an Array<String> it says array is not a subtype of iterable. What's the solution to this problem?tschuchort
07/23/2017, 9:27 PMpakoito
07/24/2017, 12:24 AMevkaky
07/24/2017, 7:55 AMval eof = '\0' // doesn't work
evkaky
07/24/2017, 8:05 AMThere is no such thing as a EOF characterreally sadly
rrader
07/24/2017, 8:06 AMfred.deschenes
07/24/2017, 2:16 PMnekoinemo
07/25/2017, 4:39 AMcodematix
07/25/2017, 7:01 AMfabianterhorst
07/25/2017, 10:13 AMferoz_baig
07/25/2017, 11:14 AMkevinmost
07/25/2017, 3:12 PMfoo: String
and foo: mut String
, and no val
and var
😛kevinmost
07/25/2017, 3:16 PMstuff(): Job = launch(UI) { ... }
leonardkoch
07/25/2017, 3:37 PMdamian
07/25/2017, 5:01 PMuntil
😞ilya.gorbunov
07/25/2017, 6:29 PMpasssy
07/25/2017, 11:12 PMblakelee
07/26/2017, 3:44 AMkarelpeeters
07/26/2017, 6:25 AMroamingthings
07/26/2017, 6:59 AMval myNullableString : String?
val resultingString = if (myNullableString.isNullOrBlank()) myNullDefaultString else String.format(myNullableString!!, someOtherString)
I have to use myNullableString!!
in String.format()
since the compiler would not be able to figure out that isNullOrBlank()
includes a null-check. Is this correct or is there any way to tell the compiler that a function will infer that the instance is not null?feroz_baig
07/26/2017, 8:10 AMfun main(args: Array<String>) = runBlocking {
val job = launch(CommonPool) {
var nextPrintTime = System.currentTimeMillis()
var i = 0
while (i < 10) { // computation loop
val currentTime = System.currentTimeMillis()
if (currentTime >= nextPrintTime) {
println("I'm sleeping ${i++} ...")
nextPrintTime += 500L
}
}
}
delay(1300L) // delay a bit
println("main: I'm tired of waiting!")
job.cancel() // cancels the job
delay(1300L) // delay a bit to see if it was cancelled....
println("main: Now I can quit.")
}
Why is the job not cancelled after calling it explicitly?rrader
07/26/2017, 9:45 AMdata class Login(@get:NotBlank @get:Size(min=3) @JsonProperty(value = "login", required = true) val login: String,
@get:NotBlank @JsonProperty(value = "password", required = true) val password: String)
annotations are used for validation, validation is executed after constructor
but before validation, I need to trim login
and password
, in order to reject values as " r " for login
, because real value is "r" and size is 1, which is less than 3
how to do this in Kotlin?gabrielfv
07/26/2017, 10:33 PMval something = someExpr()
get() = someOtherExpr()
class Foo {
var bar = 2
get() {
tar *= 4
return tar
}
var tar = 3
}
poohbar
07/27/2017, 8:23 AMpoohbar
07/27/2017, 8:23 AMkagomez
07/27/2017, 2:51 PM