/*
Print procedure detail, such as statement text, frag id and json plan.

@Param proc  Catalog procedure
13547
public static String printUserProcedureDetail(Procedure proc) {
        PureJavaCrc32C crc = new PureJavaCrc32C();
        StringBuilder sb = new StringBuilder();
        sb.append("Procedure:" + proc.getTypeName()).append("\n");
        for (Statement stmt : proc.getStatements()) {
            // compute hash for determinism check
            String sqlText = stmt.getSqltext();
            crc.reset();
            crc.update(sqlText.getBytes(Constants.UTF8ENCODING));
            int hash = (int) crc.getValue();
            sb.append("Statement Hash: ").append(hash);
            sb.append(", Statement SQL: ").append(sqlText);
            for (PlanFragment frag : stmt.getFragments()) {
                byte[] planHash = Encoder.hexDecode(frag.getPlanhash());
                long planId = ActivePlanRepository.getFragmentIdForPlanHash(planHash);
                String stmtText = ActivePlanRepository.getStmtTextForPlanHash(planHash);
                byte[] jsonPlan = ActivePlanRepository.planForFragmentId(planId);
                sb.append("Plan Stmt Text:").append(stmtText);
                sb.append(", Plan Fragment Id:").append(planId);
                sb.append(", Json Plan:").append(new String(jsonPlan));
            }
            sb.append("\n");
        }
        return sb.toString();
    }
186149
public void printCommand(CliCommand command) {
        final PrintContext context = new PrintContext();

        // Print command name : description
        printIdentifiable(context, command);

        // Print each param name : description
        printIdentifiables(context, command.getParams());
    }
1374271
@Override
    public void describe(DDParser.Diagnostics diag) {
        diag.describeIfSet("class-name", className);
        diag.describeIfSet("name", name);
        diag.describeIfSet("actions", actions);

    }
689836
public void printOutDashboard() {
        log.info("---Total Op Calls: {}", invocationsCount.get());
        System.out.println();
        log.info("--- OpClass calls statistics: ---");
        System.out.println(classCounter.asString());
        System.out.println();
        log.info("--- OpClass pairs statistics: ---");
        System.out.println(classPairsCounter.asString());
        System.out.println();
        log.info("--- Individual Op calls statistics: ---");
        System.out.println(opCounter.asString());
        System.out.println();
        log.info("--- Matching Op calls statistics: ---");
        System.out.println(matchingCounter.asString());
        System.out.println();
        log.info("--- Matching detailed Op calls statistics: ---");
        System.out.println(matchingCounterDetailed.asString());
        System.out.println();
        log.info("--- Matching inverts Op calls statistics: ---");
        System.out.println(matchingCounterInverted.asString());
        System.out.println();
        log.info("--- Time for OpClass calls statistics: ---");
        System.out.println(classAggergator.asString());
        System.out.println();
        log.info("--- Time for long Op calls statistics: ---");
        System.out.println(longAggergator.asString());
        System.out.println();
        log.info("--- Time spent for Op calls statistics: ---");
        System.out.println(classAggergator.asPercentageString());
        System.out.println();
        log.info("--- Time spent for long Op calls statistics: ---");
        System.out.println(longAggergator.asPercentageString());
        System.out.println();
        log.info("--- Time spent within methods: ---");
        methodsAggregator.renderTree(true);
        System.out.println();
        log.info("--- Bad strides stack tree: ---");
        System.out.println("Unique entries: " + stridedAggregator.getUniqueBranchesNumber());
        stridedAggregator.renderTree();
        System.out.println();
        log.info("--- non-EWS access stack tree: ---");
        System.out.println("Unique entries: " + nonEwsAggregator.getUniqueBranchesNumber());
        nonEwsAggregator.renderTree();
        System.out.println();
        log.info("--- Mixed orders access stack tree: ---");
        System.out.println("Unique entries: " + mixedOrderAggregator.getUniqueBranchesNumber());
        mixedOrderAggregator.renderTree();
        System.out.println();
        log.info("--- TAD bad strides stack tree: ---");
        System.out.println("Unique entries: " + tadStridedAggregator.getUniqueBranchesNumber());
        tadStridedAggregator.renderTree();
        System.out.println();
        log.info("--- TAD non-EWS access stack tree: ---");
        System.out.println("Unique entries: " + tadNonEwsAggregator.getUniqueBranchesNumber());
        tadNonEwsAggregator.renderTree();
        System.out.println();
        log.info("--- Scalar access stack tree: ---");
        System.out.println("Unique entries: " + scalarAggregator.getUniqueBranchesNumber());
        scalarAggregator.renderTree(false);
        System.out.println();
        log.info("--- Blas GEMM odrders count: ---");
        System.out.println(blasOrderCounter.asString());
        System.out.println();
        log.info("--- BLAS access stack trace: ---");
        System.out.println("Unique entries: " + blasAggregator.getUniqueBranchesNumber());
        blasAggregator.renderTree(false);
        System.out.println();

    }
91725
public function printApplicationDetails()
    {
        $this->output->writeln($this->console->getName());

        if (!is_null($this->console->getVersion())) {
            $this->output->writeln('version '.$this->console->getVersion());
        }

        // New line padding
        $this->output->writeln('');
    }
962747
function printReports(filePath, results) {

  let errorCount = 0;
  let warningCount = 0;

  const table = createTable();

  Object.entries(results).forEach(function([ name, reports ]) {

    reports.forEach(function(report) {

      const {
        category,
        id,
        message,
        name: reportName
      } = report;

      table.push(tableEntry({
        category,
        id,
        message,
        name: reportName || name
      }));

      if (category === 'error') {
        errorCount++;
      } else {
        warningCount++;
      }
    });
  });

  const problemCount = warningCount + errorCount;

  if (problemCount) {
    console.log();
    console.log(underline(path.resolve(filePath)));
    console.log(table.toString());
  }

  return {
    errorCount,
    warningCount
  };
}
500580
public void printStackTrace() {
        if (detail == null) {
            super.printStackTrace();
        } else {
            synchronized(System.err) {
                System.err.println(super.getMessage() + "; nested exception is:");
                detail.printStackTrace();
            }
        }
    }
370319
def do_print(self,args):
        """"""
        parser = CommandArgumentParser("print")
        parser.add_argument('-r','--refresh',dest='refresh',action='store_true',help='refresh view of the current stack')
        parser.add_argument('-i','--include',dest='include',default=None,nargs='+',help='resource types to include')
        parser.add_argument(dest='filters',nargs='*',default=["*"],help='Filter stacks');
        args = vars(parser.parse_args(args))

        if args['refresh']:
            self.do_refresh('')

        self.printStack(self.wrappedStack,args['include'],args['filters'])
175872
function(psRec,sProcId){
            if(!sProcId){throw new Error("No Proc Id found in data");}
            var iFind,sArgs
            iFind=psRec.CommandLine.indexOf(psRec.Name);
            sArgs = psRec.CommandLine.substring(iFind+psRec.Name.length+1);
            psRecs[sProcId]={
                pid: psRec.ProcessId
               ,ppid: psRec.ParentProcessId
               ,commandPath: psRec.ExecutablePath
               ,command: psRec.Name
               ,args: sArgs
            }
        }
1067359
function o_procset( $id, $action, $options = '' )
    {
        if ( $action != 'new' )
        {
            $o =& $this->objects[$id];
        }
        switch ( $action )
        {
        case 'new':
            $this->objects[$id] = array( 't' => 'procset',
                                         'info' => array( 'PDF' => 1, 'Text' => 1 ) );
            $this->o_pages( $this->currentNode, 'procset', $id );
            $this->procsetObjectId = $id;
            break;
        case 'add':
            // this is to add new items to the procset list, despite the fact that this is considered
            // obselete, the items are required for printing to some postscript printers
            switch ( $options )
            {
            case 'ImageB':
            case 'ImageC':
            case 'ImageI':
                $o['info'][$options] = 1;
                break;
            }
            break;
        case 'out':
            $res = "\n" . $id . " 0 obj\n[";
            foreach ( $o['info'] as $label => $val )
            {
                $res .= '/'.$label.' ';
            }
            $res .= "]\nendobj";
            return $res;
            break;
        }
    }
681119
void printSummary() {
        System.out.printf("There are %d agents outstanding and %d phones. %d entries waiting to go.\n",
                agentsAvailable.size(), phoneNumbersAvailable.size(), delayedEvents.size());
    }
1063758
public static boolean isDurableProc(String procName) {
        SystemProcedureCatalog.Config sysProc = SystemProcedureCatalog.listing.get(procName);
        return sysProc == null || sysProc.isDurable();
    }
202500
@SuppressWarnings("static-method")
	protected void printSynopsis(HelpAppender out, String name, String argumentSynopsis) {
		out.printSectionName(SYNOPSIS);

		assert name != null;

		if (Strings.isNullOrEmpty(argumentSynopsis)) {
			out.printText(name, OPTION_SYNOPSIS);
		} else {
			out.printText(name, OPTION_SYNOPSIS, argumentSynopsis);
		}
	}
505789
@Override
  public void printProbsDocument(List<IN> document) {

    Pair<int[][][], int[]> p = documentToDataAndLabels(document);
    int[][][] data = p.first();

    // FactorTable[] factorTables =
    // CRFLogConditionalObjectiveFunction.getCalibratedCliqueTree(weights, data,
    // labelIndices, classIndex.size());
    CRFCliqueTree cliqueTree = CRFCliqueTree.getCalibratedCliqueTree(weights, data, labelIndices, classIndex.size(),
        classIndex, flags.backgroundSymbol);

    // for (int i = 0; i < factorTables.length; i++) {
    for (int i = 0; i < cliqueTree.length(); i++) {
      IN wi = document.get(i);
      System.out.print(wi.get(CoreAnnotations.TextAnnotation.class) + '\t');
      for (Iterator<String> iter = classIndex.iterator(); iter.hasNext();) {
        String label = iter.next();
        int index = classIndex.indexOf(label);
        // double prob = Math.pow(Math.E, factorTables[i].logProbEnd(index));
        double prob = cliqueTree.prob(i, index);
        System.out.print(label + '=' + prob);
        if (iter.hasNext()) {
          System.out.print("\t");
        } else {
          System.out.print("\n");
        }
      }
    }
  }
293381
private String processCatalogName(String dbProvideName, String userName, String catalogName) {
        String result = null;

        if (catalogName != null) {
            result = catalogName.toUpperCase();
        } else {
            if ("Oracle".equals(dbProvideName) == true) {
                // SPRING: Oracle uses catalog name for package name or an empty string if no package
                result = "";
            }
        }

        return result;
    }
345039
public void printHtmlJavaLogo(PrintWriter out, String strTag, String strParams, String strData)
    {
        String strType = m_recDetail.getField(MenusModel.TYPE).toString();
        String strJava = this.getRecordOwner().getProperty(DBParams.JAVA);
        if ((strJava == null) || (strJava.length() == 0))
            strJava = DBConstants.NO;
        if (strJava.toUpperCase().charAt(0) != 'N')
            if ((strType.equalsIgnoreCase(DBParams.RECORD))
                || (strType.equalsIgnoreCase(DBParams.SCREEN))
                    || (strType.equalsIgnoreCase("form")))
            out.print(strData);
    }
1204608
@Override
	public void processItemDocument(ItemDocument itemDocument) {
		this.countItems++;

		// Do some printing for demonstration/debugging.
		// Only print at most 50 items (or it would get too slow).
		if (this.countItems < 10) {
			System.out.println(itemDocument);
		} else if (this.countItems == 10) {
			System.out.println("*** I won't print any further items.\n"
					+ "*** We will never finish if we print all the items.\n"
					+ "*** Maybe remove this debug output altogether.");
		}
	}