zoukankan      html  css  js  c++  java
  • Redis

    public class Redis {

    public static List<String> list = new ArrayList<String>();
    public static Jedis jedis;

    public static void main(String[] args) throws IOException {

    Getlist();
    jedis = new Jedis("localhost");
    String md5;
    jedis.flushDB();
    File file = new File("E:/work/Parser/Trial/out/check2.txt");
    BufferedWriter bw = new BufferedWriter(new FileWriter(file));
    for (String value : list) {
    md5 = MD5.digest(value);
    if (!jedis.exists(md5)) {
    jedis.set(md5, value);
    bw.write(md5 + " " + value);
    bw.newLine();
    }
    }
    bw.close();
    System.out.print("finish!");
    }

    private static void Getlist() throws IOException {
    String line;
    File file = new File("E:/work/Parser/Trial/out/dir.list");
    BufferedReader br = new BufferedReader(new FileReader(file));
    while ((line = br.readLine()) != null) {
    list.add(line);
    }
    br.close();
    }
    }

  • 相关阅读:
    BZOJ3156 防御准备
    BZOJ1911 [APIO2010] 特别行动队
    BZOJ1096 [ZJOI2007] 仓库建设
    HDU
    斜率优化的各种板子
    HDU
    HDU
    HDU
    HDU
    HDU
  • 原文地址:https://www.cnblogs.com/agileblog/p/3610562.html
Copyright © 2011-2022 走看看