print code to console

@param code code in string
@param desc code description
513722
public static void printCode(String code, String desc) {
        System.out.println("--------------------------" + desc + " begin--------------------------");
        System.out.println(code);
        System.out.println("--------------------------" + desc + " end--------------------------");
    }
282936
def _print_code(self, code):
        """"""
        # This needs a rewrite --- it doesn't check for match clashes! So sub11 would be replaced by sub1 before being replaced with sub11!!
        for key in self.variables.keys():
            for arg in self.variables[key]:
                code = code.replace(arg.name, 'self.'+arg.name)
        return code
1190036
public static String desc2name(String desc) {
		StringBuilder sb = new StringBuilder();
		int c = desc.lastIndexOf('[') + 1;
		if (desc.length() == c + 1) {
			switch (desc.charAt(c)) {
			case JVM_VOID: {
				sb.append("void");
				break;
			}
			case JVM_BOOLEAN: {
				sb.append("boolean");
				break;
			}
			case JVM_BYTE: {
				sb.append("byte");
				break;
			}
			case JVM_CHAR: {
				sb.append("char");
				break;
			}
			case JVM_DOUBLE: {
				sb.append("double");
				break;
			}
			case JVM_FLOAT: {
				sb.append("float");
				break;
			}
			case JVM_INT: {
				sb.append("int");
				break;
			}
			case JVM_LONG: {
				sb.append("long");
				break;
			}
			case JVM_SHORT: {
				sb.append("short");
				break;
			}
			default:
				throw new RuntimeException();
			}
		} else {
			sb.append(desc.substring(c + 1, desc.length() - 1)
					.replace('/', '.'));
		}
		while (c-- > 0)
			sb.append("[]");
		return sb.toString();
	}
511585
def print_code(vm, out=sys.stdout, ops_per_line=8, registers=True):
    """"""
    if registers:
        out.write("IP: %d\n" % vm.instruction_pointer)
        out.write("DS: %s\n" % str(vm.stack))
        out.write("RS: %s\n" % str(vm.return_stack))

    def to_str(op):
        if is_embedded_push(op):
            op = get_embedded_push_value(op)

        if isstring(op):
            return '"%s"' % repr(op)[1:-1]
        elif callable(op):
            return vm.lookup(op)
        else:
            return str(op)

    for addr, op in enumerate(vm.code):
        if (addr % ops_per_line) == 0 and (addr==0 or (addr+1) < len(vm.code)):
            if addr > 0:
                out.write("\n")
            out.write("%0*d  " % (max(4, len(str(len(vm.code)))), addr))
        out.write("%s " % to_str(op))
    out.write("\n")
1088163
@Override
    public void visitCode(final Code obj) {
        if (sourceLines == null) {
            return;
        }

        if (isAbstract) {
            return;
        }

        if (Values.STATIC_INITIALIZER.equals(methodName) || Values.CONSTRUCTOR.equals(methodName)) {
            return;
        }

        int methodStart = srcLineAnnotation.getStartLine() - 2;
        int methodLine = methodStart;
        String line;
        while ((methodLine >= 0) && (methodLine < sourceLines.length)) {
            line = sourceLines[methodLine];
            if (line.indexOf(methodName) >= 0) {
                break;
            }
            methodLine--;
        }

        if (methodLine < 0) {
            return;
        }

        for (int i = methodLine; i <= methodStart; i++) {
            if ((i < 0) || (i >= sourceLines.length)) {
                return;
            }
            line = sourceLines[i];
            if (line.indexOf("final") >= 0) {
                return;
            }
        }

        changedParms = new BitSet();
        super.visitCode(obj);

        BugInstance bi = null;
        for (int i = 0; i < firstLocalReg; i++) {
            if (changedParms.get(i)) {
                changedParms.clear(i);
                continue;
            }

            String parmName = getRegisterName(obj, i);
            if (bi == null) {
                bi = new BugInstance(this, BugType.FP_FINAL_PARAMETERS.name(), LOW_PRIORITY).addClass(this).addMethod(this).addSourceLine(this, 0);
                bugReporter.reportBug(bi);
            }
            bi.addString(parmName);
        }
        changedParms = null;
    }
