Skip to content

Instantly share code, notes, and snippets.

function test() {
return "robin";
}
@robinhowlett
robinhowlett / U_BCBCAnalysis.java
Last active November 9, 2018 22:26
Java code I used to parse the BCBC's PDF of all bets placed during the tournament and convert the data into a tsv/spreadsheet. Takes about 12 seconds to run. Source: https://twitter.com/robinhowlett/status/1060427312603119618
// didn't both with the import statements
public class U_BCBCAnalysis extends PDFTextStripper {
// regex to match bets e.g. EX, TRI, DD, WIN
static final Pattern BET_TYPE = Pattern.compile("^([A-Z-])+$");
static FileOutputStream fileOutputStream;
// keeps track of where lines of text related to each player start and end
static List<BCBCEntry> players = new ArrayList<>();
// keeps track of the lines of text for some context
static List<String> playerText = new ArrayList<>();
static int index = 0;
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2-932771130
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2-932771130
[DEBUG] Imported: < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2-932771130
[DEBUG] Included: org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2
[DEBUG] Included: backport-util-concurrent:backport-util-concurrent:jar:3.1
[DEBUG] Included: org.codehaus.plexus:plexus-interpolation:jar:1.11
[DEBUG] Included: junit:junit:jar:3.8.1
[DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:3.0.15
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2-932771130, parent: sun.misc.Launcher$AppClassLoader@3d4eac69]
/**
* When building with multiple threads, reaching the last project doesn't have to mean that all projects are ready
* to be deployed
*/
private static final AtomicInteger readyProjectsCounter = new AtomicInteger();
...
public void execute()
throws MojoExecutionException, MojoFailureException {
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
[DEBUG] Imported: < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
[DEBUG] Included: org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2
[DEBUG] Included: backport-util-concurrent:backport-util-concurrent:jar:3.1
[DEBUG] Included: org.codehaus.plexus:plexus-interpolation:jar:1.11
[DEBUG] Included: junit:junit:jar:3.8.1
[DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:3.0.15
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2, parent: sun.misc.Launcher$AppClassLoader@3d4eac69]
<pluginRepositories>
<pluginRepository>
<id>temp.repo</id>
<name>Temp Repo</name>
<url>file://${user.home}/.m2/temp-repository</url>
</pluginRepository>
</pluginRepositories>
<pluginRepositories>
<pluginRepository>
<id>apache.snapshots</id>
<name>Apache Snapshots</name>
<url>http://repository.apache.org/content/groups/snapshots-group/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
> mvn clean deploy
[MVNVM] Using maven: 3.5.2
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] module-one
[INFO] pom-root
[INFO] module-two
[INFO]
...
[INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ module-two ---
[INFO] Deploying com.snaplogic:module-two:1.0-SNAPSHOT at end
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] module-one ......................................... SUCCESS [ 3.477 s]
[INFO] pom-root ........................................... SUCCESS [ 0.228 s]
[INFO] module-two ......................................... SUCCESS [ 1.446 s]
[INFO] ------------------------------------------------------------------------
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
...
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2-1119294797