Skip to content

Instantly share code, notes, and snippets.

@tarrsalah
tarrsalah / InjectingFXMLLoader.java
Last active January 20, 2021 16:40
Generic FXMLLoader.
import java.io.IOException;
import java.net.URL;
import javafx.fxml.FXMLLoader;
import javafx.util.Callback;
/**
* InjectingFXMLLoader.java (UTF-8)
*
* Apr 13, 2013
* @author tarrsalah.org
@tarrsalah
tarrsalah / hoveFX.java
Created March 12, 2013 14:54
Change a button text when hovering
btn.textProperty().bind(
Bindings.when(new_btn.hoverProperty())
.then(new SimpleStringProperty("Hello!"))
.otherwise(new SimpleStringProperty("New"));
@tarrsalah
tarrsalah / ropeinternet.sml
Created February 26, 2013 00:44
solution the RopeInternet google codejam problem
(* solving the rope internet problem *)
exception Error
val min = Int.min
val inFile= TextIO.stdIn
val outFile= TextIO.stdOut
fun new_node (n1,n2) l =
(* how many nodes did this tuple introduce to the problem *)