/// /// <summary> * Main method for testing this class. </summary> /// public static void Main1(string[] options) { string trainFileString; StringBuilder text = new StringBuilder(); SimilarityAnalysis simi = new SimilarityAnalysis(); Reader reader; try { text.Append("\n\nTime Series Similarity Analysis options:\n\n"); text.Append("-t <training file>\n"); text.Append("\tThe name of the training file.\n"); java.util.Enumeration @enum = simi.listOptions(); while (@enum.hasMoreElements()) { Option option = (Option)@enum.nextElement(); text.Append(option.synopsis() + '\n'); text.Append(option.description() + '\n'); } trainFileString = Utils.getOption('t', options); if (trainFileString.Length == 0) { throw new Exception("No training file given!"); } simi.setOptions(options); reader = new BufferedReader(new FileReader(trainFileString)); simi.analyze(new Instances(reader)); System.Console.WriteLine(simi.ToString()); } catch (java.lang.Exception e) { e.printStackTrace(); System.Console.WriteLine("\n" + e.Message + text); } }
/// <summary> /// Return a list of zip entries (compressed files meta data) /// </summary> /// <param name="zipFile"></param> /// <returns></returns> private static List <ZipEntry> getZippedFiles(ZipFile zipFile) { List <ZipEntry> zipEntries = new List <ZipEntry>(); java.util.Enumeration zipEnum = zipFile.entries(); while (zipEnum.hasMoreElements()) { ZipEntry zip = (ZipEntry)zipEnum.nextElement(); zipEntries.Add(zip); } return(zipEntries); }
public static void DestroyRuntime(ServletContext context, IJDBCDriverDeregisterer evidence) { AppDomain servletDomain = (AppDomain)context.getAttribute(J2EEConsts.APP_DOMAIN); if (servletDomain == null) { return; } try { [email protected](servletDomain); Debug.WriteLine("Destroy of GhHttpServlet"); HttpRuntime.Close(); [email protected](evidence); context.removeAttribute(J2EEConsts.APP_DOMAIN); try { FactoryFinder.releaseFactories(); } catch (FacesException) { } java.lang.ClassLoader appClassLoader = vmw.common.TypeUtils.ToClass(evidence).getClassLoader(); IJDBCDriverDeregisterer dereg = evidence; java.util.Enumeration en = java.sql.DriverManager.getDrivers(); while (en.hasMoreElements()) { Object o = en.nextElement(); if (vmw.common.TypeUtils.ToClass(o).getClassLoader() == appClassLoader) { dereg.DeregisterDriver((java.sql.Driver)o); } } java.lang.Thread.currentThread().setContextClassLoader(null); } catch (Exception e) { Debug.WriteLine(String.Format("ERROR in Servlet Destroy {0},{1}", e.GetType(), e.Message)); Debug.WriteLine(e.StackTrace); } finally { [email protected](); } }