Skip to content

Instantly share code, notes, and snippets.

View Groostav's full-sized avatar

Geoff Groostav

View GitHub Profile
@Groostav
Groostav / CLIClient.kt
Last active October 16, 2016 21:59
Could-be CLI parser for kotlin
import kotlin.reflect.KClass
import kotlin.reflect.KProperty
fun main(args: Array<String>){
val args = ClientImpl(args).parse()
val importantServiceOrUIOrWhatever = IOC.doResolveThings(domainModel1 = args.domainModel, ...)
//...
}
@Groostav
Groostav / NoSuchMethodSSCCE.class
Last active November 24, 2016 05:19
Generated code problem
// ================com/empowerops/language/NoSuchMethodSSCCE.class =================
// class version 50.0 (50)
// access flags 0x31
public final class com/empowerops/language/NoSuchMethodSSCCE {
// access flags 0x11
public final asking for statically initialized field should not get NoSuchMethodError()V
@Lorg/junit/Test;()
L0
package com.empowerops.front_end.ui.external_tool.variable_detection
import com.empowerops.common.Disposable
import com.empowerops.common.EventBus
import com.empowerops.common.NumberParser
import com.empowerops.common.ui.FXMLLoader
import com.empowerops.front_end.ui.external_tool.variable_detection.VariableDetectionStepController.Companion.bindCaptureButtonText
import com.empowerops.front_end.ui.external_tool.variable_detection.VariableDetectionStepController.Companion.checkCaptureAndAsNecessary
import com.empowerops.front_end.ui.external_tool.variable_detection.VariableDetectionStepController.Companion.createStylePropertyWithBindingsTo
import com.empowerops.front_end.ui.external_tool.variable_detection.VariableDetectionStepController.LocationState.LOCATED
@Groostav
Groostav / client-side.ps1
Last active January 6, 2017 06:57
ssh pseudocode for running simulation on remote PC
#Client (OASIS-side) SSH starting script
$SSHcredentials =
#TODO: Find-Module Posh-SSH ??
echo ./server-side.sh | ssh localhost $SSHcredentials >> output.txt
@Groostav
Groostav / this_isnt_sparta.java
Created January 19, 2017 22:11
copy paste madness
package com.empowerops.doe;
import com.empowerops.jargon.model.Evaluable;
import com.empowerops.jargon.model.ExpensivePoint;
import com.empowerops.jargon.model.VariableSymbol;
import com.empowerops.linqalike.common.Tuple;
import javafx.scene.control.Button;
import javafx.scene.control.ListCell;
import javafx.scene.control.TextField;
@Groostav
Groostav / GraphModelBuilder.kt
Last active March 15, 2017 00:05
kotlinc heap overflow in heavy DSL user
package com.empowerops.jargon.assists
import com.empowerops.common.get
import com.empowerops.jargon.EvaluableCompiler
import com.empowerops.jargon.model.*
import com.empowerops.linqalike.Factories
import com.empowerops.linqalike.Factories.empty
import com.empowerops.linqalike.Queryable
import javax.inject.Inject
@Groostav
Groostav / KotlinFXMLExtensions.kt
Created February 24, 2017 20:58
a file that allows you to configure margines nicely from FXML
package com.empowerops.common.ui
import com.empowerops.common.ReflectionUtilities
import com.empowerops.common.ReflectionUtilities.getStaticFieldValue
import com.empowerops.common.Unit
import com.empowerops.common.ui.FXMLExtensions.Node.StandardContextMenuRequestHandler.Companion.standardContextHandler
import javafx.event.EventHandler
import javafx.geometry.Insets
import javafx.scene.control.ContextMenu
import javafx.scene.control.TextFormatter
@Groostav
Groostav / build.output
Created March 13, 2017 18:51
ant build output from kotlinc with -Xmx 2G
config.versions:
[echo] Build configured for 1.3.96.320-1469s
[echo] host=1.8.0_77, source=1.8, target=1.8.0_77
[echo] running javac -version...
[exec] javac 1.8.0_77
[exec] Kotlin version 1.1.0 (JRE 1.8.0_77-b03)
[echo] running kotlinc -version...
config.java:
@Groostav
Groostav / Existing pipe code.kt
Last active April 8, 2017 20:41
Sample current pipe code on our codebase
import some.jna
import some.dtos
import some.other.domainmodels
makeEncodingAndConnectingPipe(/* makes a connected pipes using Win32 CreateNamedPipe over JNA */).use { pipe ->
pipe.writeMessage(json(StartMessage))
expect<StartAck>(pipe.readMessage())
while(isBusinessLogic()){
@Groostav
Groostav / message demultiplexer with actors.kt
Last active April 26, 2017 10:01
heartbeat and IO whiteboarding
class ResponseDemultiplexingPipe(val blockingPipe: Pipe) {
sealed class IO {}
class Read(val id: UUID, response: Channel<MessageDTO>): IO
class Write(val id: UUID, response: MessageDTO): IO
var map: Map<UUID, Differed<MessageDTO>> = emptyMap()
val actor = actor<IO>(CommonPool) {