525924
private static void printCodePoint(Appendable out, int c, EscapeMode mode)
        throws IOException
    {
        // JSON only allows uHHHH numeric escapes.
        switch (c) {
            case 0:
                out.append(mode == EscapeMode.JSON ? "\\u0000" : "\\0");
                return;
            case '\t':
                out.append("\\t");
                return;
            case '\n':
                if (mode == EscapeMode.ION_LONG_STRING) {
                    out.append('\n');
                }
                else {
                    out.append("\\n");
                }
                return;
            case '\r':
                out.append("\\r");
                return;
            case '\f':
                out.append("\\f");
                return;
            case '\u0008':
                out.append("\\b");
                return;
            case '\u0007':
                out.append(mode == EscapeMode.JSON ? "\\u0007" : "\\a");
                return;
            case '\u000B':
                out.append(mode == EscapeMode.JSON ? "\\u000b" : "\\v");
                return;
            case '\"':
                if (mode == EscapeMode.JSON || mode == EscapeMode.ION_STRING) {
                    out.append("\\\"");
                    return;
                }
                break; // Treat as normal code point for long string or symbol.
            case '\'':
                if (mode == EscapeMode.ION_SYMBOL ||
                    mode == EscapeMode.ION_LONG_STRING)
                {
                    out.append("\\\'");
                    return;
                }
                break;
            case '\\':
                out.append("\\\\");
                return;
            default:
                break;
        }

        if (c < 32) {
            if (mode == EscapeMode.JSON) {
                printCodePointAsFourHexDigits(out, c);
            }
            else {
                printCodePointAsTwoHexDigits(out, c);
            }
        }
        else if (c < 0x7F) {  // Printable ASCII
            out.append((char)c);
        }
        else if (c <= 0xFF) {
            if (mode == EscapeMode.JSON) {
                printCodePointAsFourHexDigits(out, c);
            }
            else {
                printCodePointAsTwoHexDigits(out, c);
            }
        }
        else if (c <= 0xFFFF) {
            printCodePointAsFourHexDigits(out, c);
        }
        else {
            if (mode == EscapeMode.JSON) {
                // JSON does not have a \Uxxxxyyyy escape, surrogates
                // must be used as per RFC-4627
                //
                // http://www.ietf.org/rfc/rfc4627.txt
                // [...]
                //   To escape an extended character that is not in the Basic Multilingual
                //   Plane, the character is represented as a twelve-character sequence,
                //   encoding the UTF-16 surrogate pair.  So, for example, a string
                //   containing only the G clef character (U+1D11E) may be represented as
                //   "\uD834\uDD1E".
                // [...]
                printCodePointAsSurrogatePairHexDigits(out, c);
            }
            else {
                printCodePointAsEightHexDigits(out, c);
            }
        }
    }
