Examples of Search


Examples of com.sissi.protocol.iq.search.Search

    this.searchContext = searchContext;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    Search search = protocol.cast(Search.class);
    BeanFields fields = this.searchContext.search(search, new BeanFields(false), BeanFields.class);
    context.write(search.clear().add(fields).parent().reply().setType(ProtocolType.RESULT));
    return true;
  }
View Full Code Here

Examples of com.sissi.protocol.iq.search.Search

    this.data = new XData().setType(XDataType.RESULT.toString()).add(new XField().setType(XFieldType.HIDDEN.toString()).setVar(XDataType.FORM_TYPE.toString()).add(new XValue(Search.XMLNS))).add(Field.class.cast(new XReported().add(reports)));
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    Search search = protocol.cast(Search.class);
    context.write(search.clear().x(this.searchContext.search(search.getX(), this.data.clone(), XData.class)).parent().reply().setType(ProtocolType.RESULT));
    return true;
  }
View Full Code Here

Examples of com.stratio.cassandra.index.query.Search

     * @return The {@link Search} represented by this builder.
     */
    @Override
    public Search build()
    {
        return new Search(queryCondition, filterCondition, sorting);
    }
View Full Code Here

Examples of cs.min2phase.Search

        if ((testValue & 0x08) != 0) {
            System.out.println(String.format("Initialization Time: %d ms\r", System.nanoTime() - tm));
        }


        Search search = new Search();
        String sol;
        if ((testValue & 0x10) != 0) {
            System.out.println("========== Selected Scramble Solving Test (Optimal Solver) ==========");
            System.out.print("IdCube Test: \"");
            String scr = Tools.fromScramble(new int[0]);
            System.out.print(search.solution(scr, 21, 100000, 0, Search.OPTIMAL_SOLUTION));
            System.out.println("\"");

            int n_test = 0;
            long curTime;
            for (int length = 1; length < 5; length++) {
                System.out.print(String.format("%d-Move: ", length));
                curTime = System.nanoTime();
                n_test = testOptimal(length, 0, new int[length], -1, search, Search.OPTIMAL_SOLUTION);
                System.out.println(String.format("OK, All %d Cube(s) Solved Optimally. AvgTime: %1.3f ms.", n_test, (System.nanoTime() - curTime) / 1000000d / n_test));
            }

            for (int length = 5; length < 15; length++) {
                System.out.print(String.format("%d-Move: ", length));
                Random gen = new Random(42L);
                curTime = System.nanoTime();
                n_test = 0;
                while (System.nanoTime() - curTime < 1e9) {
                    testRandomOptimal(length, search, gen, Search.OPTIMAL_SOLUTION);
                    ++n_test;
                }
                System.out.println(String.format("OK, %d Cube(s) Solved Optimally. AvgTime: %1.3f ms.", n_test, (System.nanoTime() - curTime) / 1000000d / n_test));
            }

            System.out.println("========== Selected Scramble Solving Test (Two-phase Solver) ==========");
            System.out.print("IdCube Test: \"");
            scr = Tools.fromScramble(new int[0]);
            System.out.print(search.solution(scr, 21, 100000, 0, Search.OPTIMAL_SOLUTION));
            System.out.println("\"");

            for (int length = 1; length < 5; length++) {
                System.out.print(String.format("%d-Move: ", length));
                curTime = System.nanoTime();
                n_test = testOptimal(length, 0, new int[length], -1, search, 0);
                System.out.println(String.format("OK, All %d Cube(s) Solved Optimally. AvgTime: %1.3f ms.", n_test, (System.nanoTime() - curTime) / 1000000d / n_test));
            }

            for (int length = 5; length < 15; length++) {
                System.out.print(String.format("%d-Move: ", length));
                Random gen = new Random(42L);
                curTime = System.nanoTime();
                n_test = 0;
                while (System.nanoTime() - curTime < 1e9) {
                    testRandomOptimal(length, search, gen, 0);
                    ++n_test;
                }
                System.out.println(String.format("OK, %d Cube(s) Solved Optimally. AvgTime: %1.3f ms.", n_test, (System.nanoTime() - curTime) / 1000000d / n_test));
            }

            System.out.print("SuperFlip: ");
            curTime = System.nanoTime();
            sol = search.solution(Tools.superFlip(), 20, 100000, 0, 0);
            while (sol.length() > 60 || sol.startsWith("Error")) {
                if (sol.startsWith("Error") && !sol.startsWith("Error 8")) {
                    throw new RuntimeException(String.format("Cannot find the optimal solution: %s", sol));
                }
                sol = search.next(100000, 0, 0);
            }
            System.out.println(String.format("OK. Time: %1.3f ms.", (System.nanoTime() - curTime) / 1000000d));
            System.out.print("20-Depth: ");
            String[] depth20 = new String[] {
                "B2 L  B2 R' F' U' B' L  D' F' L  U  L2 B2 L' D2 B2 D2 R2 B2",
                "R  U2 R  D2 R2 B2 L' D' B' F  U  B' R' U2 L' D  R2 F' U2 L2",
                "D2 R2 F2 D2 F2 D2 R' F2 D' L2 R  B  L' F  U  R' B  F2 R2 F'",
                "D' F' U  B2 R2 F  R' U2 B' L  D  F  R  D2 R2 L2 D' R2 F2 D'",
                "U2 R2 F2 D' U  F2 U2 B  U  B' R  U' F  L  B  R' F  L2 D' B ",
                "D  B2 D' B2 R2 D' R2 U  L  R' D  B' D  R  F' D2 R2 U' F' R ",
                "B  D' L' F' L  F  B  U' D2 F' R2 B' U  F2 R' L  U2 R2 F2 B2",
                "U2 L' U2 F2 L' R  D2 L2 B' D2 L  F' R' U' L  U2 F' D' R  B ",
                "F' L  B2 R  U' B' L  U2 D' F  L' R2 U2 D2 B2 R2 D  R2 L2 F2",
                "U2 R2 D2 B  U2 B' F  D' B' R' D  U2 B2 F2 R' D' B  U' F' R2"
            };
            n_test = 10;
            curTime = System.nanoTime();
            for (int i = 0; i < depth20.length; i++) {
                sol = search.solution(Tools.fromScramble(depth20[0]), 20, 100000, 0, 0);
            }
            System.out.println(String.format("OK, Random %d Cube(s) Solved. AvgTime: %1.3f ms.", n_test, (System.nanoTime() - curTime) / 1000000d / n_test));
        }

        if ((testValue & 0x20) != 0) {
            System.out.println("========== Random Scramble Solving Test (Two-phase Solver) ==========");
            System.out.println(String.format("Solve Random %d Cubes:", nSolves));
            System.out.println(
                "MaxLength: " + maxLength + "\n" +
                "ProbeMax: " + probeMax + "\n" +
                "ProbeMin: " + probeMin + "\n" +
                "verbose: " + verbose);
            tm = System.nanoTime();
            int total = 0;
            int x = 0;
            //          System.out.print("Average Solving Time: - nanoSecond(s)\r");
            long minT = 1L << 62;
            long maxT = 0L;
            long totalTime = 0;
            Tools.setRandomSource(new Random(42L));
            int totalLength = 0;
            while (System.nanoTime() - tm < 60000000000L && x < nSolves) {
                long curTime = System.nanoTime();
                String cube = Tools.randomCube();
                String s = search.solution(cube, maxLength, probeMax, probeMin, verbose);
                if (s.length() > 63) {
                    s = search.next(probeMax, 0, verbose);
                }
                curTime = System.nanoTime() - curTime;
                totalTime += curTime;
                maxT = Math.max(maxT, curTime);
                minT = Math.min(minT, curTime);
View Full Code Here

Examples of cu.ftpd.modules.dirlog.actions.Search

            }
        }
    }

    public void registerActions(SiteCommandHandler siteCommandHandler) {
        Action search = new Search(dirlog);
        siteCommandHandler.registerAction("dupe", search);
        siteCommandHandler.registerAction("find", search);
        siteCommandHandler.registerAction("search", search);

        Action siteNew = new SiteNew(dirlog);
View Full Code Here

Examples of de.uni_mannheim.swt.codeconjurer.domain.search.Search

            StringBuilder message = new StringBuilder();
            if (msg.equals("")) {
              if (noServer || noUsername || noPassword) {
                message.append("Please set up preferences first. Go to Eclipse -> Preferences -> Code Conjurer.");
              } else {
                Search search = CodeConjurer.getInstance()
                    .getActiveEditorSearch();
                ActionContributionItem showAdapterAction = (ActionContributionItem) getViewSite()
                    .getActionBars()
                    .getToolBarManager()
                    .find("de.uni_mannheim.swt.codeconjurer.showAdapterAction");

                if (search != null) {
                  Result result = null;
                  int results = 0;
                  switch (search.getKind()) {
                  case Search.STANDARD_SEARCH:
                    showAdapterAction.getAction()
                        .setEnabled(false);
                    result = search.getSearchResult();
                    results = result.getResultItems().length;
                    if (results > 0) {
                      message.append(results
                          + " results found. "
                          + result.getNumberOfSuccessfullyFetchedSources()
                          + " items successfully downloaded. :: Result created "
                          + result.getCreationDate());
                    }
                    break;

                  case Search.TEST_DRIVEN_SEARCH:
                    showAdapterAction.getAction()
                        .setEnabled(true);
                    result = search.getSearchResult();
                    int passes = result
                        .getNumberOfSuccessfulTests();
                    int retrieved = result
                        .getNumberOfSuccessfullyFetchedSources();
                    long time = search.getDuration();
                    String duration;
                    if (time / Math.pow(10, 9) < 120) {
                      duration = String.valueOf(time
                          / Math.pow(10, 9));
                      duration = duration.substring(0,
                          duration.indexOf("."));
                      duration += " s";
                    } else {
                      duration = String
                          .valueOf((time / Math.pow(
                              10, 9)) / 60);
                      duration = duration.substring(0,
                          duration.indexOf(".") + 2);
                      duration += " min";
                    }
                    results = result.getResultItems().length;
                    if (search.getState() == Job.RUNNING) {
                      message.append("Testing in progress");
                      message.append(" :: Time elapsed "
                          + duration);
                    }
                    if (retrieved > 0) {
                      message.append(" :: "
                          + passes
                          + " of "
                          + results
                          + " candidates passed test. "
                          + retrieved
                          + " items successfully downloaded.");
                      if (search.isFinished()) {
                        message.append(" :: Result created "
                            + result.getCreationDate());
                        message.append(" :: Result created in "
                            + duration);
                      }
View Full Code Here

Examples of de.uni_mannheim.swt.codeconjurer.domain.search.Search

        String message = "";
        if (msg.equals("")) {
          if (noServer || noUsername || noPassword) {
            message = "Please setup preferences first. Go to Eclipse -> Preferences -> Code Conjurer.";
          } else {
            Search search = CodeConjurer.getInstance()
                .getActiveSearch();

            if (search != null) {
              Result result = search.getSearchResult();
              int results = result.getResultItems().length;
              if (results > 0) {
                message = (results
                    + " Results Found. "
                    + result.getNumberOfSuccessfullyFetchedSources()
View Full Code Here

Examples of de.uni_mannheim.swt.codeconjurer.domain.search.Search

    display.asyncExec(new Runnable() {
      @Override
      public void run() {
        logger.debug("Refresh " + treeViewer);
        if (treeViewer != null) {
          Search oldInput = (Search) treeViewer.getInput();
          Search newInput = CodeConjurer.getInstance()
              .getActiveSearch();
          Tree tree = treeViewer.getTree();
          if (tree != null && !tree.isDisposed()) {
            TreeItem[] selection = tree.getSelection();
            Object[] expandedElements = treeViewer
View Full Code Here

Examples of de.uni_mannheim.swt.codeconjurer.domain.search.Search

   * org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.
   * Object)
   */
  @Override
  public Object[] getElements(Object inputElement) {
    Search search = (Search) inputElement;
    ResultItem[] results = search.getSearchResult().getResultItems();
    boolean noShowNegatives = false;
    ArrayList<BodyDeclaration> elements = new ArrayList<BodyDeclaration>();
    if (search.getKind() == Search.TEST_DRIVEN_SEARCH) {
      // Remove failed candidates from result view if not requested.
      if (!Activator.getDefault().getPreferenceStore()
          .getBoolean(PreferenceConstants.P_SHOW_NEGATIVES)) {
        noShowNegatives = true;
      }
View Full Code Here

Examples of de.uni_mannheim.swt.codeconjurer.domain.search.Search

        String message = "";
        if (msg.equals("")) {
          if (noServer || noUsername || noPassword) {
            message = "Please setup preferences first. Go to Eclipse -> Preferences -> Code Conjurer.";
          } else {
            Search search = CodeConjurer.getInstance()
                .getActiveSearch();

            if (search != null) {
              Result result = search.getSearchResult();
              int results = result.getResultItems().length;
              if (results > 0) {
                message = (results
                    + " Results Found. "
                    + result.getNumberOfSuccessfullyFetchedSources()
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.