Use the class ZkAwareFederationAuthenticator
in your META-INF/context.xml
as described in https://cxf.apache.org/fediz-tomcat.html
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
/** | |
* Manually load <code>web-fragment.xml</code> from JARs and class folders on the classpath. | |
* | |
* <p>Jetty can only find them automatically if the fragment is in a JAR in <code>WEB-INF/lib/</code>. | |
*/ | |
protected void loadWebFragments(WebAppContext ctx) { | |
Map<Resource, Resource> frags = getOrCreateFragmentResources(ctx); | |
try { | |
ArrayList<URL> urls = Collections.list(getClass().getClassLoader().getResources("META-INF/web-fragment.xml")); | |
urls.forEach(url -> { |
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.geom.Rectangle2D; | |
import org.apache.pdfbox.text.PDFTextStripperByArea; | |
public class PageRegion { | |
private String name; | |
private Rectangle2D rect; | |
// Coordinates are in the order in which the Apache PDF-Box Debugger displays them |
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
// Version 7: Scoring | |
int px = 320, py = 240; | |
int tileSize = 20; | |
int score = 0; | |
int signum(float value) { | |
return value < 0 ? -1 : value > 0 ? 1 : 0; | |
} |
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
// Version 6: Winning the game | |
int px = 320, py = 240; | |
int tileSize = 20; | |
int signum(float value) { | |
return value < 0 ? -1 : value > 0 ? 1 : 0; | |
} | |
class Enemy { |
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
// Version 5: Eating Platty | |
int px = 320, py = 240; | |
int tileSize = 20; | |
int signum(float value) { | |
return value < 0 ? -1 : value > 0 ? 1 : 0; | |
} | |
class Enemy { |
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
// Version 4: Hunting Platty | |
int px = 320, py = 240; | |
int tileSize = 20; | |
int signum(float value) { | |
return value < 0 ? -1 : value > 0 ? 1 : 0; | |
} | |
class Enemy { |
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
// Version 3: Moving Around | |
int px = 320, py = 240; | |
int tileSize = 20; | |
class Enemy { | |
color c; | |
int x, y; | |
String name; | |
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
// Version 2: Enemies | |
int px = 320, py = 240; | |
int tileSize = 20; | |
class Enemy { | |
color c; | |
int x, y; | |
String name; | |
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
// Version 1: Setup and a Simple Player Character | |
void setup() { | |
size(640, 480); //VGA for those old enough to remember | |
} | |
int px = 320, py = 240; | |
int tileSize = 20; | |
void drawPlatty() { |