995305
function warn(str, code) {
  if (process.stdout.writable)
    process.stdout.write(str + '\n');

  if (typeof code != 'undefined')
    process.exit(code);
}
984747
public void writeSetupSCode(String strMethodName, String strMethodReturns, String strMethodInterface, String strClassName)
    {
        Record recFieldData = new FieldData(this);
        try   {
            String strScreenFieldName, strScreenLocation, strScreenFieldDesc, strScreenRow, strScreenCol, strScreenOutNumber, strScreenSetAnchor;
            String strFileName = DBConstants.BLANK;
            String getFile = "getMainRecord()";
            int oldRow = 2, oldCol = 21;

            Record recScreenIn = this.getRecord(ScreenIn.SCREEN_IN_FILE);
            SubFileFilter newBehavior = new SubFileFilter(recScreenIn.getField(ScreenIn.SCREEN_FILE_NAME), FieldData.FIELD_FILE_NAME, recScreenIn.getField(ScreenIn.SCREEN_FIELD_NAME), FieldData.FIELD_NAME, null, null);
            recFieldData.addListener(newBehavior);
            recFieldData.setKeyArea(FieldData.FIELD_NAME_KEY);
        
            recScreenIn.close();
            while (recScreenIn.hasNext())
            {
                recScreenIn.next();
                if (recScreenIn.getField(ScreenIn.SCREEN_FIELD_NAME).getString().length() != 0)
                {
                    strScreenFieldName = recScreenIn.getField(ScreenIn.SCREEN_FIELD_NAME).getString();
                    strScreenLocation = recScreenIn.getField(ScreenIn.SCREEN_LOCATION).getString();
                    strScreenFieldDesc = recScreenIn.getField(ScreenIn.SCREEN_FIELD_DESC).getString();
                    strScreenOutNumber = recScreenIn.getField(ScreenIn.SCREEN_OUT_NUMBER).getString();
                    strScreenSetAnchor = recScreenIn.getField(ScreenIn.SCREEN_ANCHOR).getString();
                    int row = (int)((NumberField)recScreenIn.getField(ScreenIn.SCREEN_ROW)).getValue();
                    int col = (int)((NumberField)recScreenIn.getField(ScreenIn.SCREEN_COL)).getValue();
                    if (strScreenOutNumber.equalsIgnoreCase("1")) if (strScreenLocation.length() == 0)
                    {
                        if (row > 2)
                            ((NumberField)recScreenIn.getField(ScreenIn.SCREEN_ROW)).setValue(row-2, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE);
                    }
                    strScreenRow = recScreenIn.getField(ScreenIn.SCREEN_ROW).getString();
                    strScreenCol = recScreenIn.getField(ScreenIn.SCREEN_COL).getString();
        
                        if (recScreenIn.getField(ScreenIn.SCREEN_FILE_NAME).getLength() != 0)
                        {
                            strFileName = recScreenIn.getField(ScreenIn.SCREEN_FILE_NAME).getString();
                            getFile = "getRecord(" + strFileName + "." + this.convertNameToConstant(strFileName + "File") + ")";
                        }
                        else
                            getFile = "getMainRecord()";
                    // Screen location
                    if (strScreenOutNumber.equalsIgnoreCase("1"))
                        if (strScreenLocation.length() == 0)
                            if (row == oldRow+1) if (col == oldCol)
                                strScreenLocation = "NEXT_LOGICAL";   // Next Logical
        
                    if (strScreenLocation.length() == 0)
                        strScreenLocation = "NEXT_LOGICAL";         // Use this R/C
                    if (strScreenLocation.length() == 1)
                    {
                        switch (strScreenLocation.charAt(0))
                        {
                            case 'U':
                                strScreenLocation = "USE_ROW_COL";break;
                            case 'R':
                                strScreenLocation = "RIGHT_OF_LAST";break;
                            case 'T':
                                strScreenLocation = "TOP_NEXT";break;
                            case 'B':
                                strScreenLocation = "BELOW_LAST";break;
                            case 'A':
                                strScreenLocation = "AT_ANCHOR";break;
                            case 'L':
                                strScreenLocation = "USE_THIS_LOCATION";break;
                            case 'D':
                            case 'N':
                            default:
                                strScreenLocation = "NEXT_LOGICAL";break;
                        }
                    }
                    if (strScreenLocation.equalsIgnoreCase("USE_ROW_COL"))
                        strScreenLocation = "this.getNextLocation(" + strScreenCol + ", " + strScreenRow;
                    else
                        strScreenLocation = "this.getNextLocation(ScreenConstants." + strScreenLocation;
// Set anchor?
                    if (strScreenSetAnchor.equalsIgnoreCase("N"))
                        strScreenSetAnchor = "DONT_SET_ANCHOR";
                    else if (strScreenSetAnchor.equalsIgnoreCase("Y"))
                        strScreenSetAnchor = "SET_ANCHOR";
                    else if (strScreenSetAnchor.length() == 0)
                        strScreenSetAnchor = "ANCHOR_DEFAULT";
                    strScreenLocation += ", ScreenConstants." + strScreenSetAnchor + ")";
// Display the field desc?
                    if (strScreenFieldDesc.equalsIgnoreCase("Y"))
                        strScreenFieldDesc = "DISPLAY_FIELD_DESC";
                    else if (strScreenFieldDesc.equalsIgnoreCase("N"))
                        strScreenFieldDesc = "DONT_DISPLAY_FIELD_DESC";
                    else if (strScreenFieldDesc.length() == 0)
                        strScreenFieldDesc = "DEFAULT_DISPLAY";
                    strScreenFieldDesc = "ScreenConstants." + strScreenFieldDesc;
// View Control type
                    String controlType = recScreenIn.getField(ScreenIn.SCREEN_CONTROL_TYPE).getString();
                    String strDisabledEnding = DBConstants.BLANK;
                    if ("disabled".equals(controlType))
                    {
                        controlType = DBConstants.BLANK;
                        strDisabledEnding = ".setEnabled(false)";
                    }
                    String fieldString = "this." + getFile + ".getField(" + strFileName + "." + this.convertNameToConstant(strScreenFieldName) + ")";
                    if (controlType.length() == 1)
                    {
                        switch (controlType.charAt(0))
                        {
                        case 'S': // Static
                            controlType = "SStaticText";break;
                        case 'T':
                            controlType = "STEView";break;
                        case 'N':
                            controlType = "SNumberText";break;
                        case 'C':
                            controlType = "SCheckBox";break;
                        case 'R':
                            controlType = "SRadioButton";break;
                        case 'B':
                            controlType = "SButtonBox";break;
                        case 'P':
                            controlType = "SPopupBox";break;
                        };
                    }
                    if (controlType.length() == 0)  // Default
                        m_StreamOut.writeit("\t" + fieldString + ".setupDefaultView(" + strScreenLocation + ", this, " + strScreenFieldDesc + ")" + strDisabledEnding + ";\n");
                    else
                    {
                        if (controlType.startsWith("S"))
                            if (Character.isUpperCase(controlType.charAt(1)))
                                controlType = controlType.substring(1);
                        controlType = this.convertNameToConstant(controlType);
                        m_StreamOut.writeit("\tcreateScreenComponent(ScreenModel." + controlType + ", " + strScreenLocation + ", this, fieldString, " + strScreenFieldDesc + ", null)" + strDisabledEnding + ";\n");
                        //m_StreamOut.writeit("\tnew " + controlType + "(" + strScreenLocation + ", this, " + fieldString + ", " + strScreenFieldDesc + ", null)" + strDisabledEnding + ";\n");
                    }
                    oldRow = row;
                    oldCol = col;
                }
                if (recScreenIn.getField(ScreenIn.SCREEN_TEXT).getString().length() != 0)
                {
                    m_StreamOut.setTabs(+1);
                    String tempString = recScreenIn.getField(ScreenIn.SCREEN_TEXT).getString();
                    m_StreamOut.writeit(tempString);
                    if (tempString.charAt(tempString.length() - 1) != '\n')
                        m_StreamOut.writeit("\n");
                    m_StreamOut.setTabs(-1);
                }
            }
            recScreenIn.close();
        
            recFieldData.removeListener(newBehavior, true);  // Remove and free this listener
        } catch (DBException ex)   {
            ex.printStackTrace();
        } finally {
            recFieldData.free();
        }
    }
