当前位置: 首页 > news >正文

企业网站建设合同书模板家居网站应该怎么做

企业网站建设合同书模板,家居网站应该怎么做,网站主页排版,做外贸哪个网站比较好2017日志挖掘——处理数据、计费统计 1、读取附件中日志的内容#xff0c;找出自己学号停车场中对应的进出车次数#xff08;in/out配对的记录数#xff0c;1条in、1条out#xff0c;视为一个车次#xff0c;本日志中in/out为一一对应#xff0c;不存在缺失某条进或出记录找出自己学号停车场中对应的进出车次数in/out配对的记录数1条in、1条out视为一个车次本日志中in/out为一一对应不存在缺失某条进或出记录 2、统计自己停车场车辆累计停放秒即某个车牌车辆驶出时间-车辆驶入时间本此停放秒数统计自己车场全部车牌的累计 在日志挖掘实验基础上针对车辆进出进行计费。 计费规则如下 1、进场后在30分钟内出场的车辆免收费 2、停放在2小时内含2小时收费10元从第三小时起每小时2元。 3、不封顶。 public class CountPark {static MapString,Integer profitnew HashMap();static MapString,String mapnew HashMap();static long cnt0,time0;static SimpleDateFormat sdf new SimpleDateFormat(yyyy-MM-dd HH:mm:ss);static SimpleDateFormat sdf2 new SimpleDateFormat(yyyy-MM);public static ListString readTxt(String fileName){ListString listnew ArrayList();try { // 防止文件建立或读取失败用catch捕捉错误并打印也可以throw/* 读入TXT文件 */System.out.println(fileName);File filename new File(fileName); // 要读取以上路径的input。txt文件InputStreamReader reader new InputStreamReader(new FileInputStream(filename),gbk); // 建立一个输入流对象readerBufferedReader br new BufferedReader(reader); // 建立一个对象它把文件内容转成计算机能读懂的语言String line ;line br.readLine();while (line ! null) {String[] templine.split(,);if(temp[1].equals(2018250)){if(map.containsKey(temp[2])){long cursdf.parse(temp[0]).getTime();int cost0;String monthsdf2.format(sdf.parse(temp[0]));long presdf.parse(map.get(temp[2])).getTime();double curTime((double) (cur-pre))/1000;//秒if(curTime1800)//大于半小时{cost10;//收10元double hour Math.ceil(curTime/(60*60));//小时if(hour2)//两小时以上cost(hour-2)*2;}profit.put(month,profit.getOrDefault(month,0)cost);//记录map.remove(temp[2]);}elsemap.put(temp[2],temp[0]);cnt;}line br.readLine();}} catch (Exception e) {e.printStackTrace();}return list;}public static void main(String[] args) {long cSystem.currentTimeMillis();ListString listreadTxt(cars2.txt);System.out.println(运行时间秒:(double)(System.currentTimeMillis()-c)/1000秒);for(String s:profit.keySet())System.out.println(s:profit.get(s));} } 日志挖掘——并行改造 1、读取文件并行化数据分割 具体做法针对之前一个大日志文件根据时间例如按照日期进行切割切割为多个小文件。读取时每天的数据分别读取 2、处理并行化任务分割 具体做法针对每个日期分别进行各种扫描和统计对于跨日期的数据存放在公用地方到时再配对处理 public class CountPark2 {static MapString,ArrayListString profitnew HashMap();static MapString,String mapnew HashMap();static long cnt0,time0;static SimpleDateFormat formatter new SimpleDateFormat(HH:mm:ss.SSS);static SimpleDateFormat sdf new SimpleDateFormat(yyyy-MM-dd HH:mm:ss);static SimpleDateFormat sdf2 new SimpleDateFormat(yyyy-MM);public static void readTxt(String fileName){ListString listnew ArrayList();try { // 防止文件建立或读取失败用catch捕捉错误并打印也可以throw/* 读入TXT文件 */File filename new File(fileName); // 要读取以上路径的input。txt文件InputStreamReader reader new InputStreamReader(new FileInputStream(filename),gbk); // 建立一个输入流对象readerBufferedReader br new BufferedReader(reader); // 建立一个对象它把文件内容转成计算机能读懂的语言String line ;line br.readLine();while (line ! null) {String[] templine.split(,);if(temp[1].equals(2018250)){long cursdf.parse(temp[0]).getTime(); String monthsdf2.format(sdf.parse(temp[0]));if(!profit.containsKey(month)) profit.put(month,new ArrayList());profit.get(month).add(line);}line br.readLine();} }catch (Exception e) {e.printStackTrace();}}public static void writeTxt(String content,String filename){try {File writename new File(src/logminning/reso/filename); // 相对路径如果没有则要建立一个新的output.txt文件writename.createNewFile(); // 创建新文件BufferedWriter out new BufferedWriter(new FileWriter(writename));out.write(content); // \r\n即为换行out.flush(); // 把缓存区内容压入文件out.close(); // 最后记得关闭文件} catch (Exception e) {e.printStackTrace();}}public void handle(){readTxt(cars2.txt);for(String c:profit.keySet()){StringBuilder stringBuildernew StringBuilder();for(String t:profit.get(c))stringBuilder.append(t).append(\r\n);writeTxt(stringBuilder.toString(),c);}}public static void main(String[] args) {ConcurrentHashMapString, PriorityBlockingQueueLong concurrentHashMapnew ConcurrentHashMap();BlockingQueueString blockingQueuenew LinkedBlockingQueue();ExecutorService executorService Executors.newFixedThreadPool(8);CountDownLatch countDownLatchnew CountDownLatch(6);System.out.println(Start ReadFile:formatter.format(new Date()));for(int i1;i6;i){executorService.execute(new ReadFileThread(concurrentHashMap,src/logminning/reso/2020-0String.valueOf(i).txt,countDownLatch));}try {countDownLatch.await();} catch (InterruptedException e) {e.printStackTrace();}System.out.println(End ReadFile:formatter.format(new Date())); /* int used0;for(String c:concurrentHashMap.keySet()){if(concurrentHashMap.get(c).size()2) continue;System.out.println(c:concurrentHashMap.get(c).size());usedconcurrentHashMap.get(c).size();}System.out.println(used);*/Res resnew Res();countDownLatchnew CountDownLatch(6);for(int i0;i26;i5){executorService.execute(new handler(concurrentHashMap,countDownLatch,i,res));}try {countDownLatch.await();} catch (InterruptedException e) {e.printStackTrace();}System.out.println(End Process:formatter.format(new Date()));System.out.println(res.getTar():res.getUsed());executorService.shutdown();} } public class handler implements Runnable{CountDownLatch countDownLatch;ConcurrentHashMapString, PriorityBlockingQueueLong concurrentHashMap;int s;Res res;public handler(ConcurrentHashMapString, PriorityBlockingQueueLong concurrentHashMap,CountDownLatch countDownLatch,int s,Res res) {this.ss;this.resres;this.countDownLatchcountDownLatch;this.concurrentHashMap concurrentHashMap;}Overridepublic void run() {try {for(String c:concurrentHashMap.keySet() ){int curc.charAt(1)-A;if(curscurs5){PriorityBlockingQueueLong priorityQueueconcurrentHashMap.get(c);while (priorityQueue.size()0){long c1priorityQueue.take(),c2priorityQueue.take();res.add((c2-c1)/1000);}}}} catch (Exception e) {e.printStackTrace();}countDownLatch.countDown();} } public class ReadFileThread implements Runnable {private ConcurrentHashMapString, PriorityBlockingQueueLong concurrentHashMap;private String fileName;CountDownLatch countDownLatch;SimpleDateFormat sdf new SimpleDateFormat(yyyy-MM-dd HH:mm:ss);public ReadFileThread(ConcurrentHashMapString, PriorityBlockingQueueLong concurrentHashMap, String filename, CountDownLatch countDownLatch) {this.concurrentHashMap concurrentHashMap;this.fileName filename;this.countDownLatchcountDownLatch;}Overridepublic void run() {try { // 防止文件建立或读取失败用catch捕捉错误并打印也可以throw/* 读入TXT文件 */File filename new File(fileName); // 要读取以上路径的input。txt文件InputStreamReader reader new InputStreamReader(new FileInputStream(filename),UTF-8); // 建立一个输入流对象readerBufferedReader br new BufferedReader(reader); // 建立一个对象它把文件内容转成计算机能读懂的语言String line ;line br.readLine();while (line ! null) {String[] templine.split(,);if(!concurrentHashMap.containsKey(temp[2]))concurrentHashMap.put(temp[2],new PriorityBlockingQueue());synchronized (this){long cursdf.parse(temp[0]).getTime(); concurrentHashMap.get(temp[2]).add(cur);}line br.readLine();}} catch (Exception e) {e.printStackTrace();}countDownLatch.countDown();} } public class Res {private long tar 0;private int used0;public long getTar() {return tar;}public int getUsed() {return used;}public synchronized void add(long c){tarc;used;} }
http://www.pierceye.com/news/528373/

