Function | Function type | Target passed as | Returns |
---|---|---|---|
also |
Extension | it |
Target |
apply |
Extension | this |
Target |
let |
Extension | it |
Block return value |
run |
Extension | this |
Block return value |
with |
Regular | this |
Block return value |
Function | Function type | Target passed as | Returns |
---|---|---|---|
also |
Extension | it |
Target |
apply |
Extension | this |
Target |
let |
Extension | it |
Block return value |
run |
Extension | this |
Block return value |
with |
Regular | this |
Block return value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// style1.css | |
.split-pane > .split-pane-divider { | |
-fx-padding: 1; | |
} | |
// Sample.java | |
splitPane.getStylesheets().add(getClass().getResource("style1.css").toExternalForm()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cloc --vcs git --include-lang=Kotlin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
unlike dependencies resources needs to be defined explicitly e. g. without any sort of inheritance | |
*/ | |
/*platform*/ | |
typealias LoaderOnSuccess = Loader.() -> Unit | |
object Loader { | |
fun load(vararg resources: List<String>, onSuccess: LoaderOnSuccess? = null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.Math.* | |
val t: Double = 0.0 | |
data class vec2(var x: Double = 0.0, var y: Double = 0.0) | |
open class Pixel { | |
val uv: vec2 = vec2() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.controlsfx.samples.spreadsheet; | |
import javafx.collections.FXCollections; | |
import javafx.collections.ObservableList; | |
import javafx.scene.Node; | |
import javafx.stage.Stage; | |
import org.controlsfx.ControlsFXSample; | |
import org.controlsfx.control.spreadsheet.GridBase; | |
import org.controlsfx.control.spreadsheet.SpreadsheetCell; | |
import org.controlsfx.control.spreadsheet.SpreadsheetCellType; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*featurea gradle settings*/ | |
enableFeaturePreview("GRADLE_METADATA") | |
void artifacts(Closure closure) { | |
closure.delegate = new Catalog(this, settings.rootProject.projectDir) | |
closure() | |
} | |
class Catalog { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void artifact(String path) { | |
File artifactDir = new File(path.replaceAll(":", "")) | |
if (!artifactDir.exists()) throw new RuntimeException("Artifact not found: ${artifactDir.absolutePath}") | |
String projectName | |
if (path.contains(":")) { | |
List<String> tokens = path.split("/").toList() | |
tokens.removeIf {it.endsWith(":")} | |
projectName = tokens.join(":") | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package featurea | |
import kotlin.jvm.JvmOverloads | |
import kotlin.jvm.Transient | |
class PriorityQueue<E> : Queue<E> { | |
companion object { | |
private const val DEFAULT_INITIAL_CAPACITY = 11 | |
private const val MAX_ARRAY_SIZE = Int.MAX_VALUE - 8 |