Skip to content

Instantly share code, notes, and snippets.

View bjonnh's full-sized avatar
🐈

Jonathan Bisson bjonnh

🐈
View GitHub Profile
class TableRow(col1: String, col2: String, col3: String): BaseDataComponent() {
var col1 by obs(col1)
var col2 by obs(col2)
var col3 by obs(col3)
}
override fun start(state: Map<String, Any>) {
I18n.manager =
MAXIONS = 3
intensite=[1000,20,30,100,1000]
masse=[1,2,3,4,5]
intensite,masse = zip(*sorted(zip(intensite,masse))[-MAXIONS:])
print(intensite,masse)
fun run(): arrow.core.Tuple2<IO<ResultSet>, () -> kotlin.Unit> {
val (localExec, cancelQuery) = fxCancellable {
createQueryExecutionInExternalLib(…Some query…) // returns immediately with an object that allows to abort
}
val (localResult, cancelResult) = fxCancellable {
localExec.bind().executequery() // Blocking task
}
return fx { localResult.bind() } toT {
package net.nprod.mnwe
import javafx.scene.input.KeyCombination
import tornadofx.*
class MainView: View() {
override val root = tabpane {
tab("1") {
button("Click me") {
package net.nprod.failuretable
import javafx.beans.property.SimpleListProperty
import javafx.beans.property.SimpleObjectProperty
import javafx.scene.control.TableView
import javafx.scene.paint.Color
import javafx.stage.Stage
import tornadofx.*
import java.time.LocalDate
import java.time.Period
override fun call(url: String, parameters: Map<String, String>): IO<String> =
fx {
effect { calcDelay() }
val call: HttpClientCall = effect {
httpClient.call("$apiURL/$url") {
method = HttpMethod.Get
parameters.forEach { k, v -> parameter(k, v) }
}
}
effect {
from enum import Enum
from dataclasses import dataclass, field
from typing import List
class TYPES(Enum):
STD = "std"
WW = "W/W"
HH = "H/H"
SS = "S/S"
WH = "W/H"
import unittest
import rnaviewparser.rnaview_ast as ast
class TestNode(unittest.TestCase):
def test_repr(self):
node = ast.Node([])
self.assertEqual(node.__repr__(), "Basic Node")
if __name__ == '__main__':
unittest.main()
class Query(subject: Resource?, label: String, content: String) {
private val originalSubjectProperty = SimpleStringProperty(subject.toString())
fun originalSubjectProperty() = originalSubjectProperty
var originalSubject by originalSubjectProperty
private val subjectProperty = SimpleStringProperty(subject.toString())
fun subjectProperty() = subjectProperty
var subject by subjectProperty
private val originalLabelProperty = SimpleStringProperty(label)
class ResultFragment: Fragment() {
var insertInQuery: MenuItem by singleAssign()
override val scope = super.scope as ResultsScope
override val root = tableview(scope.items) {
columnResizePolicy = TableView.CONSTRAINED_RESIZE_POLICY
smartResize()
selectionModel.isCellSelectionEnabled = true
contextMenu = ContextMenu().apply {
insertInQuery = item("Insert in queryTextArea")