Examples of Detector


Examples of org.exoplatform.services.chars.chardet.Detector

         return;
      }

      //Initialize the nsDetector();
      int lang = (argv.length == 2) ? Integer.parseInt(argv[1]) : PSMDetector.ALL;
      Detector det = new Detector(lang);

      //Set an observer...
      //The Notify() will be called when a matching charset is found.

      det.init(new ICharsetDetectionObserver()
      {
         public void notify(String charset)
         {
            HtmlCharsetDetector.found = true;
            System.out.println("CHARSET = " + charset);
         }
      });

      URL url = new URL(argv[0]);
      BufferedInputStream imp = new BufferedInputStream(url.openStream());

      byte[] buf = new byte[1024];
      int len;
      boolean done = false;
      boolean isAscii = true;

      while ((len = imp.read(buf, 0, buf.length)) != -1)
      {
         //Check if the stream is only ascii.
         if (isAscii)
            isAscii = det.isAscii(buf, len);

         //DoIt if non-ascii and not done yet.
         if (!isAscii && !done)
            done = det.doIt(buf, len, false);
      }
      det.dataEnd();

      if (isAscii)
      {
         System.out.println("CHARSET = ARSII");
         found = true;
      }

      if (!found)
      {
         String prob[] = det.getProbableCharsets();
         for (int i = 0; i < prob.length; i++)
         {
            System.out.println("Probable Charset = " + prob[i]);
         }
      }
View Full Code Here

Examples of org.exoplatform.services.chars.chardet.Detector

      return createDocument(reader.load(file), charset);
   }

   public static String detect(byte[] buf)
   {
      Detector det = new Detector(PSMDetector.ALL);
      charset_ = null;
      det.init(new ICharsetDetectionObserver()
      {
         public void notify(String charset)
         {
            charset_ = charset;
         }
      });

      boolean isAscii = true;
      int len = buf.length;

      isAscii = det.isAscii(buf, len);
      if (!isAscii)
         det.doIt(buf, len, false);
      det.dataEnd();

      if (isAscii)
         charset_ = "ASCII";
      return charset_;
   }
View Full Code Here

Examples of org.jboss.remoting.detection.Detector

         ObjectName obj = new ObjectName("jboss.remoting:type=Connector,transport=" + locator.getProtocol());
         server.registerMBean(connector, obj);
         //connector.create();
         connector.start();

         Detector detector = null;
         ObjectName objName = null;

         if(type.equals(TYPE_MULTICAST))
         {
            MulticastDetector mdet = new MulticastDetector();
            mdet.setPort(port);
            detector = mdet;
            objName = new ObjectName("remoting:type=Detector,transport=multicast");
         }
         else if(type.equals(TYPE_JNDI))
         {
            JNDIDetector jdet = new JNDIDetector();
            jdet.setPort(port);
            jdet.setHost(host);
            jdet.setContextFactory(contextFactory);
            jdet.setURLPackage(urlPackage);
            detector = jdet;
            objName = new ObjectName("remoting:type=Detector,transport=jndi");
         }

         server.registerMBean(detector, objName);
         detector.start();
         System.err.println("Starting Detector");

         while(true)
         {
            Thread.currentThread().sleep(3000);
View Full Code Here

Examples of org.jboss.remoting.detection.Detector

         ObjectName obj = new ObjectName("jboss.remoting:type=Connector,transport=" + locator.getProtocol());
         SecurityUtility.registerMBean(server, connector, obj);
         //connector.create();
         connector.start();

         Detector detector = null;
         ObjectName objName = null;

         if(type.equals(TYPE_MULTICAST))
         {
            MulticastDetector mdet = new MulticastDetector();
            mdet.setPort(port);
            detector = mdet;
            objName = new ObjectName("remoting:type=Detector,transport=multicast");
         }
         else if(type.equals(TYPE_JNDI))
         {
            JNDIDetector jdet = new JNDIDetector();
            jdet.setPort(port);
            jdet.setHost(host);
            jdet.setContextFactory(contextFactory);
            jdet.setURLPackage(urlPackage);
            detector = jdet;
            objName = new ObjectName("remoting:type=Detector,transport=jndi");
         }
        
         SecurityUtility.registerMBean(server, detector, objName);
         detector.start();
         System.err.println("Starting Detector");

         while(true)
         {
            Thread.currentThread().sleep(3000);
View Full Code Here

Examples of org.jboss.remoting.detection.Detector

         ObjectName obj = new ObjectName("jboss.remoting:type=Connector,transport=" + locator.getProtocol());
         server.registerMBean(connector, obj);
         //connector.create();
         connector.start();

         Detector detector = null;
         ObjectName objName = null;

         if(type.equals(TYPE_MULTICAST))
         {
            MulticastDetector mdet = new MulticastDetector();
            mdet.setPort(port);
            detector = mdet;
            objName = new ObjectName("remoting:type=Detector,transport=multicast");
         }
         else if(type.equals(TYPE_JNDI))
         {
            JNDIDetector jdet = new JNDIDetector();
            jdet.setPort(port);
            jdet.setHost(host);
            jdet.setContextFactory(contextFactory);
            jdet.setURLPackage(urlPackage);
            detector = jdet;
            objName = new ObjectName("remoting:type=Detector,transport=jndi");
         }

         server.registerMBean(detector, objName);
         detector.start();
         System.err.println("Starting Detector");

         while(true)
         {
            Thread.currentThread().sleep(3000);
View Full Code Here

Examples of org.openpixi.pixi.physics.collision.detectors.Detector

  }

  public void collisionChange(int i) {
    switch(i) {
    case 0:
      s.detector = new Detector();
      s.collisionalgorithm = new CollisionAlgorithm();
      break;
    case 1:
      s.detector = new AllParticles(s.particles);
      break;
View Full Code Here

Examples of pymontecarlo.program._analytical.options.detector.Detector

        Map<String, Detector> detectors = new HashMap<String, Detector>();

        DetectorExtractor extractor;
        String key;
        Detector detector;
        for (Element detectorElement : detectorsRoot.getChildren()) {
            key = detectorElement.getAttributeValue("_key");

            extractor =
                    (DetectorExtractor) ExtractorManager
View Full Code Here

Examples of pymontecarlo.program._analytical.options.detector.Detector

        HDF5Group resultsGroup =
                rootGroup.createSubgroup("result-" + identifier);

        // Save results from detectors
        String key;
        Detector detector;
        for (Entry<String, Detector> entry : detectors.entrySet()) {
            key = entry.getKey();
            detector = entry.getValue();
            detector.saveResults(resultsGroup, key);
        }

        // Save overall log
        Properties logProps = new Properties();
        logProps.putAll(props.getPropertyMap());
View Full Code Here

Examples of pymontecarlo.program.nistmonte.options.detector.Detector

        HDF5Group resultsGroup =
                rootGroup.createSubgroup("result-" + identifier);

        // Save results from detectors
        String key;
        Detector detector;
        for (Entry<String, Detector> entry : detectors.entrySet()) {
            key = entry.getKey();
            detector = entry.getValue();

            detector.saveResults(resultsGroup, key);
        }

        // Save overall log
        Properties props = new Properties();
        createLog(props, mcss);
View Full Code Here

Examples of pymontecarlo.program.nistmonte.options.detector.Detector

        Map<String, Detector> detectors = new HashMap<String, Detector>();

        DetectorExtractor extractor;
        String key;
        Detector detector;
        for (Element detectorElement : detectorsRoot.getChildren()) {
            key = detectorElement.getAttributeValue("_key");

            extractor =
                    (DetectorExtractor) ExtractorManager
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.