相关文章:

  • 网站建设方案应急处置wordpress我爱水煮鱼
  • 网页设计模板html代码班级主题广东seo推广
  • 西安 网站托管西安网站关键词排名
  • 做网站用discuz还是wp汉狮做网站公司郑州
  • 网站运营服务中心建设方案网页免费制作网站
  • 做网站销售有前景怎么注销网站
  • 福州建设网站设计电子商务网站平台有哪些
  • 扁平化色块风格的网站企业网站建设客户需求调查问卷
  • 网站建设产品服务痘痘如何去除效果好
  • 展会电子商务网站如何建设单页网站如何做
  • 济南软件外包邢台seo服务公司
  • 网站建设2017主流代码语言垂直型电商网站如何做
  • 重庆 网站定制推广产品怎么发朋友圈
  • 网站建设公司初心经典企业网站欣赏
  • 本地网站开发公司网站建设 产品拍照
  • 军队营房基础建设网站wordpress 标签云集
  • 苏州建设建设信息网站如何给自己的店做小程序
  • 沈阳微营销网站制作厨师培训机构 厨师短期培训班
  • 个人备案用作资讯网站网站开发yuanmus
  • 大连网站建设 选领超科技网站建设实录音乐
  • 上海网站建设流wordpress关闭会员
  • 网站运营的目的及意义pc网站怎么适配移动端
  • 网站深圳优化建设10月上海娱乐场所又要关门了
  • 怎么做网页文件打开别的网站河南省城乡和住房建设厅
  • 泰州公司做网站成都网页设计培训中心
  • 网站业务需求文档网站正在建设中 动态
  • 一级a做爰电影片免费网站姑苏区住房建设局网站
  • 宁夏建设教育协会网站医院网站跳出率高
  • 网站建设佰首选金手指二关于网站建设的职位
  • 网站建设公司商务网站项目书中堂东莞网站建设