I hereby claim:
- I am mikehearn on github.
- I am hearn (https://keybase.io/hearn) on keybase.
- I have a public key ASAtBlfHGFrnjtqS-telpy4tveHymEWbfRtzMnMQYgKOMgo
To claim this, I am signing this object:
/** | |
* Maps elements of type F to E with change listeners working as expected. | |
*/ | |
public class MappedList<E, F> extends TransformationList<E, F> { | |
private final Function<F, E> mapper; | |
private final ArrayList<E> mapped; | |
/** | |
* Creates a new MappedList list wrapped around the source list. | |
* Each element will have the given function applied to it, such that the list is cast through the mapper. |
/** | |
* This list is created by dynamically concatenating all the source lists together. | |
*/ | |
public class ConcatenatingList<T> extends ObservableListBase<T> implements ObservableList<T> { | |
private List<ObservableList<T>> sources = new ArrayList<>(); | |
private ListChangeListener<T> listener = this::sourceChanged; | |
@SafeVarargs | |
public ConcatenatingList(ObservableList<T>... source) { | |
super(); |
public static class AnimatedBindInfo { | |
@Nullable public Timeline timeline; | |
public NumberBinding bindFrom; | |
public Runnable onAnimFinish; | |
} | |
public static AnimatedBindInfo animatedBind(Node node, WritableDoubleValue bindTo, NumberBinding bindFrom) { | |
bindTo.set(bindFrom.doubleValue()); // Initialise. | |
bindFrom.addListener((o, prev, cur) -> { | |
AnimatedBindInfo info = (AnimatedBindInfo) node.getUserData(); |
class ThreadBox<T>(private val data: T) { | |
synchronized fun use<R>(block: (T) -> R): R = block(data) | |
synchronized fun useWith<R>(block: T.() -> R): R = data.block() | |
} | |
class UIThreadBox<T>(private val data: T) { | |
fun use(block: (T) -> Unit): Unit = if (Platform.isFxApplicationThread()) block(data) else Platform.runLater { block(data) } | |
fun useWith(block: T.() -> Unit): Unit = if (Platform.isFxApplicationThread()) data.block() else Platform.runLater { data.block() } | |
/** Does a blocking get from the UI thread - danger of deadlock if not used properly! */ |
open class LinearVal<T>(private val _v: T) { | |
open operator fun invoke(): T { | |
return _v | |
} | |
inline fun move(): LinearVal<T> { | |
if (this !is UnavailableLinearVal) | |
throw AssertionError() | |
@Suppress("DEPRECATION") | |
return __dupe() |
import java.io.File | |
import kotlin.system.measureTimeMillis | |
fun main(args: Array<String>) { | |
val name = if (args.size > 1) args[0] else "/usr/share/dict/words" | |
val time = measureTimeMillis { | |
repeat(200) { | |
go(name) | |
} |
I hereby claim:
To claim this, I am signing this object:
/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin/jlink --list-plugins | |
List of available plugins: | |
Plugin Name: class-for-name | |
Option: --class-for-name | |
Description: Class optimization: convert Class.forName calls to constant loads. | |
Plugin Name: compress | |
Option: --compress=<0|1|2>[:filter=<pattern-list>] |
enum SortBy { | |
Featured, | |
Relevance, | |
PriceLowToHigh, | |
PriceHighToLow, | |
Reviews | |
} | |
@PermazenType | |
class AmazonSearch( |
<html> | |
<head> | |
<title>Hello World!</title> | |
<style> | |
div.centered { | |
padding: 1em; | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
margin-right: -50%; |