This file contains 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
import com.google.inject.AbstractModule; | |
import com.google.inject.Provides; | |
public class FXMLLoadingModule extends AbstractModule { | |
private final FXMLLoadingScope fxmlLoadingScope; | |
public FXMLLoadingModule() { | |
fxmlLoadingScope = new FXMLLoadingScope(); | |
} |
This file contains 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 projmon.guice; | |
import java.util.ArrayList; | |
import com.google.inject.Key; | |
import com.google.inject.Provider; | |
import com.google.inject.Singleton; | |
@Singleton | |
public class FXMLLoadingScope extends EnterableScope { |
This file contains 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
@Target({ TYPE, METHOD }) @Retention(RUNTIME) @ScopeAnnotation | |
public @interface FXMLLoadingScoped { | |
} |
This file contains 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
import java.util.concurrent.CountDownLatch; | |
import javax.swing.SwingUtilities; | |
import javafx.application.Platform; | |
import javafx.embed.swing.JFXPanel; | |
import org.junit.Rule; | |
import org.junit.rules.TestRule; | |
import org.junit.runner.Description; |
This file contains 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
import java.awt.Color; | |
import java.awt.Graphics; | |
import java.awt.GraphicsConfiguration; | |
import java.awt.GraphicsDevice; | |
import java.awt.GraphicsEnvironment; | |
import java.awt.Image; | |
import java.awt.Transparency; | |
import java.awt.image.BufferedImage; | |
import java.io.File; |
This file contains 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
import java.lang.invoke.MethodHandle; | |
import java.lang.invoke.MethodHandles; | |
import java.lang.invoke.MethodType; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
public class MethodHandleTest | |
{ | |
private static final String METHOD_NAME = "increment"; |
This file contains 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
%% @author atill | |
%% | |
%% @doc | |
%% CSV parsing module. Parsed CSV will be processed and converted | |
%% into a list containing the separated values, lines are separated | |
%% by the newline atom. | |
-module(csv). | |
-import(lists, [reverse/1]). |
This file contains 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 projmon.hierarchical; | |
import javafx.event.EventHandler; | |
import javafx.geometry.Point2D; | |
import javafx.scene.control.TreeCell; | |
import javafx.scene.control.TreeItem; | |
import javafx.scene.effect.InnerShadow; | |
import javafx.scene.input.ClipboardContent; | |
import javafx.scene.input.DragEvent; | |
import javafx.scene.input.Dragboard; |
This file contains 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
public class Math { | |
public static boolean isPrime(final long number) { | |
if (number == 2) | |
return true; | |
if (number < 2) | |
return false; | |
if(number % 2 == 0) | |
return false; | |
long maxCheck = (long) Math.sqrt(number); |
This file contains 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
# web proxy for a neo4j database, using Heroku but could be easily modified for anything else | |
# this code is a modified version of the code found here https://github.com/akollegger/nosql-now/blob/master/web.rb | |
# the main changes are... | |
# - authentication required for modification, although viewing is allowed without authentication (auth can be added by calling protected! in the get method) | |
# - the domain returned in the data is replaced with the proxy domain instead of being removed which was causing errors in the java jersey library | |
# - modified post routing, this wasn't catching all POST requests | |
require 'sinatra' | |
require 'rest-client' | |
require 'json' |