Merge pull request #195 from Doha2012/master

fix data collector
This commit is contained in:
Eugen 2015-04-19 18:21:39 +03:00
commit be841b1d6d
10 changed files with 8159 additions and 8133 deletions

View File

@ -185,7 +185,7 @@
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<!-- logging -->
<dependency>

View File

@ -30,11 +30,9 @@ public class ServletInitializer extends AbstractDispatcherServletInitializer {
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
super.onStartup(servletContext);
servletContext.addListener(new SessionListener());
registerProxyFilter(servletContext, "oauth2ClientContextFilter");
registerProxyFilter(servletContext, "springSecurityFilterChain");
}
private void registerProxyFilter(ServletContext servletContext, String name) {

View File

@ -3,6 +3,7 @@ package org.baeldung.config;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
import org.baeldung.reddit.util.MyFeatures;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -13,6 +14,7 @@ public class SessionListener implements HttpSessionListener {
public void sessionCreated(HttpSessionEvent event) {
logger.info("==== Session is created ====");
event.getSession().setMaxInactiveInterval(30 * 60);
event.getSession().setAttribute("PREDICTION_FEATURE", MyFeatures.PREDICTION_FEATURE);
}
@Override

View File

@ -3,6 +3,8 @@ package org.baeldung.reddit.classifier;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Calendar;
import java.util.TimeZone;
import org.apache.mahout.classifier.sgd.L2;
import org.apache.mahout.classifier.sgd.OnlineLogisticRegression;
@ -18,6 +20,7 @@ public class RedditClassifier {
public static int GOOD = 0;
public static int BAD = 1;
public static int MIN_SCORE = 5;
private final OnlineLogisticRegression classifier;
private final FeatureVectorEncoder titleEncoder;
private final FeatureVectorEncoder domainEncoder;
@ -44,7 +47,7 @@ public class RedditClassifier {
}
while ((line != null) && (line != "")) {
category = (line.startsWith("good")) ? GOOD : BAD;
category = extractCategory(line);
trainCount[category]++;
features = convertLineToVector(line);
classifier.train(category, features);
@ -76,7 +79,7 @@ public class RedditClassifier {
Vector features;
String line = reader.readLine();
while ((line != null) && (line != "")) {
category = (line.startsWith("good")) ? GOOD : BAD;
category = extractCategory(line);
evalCount[category]++;
features = convertLineToVector(line);
result = classify(features);
@ -94,12 +97,21 @@ public class RedditClassifier {
}
// ==== private
private int extractCategory(String line) {
final int score = Integer.parseInt(line.substring(0, line.indexOf(';')));
return (score < MIN_SCORE) ? BAD : GOOD;
}
private Vector convertLineToVector(String line) {
final Vector features = new RandomAccessSparseVector(4);
final String[] items = line.split(";");
final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
cal.setTimeInMillis(Long.parseLong(items[1]) * 1000);
final int hour = cal.get(Calendar.HOUR_OF_DAY);
titleEncoder.addToVector(items[3], features);
domainEncoder.addToVector(items[4], features);
features.set(2, Integer.parseInt(items[1])); // hour of day
features.set(2, hour); // hour of day
features.set(3, Integer.parseInt(items[2])); // number of words in the title
return features;
}

View File

@ -2,9 +2,7 @@ package org.baeldung.reddit.classifier;
import java.io.FileWriter;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.baeldung.reddit.util.UserAgentInterceptor;
@ -20,57 +18,52 @@ import com.google.common.base.Splitter;
public class RedditDataCollector {
public static final String TRAINING_FILE = "src/main/resources/train.csv";
public static final String TEST_FILE = "src/main/resources/test.csv";
public static final int LIMIT = 100;
public static final Long YEAR = 31536000L;
private final Logger logger = LoggerFactory.getLogger(getClass());
private String postAfter;
private Long timestamp;
private final RestTemplate restTemplate;
private final String subreddit;
private final int minScore;
public RedditDataCollector() {
restTemplate = new RestTemplate();
final List<ClientHttpRequestInterceptor> list = new ArrayList<ClientHttpRequestInterceptor>();
list.add(new UserAgentInterceptor());
restTemplate.setInterceptors(list);
subreddit = "all";
minScore = 4;
subreddit = "java";
}
public RedditDataCollector(String subreddit, int minScore) {
public RedditDataCollector(String subreddit) {
restTemplate = new RestTemplate();
final List<ClientHttpRequestInterceptor> list = new ArrayList<ClientHttpRequestInterceptor>();
list.add(new UserAgentInterceptor());
restTemplate.setInterceptors(list);
this.subreddit = subreddit;
this.minScore = minScore;
}
public void collectData() {
final int limit = 100;
final int noOfRounds = 80;
timestamp = System.currentTimeMillis() / 1000;
try {
final FileWriter writer = new FileWriter(TRAINING_FILE);
for (int i = 0; i < noOfRounds; i++) {
getPosts(limit, writer);
getPosts(writer);
}
writer.close();
final FileWriter testWriter = new FileWriter(TEST_FILE);
getPosts(limit, testWriter);
getPosts(testWriter);
testWriter.close();
} catch (final Exception e) {
logger.error("write to file error", e);
}
}
// ==== private
private void getPosts(int limit, FileWriter writer) {
String fullUrl = "http://www.reddit.com/r/" + subreddit + "/new.json?limit=" + limit;
if (postAfter != null) {
fullUrl += "&count=" + limit + "&after=" + postAfter;
}
// ==== Private
private void getPosts(FileWriter writer) {
final String fullUrl = "http://www.reddit.com/r/" + subreddit + "/search.json?sort=new&q=timestamp:" + (timestamp - YEAR) + ".." + timestamp + "&restrict_sr=on&syntax=cloudsearch&limit=" + LIMIT;
try {
final JsonNode node = restTemplate.getForObject(fullUrl, JsonNode.class);
parseNode(node, writer);
@ -82,22 +75,18 @@ public class RedditDataCollector {
}
private void parseNode(JsonNode node, FileWriter writer) throws IOException {
postAfter = node.get("data").get("after").asText();
System.out.println(postAfter);
String line;
String category;
List<String> words;
final SimpleDateFormat df = new SimpleDateFormat("HH");
int score;
for (final JsonNode child : node.get("data").get("children")) {
category = (child.get("data").get("score").asInt() < minScore) ? "bad" : "good";
score = child.get("data").get("score").asInt();
words = Splitter.onPattern("\\W").omitEmptyStrings().splitToList(child.get("data").get("title").asText());
final Date date = new Date(child.get("data").get("created_utc").asLong() * 1000);
timestamp = child.get("data").get("created_utc").asLong();
line = category + ";";
line += df.format(date) + ";";
line = score + ";";
line += timestamp + ";";
line += words.size() + ";" + Joiner.on(' ').join(words) + ";";
line += child.get("data").get("domain").asText() + "\n";
writer.write(line);
}
}

View File

@ -0,0 +1,17 @@
package org.baeldung.reddit.util;
public enum MyFeatures {
PREDICTION_FEATURE(false);
private boolean active;
private MyFeatures(boolean active) {
this.active = active;
}
public boolean isActive() {
return this.active;
}
}

View File

@ -1,100 +1,100 @@
bad;20;5;The President s Kill List;newyorker.com
bad;20;8;Home stretch for the Ancient History Magazine Kickstarter;kickstarter.com
good;20;20;A constant Burn to disk link under right click menu but there s no optical drive on retina Macbook Pro;i.imgur.com
bad;20;8;Grey s be creeping on the button like;gph.is
good;20;16;Droid Life First look at Moto 360 s Gorgeous and Impossible to Find Monolink Metal Band;droid-life.com
bad;20;23;US Bleeding Hollow lt Unspoken gt has a couple spots open for our core team 3 7 M HM 10 10 H BRF;self.wowguilds
bad;20;30;I drove up to Orlando for nothing I m by the science center What s some stuff I can do for cheap free so I don t waste my day;self.orlando
bad;20;20;As we make computers more intelligent they ll eventually gain consciousness Then evolution would ve led to silicon based life;self.Showerthoughts
bad;20;5;i am jealous and miserable;self.SuicideWatch
bad;20;29;TIL that in addition to the recent gyrocopter landing the last person to land a helicopter on the White House or U S Capital lawn was also a Floridian;reddit.com
good;20;7;When we finally arrived at Comic Con;i.imgur.com
good;20;22;Just got a call that my OBGYN is out on an emergency for the next week I m being induced this Saturday;self.BabyBumps
good;20;10;Scientists discover intense magnetic field close to supermassive black hole;sciencedaily.com
bad;20;2;W ow;fap.to
bad;20;8;Wedding Photographers did you love your wedding photographer;self.WeddingPhotography
bad;20;38;This video reminds me of the hype in this sub for a Fallout 4 in New York Even though the style is a bit WAY off Most of the characters are a bit similar to the Fallout series;youtube.com
good;20;6;Max the animatronic abandoned at Disney;i.imgur.com
bad;20;2;Francia Expansions;self.HistoricalWorldPowers
bad;20;10;When you learn autotools and discover all am in files;youtube.com
good;20;1;Instincts;i.imgur.com
bad;20;6;No more bing rewards for searches;self.beermoney
bad;20;7;Launcher stops working when signing in HELP;self.GTAV
bad;20;15;I m new to the gym amp changing my diet but I m loving it;self.loseit
bad;20;9;Forbes The Chevy Bolt Tesla s Best News Yet;forbes.com
bad;20;12;Forth Rail Bridge obscured by fog OS 720x720 x post r ScottishPhotos;i.imgur.com
bad;20;2;Background score;self.Daredevil
bad;20;4;To MIT Media Lab;bitcoin-gr.org
good;20;3;Havana Street Art;self.cigars
bad;20;4;Gear PRS Custom 24;self.Guitar
bad;20;34;US Calif Co own a home with SO not married for 2 years Now we are breaking up and she only wants to give me my original down pymt instead of buying me out;self.legaladvice
good;20;6;There s been a fur der;imgur.com
good;20;17;ICA Use A Test Website UI Greg Miaskiewicz 0 40 1 5 min gt 95 gt 500;self.HITsWorthTurkingFor
bad;20;8;balloon popping sound in 5 4 3 2;i.imgur.com
good;20;12;My attempt at recreating the Imperial Insignia in the new teaser trailer;imgur.com
bad;20;10;This is the most important thing on the internet today;youtu.be
bad;20;6;A R Kane and Dirty Beaches;self.ambient
bad;20;10;What is a good hot air soldering for a hobbyist;self.AskElectronics
bad;20;8;Falconshield This Is War 4 Freljord COLLAB draggles;np.reddit.com
bad;20;3;Sacramento home appraiser;sacramentovalleyappraisal.com
bad;20;10;FIRST WALK OFF OF THE YEAR UPVOTE PARTY r CHICubs;reddit.com
bad;20;23;Ukrainian notables politicians journalists react to murder of Kalashnikov and Buzhina See their fb posts in link Most popular opinion Putin did it;pravda.com.ua
bad;20;4;Maclock watch for sale;self.MacMiller
bad;20;2;me irl;imgur.com
bad;20;7;Looking to recruit EU Aliance Outland BCH;self.wowraf
bad;20;10;Trying to understand potential of the restaurant food truck industry;self.Entrepreneur
bad;20;3;Democracy Now Bitcoin;bitcoin-gr.org
good;20;4;Got pulled over today;self.motorcycles
bad;20;7;ESPN Reporter Britt McHenry is a shitlord;liveleak.com
bad;20;15;I m looking for places to buy local craft beers by the bottle Any suggestions;self.dayton
bad;20;5;No username in login screen;self.techsupport
good;20;7;Ads for the upcoming election in Alberta;youtube.com
bad;20;11;Michael Savage Hillary Clinton s Looks Alone Could Sink The Campaign;rightwingwatch.org
good;20;4;Another from People Magazine;imgur.com
bad;20;10;ps4 LF2 CE CROTA CP need sword bearer Psn blackskyes;self.Fireteams
bad;20;4;Dealing with Cho mid;self.summonerschool
bad;20;3;C 3P0 Question;self.XWingTMG
bad;20;10;DUNGEON HUNTER 5 HACK AND CHEATS TOOL RESOURCES GENERATOR UTILITY;self.maxgiron
bad;20;11;I m searching for mature anime genre is not too relevant;self.Animesuggest
bad;20;3;Cassie s hair;self.MortalKombat
bad;20;6;Ha Ha Ha Ha 0 02;youtube.com
bad;20;8;Can someone make a simple I hope profile;self.ChromaProfiles
bad;20;5;I can t reinstall SMITE;self.Smite
bad;20;19;TIL That in 1974 a US Army Private stole a helicopter and landed it at the White House Twice;en.wikipedia.org
good;20;2;Rottweiler pup;imgur.com
good;20;4;New stealth Bonnaroo additions;self.bonnaroo
bad;20;5;Any Houston Rockets fans here;self.Eugene
good;20;10;Pictures of Tube Televisions the moment they re Turned Off;imgur.com
bad;20;10;Camping this summer with a 9 5 month old Tips;self.beyondthebump
good;20;15;Toss this into your old 1 4 7 based packs to improve falling block rendering;minecraftforum.net
good;20;13;StreetPass Thank You Bundle takes EXTRA 1 off the new Mii Plaza games;technologytell.com
good;20;11;First Step of Becoming a Real Sissy M m F m;self.gonewildstories
good;20;10;Big BART delays after apparent suicide at Civic Center station;sfgate.com
bad;20;5;tornado sirens in northwest suburbs;self.Minneapolis
good;20;2;Me irl;i.imgur.com
bad;20;13;Kimi Raikkonen hints at Ferrari stay in 2016 if the team wants him;espn.co.uk
bad;20;16;If you had to Explain a game of LoL in one Analogy what would it be;self.leagueoflegends
good;20;6;What is your guilty pleasure song;self.AskReddit
bad;20;14;Suggestion Don t unlock the next unit until you can afford to buy it;self.swarmsim
good;20;1;Metal;imgur.com
bad;20;6;TheFatRat Time Lapse House Electro 2015;soundcloud.com
bad;20;22;Hey Reddit is it true that the silver fillings dentists put in our teeth contains mercury and could be harmful over time;self.AskReddit
good;20;5;request Will Photoshop For Pizza;self.RandomActsOfPizza
bad;20;13;My wife likes to put small things on the big thing shelf fixed;i.imgur.com
bad;20;14;Mi novio es de M xico y quiero practicar con l pero estoy nerviosa;self.SpanishImmersion
bad;20;5;Anybody have experience with PageFair;self.adops
good;20;23;Osoba na snimci kriva je za nekoliko kra a bicikala po Zagrebu pa tako i maznuo jedan mom frendu Ako ga prepoznajete javite;youtube.com
bad;20;9;Grogheads com Brother Against Brother The AAR Part 1;grogheads.com
good;20;29;St Bernadette Soubirous Feast April 16th outside of France One of the many Incorrupt Saints She looked upon the face of the Blessed Virgin Mary 18 times at Lourdes;en.lourdes-france.org
bad;20;18;My mom texted asking what food I want in the fridge including my preferred flavor of Greek yogurt;i.imgur.com
good;20;18;Spoilers All If Dragon Age II had a subtitle s like Origins and Inquisition what would it be;self.dragonage
bad;20;5;Best hidden places on campus;self.IndianaUniversity
bad;20;8;Rematch Snack Santa Snackta is wonderful and generous;redditgifts.com
bad;20;13;Half Of Yemen s Population Is Going Hungry As Violence Worsens UN Says;huffingtonpost.com
good;20;6;RBC Heritage Round 1 Live Thread;self.dfsports
bad;20;7;Feeling full all the time swollen liver;self.stopdrinking
bad;20;9;Recent events for MLP Zero Hard treasure trail completed;self.TrueLionhearts
bad;20;5;PS4 LF2 for NF Weekly;self.Fireteams
bad;20;5;Stardust with Ocular by yitaku;soundcloud.com
bad;20;4;PC M9 Bayonet Slaughter;self.GlobalOffensiveTrade
good;20;2;Spare food;self.tampa
3;1357021066;7;Good Examples of Component dragging and dropping;self.java
0;1357017936;10;Game only works on mac need help porting to windows;self.java
2;1357008210;4;eclipse or keyboard issues;self.java
37;1356977564;6;The Long Strange Trip to Java;blinkenlights.com
5;1356970069;9;How to Send Email with Embedded Images Using Java;blog.smartbear.com
0;1356956937;4;What makes you architect;programming.freeblog.hu
0;1356900338;4;Apache Maven I of;javaxperiments.blogspot.com
0;1356896219;5;Custom functions per class instance;self.java
0;1356891056;5;JMeter Performance and Tuning Tips;ubik-ingenierie.com
12;1356888358;19;First fully functional GUI program about making acronyms easier to remember Was wondering if you guys had any tips;github.com
2;1356881034;12;Social Tech 101 Why do I love Java Developer Edition Part 1;socialtech101.blogspot.com
5;1356826782;7;Configurable deployment descriptors proposal for Java EE;java.net
31;1356793800;16;Finished my very first game in java Snake clone It s not much but it works;self.java
18;1356766107;10;la4j Linear Alebra for Java 0 3 0 is out;la4j.org
1;1356747219;6;RubyFlux a Ruby to Java compiler;github.com
15;1356735585;10;Simple JMS 2 0 Sample JMSDestinationDefinition and Synchronous Message Receive;blogs.oracle.com
9;1356717174;3;Java Use WebCam;self.java
4;1356711735;5;Compiler Optimisation for saving memory;self.java
4;1356662279;22;I m interested in your opinion about Java for Python Programmers by Brad Miller or a better alternative for a Java newbie;self.java
0;1356633508;4;A good android game;self.java
4;1356631759;12;a java library i saw mentioned here can t find pls help;self.java
1;1356627923;5;About learning Java a question;self.java
0;1356623761;3;Objects and java2d;self.java
0;1356593886;2;AffineTransform halp;self.java
43;1356584047;7;Java Was Strongly Influenced by Objective C;cs.gmu.edu
1;1356580543;7;Having trouble Setting Up Android Development Environment;self.java
0;1356560732;13;How can I fetch the first X links of reddit into a list;self.java
0;1356551788;4;JDK Download page error;self.java
9;1356536557;12;looking for a good book website to learn intermediate core java spring;self.java
7;1356487079;11;A popup menu like Filemaker s Any library have an implementation;self.java
1;1356455255;6;Just a Few Helpful Solr Functions;ignatyev-dev.blogspot.ru
13;1356433373;7;Bart s Blog Xtend the better compromise;bartnaudts.blogspot.de
4;1356410180;3;Beginner Question Here;self.java
19;1356283667;5;Nashorn JavaScript for the JVM;blogs.oracle.com
0;1356234086;5;Problem with Java memory use;self.java
0;1356195953;5;Learning Java in two weeks;self.java
0;1356127053;10;Twitter4J Download a Twitter Users Tweets to a Text File;github.com
20;1356118151;15;Using Apache Commons Functor functional interfaces with Java 8 lambdas cross post from r functionalprogramming;kinoshita.eti.br
13;1356102153;7;Date and Time in Java 8 Timezones;insightfullogic.com
10;1356088959;8;Implementing a collapsible ui repeat rows in JSF;kahimyang.info
8;1356034544;5;OmniFaces 1 3 is released;balusc.blogspot.com
1;1356027563;11;How to Configure a JNDI DataSource in the OpenShift Tomcat Cartridge;openshift.redhat.com
82;1356020780;7;Doomsday Sale IntelliJ 75 off today only;jetbrains.com
3;1355976320;3;IntelliJ Working Directory;self.java
0;1355966433;5;Help with java problem please;self.java
17;1355928745;12;What s new in Servlet 3 1 Java EE 7 moving forward;blogs.oracle.com
11;1355864485;5;Quick poll for research project;self.java
0;1355851994;5;Eclipse Text Problem Need Help;self.java
29;1355823193;4;Java 8 vs Xtend;blog.efftinge.de
2;1355805047;4;Learning Java between semesters;self.java
6;1355798488;11;I m a beginner programmer any tips on where to start;self.java
7;1355784039;9;Java Advent Calendar far sight look at JDK 8;javaadvent.com
2;1355782111;9;Technical Interview coming up Suggestions Pointers Words of Wisdom;self.java
0;1355775350;6;someone may help me out here;stackoverflow.com
2;1355765235;14;THC and a bit of Thunking Creative ways to deal with multiple return types;kingsfleet.blogspot.it
0;1355749586;12;Newbie here can you explain to me what class private stack is;self.java
0;1355748318;4;When StackOverflow Goes Bad;blogs.windward.net
0;1355721981;4;Java Graphics Projectile HELP;self.java
0;1355719622;12;Which one of the following statements about object oriented programming is false;self.java
16;1355707814;8;What s the skinny on JavaFX these days;self.java
2;1355685929;20;Can someone explain exactly what Apache Ant is How does it differ from just creating a jar file in blueJ;self.java
4;1355621071;7;Looking to add test code in Github;self.java
7;1355613608;6;Java Version of Jarvis Must Haves;self.java
5;1355599765;6;Java Advent Calendar Functional Java Collections;javaadvent.com
7;1355597483;13;I m working on a text based RPG and I have some questions;self.java
2;1355574445;6;Java EE 7 Community Survey Results;blog.eisele.net
0;1355576629;4;Evolution of Java Technology;compilr.org
18;1355574828;10;Are your Garbage Collection Logs speaking to you Censum does;blog.eisele.net
10;1355559380;13;What is the best GUI tool for creating a 2d platformer in Java;self.java
0;1355555357;7;Hit me with your best arrays tutorial;self.java
10;1355542403;11;Does any one know of clean 2d graphics library for java;self.java
23;1355511507;9;Dark Juno A Dark UI Theme for Eclipse 4;rogerdudler.github.com
0;1355504132;10;Java devs that work remote I have a few questions;self.java
0;1355501999;9;How do you make use of your Java knowledge;self.java
1;1355492027;5;How ClassLoader works in Java;javarevisited.blogspot.com.au
0;1355489352;9;Main difference between Abstract Class and Interface Compilr org;compilr.org
48;1355487006;8;Date and Time in Java 8 Part 1;insightfullogic.com
0;1355485766;3;Java JSON problem;self.java
10;1355448875;16;Open source applications large small worth looking at in Java I want to understand application structure;self.java
1;1355444452;4;lo mexor pz xxx;heavy-r.com
0;1355402889;11;JRebel Remoting to Push Changes to Your Toaster in The Cloud;zeroturnaround.com
0;1355402734;6;Are bugs part of technical debt;swreflections.blogspot.ca
2;1355400483;9;Compile and Run Java programs with Sublime Text 2;compilr.org
0;1355391115;4;console input like craftbukkit;self.java
7;1355390023;8;Hosting suggestions needed for a java web app;self.java
6;1355359227;17;Java novice here Have noticed funny performance differences across laptop and desktop Nvidia optimus related Details inside;self.java
1;1355327090;18;Please advice which java server technology should I choose for this new web app in my new work;self.java
0;1355326137;6;code to convert digits into words;compilr.org
34;1355319442;7;I want to learn REAL WORLD Java;self.java
5;1355285442;3;Hiring Java Developers;self.java
0;1355282335;14;Help How can I count the amount of a specific integer in an ArrayList;self.java
1;1355272303;24;I m taking a Java 1 final tomorrow I m fairly confident but I would appreciate any tips on things to look out for;self.java
38;1355267143;6;Will Java become the next COBOL;self.java
0;1355263047;2;Understanding recursion;imgur.com
1;1355257558;15;How can I clear the command prompt terminal with java and make it cross platform;self.java
2;1355253849;18;Is there a strategy for reducing code clutter when you are printing to the terminal alot Beginner Programmer;self.java
1;1355253049;5;BlockingQueues and multiple producer threads;self.java
1;1355241441;6;Beginner Struggling with classes Need help;self.java
0;1355238089;8;Simple Steps to Merge PDF files using Java;compilr.org
23;1355236940;8;Java and vs Python within a business context;self.java

1 bad 3 20 1357021066 5 7 The President s Kill List Good Examples of Component dragging and dropping newyorker.com self.java
2 bad 0 20 1357017936 8 10 Home stretch for the Ancient History Magazine Kickstarter Game only works on mac need help porting to windows kickstarter.com self.java
3 good 2 20 1357008210 20 4 A constant Burn to disk link under right click menu but there s no optical drive on retina Macbook Pro eclipse or keyboard issues i.imgur.com self.java
4 bad 37 20 1356977564 8 6 Grey s be creeping on the button like The Long Strange Trip to Java gph.is blinkenlights.com
5 good 5 20 1356970069 16 9 Droid Life First look at Moto 360 s Gorgeous and Impossible to Find Monolink Metal Band How to Send Email with Embedded Images Using Java droid-life.com blog.smartbear.com
6 bad 0 20 1356956937 23 4 US Bleeding Hollow lt Unspoken gt has a couple spots open for our core team 3 7 M HM 10 10 H BRF What makes you architect self.wowguilds programming.freeblog.hu
7 bad 0 20 1356900338 30 4 I drove up to Orlando for nothing I m by the science center What s some stuff I can do for cheap free so I don t waste my day Apache Maven I of self.orlando javaxperiments.blogspot.com
8 bad 0 20 1356896219 20 5 As we make computers more intelligent they ll eventually gain consciousness Then evolution would ve led to silicon based life Custom functions per class instance self.Showerthoughts self.java
9 bad 0 20 1356891056 5 5 i am jealous and miserable JMeter Performance and Tuning Tips self.SuicideWatch ubik-ingenierie.com
10 bad 12 20 1356888358 29 19 TIL that in addition to the recent gyrocopter landing the last person to land a helicopter on the White House or U S Capital lawn was also a Floridian First fully functional GUI program about making acronyms easier to remember Was wondering if you guys had any tips reddit.com github.com
11 good 2 20 1356881034 7 12 When we finally arrived at Comic Con Social Tech 101 Why do I love Java Developer Edition Part 1 i.imgur.com socialtech101.blogspot.com
12 good 5 20 1356826782 22 7 Just got a call that my OBGYN is out on an emergency for the next week I m being induced this Saturday Configurable deployment descriptors proposal for Java EE self.BabyBumps java.net
13 good 31 20 1356793800 10 16 Scientists discover intense magnetic field close to supermassive black hole Finished my very first game in java Snake clone It s not much but it works sciencedaily.com self.java
14 bad 18 20 1356766107 2 10 W ow la4j Linear Alebra for Java 0 3 0 is out fap.to la4j.org
15 bad 1 20 1356747219 8 6 Wedding Photographers did you love your wedding photographer RubyFlux a Ruby to Java compiler self.WeddingPhotography github.com
16 bad 15 20 1356735585 38 10 This video reminds me of the hype in this sub for a Fallout 4 in New York Even though the style is a bit WAY off Most of the characters are a bit similar to the Fallout series Simple JMS 2 0 Sample JMSDestinationDefinition and Synchronous Message Receive youtube.com blogs.oracle.com
17 good 9 20 1356717174 6 3 Max the animatronic abandoned at Disney Java Use WebCam i.imgur.com self.java
18 bad 4 20 1356711735 2 5 Francia Expansions Compiler Optimisation for saving memory self.HistoricalWorldPowers self.java
19 bad 4 20 1356662279 10 22 When you learn autotools and discover all am in files I m interested in your opinion about Java for Python Programmers by Brad Miller or a better alternative for a Java newbie youtube.com self.java
20 good 0 20 1356633508 1 4 Instincts A good android game i.imgur.com self.java
21 bad 4 20 1356631759 6 12 No more bing rewards for searches a java library i saw mentioned here can t find pls help self.beermoney self.java
22 bad 1 20 1356627923 7 5 Launcher stops working when signing in HELP About learning Java a question self.GTAV self.java
23 bad 0 20 1356623761 15 3 I m new to the gym amp changing my diet but I m loving it Objects and java2d self.loseit self.java
24 bad 0 20 1356593886 9 2 Forbes The Chevy Bolt Tesla s Best News Yet AffineTransform halp forbes.com self.java
25 bad 43 20 1356584047 12 7 Forth Rail Bridge obscured by fog OS 720x720 x post r ScottishPhotos Java Was Strongly Influenced by Objective C i.imgur.com cs.gmu.edu
26 bad 1 20 1356580543 2 7 Background score Having trouble Setting Up Android Development Environment self.Daredevil self.java
27 bad 0 20 1356560732 4 13 To MIT Media Lab How can I fetch the first X links of reddit into a list bitcoin-gr.org self.java
28 good 0 20 1356551788 3 4 Havana Street Art JDK Download page error self.cigars self.java
29 bad 9 20 1356536557 4 12 Gear PRS Custom 24 looking for a good book website to learn intermediate core java spring self.Guitar self.java
30 bad 7 20 1356487079 34 11 US Calif Co own a home with SO not married for 2 years Now we are breaking up and she only wants to give me my original down pymt instead of buying me out A popup menu like Filemaker s Any library have an implementation self.legaladvice self.java
31 good 1 20 1356455255 6 6 There s been a fur der Just a Few Helpful Solr Functions imgur.com ignatyev-dev.blogspot.ru
32 good 13 20 1356433373 17 7 ICA Use A Test Website UI Greg Miaskiewicz 0 40 1 5 min gt 95 gt 500 Bart s Blog Xtend the better compromise self.HITsWorthTurkingFor bartnaudts.blogspot.de
33 bad 4 20 1356410180 8 3 balloon popping sound in 5 4 3 2 Beginner Question Here i.imgur.com self.java
34 good 19 20 1356283667 12 5 My attempt at recreating the Imperial Insignia in the new teaser trailer Nashorn JavaScript for the JVM imgur.com blogs.oracle.com
35 bad 0 20 1356234086 10 5 This is the most important thing on the internet today Problem with Java memory use youtu.be self.java
36 bad 0 20 1356195953 6 5 A R Kane and Dirty Beaches Learning Java in two weeks self.ambient self.java
37 bad 0 20 1356127053 10 10 What is a good hot air soldering for a hobbyist Twitter4J Download a Twitter Users Tweets to a Text File self.AskElectronics github.com
38 bad 20 20 1356118151 8 15 Falconshield This Is War 4 Freljord COLLAB draggles Using Apache Commons Functor functional interfaces with Java 8 lambdas cross post from r functionalprogramming np.reddit.com kinoshita.eti.br
39 bad 13 20 1356102153 3 7 Sacramento home appraiser Date and Time in Java 8 Timezones sacramentovalleyappraisal.com insightfullogic.com
40 bad 10 20 1356088959 10 8 FIRST WALK OFF OF THE YEAR UPVOTE PARTY r CHICubs Implementing a collapsible ui repeat rows in JSF reddit.com kahimyang.info
41 bad 8 20 1356034544 23 5 Ukrainian notables politicians journalists react to murder of Kalashnikov and Buzhina See their fb posts in link Most popular opinion Putin did it OmniFaces 1 3 is released pravda.com.ua balusc.blogspot.com
42 bad 1 20 1356027563 4 11 Maclock watch for sale How to Configure a JNDI DataSource in the OpenShift Tomcat Cartridge self.MacMiller openshift.redhat.com
43 bad 82 20 1356020780 2 7 me irl Doomsday Sale IntelliJ 75 off today only imgur.com jetbrains.com
44 bad 3 20 1355976320 7 3 Looking to recruit EU Aliance Outland BCH IntelliJ Working Directory self.wowraf self.java
45 bad 0 20 1355966433 10 5 Trying to understand potential of the restaurant food truck industry Help with java problem please self.Entrepreneur self.java
46 bad 17 20 1355928745 3 12 Democracy Now Bitcoin What s new in Servlet 3 1 Java EE 7 moving forward bitcoin-gr.org blogs.oracle.com
47 good 11 20 1355864485 4 5 Got pulled over today Quick poll for research project self.motorcycles self.java
48 bad 0 20 1355851994 7 5 ESPN Reporter Britt McHenry is a shitlord Eclipse Text Problem Need Help liveleak.com self.java
49 bad 29 20 1355823193 15 4 I m looking for places to buy local craft beers by the bottle Any suggestions Java 8 vs Xtend self.dayton blog.efftinge.de
50 bad 2 20 1355805047 5 4 No username in login screen Learning Java between semesters self.techsupport self.java
51 good 6 20 1355798488 7 11 Ads for the upcoming election in Alberta I m a beginner programmer any tips on where to start youtube.com self.java
52 bad 7 20 1355784039 11 9 Michael Savage Hillary Clinton s Looks Alone Could Sink The Campaign Java Advent Calendar far sight look at JDK 8 rightwingwatch.org javaadvent.com
53 good 2 20 1355782111 4 9 Another from People Magazine Technical Interview coming up Suggestions Pointers Words of Wisdom imgur.com self.java
54 bad 0 20 1355775350 10 6 ps4 LF2 CE CROTA CP need sword bearer Psn blackskyes someone may help me out here self.Fireteams stackoverflow.com
55 bad 2 20 1355765235 4 14 Dealing with Cho mid THC and a bit of Thunking Creative ways to deal with multiple return types self.summonerschool kingsfleet.blogspot.it
56 bad 0 20 1355749586 3 12 C 3P0 Question Newbie here can you explain to me what class private stack is self.XWingTMG self.java
57 bad 0 20 1355748318 10 4 DUNGEON HUNTER 5 HACK AND CHEATS TOOL RESOURCES GENERATOR UTILITY When StackOverflow Goes Bad self.maxgiron blogs.windward.net
58 bad 0 20 1355721981 11 4 I m searching for mature anime genre is not too relevant Java Graphics Projectile HELP self.Animesuggest self.java
59 bad 0 20 1355719622 3 12 Cassie s hair Which one of the following statements about object oriented programming is false self.MortalKombat self.java
60 bad 16 20 1355707814 6 8 Ha Ha Ha Ha 0 02 What s the skinny on JavaFX these days youtube.com self.java
61 bad 2 20 1355685929 8 20 Can someone make a simple I hope profile Can someone explain exactly what Apache Ant is How does it differ from just creating a jar file in blueJ self.ChromaProfiles self.java
62 bad 4 20 1355621071 5 7 I can t reinstall SMITE Looking to add test code in Github self.Smite self.java
63 bad 7 20 1355613608 19 6 TIL That in 1974 a US Army Private stole a helicopter and landed it at the White House Twice Java Version of Jarvis Must Haves en.wikipedia.org self.java
64 good 5 20 1355599765 2 6 Rottweiler pup Java Advent Calendar Functional Java Collections imgur.com javaadvent.com
65 good 7 20 1355597483 4 13 New stealth Bonnaroo additions I m working on a text based RPG and I have some questions self.bonnaroo self.java
66 bad 2 20 1355574445 5 6 Any Houston Rockets fans here Java EE 7 Community Survey Results self.Eugene blog.eisele.net
67 good 0 20 1355576629 10 4 Pictures of Tube Televisions the moment they re Turned Off Evolution of Java Technology imgur.com compilr.org
68 bad 18 20 1355574828 10 10 Camping this summer with a 9 5 month old Tips Are your Garbage Collection Logs speaking to you Censum does self.beyondthebump blog.eisele.net
69 good 10 20 1355559380 15 13 Toss this into your old 1 4 7 based packs to improve falling block rendering What is the best GUI tool for creating a 2d platformer in Java minecraftforum.net self.java
70 good 0 20 1355555357 13 7 StreetPass Thank You Bundle takes EXTRA 1 off the new Mii Plaza games Hit me with your best arrays tutorial technologytell.com self.java
71 good 10 20 1355542403 11 11 First Step of Becoming a Real Sissy M m F m Does any one know of clean 2d graphics library for java self.gonewildstories self.java
72 good 23 20 1355511507 10 9 Big BART delays after apparent suicide at Civic Center station Dark Juno A Dark UI Theme for Eclipse 4 sfgate.com rogerdudler.github.com
73 bad 0 20 1355504132 5 10 tornado sirens in northwest suburbs Java devs that work remote I have a few questions self.Minneapolis self.java
74 good 0 20 1355501999 2 9 Me irl How do you make use of your Java knowledge i.imgur.com self.java
75 bad 1 20 1355492027 13 5 Kimi Raikkonen hints at Ferrari stay in 2016 if the team wants him How ClassLoader works in Java espn.co.uk javarevisited.blogspot.com.au
76 bad 0 20 1355489352 16 9 If you had to Explain a game of LoL in one Analogy what would it be Main difference between Abstract Class and Interface Compilr org self.leagueoflegends compilr.org
77 good 48 20 1355487006 6 8 What is your guilty pleasure song Date and Time in Java 8 Part 1 self.AskReddit insightfullogic.com
78 bad 0 20 1355485766 14 3 Suggestion Don t unlock the next unit until you can afford to buy it Java JSON problem self.swarmsim self.java
79 good 10 20 1355448875 1 16 Metal Open source applications large small worth looking at in Java I want to understand application structure imgur.com self.java
80 bad 1 20 1355444452 6 4 TheFatRat Time Lapse House Electro 2015 lo mexor pz xxx soundcloud.com heavy-r.com
81 bad 0 20 1355402889 22 11 Hey Reddit is it true that the silver fillings dentists put in our teeth contains mercury and could be harmful over time JRebel Remoting to Push Changes to Your Toaster in The Cloud self.AskReddit zeroturnaround.com
82 good 0 20 1355402734 5 6 request Will Photoshop For Pizza Are bugs part of technical debt self.RandomActsOfPizza swreflections.blogspot.ca
83 bad 2 20 1355400483 13 9 My wife likes to put small things on the big thing shelf fixed Compile and Run Java programs with Sublime Text 2 i.imgur.com compilr.org
84 bad 0 20 1355391115 14 4 Mi novio es de M xico y quiero practicar con l pero estoy nerviosa console input like craftbukkit self.SpanishImmersion self.java
85 bad 7 20 1355390023 5 8 Anybody have experience with PageFair Hosting suggestions needed for a java web app self.adops self.java
86 good 6 20 1355359227 23 17 Osoba na snimci kriva je za nekoliko kra a bicikala po Zagrebu pa tako i maznuo jedan mom frendu Ako ga prepoznajete javite Java novice here Have noticed funny performance differences across laptop and desktop Nvidia optimus related Details inside youtube.com self.java
87 bad 1 20 1355327090 9 18 Grogheads com Brother Against Brother The AAR Part 1 Please advice which java server technology should I choose for this new web app in my new work grogheads.com self.java
88 good 0 20 1355326137 29 6 St Bernadette Soubirous Feast April 16th outside of France One of the many Incorrupt Saints She looked upon the face of the Blessed Virgin Mary 18 times at Lourdes code to convert digits into words en.lourdes-france.org compilr.org
89 bad 34 20 1355319442 18 7 My mom texted asking what food I want in the fridge including my preferred flavor of Greek yogurt I want to learn REAL WORLD Java i.imgur.com self.java
90 good 5 20 1355285442 18 3 Spoilers All If Dragon Age II had a subtitle s like Origins and Inquisition what would it be Hiring Java Developers self.dragonage self.java
91 bad 0 20 1355282335 5 14 Best hidden places on campus Help How can I count the amount of a specific integer in an ArrayList self.IndianaUniversity self.java
92 bad 1 20 1355272303 8 24 Rematch Snack Santa Snackta is wonderful and generous I m taking a Java 1 final tomorrow I m fairly confident but I would appreciate any tips on things to look out for redditgifts.com self.java
93 bad 38 20 1355267143 13 6 Half Of Yemen s Population Is Going Hungry As Violence Worsens UN Says Will Java become the next COBOL huffingtonpost.com self.java
94 good 0 20 1355263047 6 2 RBC Heritage Round 1 Live Thread Understanding recursion self.dfsports imgur.com
95 bad 1 20 1355257558 7 15 Feeling full all the time swollen liver How can I clear the command prompt terminal with java and make it cross platform self.stopdrinking self.java
96 bad 2 20 1355253849 9 18 Recent events for MLP Zero Hard treasure trail completed Is there a strategy for reducing code clutter when you are printing to the terminal alot Beginner Programmer self.TrueLionhearts self.java
97 bad 1 20 1355253049 5 5 PS4 LF2 for NF Weekly BlockingQueues and multiple producer threads self.Fireteams self.java
98 bad 1 20 1355241441 5 6 Stardust with Ocular by yitaku Beginner Struggling with classes Need help soundcloud.com self.java
99 bad 0 20 1355238089 4 8 PC M9 Bayonet Slaughter Simple Steps to Merge PDF files using Java self.GlobalOffensiveTrade compilr.org
100 good 23 20 1355236940 2 8 Spare food Java and vs Python within a business context self.tampa self.java

File diff suppressed because it is too large Load Diff

View File

@ -80,6 +80,7 @@ border-color: #ddd;
</div>
</form>
<div>
<c:if test="${PREDICTION_FEATURE.isActive()}">
<button id="checkbtn" class="btn btn-default disabled" onclick="predicateResponse()">Predicate Response</button>
<span id="prediction"></span>
@ -104,6 +105,7 @@ function predicateResponse(){
});
}
</script>
</c:if>
</div>
</div>
</body>

View File

@ -56,6 +56,8 @@ public class PersistenceJPATest {
alreadySentPost.setSent(true);
alreadySentPost.setSubmissionDate(dateFormat.parse("2015-03-03 10:30"));
alreadySentPost.setUser(userJohn);
alreadySentPost.setSubreddit("funny");
alreadySentPost.setUrl("www.example.com");
postRepository.save(alreadySentPost);
notSentYetOld = new Post();
@ -63,6 +65,8 @@ public class PersistenceJPATest {
notSentYetOld.setSent(false);
notSentYetOld.setSubmissionDate(dateFormat.parse("2015-03-03 11:00"));
notSentYetOld.setUser(userTom);
notSentYetOld.setSubreddit("funny");
notSentYetOld.setUrl("www.example.com");
postRepository.save(notSentYetOld);
notSentYet = new Post();
@ -70,6 +74,8 @@ public class PersistenceJPATest {
notSentYet.setSent(false);
notSentYet.setSubmissionDate(dateFormat.parse("2015-03-03 11:30"));
notSentYet.setUser(userJohn);
notSentYet.setSubreddit("funny");
notSentYet.setUrl("www.example.com");
postRepository.save(notSentYet);
}