909102
protected void print(Object s) throws IOException {
        out.write(Convert.escapeUnicode(s.toString()));
    }
629528
final public void print(String s)
  {
    if (s == null)
      write(_nullChars, 0, _nullChars.length);
    else
      write(s, 0, s.length());
  }
1201201
public void printHtmlControlDesc(PrintWriter out, String strFieldDesc, int iHtmlAttributes)
    {
        if ((iHtmlAttributes & HtmlConstants.HTML_ADD_DESC_COLUMN) != 0)
            out.println("<td align=\"right\">" + strFieldDesc + "</td>");
    }
801530
private static void print(Node node, PrintWriter out) {
        if (node == null) {
            return;
        }

        boolean hasChildren = false;
        int type = node.getNodeType();
        NodeList children = null;
        switch (type) {
            case Node.DOCUMENT_NODE:
                children = node.getChildNodes();
                if (children != null) {
                    int numChildren = children.getLength();
                    for (int i = 0; i < numChildren; i++) {
                        print(children.item(i), out);
                    }
                }
                break;
            case Node.ELEMENT_NODE:
                out.print('<');
                out.print(node.getNodeName());
                if (node.hasAttributes()) {
                    NamedNodeMap attrs = node.getAttributes();
                    int len = (attrs != null) ? attrs.getLength() : 0;
                    for (int a = 0; a < len; a++) {
                        Attr attr = (Attr) attrs.item(a);
                        out.print(' ');
                        out.print(attr.getNodeName());
                        out.print("=\"");
                        out.print(attr.getValue());
                        out.print('\"');
                    }
                }
                children = node.getChildNodes();
                if (children != null) {
                    int numChildren = children.getLength();
                    hasChildren = (numChildren > 0);
                    if (hasChildren) {
                        out.print('>');
                    }
                    for (int i = 0; i < numChildren; i++) {
                        print(children.item(i), out);
                    }
                } else {
                    hasChildren = false;
                }
                if (!hasChildren) {
                    out.print("/>");
                }
                break;
            case Node.ENTITY_REFERENCE_NODE:
                out.print('&');
                out.print(node.getNodeName());
                out.print(';');
                break;
            case Node.CDATA_SECTION_NODE:
                out.print("<![CDATA[");
                out.print(node.getNodeValue());
                out.print("]]>");
                break;
            case Node.TEXT_NODE:
                out.print(node.getNodeValue());
                break;
            default:
                if (logger.isDebugEnabled()) {
                    logger.debug("Unknown type: " + type);
                }
        }
        if (type == Node.ELEMENT_NODE && hasChildren) {
            out.print("</");
            out.print(node.getNodeName());
            out.print('>');
            hasChildren = false;
        }
    }
