jkbbwr
01/06/2018, 2:07 AMbyte b1 = (byte) 0xAD;
byte b2 = (byte) 0xCA;
short s = (short) (b1<<8 | b2);
karelpeeters
01/06/2018, 9:59 AMclass Test<out T>(val a: T) {
val b: T? = null
fun derp() {
val b: T
}
}
alexcouch
01/07/2018, 6:16 AMvar (str1, str2): String
as a way of declaring a local/top-level var/val to be of whatever type you want it to be, and only as long as you want them both to be a var or a val as I've shown (otherwise it'd be counter intuitive). Is there a hacky way of doing so, or is it just not at all desired and for what reason?czyzby
01/07/2018, 10:45 AMdh44t
01/08/2018, 11:54 AMsuspend
lambdayaakov
01/08/2018, 5:11 PMhelpermethod
01/09/2018, 8:45 AMcases.xPath = "//"
doesn't seem to workjkbbwr
01/09/2018, 12:54 PMtess_snow
01/09/2018, 1:17 PMlovis
01/09/2018, 2:46 PMinterface BootstrapListener {
fun onBootstrapComplete()
object DoNothing : BootstrapListener {
override fun onBootstrapComplete() {}
}
}
class PlayoutSocketClient(..., private val bootstrapListener: BootstrapListener = BootstrapListener.DoNothing)
menegatti
01/09/2018, 4:09 PMaraqnid
01/09/2018, 4:18 PMdSebastien
01/09/2018, 8:10 PMyaakov
01/09/2018, 8:48 PMShawn
01/09/2018, 8:56 PMcedric
01/09/2018, 10:21 PMCzar
01/10/2018, 1:51 PMfilter
to avoid creating a mapmike_shysh
01/10/2018, 1:54 PMtestDataConst.filterKeys { it.contains("NodeForDelete") }
.values.map { NodeID(it) } << need to create an object=)
.toList()
yaakov
01/10/2018, 4:52 PMcravalec
01/10/2018, 5:01 PMMichael H. Cox (Mike) (he/him)
01/11/2018, 12:51 AMqwert_ukg
01/11/2018, 2:59 AMcedric
01/11/2018, 5:02 AMsrc/test/kotlin
alex2069
01/11/2018, 6:49 AM// Configure TestNG
project.afterEvaluate {
def tests = project.getTasksByName("testDebugUnitTest", false) + project.getTasksByName("testReleaseUnitTest", false)
tests.forEach {
it.doFirst {
useTestNG()
testLogging.showStandardStreams = true
}
}
}
louiscad
01/11/2018, 11:07 AMsealed class
inside another one is a bad idea? My use case is to represent the states of CameraCaptureSession
from Android Camera2 API (see these state callbacks: https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.StateCallback.html)
Here's my updated sealed class
that is inside a custom CamCaptureSession
class:
sealed class State {
sealed class Configured() : State() {
companion object : Configured()
sealed class InputQueueEmpty : Configured() {
companion object : InputQueueEmpty()
object Ready : InputQueueEmpty()
}
object Active : Configured()
}
sealed class Closed : State() {
companion object : Closed()
object ConfigureFailed : Closed()
}
}
tschuchort
01/11/2018, 1:37 PMIain
01/11/2018, 3:07 PMRoberto Fernandez
01/11/2018, 5:33 PMfun getView(cardGraphs: List<Graph>): View {
val graphsContainer = RelativeLayout(context)
graphsContainer.layoutParams = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
cardGraphs.fold(null) { view: View?, graph: Graph ->
return addView(graphsContainer, view, getView(graph))
}
return graphsContainer
}
With this code, my function getView (the main function) is returning whatever is the first return of the addView() inside fold..If i set return@fold it needs return Nothing? but my method addView() returns View so it has a type parameter errors..
Can someone explain what is happening here in both cases? and why?Paul Woitaschek
01/12/2018, 10:05 AMfun round(x : Float) : Float
returns float but javas Math.int round(float a)
returns int?Natsuki(开元米粉实力代购)
01/12/2018, 11:11 AMNatsuki(开元米粉实力代购)
01/12/2018, 11:11 AMgildor
01/12/2018, 11:37 AM