Skip to content

Instantly share code, notes, and snippets.

View Groostav's full-sized avatar

Geoff Groostav

View GitHub Profile
Caused by: java.nio.file.NoSuchFileException: C:\Users\Inhal\AppData\Roaming\OASIS 2020.1\licenses\trial-license.l4j
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:53)
at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:38)
at sun.nio.fs.WindowsFileSystemProvider.readAttributes(WindowsFileSystemProvider.java:193)
at java.nio.file.Files.readAttributes(Files.java:1737)
at java.nio.file.Files.size(Files.java:2332)
at com.empowerops.front_end.LicenseImportingServiceImpl$findLicenseCacheSources$2.invokeSuspend(LicenseImportingService.kt:142)
//second attempt, now with more code!
fun StyledTextArea<*, *>.asDebouncedTextChangesFlow(): Flow<PropertyChange<String?>>
= debounceAsTyping(textProperty(), textProperty().asFlow(), focusedProperty())
fun TextInputControl.asDebouncedTextChangesFlow(): Flow<PropertyChange<String?>>
= debounceAsTyping(textProperty(), textProperty().asFlow(), focusedProperty())
fun <T> Flow<PropertyChange<T>>.debounceAsTyping(source: ObservableValue<T>, focusedProperty: ObservableValue<Boolean> = BooleanConstant.TRUE): Flow<PropertyChange<T>>
= debounceAsTyping(source, this, focusedProperty)
@Groostav
Groostav / changes.md
Last active September 16, 2019 08:19
work-in-progress OASIS 2020 UI

before: image

after: image

before: image

<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import custommenu.view.ContextMenuPane?>
<AnchorPane xmlns:fx="http://javafx.com/fxml" fx:controller="custommenu.controller.CustomMenuController">
<children>
<VBox fx:id="vbox" onContextMenuRequested="#showMenu"
onMousePressed="#hideMenu" prefHeight="200" prefWidth="200">
@Groostav
Groostav / JavaFxUtilities.kt
Last active August 5, 2019 21:35
Strategy to synchronously enter asynchronous code
package com.empowerops.common
import com.sun.javafx.tk.Toolkit
import kotlinx.coroutines.*
import kotlinx.coroutines.javafx.JavaFx
import java.util.*
private class ExceptionWrapper(val ex: Throwable)
@Groostav
Groostav / eventcontext.kt
Created July 26, 2019 19:45
first crack at mutable event bus context
class EventContext(key: Key): AbstractCoroutineContextElement(key) {
private val completed = CompletableDeferred<Unit>()
private var events: AtomicReference<ImmutableList<EventWrapper>?> = AtomicReference(immutableListOf())
// in this implementation, polling an empty list "closes" it,
// thus, if you poll a list of 1 element, it becomes a list of 0 elements,
// when thats polled, its atomically closed and subsequent offer calls return false.
fun poll(): EventWrapper? {
@Groostav
Groostav / results.log
Created June 11, 2019 21:02
looks fine to me
[ditto@teamcity ~]$ cat ./.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTEe1AqswRuHevBWuuuIcEzFTxz+glnohcGQWFpQShhawcTiB4FRhF3FsayU1Qt9HaiDd/Mafdnh0tGpWGJ/sozl6l3ydFSD++FIlJM9TSxhnPHMOOBKLISpB3rDSH4Nz8C6Hp0ySMtF2aMZhCSz/EKjjm/iV6cTQ/ScYFh3rcn6Y78cR3U9WgOFFfFaIfh9QQRs3oN6RowrlE+Oj+5U6W8PtPgcoC+smxd1DxEE2aX96FhlpmeRyAQtyoJEPj07LExKPEIQ6Vv2aAiL13EB/dK5qV5gSeq5+m9C/OOscnR/S6NkXUpsprxpXPyVFmanaKn87i57Iq5146IKP+Wfwr geoff@Kusinagi-2
[ditto@teamcity ~]$ logout
Connection to teamcity.empowerops.ca closed.
C:\Users\Geoff\Code\OASIS\Samples\PowerShell\SC function via ssh [2238_create_non_commercial_version ≡ +0 ~2 -0 !]> cat C:\Users\Geoff\.ssh\id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTEe1AqswRuHevBWuuuIcEzFTxz+glnohcGQWFpQShhawcTiB4FRhF3FsayU1Qt9HaiDd/Mafdnh0tGpWGJ/sozl6l3ydFSD++FIlJM9TSxhnPHMOOBKLISpB3rDSH4Nz8C6Hp0ySMtF2aMZhCSz/EKjjm/iV6cTQ/ScYFh3rcn6Y78cR3U9WgOFFfFaIfh9QQRs3oN6RowrlE+Oj+5U6W8PtPgcoC+smxd1DxEE2aX96FhlpmeRyAQtyoJEPj07LExKPEIQ6Vv2aAiL13EB/dK5qV5gSeq5+m9C/OOscnR/S6NkXUpsprxpXPyVFm
Param(
$OutputCerts = "./sslcerts",
$ServerCN = "127.0.0.1",
$ClientCN = "127.0.0.1"
)
Get-Command "openssl" -ErrorAction Stop
# you can get this from choco with
# choco install openssl-light
@Groostav
Groostav / my opinions.kt
Created March 11, 2019 19:01
synchronizing on database events
@Test fun `should receive updated data when querying all challenges`() = runBlocking<Unit> {
//setup
val initChallenges = list(Challenge(...),Challenge(...))
val newSurveyChallenge = SurveyChallenge(...)
val expectedChallenges = initChallenges + newSurveyChallenge
//act
initChallenges.forEach(challengeDao::addOrUpdate)
challengeDao.addOrUpdate(newSurveyChallenge)
@Groostav
Groostav / ReasonablySimpleTest.kt
Last active March 3, 2019 19:41
trying to use Undispatched to clean up stack traces
@Test fun `when using a rendezvous channel can see through to caller if configured`() = runBlocking{
val channel = Channel<String>(RENDEZVOUS)
var exception: Exception? = null
val producer = GlobalScope.launch(Dispatchers.IO){
hardpoint {
channel.send("hello!")
}
}