package com.fos.demo.exapmles;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;

public class DataExample {

    public static void main(String[] args) {
        // TODO Auto-generated method stub

        String a = null;
        System.out.println(StringUtils.isBlank(a));
        System.exit(0);
        Calendar calendar = Calendar.getInstance();
        Map<String, Integer> counters = new HashMap<>();
        counters.put("2015-08-04", 7);
        counters.put("2015-08-05", 322);
        counters.put("2015-08-06", 545);
        counters.put("2015-08-07", 427);
        counters.put("2015-08-08", 474);
        counters.put("2015-08-09", 124);
        counters.put("2015-08-28", 164);
        counters.put("2015-08-29", 326);
        counters.put("2015-08-30", 285);
        counters.put("2015-08-31", 362);
        counters.put("2015-09-01", 342);
        counters.put("2015-09-02", 337);
        counters.put("2015-09-03", 284);
        counters.put("2015-09-04", 370);
        counters.put("2015-09-05", 515);
        counters.put("2015-09-06", 861);
        counters.put("2015-09-07", 1426);
        counters.put("2015-09-08", 762);
        counters.put("2015-09-09", 397);
        counters.put("2015-09-10", 287);
        counters.put("2015-09-11", 186);
        counters.put("2015-09-12", 78);
        counters.put("2015-09-13", 246);
        counters.put("2015-09-14", 262);
        counters.put("2015-09-15", 304);
        counters.put("2015-09-16", 353);
        counters.put("2015-09-17", 156);
        counters.put("2016-01-07", 189);
        counters.put("2016-01-08", 212);

        calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH)-160);
        for (int i = 0; i < 163; i++) {
            
            calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH)+1);
            String d = (new SimpleDateFormat("yyyy-MM-dd")).format(calendar.getTime());
            if(counters.get(d) == null){
                int bif = getRandom(160, 900);
                System.out.println(d+"\t"+bif);
            } else {
                
                System.out.println(d+"\t"+counters.get(d));
            }
        }
    }
    
    public static int getRandom(int min, int max) {
        
        int randomNumber = (int)(Math.random()*(max-min+3)+min);
        while (randomNumber == min || randomNumber == max+2) {
            randomNumber = (int)(Math.random()*(max-min+3)+min);
        }
        return randomNumber-1;
    }

}
