This file contains 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 io.data2viz.examples.thomas | |
import io.data2viz.color.Colors | |
import io.data2viz.geom.Size | |
import io.data2viz.scale.Scales | |
import io.data2viz.viz.JFxVizRenderer | |
import io.data2viz.viz.Viz | |
import io.data2viz.viz.viz | |
import javafx.application.Application |
This file contains 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 io.data2viz.svg | |
import javafx.animation.AnimationTimer | |
import javafx.application.Application | |
import javafx.scene.Group | |
import javafx.scene.Scene | |
import javafx.scene.paint.Color | |
import javafx.scene.shape.Circle | |
import javafx.scene.shape.Rectangle | |
import javafx.stage.Stage |
This file contains 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 io.data2viz.color.htmlColors | |
import io.data2viz.color.colors.col | |
val aliceblue by lazy { 0xf0f8ff.col } | |
val aqua by lazy { 0x00ffff.col } | |
val aquamarine by lazy { 0x7fffd4.col } | |
val azure by lazy { 0xf0ffff.col } | |
val beige by lazy { 0xf5f5dc.col } | |
val bisque by lazy { 0xffe4c4.col } |
This file contains 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
// runs the code in the background thread pool | |
fun asyncOverlay() = async(CommonPool) { | |
// start two async operations | |
val original = asyncLoadImage("original") | |
val overlay = asyncLoadImage("overlay") | |
// and then apply overlay to both results | |
applyOverlay(original.await(), overlay.await()) | |
} | |
// launches new coroutine in UI context |
This file contains 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 jug.dsl | |
val kotlinSurveyDef = createNewSurveyDef("Évaluation du kotlin user group") { | |
introduction = "Merci de prendre 20 secondes pour répondre à quelques questions." | |
val appreciation = intQuestion("Quelle est votre appréciation de la dernière session ?"){ | |
min = 1 | |
max = 5 | |
} |
This file contains 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.gzk.marslander | |
import java.io.StringReader | |
import java.util.* | |
fun main(args: Array<String>) { | |
val bestChimp = findBestChimp(::createMarsLander1FromGenome, ::marsLander1Fitness) | |
println( | |
bestChimp.result.trajectory.drop(1).joinToString (transform = { state -> "${state.angle}, ${state.power}" }) | |
) |
This file contains 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.gzk.marslander | |
import java.lang.Math.random | |
val log = true | |
val elitism = true | |
val generationsCount = 10 | |
val populationSize = 20 | |
val genomeSize = 1200 |
This file contains 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.gzk.marslander | |
data class Time(val sec:Double) | |
val Double.sec: Time | |
get() = Time(this) | |
/** | |
* Speed is internally using a vector, allowing to compose it. speed12 = speed1 + speed2 | |
*/ |
This file contains 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.gzk.marslander | |
import java.lang.Math.* | |
/** | |
* A point in a 2 dimensions cartesian system. | |
* Point + Vector -> Point | |
* Point - Point -> Vector | |
*/ | |
data class Point(val x:Double, val y: Double) { |
This file contains 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.gzk.marslander | |
val GRAVITY = acceleration(0.0, -3.711) | |
val maxX = 6999 | |
val minX = 0 | |
/** | |
* power : 0, 1, 2, 3, 4 | |
* angle : -90, -75, ... , 0, +15, +30, ..., +75, +90 | |
*/ |
NewerOlder