Skip to content

Instantly share code, notes, and snippets.

View rothso's full-sized avatar

Rothanak So rothso

  • SS&C Black Diamond
  • Jacksonville, FL, USA
View GitHub Profile
@rothso
rothso / edges.clj
Created October 11, 2019 21:56
A* Project edges
(([:goal [34 19]]
(([:d [18 20]] 16.0312195418814)
([:h [31 19]] 3)
([:h [34 16]] 3)))
([:a [2 6]]
(([:a [17 6]] 15)
([:a [2 1]] 5)
([:b [7 8]] 5.385164807134504)
([:b [1 9]] 3.1622776601683795)
([:c [10 8]] 8.246211251235321)
@rothso
rothso / README.md
Last active April 5, 2019 00:48
Compilers Project 3 Test Cases

The following represents a set of tests that might be considered. The list is not required, nor is it complete, but may be used as a goal for semantic analysis. Run the REJECT cases separately. This guarantees each individual case is rejected.

Semantic Rules

Functions not declared void must return values of the correct type (int, float).

// ACCEPT

int x(void) { return 4; }
float w(void) { return 4.0E-13; }
@rothso
rothso / one.md
Last active February 27, 2021 22:52
Displaying a MediaView in JavaFX

Goal: Show a preview of your input and output videos in your JavaFX scene and become Asian Kid

Step 1

Integrate the code from Moussa. Here's the code in its raw form, without any modifications:

String MEDIA_URL = "https://liveexample.pearsoncmg.com/common/sample.mp4";

Media media = new Media(MEDIA_URL);
MediaPlayer mediaPlayer = new MediaPlayer(media);
@rothso
rothso / duplicates.go
Created December 6, 2017 15:14
Go function that returns the duplicate elements in a slice
func findDuplicates(elements []int) []int {
// Use map to record duplicates as we find them.
encountered := map[int]bool{}
result := []int{}
for v := range elements {
if encountered[elements[v]] == true {
// Append to result slice.
result = append(result, elements[v])
} else {
@rothso
rothso / DriveController.java
Created December 7, 2016 23:16
Hotswapping Joysticks
public interface DriveController {
ContinuousRange getXSpeed();
ContinuousRange getYSpeed();
ContinuousRange getRotationSpeed();
}
@rothso
rothso / build.gradle
Created October 23, 2016 03:36
Leaked build script for our secret water game bot.
group 'org.teamresistance.frc.ohmer'
version '1.0-SNAPSHOT'
buildscript {
repositories {
mavenCentral()
maven { url "http://dev.imjac.in/maven" }
}
dependencies {
// Keep an eye on https://github.com/Open-RIO/GradleRIO/issues/11