Exemplo n.º 1
0
 public void launch(String[] args) {
   try {
     // make_dir(args[0]);
     // get_file(args[0]);
     // Cloner(args[0], args[1]);
     csvAverage(args[0]);
   } catch (ArrayIndexOutOfBoundsException n) {
     System.out.println("oops looks like you forgot to add an arg");
     n.printStackTrace();
   }
 }
Exemplo n.º 2
0
 public static double cov(Univariate x, Univariate y) {
   double sumxy = 0;
   int i, n = (x.size() >= y.size() ? x.size() : y.size());
   try {
     for (i = 0; i < x.size(); i++)
       sumxy += (x.elementAt(i) - x.mean()) * (y.elementAt(i) - y.mean());
   } catch (ArrayIndexOutOfBoundsException e) {
     logger.info("size of x != size of y");
     e.printStackTrace();
   }
   return (sumxy / (n - 1));
 }
Exemplo n.º 3
0
 public static void main(String[] args) {
   try {
     if (args.length > 1) {
       System.out.println("ERROR: Cannot check more than one directory at a time");
     } else {
       File folder = new File(args[0]);
       if (folder.exists()) {
         File file = new File(args[0]);
         String[] fileNames = file.list();
         for (int i = 0; i < fileNames.length; i++) {
           System.out.println(fileNames[i]);
         }
       } else {
         System.out.println("ERROR: Directory does not exists");
       }
     }
   } catch (ArrayIndexOutOfBoundsException ex) {
     System.out.println("ERROR: No argument presented");
     ex.printStackTrace();
   }
 }