630081
function ( code ) {
		var text = code.firstChild;
		if ( text ) {
			text.data = text.data.substring ( 1 ); // we inserted a #
		}
	}
1044542
function prune(code) {
  var ast = esprima.parse(code);

  estraverse.replace(ast, {
    leave: function leave(node, parent) {
      var ret;

      if ('IfStatement' === node.type) {
        if ('BinaryExpression' !== node.test.type) return;

        if ('self' === node.test.left.argument.name) {
          node.alternate = null;
        } else if ('global' === node.test.left.argument.name) {
          ret = node.alternate;
        }

        return ret;
      }

      if (
          'BlockStatement' === node.type
        && 'FunctionExpression' === parent.type
      ) {
        return node.body[0].alternate.alternate;
      }
    }
  });

  return escodegen.generate(ast, {
    format: {
      indent: { style: '  ' },
      semicolons: false,
      compact: true
    }
  });
}
26726
public static void print(Object... params) {
		String fullText = buildToString(params);
		System.out.println(fullText);
	}
921348
public static void printStringCodePoint(Appendable out, int codePoint)
        throws IOException
    {
        printCodePoint(out, codePoint, EscapeMode.ION_STRING);
    }
1192891
public void print(char ch) throws IOException
  {
    if (_startLine)
      printIndent();

    if (ch == '\r') {
      _destLine++;
    } else if (ch == '\n' && !_lastCr)
      _destLine++;

    _lastCr = ch == '\r';

    _os.print(ch);
  }