当前位置: 首页 > 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.zqtcl.cn/news/528373/

相关文章:

  • 网站首页是什么产品网络推广方案
  • 网站首页制作方案南通市规划建设局网站
  • 网站建设费用兴田德润团队西宁网站策划公司
  • 手机价格网站建设用别人备案域名做违法网站
  • 成都武侯区建设厅官方网站石家庄住房和城乡建设部网站
  • 前端做网站的步骤酉阳网站建设
  • 湖北省住房与建设厅网站php做网站访问记录
  • 做网站的公司没有技术吉林北京网站建设
  • 产品设计培训机构哪家好贵州整站优化seo平台
  • 天津网站制作推广wordpress 果酱
  • 写给初学网站开发们的一封信企业网站建设 ppt
  • 做装修网站多少钱做网站百度一下
  • 用asp做网站的可行性分析9免费建网站
  • 网站域名注册商查询徐州集团网站建设报价
  • 句容网站设计公司做网站充值犯法吗
  • 网站建设所用系统网站备案目的
  • 苏州做网站优化公司哪家好网站的大小
  • 四川省住房和城乡建设厅官方网站网站建设图标图片
  • 做影视网站侵权吗评论凡科网站建设怎么样
  • 建设个人网站流程建设游戏网站需要哪些设备
  • 四字母net做网站怎么样河南做网站优化
  • 怎样做网站快照网站当前位置怎么做
  • 网站模板移植现在c 做网站用什么框架
  • 国内专业的室内设计网站盐城网站开发代理商
  • 外贸网站建设 评价wordpress 函数调用
  • 广告支持模式的网站二级域名做网站域名
  • 空间 两个网站购物网站建设图标大全
  • 17.zwd一起做网站广州网站制作费用
  • 如何选择网站建设公司网站开发公司vue框架
  • 网站建设设计外包公司360个人网站建设