alchzh
11/20/2017, 1:56 AMtrent
11/20/2017, 5:18 AMcontext = null
, for Non-Nullable types? Is it impossible?tekjar
11/20/2017, 11:31 AMtechie01
11/20/2017, 11:36 AMcarolos
11/20/2017, 1:28 PMvar kotlin_version by extra { "1.1.60" }
and I am getting an unresolved reference 😞 even though I have seen some examples that do that
instead I have to do this:
var kotlin_version: String by extra
kotlin_version = "1.1.60"
am I doing something wrong?Hugh
11/21/2017, 12:43 PMchi
11/22/2017, 11:48 AMval bufferedImgFile: BufferedImage = ImageIO.read(File(filePath))
val imageMatrix: Array<IntArray> = Array(height) { IntArray(width) }
(0..(bufferedImgFile.height - 1)).map { hgt ->
(0..(bufferedImgFile.width - 1)).map { wdt ->
imageMatrix[hgt][wdt] = bufferedImgFile.getRGB(hgt, wdt)
}
}
And
val bufferedImgFile: BufferedImage = ImageIO.read(File(filePath))
val imageMatrix: Array<IntArray> = Array(height) { IntArray(width) }
async {
(0..(bufferedImgFile.height - 1)).map { hgt ->
async {
(0..(bufferedImgFile.width - 1)).map { wdt ->
data[hgt][wdt]= bufferedImgFile.getRGB(hgt, wdt)
}
}
}
}
The former would crash with an ArrayOutOfBoundsException
, the later doesn't crash and completes. Please why is this so?tekjar
11/22/2017, 11:56 AMshr
is not resolved in the above functionOleksii Malovanyi
11/22/2017, 3:40 PMdetekt
and wanna write custom rules for android (e.g. ignore UnsafeCast for context.getSystemService
), so a bit messy with AST and compiler-embedable
module. Could anyone provide link to some tutorial or smth to understand basics of ASTNode
parsing: e.g. how to get method body properly or get variable type, etc. Thanks!Snild
11/23/2017, 11:25 AMerror()
looks good. But we're all in agreement that this is a bit weird, right? Would it be reasonable to file an issue on the compiler, to get some kind of official opinion on whether or not it works as intended?kristofdho
11/23/2017, 12:45 PMstr
is an implicitly predefined variabletulio
11/23/2017, 2:18 PMDias Neto, J.
11/24/2017, 3:12 AMvxh.viet
11/24/2017, 4:04 AM>>> val letters = Array(26) { i -> ('a' + i).toString() }
>>> println(letters.joinToString(""))
abcdefghijklmnopqrstuvwxyz
What exactly is 'a' + i
? I've done a little bit of testing and depending on i
it will return a character. For example:
println('a' + 2)
c
It seems very basic but I can't find any more detail explanation for this.birgersp
11/24/2017, 2:13 PMSlackbot
11/24/2017, 2:28 PMtmseiler
11/24/2017, 9:03 PMelect
11/25/2017, 6:58 PMdata.requests
with map
instead of using the if
at the end?
val rq = data.requests.find{ it.id == which && it.loaded }
if(rq != null){
val sc = rq.scene
if (--rq.refCnt == 0) data.requests.remove(rq)
return sc
}
Slackbot
11/28/2017, 8:48 AMtekjar
11/28/2017, 10:01 AMalex.tavella
11/28/2017, 3:22 PMpoohbar
11/29/2017, 1:18 PMSmit Aen
11/29/2017, 2:08 PMbirgersp
11/29/2017, 2:18 PMadam-mcneilly
11/29/2017, 2:55 PMkevinmost
11/29/2017, 7:45 PMvoid
or Void
, it uses Unit
. You want logic: (g: Graphics) -> Unit
birgersp
11/30/2017, 8:28 AMinterface Consumer<T> {
fun consume(item: T)
}
class SomeClass {
fun processInteger(integer: Int) {
println("I got ${integer}")
}
}
fun invokeConsumerFunction(consumer: Consumer<Int>) {
consumer.consume(123)
}
fun main(args: Array<String>) {
val obj = SomeClass()
// Attempts, neither of them compiles
invokeConsumerFunction(obj.processInteger)
invokeConsumerFunction({item -> obj.processInteger(item)})
}
leodeng
11/30/2017, 7:46 PMkarelpeeters
12/01/2017, 2:57 PMjava.lang.Character
, not sure though.Andreas Sinz
12/01/2017, 3:29 PM