A simple SkipList implementation with int keys.
Based on SylvanasSun/SkipList.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package lib.junit5.tools; | |
| import static java.util.stream.Collectors.toList; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.nio.file.Files; | |
| import java.nio.file.Path; | |
| import java.nio.file.Paths; |
This NIO example uses the new(ish) Selector.select(Consumer<?>) api
which seems to solve a lot of the spurious wakeup problems in previous examples.
The example also demonstrates performing channel read/write functions asynchronously via SelectionKey interestOps() and attach() manipulation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function flatten(a) { | |
| if (!Array.isArray(a)) { | |
| throw("Not an array: "+a); | |
| } | |
| let b = new Array(); | |
| append(a); | |
| return b; | |
| function append(x) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This gist provides a simple example of the various steps involved in making a java runtime image using the new jlink tool. | |
| This example also has simple jni and shared library parts to show how jmod and jlink deal with those elements. | |
| To build, just download the gist zip file, unzip that and cd into the gist directory, then: | |
| # sh ungist | |
| # ln -s ${JAVA_HOME} jdk | |
| # make build | |
| # make image | |
| # make demo | |