diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000000000000000000000000000000000000..7144ddba94e3a5786ca6eb438e706451093402b6
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.project b/.project
new file mode 100644
index 0000000000000000000000000000000000000000..5b5a27bc2c12803f5590fc39ccb2bc7fe06c0fc8
--- /dev/null
+++ b/.project
@@ -0,0 +1,17 @@
+
+
+ RecommandSystem
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000000000000000000000000000000000000..6a1838d62b0cb137d3f7aa471dcb93fcdeb7e685
--- /dev/null
+++ b/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding//src/log4j.properties=UTF-8
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000000000000000000000000000000000..3a21537071bf4118b9e1ee864cb4bc258aa48211
--- /dev/null
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,11 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/RecommandSystem.iml b/RecommandSystem.iml
new file mode 100644
index 0000000000000000000000000000000000000000..1f89d77c07281d10d9718c8ecabbabb20c2b9146
--- /dev/null
+++ b/RecommandSystem.iml
@@ -0,0 +1,209 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/bin/.DS_Store b/bin/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..4de0ded2fb8099a07518498d5d313400c3820f3e
Binary files /dev/null and b/bin/.DS_Store differ
diff --git a/bin/log4j.properties b/bin/log4j.properties
new file mode 100644
index 0000000000000000000000000000000000000000..505cb5d0bb1eea20455cc64ed134591b39e15838
--- /dev/null
+++ b/bin/log4j.properties
@@ -0,0 +1,24 @@
+###设置###
+log4j.rootLogger = stdout,D,E
+
+### 输出信息到控制台###
+log4j.appender.stdout = org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target = System.out
+log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
+
+###输出DEBUG级别日志到/Users/hanbo/Desktop/debug.log ###
+log4j.appender.D = org.apache.log4j.DailyRollingFileAppender
+log4j.appender.D.File = /Users/hanbo/Desktop/debug.log
+log4j.appender.D.Append = true
+log4j.appender.D.Threshold = DEBUG
+log4j.appender.D.layout = org.apache.log4j.PatternLayout
+log4j.appender.D.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
+
+###输出ERROR级别日志到/Users/hanbo/Desktop/error.log###
+log4j.appender.E = org.apache.log4j.DailyRollingFileAppender
+log4j.appender.E.File =/Users/hanbo/Desktop/error.log
+log4j.appender.E.Append = true
+log4j.appender.E.Threshold = ERROR
+log4j.appender.E.layout = org.apache.log4j.PatternLayout
+log4j.appender.E.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
\ No newline at end of file
diff --git a/bin/top/.DS_Store b/bin/top/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..5432b94bfaa006e420c8271aa2c68cbc5bee1a84
Binary files /dev/null and b/bin/top/.DS_Store differ
diff --git a/bin/top/qianxinyao/.DS_Store b/bin/top/qianxinyao/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..54f170ec9ab16313960cb6d226e4a66673f4d88d
Binary files /dev/null and b/bin/top/qianxinyao/.DS_Store differ
diff --git a/bin/top/qianxinyao/Main/Main.class b/bin/top/qianxinyao/Main/Main.class
new file mode 100644
index 0000000000000000000000000000000000000000..43a0ad88fd1c1473bb504448f0cb092c14a0adb5
Binary files /dev/null and b/bin/top/qianxinyao/Main/Main.class differ
diff --git a/bin/top/qianxinyao/UserBasedCollaborativeRecommender/MahoutUserBasedCollaborativeRecommender.class b/bin/top/qianxinyao/UserBasedCollaborativeRecommender/MahoutUserBasedCollaborativeRecommender.class
new file mode 100644
index 0000000000000000000000000000000000000000..efe137c7fa542978f39e11f343cfd9dd9eff6e1d
Binary files /dev/null and b/bin/top/qianxinyao/UserBasedCollaborativeRecommender/MahoutUserBasedCollaborativeRecommender.class differ
diff --git a/bin/top/qianxinyao/UserBasedCollaborativeRecommender/quartz/CFCronTriggerRunner.class b/bin/top/qianxinyao/UserBasedCollaborativeRecommender/quartz/CFCronTriggerRunner.class
new file mode 100644
index 0000000000000000000000000000000000000000..22e7f49672343cefa6e6250cff07d8aa0dcb3e99
Binary files /dev/null and b/bin/top/qianxinyao/UserBasedCollaborativeRecommender/quartz/CFCronTriggerRunner.class differ
diff --git a/bin/top/qianxinyao/UserBasedCollaborativeRecommender/quartz/CFJob.class b/bin/top/qianxinyao/UserBasedCollaborativeRecommender/quartz/CFJob.class
new file mode 100644
index 0000000000000000000000000000000000000000..77bdc8eecd4fa283f284428cbbef2967661c9d9b
Binary files /dev/null and b/bin/top/qianxinyao/UserBasedCollaborativeRecommender/quartz/CFJob.class differ
diff --git a/bin/top/qianxinyao/algorithms/.DS_Store b/bin/top/qianxinyao/algorithms/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6
Binary files /dev/null and b/bin/top/qianxinyao/algorithms/.DS_Store differ
diff --git a/bin/top/qianxinyao/algorithms/JsonKit$1.class b/bin/top/qianxinyao/algorithms/JsonKit$1.class
new file mode 100644
index 0000000000000000000000000000000000000000..0c72a2bb92a0ae27df638363002a1a9e99bd07b4
Binary files /dev/null and b/bin/top/qianxinyao/algorithms/JsonKit$1.class differ
diff --git a/bin/top/qianxinyao/algorithms/JsonKit$2.class b/bin/top/qianxinyao/algorithms/JsonKit$2.class
new file mode 100644
index 0000000000000000000000000000000000000000..218bc3cbe852f2ce34173f17248f44279e6c8e23
Binary files /dev/null and b/bin/top/qianxinyao/algorithms/JsonKit$2.class differ
diff --git a/bin/top/qianxinyao/algorithms/JsonKit$3.class b/bin/top/qianxinyao/algorithms/JsonKit$3.class
new file mode 100644
index 0000000000000000000000000000000000000000..ad08cb1c036b421b62f8d46b74e35d067c6fdcf6
Binary files /dev/null and b/bin/top/qianxinyao/algorithms/JsonKit$3.class differ
diff --git a/bin/top/qianxinyao/algorithms/JsonKit.class b/bin/top/qianxinyao/algorithms/JsonKit.class
new file mode 100644
index 0000000000000000000000000000000000000000..f69612823a661e71ba4e36f8a5f0b31ce8f95047
Binary files /dev/null and b/bin/top/qianxinyao/algorithms/JsonKit.class differ
diff --git a/bin/top/qianxinyao/algorithms/PropGetKit.class b/bin/top/qianxinyao/algorithms/PropGetKit.class
new file mode 100644
index 0000000000000000000000000000000000000000..d1ca3458d8f748668f16b4496e11e3c296b21c56
Binary files /dev/null and b/bin/top/qianxinyao/algorithms/PropGetKit.class differ
diff --git a/bin/top/qianxinyao/algorithms/RecommendAlgorithm.class b/bin/top/qianxinyao/algorithms/RecommendAlgorithm.class
new file mode 100644
index 0000000000000000000000000000000000000000..2680cef64204c7488f67bcbde4ac5cdd11ee8677
Binary files /dev/null and b/bin/top/qianxinyao/algorithms/RecommendAlgorithm.class differ
diff --git a/bin/top/qianxinyao/algorithms/RecommendKit.class b/bin/top/qianxinyao/algorithms/RecommendKit.class
new file mode 100644
index 0000000000000000000000000000000000000000..9c4f5da6529c39c6df30193ee26fe4f05bc9f2d8
Binary files /dev/null and b/bin/top/qianxinyao/algorithms/RecommendKit.class differ
diff --git a/bin/top/qianxinyao/contentbasedrecommend/ContentBasedRecommender.class b/bin/top/qianxinyao/contentbasedrecommend/ContentBasedRecommender.class
new file mode 100644
index 0000000000000000000000000000000000000000..1d1677a4e9ae6446a52c467589267158b86981c9
Binary files /dev/null and b/bin/top/qianxinyao/contentbasedrecommend/ContentBasedRecommender.class differ
diff --git a/bin/top/qianxinyao/contentbasedrecommend/CustomizedComparator.class b/bin/top/qianxinyao/contentbasedrecommend/CustomizedComparator.class
new file mode 100644
index 0000000000000000000000000000000000000000..662b201dc791eeb5a9fc4a780ff7cad29cc451bb
Binary files /dev/null and b/bin/top/qianxinyao/contentbasedrecommend/CustomizedComparator.class differ
diff --git a/bin/top/qianxinyao/contentbasedrecommend/CustomizedHashMap.class b/bin/top/qianxinyao/contentbasedrecommend/CustomizedHashMap.class
new file mode 100644
index 0000000000000000000000000000000000000000..9a30b2fbb0b8541e49410a1ea2ee6ca31f1cf8ca
Binary files /dev/null and b/bin/top/qianxinyao/contentbasedrecommend/CustomizedHashMap.class differ
diff --git a/bin/top/qianxinyao/contentbasedrecommend/MapValueComparator.class b/bin/top/qianxinyao/contentbasedrecommend/MapValueComparator.class
new file mode 100644
index 0000000000000000000000000000000000000000..654ee6033c01d1d96cb30a63b7a531fe2a1e39f1
Binary files /dev/null and b/bin/top/qianxinyao/contentbasedrecommend/MapValueComparator.class differ
diff --git a/bin/top/qianxinyao/contentbasedrecommend/TFIDF.class b/bin/top/qianxinyao/contentbasedrecommend/TFIDF.class
new file mode 100644
index 0000000000000000000000000000000000000000..5a17fd5fc35f6a4fa72d0d1629a7f7bc9fe90627
Binary files /dev/null and b/bin/top/qianxinyao/contentbasedrecommend/TFIDF.class differ
diff --git a/bin/top/qianxinyao/contentbasedrecommend/UserPrefRefresher.class b/bin/top/qianxinyao/contentbasedrecommend/UserPrefRefresher.class
new file mode 100644
index 0000000000000000000000000000000000000000..9402cf4ebb0eb06cb5e24a401851457d5965181c
Binary files /dev/null and b/bin/top/qianxinyao/contentbasedrecommend/UserPrefRefresher.class differ
diff --git a/bin/top/qianxinyao/contentbasedrecommend/quartz/CBCronTriggerRunner.class b/bin/top/qianxinyao/contentbasedrecommend/quartz/CBCronTriggerRunner.class
new file mode 100644
index 0000000000000000000000000000000000000000..04372d9a9b67af3150921d0502143042ad103068
Binary files /dev/null and b/bin/top/qianxinyao/contentbasedrecommend/quartz/CBCronTriggerRunner.class differ
diff --git a/bin/top/qianxinyao/contentbasedrecommend/quartz/CBJob.class b/bin/top/qianxinyao/contentbasedrecommend/quartz/CBJob.class
new file mode 100644
index 0000000000000000000000000000000000000000..20648ae4a7afd7a50c3692d1028208d7a79be3ce
Binary files /dev/null and b/bin/top/qianxinyao/contentbasedrecommend/quartz/CBJob.class differ
diff --git a/bin/top/qianxinyao/dbconnection/ConnectionFactory.class b/bin/top/qianxinyao/dbconnection/ConnectionFactory.class
new file mode 100644
index 0000000000000000000000000000000000000000..2c10c4246fd6fcd5af2a93dd304c0ef94c2df5cf
Binary files /dev/null and b/bin/top/qianxinyao/dbconnection/ConnectionFactory.class differ
diff --git a/bin/top/qianxinyao/dbconnection/StatementWatcher.class b/bin/top/qianxinyao/dbconnection/StatementWatcher.class
new file mode 100644
index 0000000000000000000000000000000000000000..122b69a6b67832de1fd21a8c8a1a2a912fe9da40
Binary files /dev/null and b/bin/top/qianxinyao/dbconnection/StatementWatcher.class differ
diff --git a/bin/top/qianxinyao/hotrecommend/HotRecommender.class b/bin/top/qianxinyao/hotrecommend/HotRecommender.class
new file mode 100644
index 0000000000000000000000000000000000000000..b94bc6bf59dcb9f6c8aea96994157d90af338943
Binary files /dev/null and b/bin/top/qianxinyao/hotrecommend/HotRecommender.class differ
diff --git a/bin/top/qianxinyao/hotrecommend/quartz/HRCronTriggerRunner.class b/bin/top/qianxinyao/hotrecommend/quartz/HRCronTriggerRunner.class
new file mode 100644
index 0000000000000000000000000000000000000000..f57443fa1e7791437b601a3012f27b740c5612ca
Binary files /dev/null and b/bin/top/qianxinyao/hotrecommend/quartz/HRCronTriggerRunner.class differ
diff --git a/bin/top/qianxinyao/hotrecommend/quartz/HRJob.class b/bin/top/qianxinyao/hotrecommend/quartz/HRJob.class
new file mode 100644
index 0000000000000000000000000000000000000000..7c20160017cb40043e6b09cb1ea36250a66205e0
Binary files /dev/null and b/bin/top/qianxinyao/hotrecommend/quartz/HRJob.class differ
diff --git a/bin/top/qianxinyao/performance/Judge.class b/bin/top/qianxinyao/performance/Judge.class
new file mode 100644
index 0000000000000000000000000000000000000000..cf078395b9db17ca28e624c8b57f815dfabc265f
Binary files /dev/null and b/bin/top/qianxinyao/performance/Judge.class differ
diff --git a/res/dbconfig.properties b/res/dbconfig.properties
new file mode 100644
index 0000000000000000000000000000000000000000..f5d27a17f7061155432d384c697db251bf4e1dc1
--- /dev/null
+++ b/res/dbconfig.properties
@@ -0,0 +1,16 @@
+#url=jdbc:mysql://121.42.36.199/recommand_system
+#user=root
+#password=123456
+#dbname=recommand_system
+#ip=121.42.36.199
+
+
+url = jdbc:postgresql://202.114.234.171:25432/mcipdb
+user = postgres
+password = n749fj
+dbname=mcipdb
+
+#url = jdbc:postgresql://115.28.212.146:5432/mcipdb
+#user = postgres
+#password = n749fj
+#dbname=mcipdb
\ No newline at end of file
diff --git a/res/paraConfig.properties b/res/paraConfig.properties
new file mode 100644
index 0000000000000000000000000000000000000000..28a46719fdc2cbd82ede09fd19699e33092f8af8
--- /dev/null
+++ b/res/paraConfig.properties
@@ -0,0 +1,29 @@
+#---Recommend System Parameter---
+#Recommend Executing Moment(Quartz's CronExpression)
+startAt=0 0 0 ? * *
+
+
+#---Specific Algorithm Parameter---
+
+#-RecommendKit-
+#Valid specific day the news published after which are still valuable
+beforeDays=-30
+#Valid specific day after which those who has browsed news can be regarded "active"
+activeDay=-30
+
+#-Collaborative Filtering Recommendation-
+#Recommend Num from CF(Collaborative Filtering)
+CFRecNum=5
+#Valid specific day after which users' browsing history would be calculated
+CFValidDay=-30
+
+#-Content-Based Recommendation-
+#Recommend Num from CB(Content-Based Recommend)
+CBRecNum=5
+#Set a previous day after which the browsing history will be calculated with, namely, is still in time
+previousDays=-30
+#TF-IDF's extracting numbers of keywords from every news
+TFIDFKeywordsNum=10
+
+#-Hot Recommendation-
+
diff --git a/src/.DS_Store b/src/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..4de0ded2fb8099a07518498d5d313400c3820f3e
Binary files /dev/null and b/src/.DS_Store differ
diff --git a/src/log4j.properties b/src/log4j.properties
new file mode 100644
index 0000000000000000000000000000000000000000..505cb5d0bb1eea20455cc64ed134591b39e15838
--- /dev/null
+++ b/src/log4j.properties
@@ -0,0 +1,24 @@
+###设置###
+log4j.rootLogger = stdout,D,E
+
+### 输出信息到控制台###
+log4j.appender.stdout = org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target = System.out
+log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
+
+###输出DEBUG级别日志到/Users/hanbo/Desktop/debug.log ###
+log4j.appender.D = org.apache.log4j.DailyRollingFileAppender
+log4j.appender.D.File = /Users/hanbo/Desktop/debug.log
+log4j.appender.D.Append = true
+log4j.appender.D.Threshold = DEBUG
+log4j.appender.D.layout = org.apache.log4j.PatternLayout
+log4j.appender.D.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
+
+###输出ERROR级别日志到/Users/hanbo/Desktop/error.log###
+log4j.appender.E = org.apache.log4j.DailyRollingFileAppender
+log4j.appender.E.File =/Users/hanbo/Desktop/error.log
+log4j.appender.E.Append = true
+log4j.appender.E.Threshold = ERROR
+log4j.appender.E.layout = org.apache.log4j.PatternLayout
+log4j.appender.E.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
\ No newline at end of file
diff --git a/src/top/.DS_Store b/src/top/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..5432b94bfaa006e420c8271aa2c68cbc5bee1a84
Binary files /dev/null and b/src/top/.DS_Store differ
diff --git a/src/top/qianxinyao/.DS_Store b/src/top/qianxinyao/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..54f170ec9ab16313960cb6d226e4a66673f4d88d
Binary files /dev/null and b/src/top/qianxinyao/.DS_Store differ
diff --git a/src/top/qianxinyao/Main/DataProcessor.java b/src/top/qianxinyao/Main/DataProcessor.java
new file mode 100644
index 0000000000000000000000000000000000000000..4a3b0262ff594faf0d9e52e047d98772aad79663
--- /dev/null
+++ b/src/top/qianxinyao/Main/DataProcessor.java
@@ -0,0 +1,158 @@
+///**
+// *
+// */
+//package top.qianxinyao.Main;
+//
+//import java.io.File;
+//import java.io.FileInputStream;
+//import java.io.FileNotFoundException;
+//import java.io.IOException;
+//import java.text.DecimalFormat;
+//import java.util.HashMap;
+//import java.util.Iterator;
+//
+//import org.apache.log4j.Logger;
+//import org.apache.poi.hssf.usermodel.HSSFCell;
+//import org.apache.poi.hssf.usermodel.HSSFRow;
+//import org.apache.poi.hssf.usermodel.HSSFSheet;
+//import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+//import org.apache.poi.ss.usermodel.Cell;
+//import org.apache.poi.ss.usermodel.Row;
+//
+//
+///**
+// * @author qianxinyao
+// * @email tomqianmaple@gmail.com
+// * @github https://github.com/bluemapleman
+// * @date 2016年10月16日
+// */
+//
+//public class DataProcessor
+//{
+//
+// private static Logger logger = Logger.getLogger(DataProcessor.class);
+//
+// private static HashMap> userLikes;
+//
+// /**
+// * 读取数据表,获得用户的喜好数据
+// */
+// public static void readDataTable(){
+//
+// }
+//
+// /**
+// * 读取excel文件,获得用户的喜好数据
+// *
+// * @param file
+// */
+//
+// public static void readExcelData(File file)
+// {
+// userLikes=new HashMap>();
+//
+// HSSFWorkbook wb=null;
+//
+// try
+// {
+// wb = new HSSFWorkbook(new FileInputStream(file));
+//
+// HSSFSheet sheet = wb.getSheetAt(0);
+//
+// // Iterate over each row in the sheet
+//
+// Iterator rows = sheet.rowIterator();
+//
+// while (rows.hasNext())
+// {
+// HashMap likes=new HashMap();
+//
+// HSSFRow row = (HSSFRow) rows.next();
+//
+// // Iterate over each cell in the row and print out the cell"s
+//
+// // content
+//
+// Iterator cells = row.cellIterator();
+//
+//
+// while (cells.hasNext())
+// {
+// Cell cell=cells.next();
+//
+// String cellValue=getCellValue((HSSFCell) cell);
+//
+//
+// logger.info(cellValue);
+//
+// }
+// }
+// }
+// catch (FileNotFoundException fe)
+// {
+// logger.error("Exception:" + fe.toString());
+// }
+// catch (Exception e)
+// {
+// logger.error("Exception:" + e.toString());
+// }
+// finally
+// {
+// if(null!=wb){
+// try
+// {
+// wb.close();
+// }
+// catch (IOException e)
+// {
+// // TODO Auto-generated catch block
+// logger.error("XSSFWorkbook close failed!");
+// }
+// }
+// logger.info("程序出现异常!请检查!");
+// }
+// }
+//
+//
+// /**
+// * 返回各种类型单元格值的字符串形式的方法
+// * @param cell
+// * @return
+// */
+// private static String getCellValue(HSSFCell cell) {
+// String cellValue = "";
+// DecimalFormat df = new DecimalFormat("#");
+// switch (cell.getCellType()) {
+// case HSSFCell.CELL_TYPE_STRING:
+// cellValue = cell.getRichStringCellValue().getString().trim();
+// break;
+// case HSSFCell.CELL_TYPE_NUMERIC:
+// cellValue = df.format(cell.getNumericCellValue()).toString();
+// break;
+// case HSSFCell.CELL_TYPE_BOOLEAN:
+// cellValue = String.valueOf(cell.getBooleanCellValue()).trim();
+// break;
+// case HSSFCell.CELL_TYPE_FORMULA:
+// cellValue = cell.getCellFormula();
+// break;
+// default:
+// cellValue = "";
+// }
+// return cellValue;
+// }
+//
+//
+//
+//
+//
+// /**
+// * 分隔用户所喜好新闻数据的方法,获得用户喜好的所有新闻信息。
+// * @param likes
+// * @param seperator 新闻数据分隔符
+// * @return
+// */
+//// private static String[] seperateLikes(String likes,String seperator){
+//// return likes.split(seperator);
+//// }
+//
+//}
diff --git a/src/top/qianxinyao/Main/Main.java b/src/top/qianxinyao/Main/Main.java
new file mode 100644
index 0000000000000000000000000000000000000000..53d8af1b689d556fae31ebf6adeffea4cc9b276f
--- /dev/null
+++ b/src/top/qianxinyao/Main/Main.java
@@ -0,0 +1,60 @@
+/**
+ *
+ */
+package top.qianxinyao.Main;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.List;
+
+import top.qianxinyao.UserBasedCollaborativeRecommender.MahoutUserBasedCollaborativeRecommender;
+import top.qianxinyao.algorithms.PropGetKit;
+import top.qianxinyao.algorithms.RecommendKit;
+import top.qianxinyao.contentbasedrecommend.ContentBasedRecommender;
+import top.qianxinyao.hotrecommend.HotRecommender;
+
+/**
+ * @author qianxinyao
+ * @email tomqianmaple@gmail.com
+ * @github https://github.com/bluemapleman
+ * @date 2016年10月20日
+ */
+public class Main
+{
+ static ResultSet rs=null;
+
+ /**
+ * @param args
+ * @throws SQLException
+ */
+ public static void main(String[] args) throws SQLException
+ {
+ //加载系统配置文件
+ PropGetKit.loadProperties("paraConfig");
+ //仅给最近一个月有活动的用户进行推荐动作
+ List users=RecommendKit.getActiveUsers();
+ //设定推荐任务每天的执行时间
+// String cronExpression=PropGetKit.getString("startAt");
+// try
+// {
+// new CFCronTriggerRunner().task(users,cronExpression);
+// new CBCronTriggerRunner().task(users,cronExpression);
+// new HRCronTriggerRunner().task(users,cronExpression);
+// }
+// catch (SchedulerException e)
+// {
+// // TODO Auto-generated catch block
+// e.printStackTrace();
+// }
+ HotRecommender.formTodayTopHotNewsList();
+// new MahoutUserBasedCollaborativeRecommender().recommend(users);
+// new ContentBasedRecommender().recommend(users);
+ new HotRecommender().recommend(users);
+
+
+
+
+
+ }
+}
+
diff --git a/src/top/qianxinyao/UserBasedCollaborativeRecommender/MahoutUserBasedCollaborativeRecommender.java b/src/top/qianxinyao/UserBasedCollaborativeRecommender/MahoutUserBasedCollaborativeRecommender.java
new file mode 100644
index 0000000000000000000000000000000000000000..abc01971c21fbc1bac65cde70d590e138fafe09b
--- /dev/null
+++ b/src/top/qianxinyao/UserBasedCollaborativeRecommender/MahoutUserBasedCollaborativeRecommender.java
@@ -0,0 +1,150 @@
+/**
+ *
+ */
+package top.qianxinyao.UserBasedCollaborativeRecommender;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.apache.mahout.cf.taste.common.TasteException;
+import org.apache.mahout.cf.taste.impl.model.jdbc.PostgreSQLBooleanPrefJDBCDataModel;
+import org.apache.mahout.cf.taste.impl.neighborhood.NearestNUserNeighborhood;
+import org.apache.mahout.cf.taste.impl.recommender.GenericUserBasedRecommender;
+import org.apache.mahout.cf.taste.impl.similarity.LogLikelihoodSimilarity;
+import org.apache.mahout.cf.taste.neighborhood.UserNeighborhood;
+import org.apache.mahout.cf.taste.recommender.RecommendedItem;
+import org.apache.mahout.cf.taste.recommender.Recommender;
+import org.apache.mahout.cf.taste.similarity.UserSimilarity;
+
+import top.qianxinyao.algorithms.PropGetKit;
+import top.qianxinyao.algorithms.RecommendAlgorithm;
+import top.qianxinyao.algorithms.RecommendKit;
+import top.qianxinyao.dbconnection.ConnectionFactory;
+
+/**
+ * @author qianxinyao
+ * @email tomqianmaple@gmail.com
+ * @github https://github.com/bluemapleman
+ * @date 2016年10月18日 协同过滤
+ */
+
+/**
+ * Collaborative-Based Filter 基于用户的协同过滤
+ *
+ */
+public class MahoutUserBasedCollaborativeRecommender implements RecommendAlgorithm
+{
+ public static final Logger logger = Logger.getLogger(MahoutUserBasedCollaborativeRecommender.class);
+
+ /**
+ * 对应计算相似度时的时效天数
+ */
+ private static int inRecDays = PropGetKit.getInt("CFValidDay");
+
+ /**
+ * 给每个用户推荐的新闻的条数
+ */
+ public static int N =PropGetKit.getInt("CFRecNum");
+
+ /**
+ * 给特定的一批用户进行新闻推荐
+ *
+ * @param 目标用户的id列表
+ */
+ @SuppressWarnings("unused")
+ @Override
+ public void recommend(List users)
+ {
+ int count=0;
+ try
+ {
+ System.out.println("CF start at "+new Date());
+
+ PostgreSQLBooleanPrefJDBCDataModel dataModel = ConnectionFactory.getPostgreSQLBooleanPrefJDBCDataModel();
+
+ Statement stmt = ConnectionFactory.getNewStatement();
+
+ ResultSet rs1 = stmt.executeQuery("select " + ConnectionFactory.PREF_TABLE_USERID + ","
+ + ConnectionFactory.PREF_TABLE_NEWSID + "," + ConnectionFactory.PREF_TABLE_TIME + " from newslogs");
+
+ // 移除过期的用户浏览新闻行为,这些行为对计算用户相似度不再具有较大价值
+ while (rs1.next())
+ {
+ if (rs1.getTimestamp(3).before(RecommendKit.getInRecTimestamp(inRecDays)))
+ {
+ dataModel.removePreference(Long.parseLong(rs1.getString(1)), Long.parseLong(rs1.getString(2)));
+ }
+ }
+
+ UserSimilarity similarity = new LogLikelihoodSimilarity(dataModel);
+
+ // NearestNeighborhood的数量有待考察
+ UserNeighborhood neighborhood = new NearestNUserNeighborhood(5, similarity, dataModel);
+
+ Recommender recommender = new GenericUserBasedRecommender(dataModel, neighborhood, similarity);
+
+ for (String user : users)
+ {
+ long start = System.currentTimeMillis();
+
+ Long userid = Long.parseLong(user);
+
+ List recItems = recommender.recommend(userid, N);
+
+ Set hs = new HashSet();
+
+ for (RecommendedItem recItem : recItems)
+ {
+ hs.add(String.valueOf(recItem.getItemID()));
+ }
+
+ // 过滤掉已推荐新闻和已过期新闻
+ RecommendKit.filterOutDateNews(hs, String.valueOf(userid));
+ RecommendKit.filterReccedNews(hs, String.valueOf(userid));
+
+ // 无可推荐新闻
+ if (hs == null)
+ {
+ continue;
+ }
+
+ if(hs.size()>N){
+ RecommendKit.removeOverNews(hs, N);
+ }
+
+ RecommendKit.insertRecommend(String.valueOf(userid), hs.iterator(),RecommendAlgorithm.CF);
+
+ count+=hs.size();
+ }
+ }
+ catch (TasteException e)
+ {
+ logger.error("CB算法构造偏好对象失败!");
+ e.printStackTrace();
+ }
+ catch (SQLException e)
+ {
+ logger.error("CB算法数据库操作失败!");
+ e.printStackTrace();
+ }
+ System.out.println("CF has contributed " + (count/users.size()) + " recommending news on average");
+ System.out.println("CF finish at "+new Date());
+ return;
+ }
+
+ public int getRecNums()
+ {
+ return N;
+ }
+
+ public void setRecNums(int recNums)
+ {
+ N = recNums;
+ }
+}
diff --git a/src/top/qianxinyao/UserBasedCollaborativeRecommender/quartz/CFCronTriggerRunner.java b/src/top/qianxinyao/UserBasedCollaborativeRecommender/quartz/CFCronTriggerRunner.java
new file mode 100644
index 0000000000000000000000000000000000000000..a490a90301222cc0b9a4ad3bf7c59ed380872d11
--- /dev/null
+++ b/src/top/qianxinyao/UserBasedCollaborativeRecommender/quartz/CFCronTriggerRunner.java
@@ -0,0 +1,56 @@
+/**
+ *
+ */
+package top.qianxinyao.UserBasedCollaborativeRecommender.quartz;
+
+import java.util.List;
+
+import org.quartz.CronExpression;
+import org.quartz.JobKey;
+import org.quartz.Scheduler;
+import org.quartz.SchedulerException;
+import org.quartz.SchedulerFactory;
+import org.quartz.impl.JobDetailImpl;
+import org.quartz.impl.StdSchedulerFactory;
+import org.quartz.impl.triggers.CronTriggerImpl;
+
+/**
+ * @author qianxinyao
+ * @email tomqianmaple@gmail.com
+ * @github https://github.com/bluemapleman
+ * @date 2016年11月23日
+ */
+public class CFCronTriggerRunner
+{
+ public void task(List users,String cronExpression) throws SchedulerException
+ {
+ // Initiate a Schedule Factory
+ SchedulerFactory schedulerFactory = new StdSchedulerFactory();
+ // Retrieve a scheduler from schedule factory
+ Scheduler scheduler = schedulerFactory.getScheduler();
+
+ // Initiate JobDetail with job name, job group, and executable job class
+ JobDetailImpl jobDetailImpl =
+ new JobDetailImpl();
+ jobDetailImpl.setJobClass(CFJob.class);
+ jobDetailImpl.setKey(new JobKey("CFJob1"));
+ jobDetailImpl.getJobDataMap().put("users", users);
+ // Initiate CronTrigger with its name and group name
+ CronTriggerImpl cronTriggerImpl = new CronTriggerImpl();
+ cronTriggerImpl.setName("CFCronTrigger1");
+ try {
+ // setup CronExpression
+ CronExpression cexp = new CronExpression(cronExpression);
+ // Assign the CronExpression to CronTrigger
+ cronTriggerImpl.setCronExpression(cexp);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ // schedule a job with JobDetail and Trigger
+ scheduler.scheduleJob(jobDetailImpl, cronTriggerImpl);
+
+ // start the scheduler
+ scheduler.start();
+ }
+}
+
diff --git a/src/top/qianxinyao/UserBasedCollaborativeRecommender/quartz/CFJob.java b/src/top/qianxinyao/UserBasedCollaborativeRecommender/quartz/CFJob.java
new file mode 100644
index 0000000000000000000000000000000000000000..6f3dfaf49e127ce5ad06ebc84559041107a4561c
--- /dev/null
+++ b/src/top/qianxinyao/UserBasedCollaborativeRecommender/quartz/CFJob.java
@@ -0,0 +1,32 @@
+/**
+ *
+ */
+package top.qianxinyao.UserBasedCollaborativeRecommender.quartz;
+
+import java.util.List;
+
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+
+import top.qianxinyao.UserBasedCollaborativeRecommender.MahoutUserBasedCollaborativeRecommender;
+
+/**
+ * @author qianxinyao
+ * @email tomqianmaple@gmail.com
+ * @github https://github.com/bluemapleman
+ * @date 2016年11月23日
+ * 每天定时根据用户当日的新闻浏览记录来更新用户的喜好关键词列表
+ */
+public class CFJob implements Job
+{
+ @SuppressWarnings("unchecked")
+ @Override
+ public void execute(JobExecutionContext arg0) throws JobExecutionException
+ {
+ List users=(List) arg0.getJobDetail().getJobDataMap().get("users");
+ new MahoutUserBasedCollaborativeRecommender().recommend(users);
+ }
+
+}
+
diff --git a/src/top/qianxinyao/algorithms/.DS_Store b/src/top/qianxinyao/algorithms/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6
Binary files /dev/null and b/src/top/qianxinyao/algorithms/.DS_Store differ
diff --git a/src/top/qianxinyao/algorithms/JsonKit.java b/src/top/qianxinyao/algorithms/JsonKit.java
new file mode 100644
index 0000000000000000000000000000000000000000..423c53416e5ec100ca542c20d60245e7cfaca69e
--- /dev/null
+++ b/src/top/qianxinyao/algorithms/JsonKit.java
@@ -0,0 +1,147 @@
+/**
+ *
+ */
+package top.qianxinyao.algorithms;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.type.TypeReference;
+
+import top.qianxinyao.contentbasedrecommend.CustomizedHashMap;
+
+/**
+ * @author qianxinyao
+ * @email tomqianmaple@gmail.com
+ * @github https://github.com/bluemapleman
+ * @date 2016年11月21日
+ */
+public class JsonKit
+{
+ public static String test(){
+ String json=null;
+ try {
+ Map moduleidMap = new HashMap();
+ Map keywordRateMap = new HashMap();
+ keywordRateMap.put("政治", 123.1);
+ keywordRateMap.put("金融", 35.2);
+ moduleidMap.put(1,keywordRateMap);
+ keywordRateMap.put("电影", 351.1);
+ moduleidMap.put(2,keywordRateMap);
+ ObjectMapper objectMapper=new ObjectMapper();
+ json=objectMapper.writeValueAsString(moduleidMap);
+
+ String test="{\"1\":{},\"2\":{},\"3\":{},\"4\":{}}";
+ return test;
+ } catch (IOException e) {
+
+ e.printStackTrace();
+
+ }
+ return json;
+ }
+
+ /**
+ * 获取用户所关注的模板的id的set
+ * @param srcJson
+ * @return
+ */
+ public static Set getUserModuleIdSet(String srcJson){
+
+ //java的擦除机制不允许直接获取泛型类的class,但是这样会使得jackson的readValue自动将键转换为String,于是需要使用jackson提供的TypeReference来解决这个问题
+ Map map=null;
+ try
+ {
+ ObjectMapper objectMapper=new ObjectMapper();
+ map = objectMapper.readValue(srcJson, new TypeReference |