diff --git a/apikey b/apikey
new file mode 100644
index 0000000..52227a7
--- /dev/null
+++ b/apikey
@@ -0,0 +1 @@
+PR8LRMV1V0FX
\ No newline at end of file
diff --git a/d4dj_rankTracker.jar b/d4dj_rankTracker.jar
index 0d4bf91..4685a96 100644
Binary files a/d4dj_rankTracker.jar and b/d4dj_rankTracker.jar differ
diff --git a/output.png b/output.png
new file mode 100644
index 0000000..f8a5cca
Binary files /dev/null and b/output.png differ
diff --git a/pom.xml b/pom.xml
index be57147..448993a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,19 +9,6 @@
0.0.1-SNAPSHOT
d4dj
-
- http://www.example.com
-
-
-
- com.google.cloud
- libraries-bom
- 18.0.0
- pom
- import
-
-
-
UTF-8
@@ -30,26 +17,22 @@
-
- com.google.cloud
- google-cloud-vision
-
junit
junit
4.11
test
-
- net.sourceforge.tess4j
- tess4j
- 3.2.1
-
org.apache.httpcomponents
httpclient
4.5.13
+
+ org.apache.httpcomponents
+ httpmime
+ 4.5.12
+
diff --git a/ranks/1.png b/ranks/1.png
new file mode 100644
index 0000000..62e26e9
Binary files /dev/null and b/ranks/1.png differ
diff --git a/ranks/10.png b/ranks/10.png
new file mode 100644
index 0000000..3bb9bf7
Binary files /dev/null and b/ranks/10.png differ
diff --git a/ranks/100.png b/ranks/100.png
new file mode 100644
index 0000000..9918fef
Binary files /dev/null and b/ranks/100.png differ
diff --git a/ranks/1000.png b/ranks/1000.png
new file mode 100644
index 0000000..6633b4b
Binary files /dev/null and b/ranks/1000.png differ
diff --git a/ranks/10000.png b/ranks/10000.png
new file mode 100644
index 0000000..f8f63f9
Binary files /dev/null and b/ranks/10000.png differ
diff --git a/ranks/10000_2.png b/ranks/10000_2.png
new file mode 100644
index 0000000..3ab833f
Binary files /dev/null and b/ranks/10000_2.png differ
diff --git a/ranks/1000_2.png b/ranks/1000_2.png
new file mode 100644
index 0000000..871c2fc
Binary files /dev/null and b/ranks/1000_2.png differ
diff --git a/ranks/100_2.png b/ranks/100_2.png
new file mode 100644
index 0000000..5ae1528
Binary files /dev/null and b/ranks/100_2.png differ
diff --git a/ranks/10_2.png b/ranks/10_2.png
new file mode 100644
index 0000000..6fbcde4
Binary files /dev/null and b/ranks/10_2.png differ
diff --git a/ranks/11.png b/ranks/11.png
new file mode 100644
index 0000000..76f1123
Binary files /dev/null and b/ranks/11.png differ
diff --git a/ranks/11_2.png b/ranks/11_2.png
new file mode 100644
index 0000000..999ec28
Binary files /dev/null and b/ranks/11_2.png differ
diff --git a/ranks/12.png b/ranks/12.png
new file mode 100644
index 0000000..3959e46
Binary files /dev/null and b/ranks/12.png differ
diff --git a/ranks/12_2.png b/ranks/12_2.png
new file mode 100644
index 0000000..470f74f
Binary files /dev/null and b/ranks/12_2.png differ
diff --git a/ranks/13.png b/ranks/13.png
new file mode 100644
index 0000000..4581e53
Binary files /dev/null and b/ranks/13.png differ
diff --git a/ranks/13_2.png b/ranks/13_2.png
new file mode 100644
index 0000000..2889305
Binary files /dev/null and b/ranks/13_2.png differ
diff --git a/ranks/14.png b/ranks/14.png
new file mode 100644
index 0000000..3dd4caa
Binary files /dev/null and b/ranks/14.png differ
diff --git a/ranks/14_2.png b/ranks/14_2.png
new file mode 100644
index 0000000..ad1ba28
Binary files /dev/null and b/ranks/14_2.png differ
diff --git a/ranks/15.png b/ranks/15.png
new file mode 100644
index 0000000..2d33a73
Binary files /dev/null and b/ranks/15.png differ
diff --git a/ranks/15_2.png b/ranks/15_2.png
new file mode 100644
index 0000000..2d4c664
Binary files /dev/null and b/ranks/15_2.png differ
diff --git a/ranks/16.png b/ranks/16.png
new file mode 100644
index 0000000..de88c5c
Binary files /dev/null and b/ranks/16.png differ
diff --git a/ranks/16_2.png b/ranks/16_2.png
new file mode 100644
index 0000000..9659210
Binary files /dev/null and b/ranks/16_2.png differ
diff --git a/ranks/17.png b/ranks/17.png
new file mode 100644
index 0000000..2625ede
Binary files /dev/null and b/ranks/17.png differ
diff --git a/ranks/17_2.png b/ranks/17_2.png
new file mode 100644
index 0000000..72ee81a
Binary files /dev/null and b/ranks/17_2.png differ
diff --git a/ranks/18.png b/ranks/18.png
new file mode 100644
index 0000000..c8be217
Binary files /dev/null and b/ranks/18.png differ
diff --git a/ranks/18_2.png b/ranks/18_2.png
new file mode 100644
index 0000000..d2e5613
Binary files /dev/null and b/ranks/18_2.png differ
diff --git a/ranks/19.png b/ranks/19.png
new file mode 100644
index 0000000..5f59bea
Binary files /dev/null and b/ranks/19.png differ
diff --git a/ranks/19_2.png b/ranks/19_2.png
new file mode 100644
index 0000000..8262fc4
Binary files /dev/null and b/ranks/19_2.png differ
diff --git a/ranks/1_2.png b/ranks/1_2.png
new file mode 100644
index 0000000..eb04c82
Binary files /dev/null and b/ranks/1_2.png differ
diff --git a/ranks/2.png b/ranks/2.png
new file mode 100644
index 0000000..b212309
Binary files /dev/null and b/ranks/2.png differ
diff --git a/ranks/20.png b/ranks/20.png
new file mode 100644
index 0000000..3a8e3b7
Binary files /dev/null and b/ranks/20.png differ
diff --git a/ranks/2000.png b/ranks/2000.png
new file mode 100644
index 0000000..50cfa12
Binary files /dev/null and b/ranks/2000.png differ
diff --git a/ranks/2000_2.png b/ranks/2000_2.png
new file mode 100644
index 0000000..4ab06b1
Binary files /dev/null and b/ranks/2000_2.png differ
diff --git a/ranks/20_2.png b/ranks/20_2.png
new file mode 100644
index 0000000..3ae4b2a
Binary files /dev/null and b/ranks/20_2.png differ
diff --git a/ranks/2_2.png b/ranks/2_2.png
new file mode 100644
index 0000000..2e05981
Binary files /dev/null and b/ranks/2_2.png differ
diff --git a/ranks/3.png b/ranks/3.png
new file mode 100644
index 0000000..f649e3e
Binary files /dev/null and b/ranks/3.png differ
diff --git a/ranks/3_2.png b/ranks/3_2.png
new file mode 100644
index 0000000..ab7764c
Binary files /dev/null and b/ranks/3_2.png differ
diff --git a/ranks/4.png b/ranks/4.png
new file mode 100644
index 0000000..d38a3e5
Binary files /dev/null and b/ranks/4.png differ
diff --git a/ranks/4_2.png b/ranks/4_2.png
new file mode 100644
index 0000000..0d2de05
Binary files /dev/null and b/ranks/4_2.png differ
diff --git a/ranks/5.png b/ranks/5.png
new file mode 100644
index 0000000..fa4d9d7
Binary files /dev/null and b/ranks/5.png differ
diff --git a/ranks/50.png b/ranks/50.png
new file mode 100644
index 0000000..df5b79e
Binary files /dev/null and b/ranks/50.png differ
diff --git a/ranks/500.png b/ranks/500.png
new file mode 100644
index 0000000..bbb3fec
Binary files /dev/null and b/ranks/500.png differ
diff --git a/ranks/5000.png b/ranks/5000.png
new file mode 100644
index 0000000..d4ff0eb
Binary files /dev/null and b/ranks/5000.png differ
diff --git a/ranks/5000_2.png b/ranks/5000_2.png
new file mode 100644
index 0000000..b03b973
Binary files /dev/null and b/ranks/5000_2.png differ
diff --git a/ranks/500_2.png b/ranks/500_2.png
new file mode 100644
index 0000000..ebd794e
Binary files /dev/null and b/ranks/500_2.png differ
diff --git a/ranks/50_2.png b/ranks/50_2.png
new file mode 100644
index 0000000..3b529ea
Binary files /dev/null and b/ranks/50_2.png differ
diff --git a/ranks/5_2.png b/ranks/5_2.png
new file mode 100644
index 0000000..86b53ce
Binary files /dev/null and b/ranks/5_2.png differ
diff --git a/ranks/6.png b/ranks/6.png
new file mode 100644
index 0000000..0c0376b
Binary files /dev/null and b/ranks/6.png differ
diff --git a/ranks/6_2.png b/ranks/6_2.png
new file mode 100644
index 0000000..87c28d6
Binary files /dev/null and b/ranks/6_2.png differ
diff --git a/ranks/7.png b/ranks/7.png
new file mode 100644
index 0000000..c4f3b4a
Binary files /dev/null and b/ranks/7.png differ
diff --git a/ranks/7_2.png b/ranks/7_2.png
new file mode 100644
index 0000000..997d1f4
Binary files /dev/null and b/ranks/7_2.png differ
diff --git a/ranks/8.png b/ranks/8.png
new file mode 100644
index 0000000..8b224b5
Binary files /dev/null and b/ranks/8.png differ
diff --git a/ranks/8_2.png b/ranks/8_2.png
new file mode 100644
index 0000000..5480f81
Binary files /dev/null and b/ranks/8_2.png differ
diff --git a/ranks/9.png b/ranks/9.png
new file mode 100644
index 0000000..9a13542
Binary files /dev/null and b/ranks/9.png differ
diff --git a/ranks/9_2.png b/ranks/9_2.png
new file mode 100644
index 0000000..55783cf
Binary files /dev/null and b/ranks/9_2.png differ
diff --git a/src/main/java/d4dj/d4dj/App.java b/src/main/java/d4dj/d4dj/App.java
index e2e9826..b5ab85a 100644
--- a/src/main/java/d4dj/d4dj/App.java
+++ b/src/main/java/d4dj/d4dj/App.java
@@ -1,542 +1,102 @@
package d4dj.d4dj;
import java.awt.Color;
-import java.awt.Font;
-import java.awt.Graphics2D;
import java.awt.Image;
-import java.awt.Point;
-import java.awt.Rectangle;
import java.awt.image.BufferedImage;
-import java.awt.image.ImageObserver;
import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Scanner;
+import java.util.HashMap;
+import java.util.Map;
import javax.imageio.ImageIO;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.math.NumberUtils;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.NameValuePair;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.message.BasicNameValuePair;
-import org.json.JSONObject;
-
-import com.google.cloud.vision.v1.ImageAnnotatorClient;
-import com.google.cloud.vision.v1.AnnotateImageRequest;
-import com.google.cloud.vision.v1.AnnotateImageResponse;
-import com.google.cloud.vision.v1.BatchAnnotateImagesResponse;
-import com.google.cloud.vision.v1.EntityAnnotation;
-import com.google.cloud.vision.v1.Feature;
-import com.google.cloud.vision.v1.Feature.Type;
-import com.google.cloud.vision.v1.ImageAnnotatorClient;
-import com.google.protobuf.ByteString;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.List;
-
-import net.sourceforge.tess4j.Tesseract;
-import net.sourceforge.tess4j.TesseractException;
+import sig.utils.FileUtils;
import sig.utils.ImageUtils;
-class SubmitThread implements Runnable{
- String name,description;
- int event,rank,points;
- boolean FINAL;
-
- SubmitThread(String name,String description,int points,int event,int rank,boolean FINAL) {
- this.name=name;
- this.description=description;
- this.points=points;
- this.event=event;
- this.rank=rank;
- this.FINAL=FINAL;
- }
-
- @Override
- public void run() {
- System.out.println(rank+": "+name+" ("+description+") - "+points);
- HttpClient httpclient = HttpClients.createDefault();
- HttpPost httppost = new HttpPost("http://projectdivar.com/eventsubmit");
- List params = new ArrayList();
- params.add(new BasicNameValuePair("eventid", Integer.toString(event)));
- params.add(new BasicNameValuePair("rank", Integer.toString(rank)));
- params.add(new BasicNameValuePair("name", name));
- params.add(new BasicNameValuePair("description", description));
- params.add(new BasicNameValuePair("points", Integer.toString(points)));
- if (FINAL) {
- params.add(new BasicNameValuePair("fin", Boolean.toString(FINAL)));
- }
- try {
- httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
-
- System.out.println("Rank "+rank+": ("+points+")");
- //Execute and get the response.
- HttpResponse response = null;
- try {
- response = httpclient.execute(httppost);
- } catch (IOException e) {
- e.printStackTrace();
- }
- HttpEntity entity = response.getEntity();
+import sig.utils.WebUtils;
- if (entity != null) {
- try (InputStream instream = entity.getContent()) {
- Scanner s = new Scanner(instream).useDelimiter("\\A");
- String result = s.hasNext() ? s.next() : "";
- System.out.println("Rank "+rank+": "+result+"("+points+")");
- //System.out.println(rank+": "+name+" ("+description+") - "+points);
- instream.close();
- } catch (UnsupportedOperationException | IOException e) {
- e.printStackTrace();
- }
- }
- }
-}
-public class App
-{
- public static Image paragraph/*,paragraph2,paragraph3*/;
- final static int EVENT = 20;
- public static int[] lastScores = new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
- public static int[] lastLowerTierScores = new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
- public static Font myFont = new Font("Serif", Font.BOLD, 26);
- public static int[] ranks = new int[] {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,
- 50,100,500,1000,2000,5000,10000,20000,30000,50000};
- public static int[] drawRanks = new int[] {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,
- 50,100,500,1000,2000,5000,10000,1000,2000,5000,10000,20000,30000,50000};
- public static boolean FINAL = false;
- public static void main( String[] args ) throws IOException
- {
- if (args.length>0) {
- if (args[0].equalsIgnoreCase("final")) {
- FINAL=true;
- }
- }
-
- Rectangle[] cropPoints1 = {
- new Rectangle(305,163,200,23),
- new Rectangle(305,262,200,23),
- new Rectangle(305,358,200,23),
- new Rectangle(305,453,200,23),
- new Rectangle(305,550,200,23),
- new Rectangle(305,645,200,23),
- new Rectangle(305,740,200,23)
- };
- Rectangle[] cropPoints2 = {
- new Rectangle(305,-191,200,23),
- new Rectangle(305,-96,200,23),
- new Rectangle(305,1,200,23),
- new Rectangle(305,95,200,23),
- new Rectangle(305,191,200,23),
- new Rectangle(305,287,200,23)
- };
- Rectangle[] cropPoints3 = {
- new Rectangle(305,206,200,23),
- new Rectangle(305,302,200,23),
- new Rectangle(305,398,200,23),
- new Rectangle(305,494,200,23),
- new Rectangle(305,589,200,23),
- new Rectangle(305,686,200,23),
- new Rectangle(305,781,200,23)
- };
-
- int lastCount=0;
-
- File folder = new File("Screenshots");
- File[] list2 = folder.listFiles();
- do {
+public class App {
+ public static String APIKEY = "";
+ public static void main(String[] args) {
+ if (new File("apikey").exists()) {
+ APIKEY = FileUtils.readFromFile("apikey")[0];
+ } else {
+ System.err.println("API Key file does not exist! It has been created at:");
+ File f = new File("apikey");
try {
- lastCount=list2.length;
- Thread.sleep(5000);
- } catch (InterruptedException e) {
+ f.createNewFile();
+ FileUtils.writetoFile(new String[] {"API key goes here."},"apikey");
+ } catch (IOException e) {
e.printStackTrace();
}
- list2 = folder.listFiles();
- } while (list2.length!=lastCount);
- for (File fff : list2) {
- fff.delete();
+ System.err.println(" "+f.getAbsolutePath());
+ System.err.println("Please fill it in then run this program again.");
+ System.exit(1);
}
- paragraph = ImageIO.read(new File("paragraph.png"));
- /*paragraph2 = ImageIO.read(new File("paragraph2.png"));
- paragraph3 = ImageIO.read(new File("paragraph3.png"));*/
- while (true) {
+ while (true) {
File f = new File("Screenshots");
- if (f.listFiles().length==5) {
- //New files found!
-
-
- //Grab the first 5 files and try to parse them.
- File[] list = f.listFiles();
- try {
- Image leaderboard = ImageIO.read(list[0]);
- BufferedImage leaderboard2 = ImageIO.read(list[1]);
- Image leaderboard3 = ImageIO.read(list[2]);
- Image leaderboard4 = ImageIO.read(list[3]);
- Image leaderboard5 = ImageIO.read(list[4]);
- BufferedImage cropped1 = new BufferedImage(910,42*48,BufferedImage.TYPE_INT_ARGB);
- Graphics2D g = cropped1.createGraphics();
- //For comments: down by 40, width is 340.
- for (int i=0;i220,G>220,B>220
- //Scroll back up until you find 36,17,77
- //That is the Y position you start at.
- int MAXTRIES=1000;
- int count=0;
- int YMarker=145;
- while (count++=220&&c.getGreen()>=220&&c.getBlue()>=220) {
- System.out.println("Step 2 - Found! Y:"+(YMarker-1));
- break;
- }
- }count=0;
- System.out.println("Test");*/
- while (count++5) {
- File[] list = f.listFiles();
- for (File ff : list) {
- ff.delete();
- }
- }
+ File[] fileList = f.listFiles();
+ for (File ff : fileList) {
+ ParseImage(ff);
+ ff.delete();
}
-
-
try {
- Thread.sleep(10000);
+ Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
- }
- }
-
- private static void drawData(Graphics2D g, int type,Image leaderboard, int i, int j, int k, int l, int x, int y, int m,
- int n, ImageObserver object) {
- switch (type) {
- case 0:{
- //g.drawImage(paragraph, 0, j, 18, l, 0, 0, 18, 23, object);
- }break;
- case 1:{
- //g.drawImage(paragraph, 2, j, 20, l, 0, 0, 18, 23, object);
- }break;
- case 2:{
- ///g.drawImage(paragraph, i-18, j, i, l, 0, 0, 18, 23, object);
- }break;
- }
- g.drawImage(leaderboard, i, j, k, l, x, y, m, n, object);
+ }
}
-
- private static void drawRank(Graphics2D g,int number,int y) {
- g.setFont(myFont);
- g.setColor(Color.BLACK);
- String numb=Integer.toString(number);
- for (int i=0;i<5-Integer.toString(number).length();i++) {
- numb="0"+numb;
- }
- g.drawString(numb,0,y+24);
- }
-
- // Detects text in the specified image.
- public static void detectText(String filePath) throws IOException {
- List requests = new ArrayList<>();
-
- ByteString imgBytes = ByteString.readFrom(new FileInputStream(filePath));
- com.google.cloud.vision.v1.Image img = com.google.cloud.vision.v1.Image.newBuilder().setContent(imgBytes).build();
- Feature feat = Feature.newBuilder().setType(Feature.Type.TEXT_DETECTION).build();
- AnnotateImageRequest request =
- AnnotateImageRequest.newBuilder().addFeatures(feat).setImage(img).build();
- requests.add(request);
-
- // Initialize client that will be used to send requests. This client only needs to be created
- // once, and can be reused for multiple requests. After completing all of your requests, call
- // the "close" method on the client to safely clean up any remaining background resources.
- StringBuilder reader = new StringBuilder();
-
- try (ImageAnnotatorClient client = ImageAnnotatorClient.create()) {
- BatchAnnotateImagesResponse response = client.batchAnnotateImages(requests);
- List responses = response.getResponsesList();
-
- for (AnnotateImageResponse res : responses) {
- if (res.hasError()) {
- System.out.format("Error: %s%n", res.getError().getMessage());
- return;
- }
-
- // For full list of available annotations, see http://g.co/cloud/vision/docs
- for (EntityAnnotation annotation : res.getTextAnnotationsList()) {
- reader.append(annotation.getDescription());
- //System.out.format("Position : %s%n", annotation.getBoundingPoly());
- break;
- //System.out.println(annotation.getDescription());
- //System.out.format("Text: %s%n", annotation.getDescription());
- }
- }
- client.close();
- }
- System.out.println(reader);
-
- String[] s = reader.toString().split("\n");
- int count=0;
- int rankIndex=0;
- String[] orderedRanks= new String[] {
- "00001","00002","00003","00004","00005","00006","00007","00008","00009","00010",
- "00011","00012","00013","00014","00015","00016","00017","00018","00019","00020",
- "00050","00100","00500","01000","02000","05000","10000","20000","30000","50000"
- };
- int[] dupData = new int[] {
- -1,-1,-1,-1,-1
- }; //Contains specifically 5k,10k,20k,30k,and 50k data.
- System.out.println(count+"/"+s.length);
- while (count mydata = new ArrayList();
- count++;
- mydata.add(orderedRanks[rankIndex]);
- int rank = Integer.parseInt(orderedRanks[rankIndex]);
- while (count4) {
- int marker=1;
- boolean foundName=false;
- boolean foundDesc=false;
- boolean foundPoints=false;
- String name = "";
- String desc = "";
- int points = 0;
- boolean submitted=false;
- while (marker0) {
- foundName=true;
- name = mydata.get(marker);
- } else
- if (!foundDesc&&mydata.get(marker).length()>0) {
- foundDesc=true;
- desc = mydata.get(marker);
- } else
- if (!foundPoints&&StringUtils.isNumeric(mydata.get(marker))&&mydata.get(marker).length()>0) {
- foundPoints=true;
- points = Integer.parseInt(mydata.get(marker));
- }
- marker++;
- }
- if (foundName&&foundDesc&&foundPoints) {
- new Thread(
- new SubmitThread(name,desc,points,EVENT,Integer.parseInt(mydata.get(0)),FINAL))
- .start();
- submitted=true;
- } else
- {
- System.out.println("Could not make a template from this: "+mydata);
- System.out.println("Name:"+foundName+"-"+name+", Description:"+foundDesc+"-"+desc+", Points:"+foundPoints+"-"+points);
- }
- } else {
- System.out.println("Could not find a suitable format for:"+mydata);
- }
- rankIndex++;
- } else {
- count++;
- }
- }
-
- /*System.out.println(scores);
- System.out.println(names);
- System.out.println(descriptions);*/
-
-
-
- /*
- for (int i=0;i0) {
- if (scores.size()<)
- }
- }*/
-
- //System.out.println(Arrays.toString(t20scores));
- //System.out.println(Arrays.toString(tempLowerTierScores));
- //Lower tier order is: 50,100,500,1000,2000,5000,10000,20000,30000,50000
- /*
- if (!error1) {
- for (int i=0;i<20;i++) {
- new Thread(
- new SubmitThread(t20names[i],t20desc[i],t20scores[i],EVENT,i+1))
- .start();
- }
- } else {
- System.out.println("Cannot submit t20 scores. Invalid array params.");
- }
- int[] ranks = new int[] {50,100,500,1000,2000,5000,10000,20000,30000,50000};
- if (!error2) {
- for (int j=0;j<10;j++) {
- try {
- //if (j>=1&&j<9&&Integer.parseInt(lowerTierScores[j])>Integer.parseInt(lowerTierScores[j+1])&&Integer.parseInt(lowerTierScores[j]) scores, int[] ranks, String ss) {
- if (scores.size()>20) {
- //See if this score is already in list.
- if (StringUtils.isNumeric(ss)) {
- int thisScore = Integer.parseInt(ss);
- boolean found=false;
- for (int i=0;i130&&c.getGreen()>=50&&c.getGreen()<=140&&c.getBlue()>=190&&c.getBlue()>130) {
+ foundPurple=true;
}
- if (StringUtils.isNumeric(ss)) {
- if (!found&&scores.size()0) {
+ template.getGraphics().setColor(Color.BLACK);
+ for (int i=0;i<7;i++) {
+ template.getGraphics().clearRect(0,60*i-2,2400,4);
+ }
+ template.getGraphics().clearRect(110,0,4,60*7);
+ template.getGraphics().clearRect(530,0,4,60*7);
+ template.getGraphics().clearRect(1262,0,4,60*7);
+ ImageIO.write(template,"png",new File("output.png"));
+ Map values = new HashMap();
+ values.put("language","jpn");
+ values.put("filetype","PNG");
+ values.put("isTable","true");
+ values.put("apikey",APIKEY);
+ System.out.println(WebUtils.POSTimage("https://apipro1.ocr.space/parse/image", new File("output.png"), values));
}
+ } catch (IOException e) {
+ e.printStackTrace();
}
}
-
}
diff --git a/src/main/java/d4dj/d4dj/App_old.java b/src/main/java/d4dj/d4dj/App_old.java
new file mode 100644
index 0000000..ef7263d
--- /dev/null
+++ b/src/main/java/d4dj/d4dj/App_old.java
@@ -0,0 +1,542 @@
+package d4dj.d4dj;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.image.BufferedImage;
+import java.awt.image.ImageObserver;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Scanner;
+
+import javax.imageio.ImageIO;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.math.NumberUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.json.JSONObject;
+
+import com.google.cloud.vision.v1.ImageAnnotatorClient;
+import com.google.cloud.vision.v1.AnnotateImageRequest;
+import com.google.cloud.vision.v1.AnnotateImageResponse;
+import com.google.cloud.vision.v1.BatchAnnotateImagesResponse;
+import com.google.cloud.vision.v1.EntityAnnotation;
+import com.google.cloud.vision.v1.Feature;
+import com.google.cloud.vision.v1.Feature.Type;
+import com.google.cloud.vision.v1.ImageAnnotatorClient;
+import com.google.protobuf.ByteString;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sourceforge.tess4j.Tesseract;
+import net.sourceforge.tess4j.TesseractException;
+import sig.utils.ImageUtils;
+class SubmitThread implements Runnable{
+ String name,description;
+ int event,rank,points;
+ boolean FINAL;
+
+ SubmitThread(String name,String description,int points,int event,int rank,boolean FINAL) {
+ this.name=name;
+ this.description=description;
+ this.points=points;
+ this.event=event;
+ this.rank=rank;
+ this.FINAL=FINAL;
+ }
+
+ @Override
+ public void run() {
+ System.out.println(rank+": "+name+" ("+description+") - "+points);
+ HttpClient httpclient = HttpClients.createDefault();
+ HttpPost httppost = new HttpPost("http://projectdivar.com/eventsubmit");
+ List params = new ArrayList();
+ params.add(new BasicNameValuePair("eventid", Integer.toString(event)));
+ params.add(new BasicNameValuePair("rank", Integer.toString(rank)));
+ params.add(new BasicNameValuePair("name", name));
+ params.add(new BasicNameValuePair("description", description));
+ params.add(new BasicNameValuePair("points", Integer.toString(points)));
+ if (FINAL) {
+ params.add(new BasicNameValuePair("fin", Boolean.toString(FINAL)));
+ }
+ try {
+ httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ }
+
+ System.out.println("Rank "+rank+": ("+points+")");
+ //Execute and get the response.
+ HttpResponse response = null;
+ try {
+ response = httpclient.execute(httppost);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ HttpEntity entity = response.getEntity();
+
+ if (entity != null) {
+ try (InputStream instream = entity.getContent()) {
+ Scanner s = new Scanner(instream).useDelimiter("\\A");
+ String result = s.hasNext() ? s.next() : "";
+ System.out.println("Rank "+rank+": "+result+"("+points+")");
+ //System.out.println(rank+": "+name+" ("+description+") - "+points);
+ instream.close();
+ } catch (UnsupportedOperationException | IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
+public class App_old
+{
+ public static Image paragraph/*,paragraph2,paragraph3*/;
+ final static int EVENT = 20;
+ public static int[] lastScores = new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+ public static int[] lastLowerTierScores = new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+ public static Font myFont = new Font("Serif", Font.BOLD, 26);
+ public static int[] ranks = new int[] {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,
+ 50,100,500,1000,2000,5000,10000,20000,30000,50000};
+ public static int[] drawRanks = new int[] {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,
+ 50,100,500,1000,2000,5000,10000,1000,2000,5000,10000,20000,30000,50000};
+ public static boolean FINAL = false;
+ public static void main( String[] args ) throws IOException
+ {
+ if (args.length>0) {
+ if (args[0].equalsIgnoreCase("final")) {
+ FINAL=true;
+ }
+ }
+
+ Rectangle[] cropPoints1 = {
+ new Rectangle(305,163,200,23),
+ new Rectangle(305,262,200,23),
+ new Rectangle(305,358,200,23),
+ new Rectangle(305,453,200,23),
+ new Rectangle(305,550,200,23),
+ new Rectangle(305,645,200,23),
+ new Rectangle(305,740,200,23)
+ };
+ Rectangle[] cropPoints2 = {
+ new Rectangle(305,-191,200,23),
+ new Rectangle(305,-96,200,23),
+ new Rectangle(305,1,200,23),
+ new Rectangle(305,95,200,23),
+ new Rectangle(305,191,200,23),
+ new Rectangle(305,287,200,23)
+ };
+ Rectangle[] cropPoints3 = {
+ new Rectangle(305,206,200,23),
+ new Rectangle(305,302,200,23),
+ new Rectangle(305,398,200,23),
+ new Rectangle(305,494,200,23),
+ new Rectangle(305,589,200,23),
+ new Rectangle(305,686,200,23),
+ new Rectangle(305,781,200,23)
+ };
+
+ int lastCount=0;
+
+ File folder = new File("Screenshots");
+ File[] list2 = folder.listFiles();
+ do {
+ try {
+ lastCount=list2.length;
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ list2 = folder.listFiles();
+ } while (list2.length!=lastCount);
+ for (File fff : list2) {
+ fff.delete();
+ }
+ paragraph = ImageIO.read(new File("paragraph.png"));
+ /*paragraph2 = ImageIO.read(new File("paragraph2.png"));
+ paragraph3 = ImageIO.read(new File("paragraph3.png"));*/
+ while (true) {
+ File f = new File("Screenshots");
+ if (f.listFiles().length==5) {
+ //New files found!
+
+
+ //Grab the first 5 files and try to parse them.
+ File[] list = f.listFiles();
+ try {
+ Image leaderboard = ImageIO.read(list[0]);
+ BufferedImage leaderboard2 = ImageIO.read(list[1]);
+ Image leaderboard3 = ImageIO.read(list[2]);
+ Image leaderboard4 = ImageIO.read(list[3]);
+ Image leaderboard5 = ImageIO.read(list[4]);
+ BufferedImage cropped1 = new BufferedImage(910,42*48,BufferedImage.TYPE_INT_ARGB);
+ Graphics2D g = cropped1.createGraphics();
+ //For comments: down by 40, width is 340.
+ for (int i=0;i220,G>220,B>220
+ //Scroll back up until you find 36,17,77
+ //That is the Y position you start at.
+ int MAXTRIES=1000;
+ int count=0;
+ int YMarker=145;
+ while (count++=220&&c.getGreen()>=220&&c.getBlue()>=220) {
+ System.out.println("Step 2 - Found! Y:"+(YMarker-1));
+ break;
+ }
+ }count=0;
+ System.out.println("Test");*/
+ while (count++5) {
+ File[] list = f.listFiles();
+ for (File ff : list) {
+ ff.delete();
+ }
+ }
+ }
+
+
+ try {
+ Thread.sleep(10000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ private static void drawData(Graphics2D g, int type,Image leaderboard, int i, int j, int k, int l, int x, int y, int m,
+ int n, ImageObserver object) {
+ switch (type) {
+ case 0:{
+ //g.drawImage(paragraph, 0, j, 18, l, 0, 0, 18, 23, object);
+ }break;
+ case 1:{
+ //g.drawImage(paragraph, 2, j, 20, l, 0, 0, 18, 23, object);
+ }break;
+ case 2:{
+ ///g.drawImage(paragraph, i-18, j, i, l, 0, 0, 18, 23, object);
+ }break;
+ }
+ g.drawImage(leaderboard, i, j, k, l, x, y, m, n, object);
+ }
+
+ private static void drawRank(Graphics2D g,int number,int y) {
+ g.setFont(myFont);
+ g.setColor(Color.BLACK);
+ String numb=Integer.toString(number);
+ for (int i=0;i<5-Integer.toString(number).length();i++) {
+ numb="0"+numb;
+ }
+ g.drawString(numb,0,y+24);
+ }
+
+ // Detects text in the specified image.
+ public static void detectText(String filePath) throws IOException {
+ List requests = new ArrayList<>();
+
+ ByteString imgBytes = ByteString.readFrom(new FileInputStream(filePath));
+
+ com.google.cloud.vision.v1.Image img = com.google.cloud.vision.v1.Image.newBuilder().setContent(imgBytes).build();
+ Feature feat = Feature.newBuilder().setType(Feature.Type.TEXT_DETECTION).build();
+ AnnotateImageRequest request =
+ AnnotateImageRequest.newBuilder().addFeatures(feat).setImage(img).build();
+ requests.add(request);
+
+ // Initialize client that will be used to send requests. This client only needs to be created
+ // once, and can be reused for multiple requests. After completing all of your requests, call
+ // the "close" method on the client to safely clean up any remaining background resources.
+ StringBuilder reader = new StringBuilder();
+
+ try (ImageAnnotatorClient client = ImageAnnotatorClient.create()) {
+ BatchAnnotateImagesResponse response = client.batchAnnotateImages(requests);
+ List responses = response.getResponsesList();
+
+ for (AnnotateImageResponse res : responses) {
+ if (res.hasError()) {
+ System.out.format("Error: %s%n", res.getError().getMessage());
+ return;
+ }
+
+ // For full list of available annotations, see http://g.co/cloud/vision/docs
+ for (EntityAnnotation annotation : res.getTextAnnotationsList()) {
+ reader.append(annotation.getDescription());
+ //System.out.format("Position : %s%n", annotation.getBoundingPoly());
+ break;
+ //System.out.println(annotation.getDescription());
+ //System.out.format("Text: %s%n", annotation.getDescription());
+ }
+ }
+ client.close();
+ }
+ System.out.println(reader);
+
+ String[] s = reader.toString().split("\n");
+ int count=0;
+ int rankIndex=0;
+ String[] orderedRanks= new String[] {
+ "00001","00002","00003","00004","00005","00006","00007","00008","00009","00010",
+ "00011","00012","00013","00014","00015","00016","00017","00018","00019","00020",
+ "00050","00100","00500","01000","02000","05000","10000","20000","30000","50000"
+ };
+ int[] dupData = new int[] {
+ -1,-1,-1,-1,-1
+ }; //Contains specifically 5k,10k,20k,30k,and 50k data.
+ System.out.println(count+"/"+s.length);
+ while (count mydata = new ArrayList();
+ count++;
+ mydata.add(orderedRanks[rankIndex]);
+ int rank = Integer.parseInt(orderedRanks[rankIndex]);
+ while (count4) {
+ int marker=1;
+ boolean foundName=false;
+ boolean foundDesc=false;
+ boolean foundPoints=false;
+ String name = "";
+ String desc = "";
+ int points = 0;
+ boolean submitted=false;
+ while (marker0) {
+ foundName=true;
+ name = mydata.get(marker);
+ } else
+ if (!foundDesc&&mydata.get(marker).length()>0) {
+ foundDesc=true;
+ desc = mydata.get(marker);
+ } else
+ if (!foundPoints&&StringUtils.isNumeric(mydata.get(marker))&&mydata.get(marker).length()>0) {
+ foundPoints=true;
+ points = Integer.parseInt(mydata.get(marker));
+ }
+ marker++;
+ }
+ if (foundName&&foundDesc&&foundPoints) {
+ new Thread(
+ new SubmitThread(name,desc,points,EVENT,Integer.parseInt(mydata.get(0)),FINAL))
+ .start();
+ submitted=true;
+ } else
+ {
+ System.out.println("Could not make a template from this: "+mydata);
+ System.out.println("Name:"+foundName+"-"+name+", Description:"+foundDesc+"-"+desc+", Points:"+foundPoints+"-"+points);
+ }
+ } else {
+ System.out.println("Could not find a suitable format for:"+mydata);
+ }
+ rankIndex++;
+ } else {
+ count++;
+ }
+ }
+
+ /*System.out.println(scores);
+ System.out.println(names);
+ System.out.println(descriptions);*/
+
+
+
+ /*
+ for (int i=0;i0) {
+ if (scores.size()<)
+ }
+ }*/
+
+ //System.out.println(Arrays.toString(t20scores));
+ //System.out.println(Arrays.toString(tempLowerTierScores));
+ //Lower tier order is: 50,100,500,1000,2000,5000,10000,20000,30000,50000
+ /*
+ if (!error1) {
+ for (int i=0;i<20;i++) {
+ new Thread(
+ new SubmitThread(t20names[i],t20desc[i],t20scores[i],EVENT,i+1))
+ .start();
+ }
+ } else {
+ System.out.println("Cannot submit t20 scores. Invalid array params.");
+ }
+ int[] ranks = new int[] {50,100,500,1000,2000,5000,10000,20000,30000,50000};
+ if (!error2) {
+ for (int j=0;j<10;j++) {
+ try {
+ //if (j>=1&&j<9&&Integer.parseInt(lowerTierScores[j])>Integer.parseInt(lowerTierScores[j+1])&&Integer.parseInt(lowerTierScores[j]) scores, int[] ranks, String ss) {
+ if (scores.size()>20) {
+ //See if this score is already in list.
+ if (StringUtils.isNumeric(ss)) {
+ int thisScore = Integer.parseInt(ss);
+ boolean found=false;
+ for (int i=0;ithreshold) {
+ col = new Color(255,
+ 255,
+ 255,0);
+ inputFile.setRGB(x, y, col.getRGB());
+ } else {
+ inputFile.setRGB(x, y, Color.BLACK.getRGB());
+ }
+ }
+ }
+ return inputFile;
+ }
+ public static BufferedImage deepCopy(BufferedImage bi) {
+ ColorModel cm = bi.getColorModel();
+ boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
+ WritableRaster raster = bi.copyData(null);
+ return new BufferedImage(cm, raster, isAlphaPremultiplied, null);
+ }
}
diff --git a/src/main/java/sig/utils/WebUtils.java b/src/main/java/sig/utils/WebUtils.java
new file mode 100644
index 0000000..a533e1e
--- /dev/null
+++ b/src/main/java/sig/utils/WebUtils.java
@@ -0,0 +1,58 @@
+package sig.utils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+import java.util.Scanner;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.mime.MultipartEntityBuilder;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+
+public class WebUtils {
+ public static String POSTimage(String url,File file,Map params) {
+ String res = "No response.";
+ CloseableHttpClient httpClient = HttpClients.createDefault();
+ HttpPost uploadFile = new HttpPost(url);
+ MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+ for (String s : params.keySet()) {
+ builder.addTextBody(s, params.get(s), ContentType.TEXT_PLAIN);
+ }
+ try {
+ // This attaches the file to the POST:
+ builder.addBinaryBody(
+ "file",
+ new FileInputStream(file),
+ ContentType.APPLICATION_OCTET_STREAM,
+ file.getName()
+ );
+
+ HttpEntity multipart = builder.build();
+ uploadFile.setEntity(multipart);
+ CloseableHttpResponse response;
+ response = httpClient.execute(uploadFile);
+ HttpEntity responseEntity = response.getEntity();
+ Thread.sleep(2000);
+ String result = "";
+ if (responseEntity != null) {
+ try (InputStream instream = responseEntity.getContent()) {
+ Scanner s = new Scanner(instream).useDelimiter("\\A");
+ result = s.hasNext() ? s.next() : "";
+ res=result;
+ instream.close();
+ } catch (UnsupportedOperationException | IOException e) {
+ e.printStackTrace();
+ }
+ }
+ } catch (IOException | InterruptedException e) {
+ e.printStackTrace();
+ }
+ return res;
+ }
+}
\ No newline at end of file
diff --git a/target/classes/com/recognition/software/jdeskew/ImageDeskew$HoughLine.class b/target/classes/com/recognition/software/jdeskew/ImageDeskew$HoughLine.class
index f649e4c..8cfddaa 100644
Binary files a/target/classes/com/recognition/software/jdeskew/ImageDeskew$HoughLine.class and b/target/classes/com/recognition/software/jdeskew/ImageDeskew$HoughLine.class differ
diff --git a/target/classes/com/recognition/software/jdeskew/ImageDeskew.class b/target/classes/com/recognition/software/jdeskew/ImageDeskew.class
index eaa3237..e29ddea 100644
Binary files a/target/classes/com/recognition/software/jdeskew/ImageDeskew.class and b/target/classes/com/recognition/software/jdeskew/ImageDeskew.class differ
diff --git a/target/classes/com/recognition/software/jdeskew/ImageUtil.class b/target/classes/com/recognition/software/jdeskew/ImageUtil.class
index 5ddffe5..a3949a2 100644
Binary files a/target/classes/com/recognition/software/jdeskew/ImageUtil.class and b/target/classes/com/recognition/software/jdeskew/ImageUtil.class differ
diff --git a/target/classes/d4dj/d4dj/Annotation.class b/target/classes/d4dj/d4dj/Annotation.class
index 831248a..d3bcb3d 100644
Binary files a/target/classes/d4dj/d4dj/Annotation.class and b/target/classes/d4dj/d4dj/Annotation.class differ
diff --git a/target/classes/d4dj/d4dj/App.class b/target/classes/d4dj/d4dj/App.class
index 478c860..7fc24df 100644
Binary files a/target/classes/d4dj/d4dj/App.class and b/target/classes/d4dj/d4dj/App.class differ
diff --git a/target/classes/d4dj/d4dj/App_old.class b/target/classes/d4dj/d4dj/App_old.class
new file mode 100644
index 0000000..14588c7
Binary files /dev/null and b/target/classes/d4dj/d4dj/App_old.class differ
diff --git a/target/classes/d4dj/d4dj/SubmitThread.class b/target/classes/d4dj/d4dj/SubmitThread.class
index 30e7c16..6eb1757 100644
Binary files a/target/classes/d4dj/d4dj/SubmitThread.class and b/target/classes/d4dj/d4dj/SubmitThread.class differ
diff --git a/target/classes/org/json/CDL.class b/target/classes/org/json/CDL.class
index f96910c..ae66f90 100644
Binary files a/target/classes/org/json/CDL.class and b/target/classes/org/json/CDL.class differ
diff --git a/target/classes/org/json/Cookie.class b/target/classes/org/json/Cookie.class
index d2dbe9b..7799866 100644
Binary files a/target/classes/org/json/Cookie.class and b/target/classes/org/json/Cookie.class differ
diff --git a/target/classes/org/json/CookieList.class b/target/classes/org/json/CookieList.class
index 40908aa..80c3d23 100644
Binary files a/target/classes/org/json/CookieList.class and b/target/classes/org/json/CookieList.class differ
diff --git a/target/classes/org/json/HTTP.class b/target/classes/org/json/HTTP.class
index cb7d423..f30cdca 100644
Binary files a/target/classes/org/json/HTTP.class and b/target/classes/org/json/HTTP.class differ
diff --git a/target/classes/org/json/HTTPTokener.class b/target/classes/org/json/HTTPTokener.class
index 1498ff3..f9e5bcd 100644
Binary files a/target/classes/org/json/HTTPTokener.class and b/target/classes/org/json/HTTPTokener.class differ
diff --git a/target/classes/org/json/JSONArray.class b/target/classes/org/json/JSONArray.class
index 3df2142..582da02 100644
Binary files a/target/classes/org/json/JSONArray.class and b/target/classes/org/json/JSONArray.class differ
diff --git a/target/classes/org/json/JSONException.class b/target/classes/org/json/JSONException.class
index 6562934..56f8570 100644
Binary files a/target/classes/org/json/JSONException.class and b/target/classes/org/json/JSONException.class differ
diff --git a/target/classes/org/json/JSONML.class b/target/classes/org/json/JSONML.class
index aeeb066..7b0e1b5 100644
Binary files a/target/classes/org/json/JSONML.class and b/target/classes/org/json/JSONML.class differ
diff --git a/target/classes/org/json/JSONObject$Null.class b/target/classes/org/json/JSONObject$Null.class
index 587b120..d424879 100644
Binary files a/target/classes/org/json/JSONObject$Null.class and b/target/classes/org/json/JSONObject$Null.class differ
diff --git a/target/classes/org/json/JSONObject.class b/target/classes/org/json/JSONObject.class
index edc32a8..cccd217 100644
Binary files a/target/classes/org/json/JSONObject.class and b/target/classes/org/json/JSONObject.class differ
diff --git a/target/classes/org/json/JSONPointer$Builder.class b/target/classes/org/json/JSONPointer$Builder.class
index ce00912..f9b727f 100644
Binary files a/target/classes/org/json/JSONPointer$Builder.class and b/target/classes/org/json/JSONPointer$Builder.class differ
diff --git a/target/classes/org/json/JSONPointer.class b/target/classes/org/json/JSONPointer.class
index a227930..ac03153 100644
Binary files a/target/classes/org/json/JSONPointer.class and b/target/classes/org/json/JSONPointer.class differ
diff --git a/target/classes/org/json/JSONPointerException.class b/target/classes/org/json/JSONPointerException.class
index 781217b..d1f812a 100644
Binary files a/target/classes/org/json/JSONPointerException.class and b/target/classes/org/json/JSONPointerException.class differ
diff --git a/target/classes/org/json/JSONString.class b/target/classes/org/json/JSONString.class
index 41b164a..f891964 100644
Binary files a/target/classes/org/json/JSONString.class and b/target/classes/org/json/JSONString.class differ
diff --git a/target/classes/org/json/JSONStringer.class b/target/classes/org/json/JSONStringer.class
index 783d607..2e8c293 100644
Binary files a/target/classes/org/json/JSONStringer.class and b/target/classes/org/json/JSONStringer.class differ
diff --git a/target/classes/org/json/JSONTokener.class b/target/classes/org/json/JSONTokener.class
index 5bd21b7..c06c2b1 100644
Binary files a/target/classes/org/json/JSONTokener.class and b/target/classes/org/json/JSONTokener.class differ
diff --git a/target/classes/org/json/JSONWriter.class b/target/classes/org/json/JSONWriter.class
index 140747c..c288399 100644
Binary files a/target/classes/org/json/JSONWriter.class and b/target/classes/org/json/JSONWriter.class differ
diff --git a/target/classes/org/json/Property.class b/target/classes/org/json/Property.class
index a07c92d..2202081 100644
Binary files a/target/classes/org/json/Property.class and b/target/classes/org/json/Property.class differ
diff --git a/target/classes/org/json/XML$1$1.class b/target/classes/org/json/XML$1$1.class
index 7cedf61..7971cab 100644
Binary files a/target/classes/org/json/XML$1$1.class and b/target/classes/org/json/XML$1$1.class differ
diff --git a/target/classes/org/json/XML$1.class b/target/classes/org/json/XML$1.class
index 7858d66..b1397d0 100644
Binary files a/target/classes/org/json/XML$1.class and b/target/classes/org/json/XML$1.class differ
diff --git a/target/classes/org/json/XML.class b/target/classes/org/json/XML.class
index 18a42b5..b194106 100644
Binary files a/target/classes/org/json/XML.class and b/target/classes/org/json/XML.class differ
diff --git a/target/classes/org/json/XMLTokener.class b/target/classes/org/json/XMLTokener.class
index 4a5e806..7bb49ad 100644
Binary files a/target/classes/org/json/XMLTokener.class and b/target/classes/org/json/XMLTokener.class differ
diff --git a/target/classes/sig/utils/Audio.class b/target/classes/sig/utils/Audio.class
index 2296f01..a5b86f5 100644
Binary files a/target/classes/sig/utils/Audio.class and b/target/classes/sig/utils/Audio.class differ
diff --git a/target/classes/sig/utils/DebugUtils.class b/target/classes/sig/utils/DebugUtils.class
index 30f9fd3..bc8f429 100644
Binary files a/target/classes/sig/utils/DebugUtils.class and b/target/classes/sig/utils/DebugUtils.class differ
diff --git a/target/classes/sig/utils/DrawUtils.class b/target/classes/sig/utils/DrawUtils.class
index 3102803..8d2d7be 100644
Binary files a/target/classes/sig/utils/DrawUtils.class and b/target/classes/sig/utils/DrawUtils.class differ
diff --git a/target/classes/sig/utils/FileUtils.class b/target/classes/sig/utils/FileUtils.class
index ed35289..c750f91 100644
Binary files a/target/classes/sig/utils/FileUtils.class and b/target/classes/sig/utils/FileUtils.class differ
diff --git a/target/classes/sig/utils/GithubUtils.class b/target/classes/sig/utils/GithubUtils.class
index 2cdb4a2..e4f6717 100644
Binary files a/target/classes/sig/utils/GithubUtils.class and b/target/classes/sig/utils/GithubUtils.class differ
diff --git a/target/classes/sig/utils/ImageUtils.class b/target/classes/sig/utils/ImageUtils.class
index 92ed7d0..1fc4812 100644
Binary files a/target/classes/sig/utils/ImageUtils.class and b/target/classes/sig/utils/ImageUtils.class differ
diff --git a/target/classes/sig/utils/JavaUtils.class b/target/classes/sig/utils/JavaUtils.class
index 994da69..de26b87 100644
Binary files a/target/classes/sig/utils/JavaUtils.class and b/target/classes/sig/utils/JavaUtils.class differ
diff --git a/target/classes/sig/utils/ReflectUtils.class b/target/classes/sig/utils/ReflectUtils.class
index c0a41ac..6507d49 100644
Binary files a/target/classes/sig/utils/ReflectUtils.class and b/target/classes/sig/utils/ReflectUtils.class differ
diff --git a/target/classes/sig/utils/SoundUtils.class b/target/classes/sig/utils/SoundUtils.class
index 4fb4c2c..3f6c921 100644
Binary files a/target/classes/sig/utils/SoundUtils.class and b/target/classes/sig/utils/SoundUtils.class differ
diff --git a/target/classes/sig/utils/TextUtils.class b/target/classes/sig/utils/TextUtils.class
index 754ab5e..cf6898c 100644
Binary files a/target/classes/sig/utils/TextUtils.class and b/target/classes/sig/utils/TextUtils.class differ
diff --git a/target/classes/sig/utils/TimeUtils.class b/target/classes/sig/utils/TimeUtils.class
index dcf11e9..e03ac1f 100644
Binary files a/target/classes/sig/utils/TimeUtils.class and b/target/classes/sig/utils/TimeUtils.class differ
diff --git a/target/classes/sig/utils/WebUtils.class b/target/classes/sig/utils/WebUtils.class
new file mode 100644
index 0000000..7fb9924
Binary files /dev/null and b/target/classes/sig/utils/WebUtils.class differ
diff --git a/target/test-classes/d4dj/d4dj/AppTest.class b/target/test-classes/d4dj/d4dj/AppTest.class
index 0b854ec..762b5aa 100644
Binary files a/target/test-classes/d4dj/d4dj/AppTest.class and b/target/test-classes/d4dj/d4dj/AppTest.class differ
diff --git a/target/test-classes/net/sourceforge/tess4j/ProgressMonitor$1.class b/target/test-classes/net/sourceforge/tess4j/ProgressMonitor$1.class
deleted file mode 100644
index 2c46ea0..0000000
Binary files a/target/test-classes/net/sourceforge/tess4j/ProgressMonitor$1.class and /dev/null differ
diff --git a/target/test-classes/net/sourceforge/tess4j/ProgressMonitor.class b/target/test-classes/net/sourceforge/tess4j/ProgressMonitor.class
index 864af67..4a36d58 100644
Binary files a/target/test-classes/net/sourceforge/tess4j/ProgressMonitor.class and b/target/test-classes/net/sourceforge/tess4j/ProgressMonitor.class differ
diff --git a/target/test-classes/net/sourceforge/tess4j/TessAPI1Test.class b/target/test-classes/net/sourceforge/tess4j/TessAPI1Test.class
index bfdf7a1..56d174a 100644
Binary files a/target/test-classes/net/sourceforge/tess4j/TessAPI1Test.class and b/target/test-classes/net/sourceforge/tess4j/TessAPI1Test.class differ
diff --git a/target/test-classes/net/sourceforge/tess4j/TessAPIImpl.class b/target/test-classes/net/sourceforge/tess4j/TessAPIImpl.class
index 74314a2..162615f 100644
Binary files a/target/test-classes/net/sourceforge/tess4j/TessAPIImpl.class and b/target/test-classes/net/sourceforge/tess4j/TessAPIImpl.class differ
diff --git a/target/test-classes/net/sourceforge/tess4j/TessAPITest.class b/target/test-classes/net/sourceforge/tess4j/TessAPITest.class
index 333a71e..13df551 100644
Binary files a/target/test-classes/net/sourceforge/tess4j/TessAPITest.class and b/target/test-classes/net/sourceforge/tess4j/TessAPITest.class differ
diff --git a/target/test-classes/net/sourceforge/tess4j/Tesseract1Test.class b/target/test-classes/net/sourceforge/tess4j/Tesseract1Test.class
index 6583796..39e7e9a 100644
Binary files a/target/test-classes/net/sourceforge/tess4j/Tesseract1Test.class and b/target/test-classes/net/sourceforge/tess4j/Tesseract1Test.class differ
diff --git a/target/test-classes/net/sourceforge/tess4j/TesseractTest.class b/target/test-classes/net/sourceforge/tess4j/TesseractTest.class
index d84b7f9..37d67ec 100644
Binary files a/target/test-classes/net/sourceforge/tess4j/TesseractTest.class and b/target/test-classes/net/sourceforge/tess4j/TesseractTest.class differ
diff --git a/target/test-classes/net/sourceforge/tess4j/TestFolderExtraction.class b/target/test-classes/net/sourceforge/tess4j/TestFolderExtraction.class
index 6a34a6a..3bce0d6 100644
Binary files a/target/test-classes/net/sourceforge/tess4j/TestFolderExtraction.class and b/target/test-classes/net/sourceforge/tess4j/TestFolderExtraction.class differ
diff --git a/target/test-classes/net/sourceforge/tess4j/util/ImageIOHelperTest.class b/target/test-classes/net/sourceforge/tess4j/util/ImageIOHelperTest.class
index 185e4af..a0eb221 100644
Binary files a/target/test-classes/net/sourceforge/tess4j/util/ImageIOHelperTest.class and b/target/test-classes/net/sourceforge/tess4j/util/ImageIOHelperTest.class differ
diff --git a/target/test-classes/net/sourceforge/tess4j/util/PdfUtilitiesTest.class b/target/test-classes/net/sourceforge/tess4j/util/PdfUtilitiesTest.class
index 588d915..0f741f8 100644
Binary files a/target/test-classes/net/sourceforge/tess4j/util/PdfUtilitiesTest.class and b/target/test-classes/net/sourceforge/tess4j/util/PdfUtilitiesTest.class differ
diff --git a/testboard.png b/testboard.png
new file mode 100644
index 0000000..c7e2f65
Binary files /dev/null and b/testboard.png differ