code: public String addBinary(String num1, String num2) {\n        boolean carry = false;\n        int size1 = num1.length() - 1;\n        int size2 = num2.length() - 1;\n        String sum = \"\";\n        \n        if (size2 > size1) {\n            String s = num1;\n            num1 = num2;\n            num2 = s;\n            int n = size1;\n            size1 = size2;\n            size2 = n;\n        }\n        \n        for (; size2 >= 0 ; size1--, size2--) {\n            if (num1.charAt(size1) == '0' && num2.charAt(size2) == '0') {\n                if (!carry)\n                    sum = \"0\" + sum;\n                else\n                    sum = \"1\" + sum;\n                carry = false;\n            } else if (num1.charAt(size1) == '1' && num2.charAt(size2) == '0') {\n                if (!carry)\n                    sum = \"1\" + sum;\n                else {\n                    sum = \"0\" + sum;\n                    carry = true;\n                }\n            } else if (num1.charAt(size1) == '0' && num2.charAt(size2) == '1') {\n                if (!carry)\n                    sum = \"1\" + sum;\n                else {\n                    sum = \"0\" + sum;\n                    carry = true;\n                }\n            } else if (num1.charAt(size1) == '1' && num2.charAt(size2) == '1') {\n                if (!carry)\n                    sum = \"0\" + sum;\n                else\n                    sum = \"1\" + sum;\n                carry = true;\n            }\n        }\n        \n        for (; size1 >= 0 ; size1--) {\n            if (num1.charAt(size1) == '0') {\n                if (!carry)\n                    sum = \"0\" + sum;\n                else\n                    sum = \"1\" + sum;\n                carry = false;\n            } else if (num1.charAt(size1) == '1') {\n                if (!carry)\n                    sum = \"1\" + sum;\n                else {\n                    sum = \"0\" + sum;\n                    carry = true;\n                }\n            }\n        }\n        \n        if (carry)\n            sum = \"1\" + sum;\n        \n        return sum;\n    }

category: Hard


code: private String getNetmask(String binaryIP){\n        String invertedIPPrefix = \"\";\n        for (int i = 0; i < MAXPREFIX; i++){\n            if (binaryIP.charAt(i) == '0')\n                invertedIPPrefix += \"1\";\n            else\n                invertedIPPrefix += \"0\";\n        }\n        return invertedIPPrefix;\n    }\n

category: Medium


code: private String convert(String binaryIP){\n        String outputIP = \"\";\n        String reassembler = \"\";\n        for (int i = 0; i < binaryIP.length(); i++){\n            reassembler += binaryIP.charAt(i);\n            fullReassembler += binaryIP.charAt(i);\n            if (i == semiCol){\n                if (isIPv4){\n                    outputIP += Integer.parseInt(reassembler, 2);\n                    reassembler = \"\";\n                } else if (isIPv6) {\n                    outputIP += Integer.toHexString(Integer.parseInt(\n                            reassembler, 2));\n                    reassembler = \"\";\n                }\n                \n                if (i != (binaryIP.length() - 1))\n                    outputIP += DELIMITER;\n                semiCol = semiCol + lengthOfToken;\n            }\n        }\n        return outputIP;\n    }\n


code: private double modfloor(double f, double t) {\n\tt = Math.abs(t);\n\t\treturn (Math.floor(f/t)*t);\n\t}\n

f

type: double

category: Easy


code: private double modceil(double f, double t) {\n\tt = Math.abs(t);\n\t\treturn (Math.ceil(f/t)*t);\n\t}\n


code: public static int Normalize(int id) {\n        if((id < 0) || (id >= translations.length) || (translations[id] == null)) {\n            return defaultId;\n        } else {\n            return id;\n        }\n    }\n

id

type: int


code:
    public static String GetTableName(String insertQuery) {
        StringTokenizer st = new StringTokenizer(insertQuery, "( ");
        String dummy = st.nextToken();
        dummy = st.nextToken();
        return st.nextToken();
    }

insertQuery

value: Start \tCreation Time \tIndex \tCreate Time String\tQuery


code: public static String IntMaxString(int value) {\n    \treturn (value == Integer.MAX_VALUE) ? \"\" : \"\" + value;\n    }\n


code: public static String NormalizeString(String str) {\n    \treturn str != null ? str : \"\";\n    }\n


code: public static int StringCompare(String lhs, String rhs) {\n    \treturn NormalizeString(lhs).compareTo(NormalizeString(rhs));\n    }\n


code: public static boolean StringIsEmpty(String str) {\n\t\treturn str == null || str.length() == 0;\n\t}\n


code: public static int StringCompareIgnCase(String lhs, String rhs) {\n    \treturn NormalizeString(lhs).compareToIgnoreCase(NormalizeString(rhs));\n    }\n


code: public static String DoubleMaxString(double value) {\n    \treturn (value == Double.MAX_VALUE) ? "" : "" + value;\n    }\n


code: private static boolean IsEmpty(String str) {\n\t\treturn Util.StringIsEmpty(str);\n\t}\n


code: static public String accountDownloadEnd(String accountName) {\n    \treturn "accountDownloadEnd: " + accountName;\n    }\n


code: public static String getField( int tickType) {\n        switch( tickType) {\n            case BID_SIZE:                    return "bidSize";\n            case BID:                         return "bidPrice";\n            case ASK:                         return "askPrice";\n            case ASK_SIZE:                    return "askSize";\n            case LAST:                        return "lastPrice";\n            case LAST_SIZE:                   return "lastSize";\n            case HIGH:                        return "high";\n            case LOW:                         return "low";\n            case VOLUME:                      return "volume";\n            case CLOSE:                       return "close";\n            case BID_OPTION:                  return "bidOptComp";\n            case ASK_OPTION:                  return "askOptComp";\n            case LAST_OPTION:                 return "lastOptComp";\n            case MODEL_OPTION:                return "modelOptComp";\n            case OPEN:                        return "open";\n            case LOW_13_WEEK:                 return "13WeekLow";\n            case HIGH_13_WEEK:                return "13WeekHigh";\n            case LOW_26_WEEK:                 return "26WeekLow";\n            case HIGH_26_WEEK:                return "26WeekHigh";\n            case LOW_52_WEEK:                 return "52WeekLow";\n            case HIGH_52_WEEK:                return "52WeekHigh";\n            case AVG_VOLUME:                  return "AvgVolume";\n            case OPEN_INTEREST:               return "OpenInterest";\n            case OPTION_HISTORICAL_VOL:       return "OptionHistoricalVolatility";\n            case OPTION_IMPLIED_VOL:          return "OptionImpliedVolatility";\n            case OPTION_BID_EXCH:             return "OptionBidExchStr";\n            case OPTION_ASK_EXCH:             return "OptionAskExchStr";\n            case OPTION_CALL_OPEN_INTEREST:   return "OptionCallOpenInterest";\n            case OPTION_PUT_OPEN_INTEREST:    return "OptionPutOpenInterest";\n            case OPTION_CALL_VOLUME:          return "OptionCallVolume";\n            case OPTION_PUT_VOLUME:           return "OptionPutVolume";\n            case INDEX_FUTURE_PREMIUM:        return "IndexFuturePremium";\n            case BID_EXCH:                    return "bidExch";\n            case ASK_EXCH:                    return "askExch";\n            case AUCTION_VOLUME:              return "auctionVolume";\n            case AUCTION_PRICE:               return "auctionPrice";\n            case AUCTION_IMBALANCE:           return "auctionImbalance";\n            case MARK_PRICE:                  return "markPrice";\n            case BID_EFP_COMPUTATION:         return "bidEFP";\n            case ASK_EFP_COMPUTATION:         return "askEFP";\n            case LAST_EFP_COMPUTATION:        return "lastEFP";\n            case OPEN_EFP_COMPUTATION:        return "openEFP";\n            case HIGH_EFP_COMPUTATION:        return "highEFP";\n            case LOW_EFP_COMPUTATION:         return "lowEFP";\n            case CLOSE_EFP_COMPUTATION:       return "closeEFP";\n            case LAST_TIMESTAMP:              return "lastTimestamp";\n            case SHORTABLE:                   return "shortable";\n            case FUNDAMENTAL_RATIOS:          return "fundamentals";\n            case RT_VOLUME:                   return "RTVolume";\n            case HALTED:                      return "halted";\n            default:                          return "unknown";\n        }\n    }\n


code: static public String tickGeneric(int tickerId, int tickType, double value) {\n    \treturn "id=" + tickerId + "  " + TickType.getField( tickType) + "=" + value;\n    }\n


code: static public String contractDetailsEnd(int reqId) {\n    \treturn "reqId = " + reqId + " =============== end ===============";\n    }\n


code: static public String fundamentalData(int reqId, String data) {\n\t\treturn "id  = " + reqId + " len = " + data.length() + '\n' + data;\n    }\n


code: static public String tickPrice( int tickerId, int field, double price, int canAutoExecute) {\n    \treturn "id=" + tickerId + "  " + TickType.getField( field) + "=" + price + " " + \n        ((canAutoExecute != 0) ? " canAutoExecute" : " noAutoExecute");\n    }\n

unknown

value: id=-2099  unknown=-2099.0 canAutoExecute


code:
    static public String nextValidId( int orderId) {
    	return "Next Valid Order ID: " + orderId;
    }


code:
static public String updateAccountValue(String key, String value, String currency, String accountName) {
    return "updateAccountValue: " + key + " " + value + " " + currency + " " + accountName;
}

value: updateAccountValue: null  com.ib.client.AnyWrapperMsgGenerator


code:
static public String tickString(int tickerId, int tickType, String value) {
    return "id=" + tickerId + "  " + TickType.getField( tickType) + "=" + value;
}


code:
static public String updateNewsBulletin( int msgId, int msgType, String message, String origExchange) {
    return "MsgId=" + msgId + " :: MsgType=" + msgType +  " :: Origin=" + origExchange + " :: Message=" + message;
}

message

value: $mXBj;n"#XC/

value: MsgId=-1496 :: MsgType=0 :: Origin=null :: Message=""$mXBj;n"#XC/"


code:
    static public String bondContractDetails(int reqId, ContractDetails contractDetails) {
        Contract contract = contractDetails.m_summary;
        String msg = "reqId = " + reqId + " ===================================\n"
        + " ---- Bond Contract Details begin ----\n"
        + "symbol = " + contract.m_symbol + "\n"
        + "secType = " + contract.m_secType + "\n"
        + "cusip = " + contractDetails.m_cusip + "\n"
        + "coupon = " + contractDetails.m_coupon + "\n"
        + "maturity = " + contractDetails.m_maturity + "\n"
        + "issueDate = " + contractDetails.m_issueDate + "\n"
        + "ratings = " + contractDetails.m_ratings + "\n"
        + "bondType = " + contractDetails.m_bondType + "\n"
        + "couponType = " + contractDetails.m_couponType + "\n"
        + "convertible = " + contractDetails.m_convertible + "\n"
        + "callable = " + contractDetails.m_callable + "\n"
        + "putable = " + contractDetails.m_putable + "\n"
        + "descAppend = " + contractDetails.m_descAppend + "\n"
        + "exchange = " + contract.m_exchange + "\n"
        + "currency = " + contract.m_currency + "\n"
        + "marketName = " + contractDetails.m_marketName + "\n"
        + "tradingClass = " + contractDetails.m_tradingClass + "\n"
        + "conid = " + contract.m_conId + "\n"
        + "minTick = " + contractDetails.m_minTick + "\n"
        + "orderTypes = " + contractDetails.m_orderTypes + "\n"
        + "validExchanges = " + contractDetails.m_validExchanges + "\n"
        + "nextOptionDate = " + contractDetails.m_nextOptionDate + "\n"
        + "nextOptionType = " + contractDetails.m_nextOptionType + "\n"
        + "nextOptionPartial = " + contractDetails.m_nextOptionPartial + "\n"
        + "notes = " + contractDetails.m_notes + "\n"
        + "longName = " + contractDetails.m_longName + "\n"
        + " ---- Bond Contract Details End ----\n";
        return msg;
    }

msg

value:
"reqId = 0 ===================================
 ---- Bond Contract Details begin ----
symbol = null
secType = null
cusip = null
coupon = 0.0
maturity = null
issueDate = null
ratings = null
bondType = null
couponType = null
convertible = false
callable = false
putable = false
descAppend = null
exchange = null
currency = null
marketName = null
tradingClass = null
conid = 0
minTick = 0.0
orderTypes = Error -
validExchanges =  open=
nextOptionDate = null
nextOptionType = null
nextOptionPartial = false
notes = null
longName = vCSC$xa;[
 ---- Bond Contract Details End ----
"


code:
    static public String scannerParameters(String xml) {
    	return SCANNER_PARAMETERS + "\n" + xml;
    }


code:
    static public String execDetailsEnd(int reqId) {
    	return "reqId = " + reqId + " =============== end ===============";
    }


code:
    static public String execDetails( int reqId, Contract contract, Execution execution) {
        String msg = " ---- Execution Details begin ----\n"
        + "reqId = " + reqId + "\n"
        + "orderId = " + execution.m_orderId + "\n"
        + "clientId = " + execution.m_clientId + "\n"
        + "symbol = " + contract.m_symbol + "\n"
        + "secType = " + contract.m_secType + "\n"
        + "expiry = " + contract.m_expiry + "\n"
        + "strike = " + contract.m_strike + "\n"
        + "right = " + contract.m_right + "\n"
        + "contractExchange = " + contract.m_exchange + "\n"
        + "currency = " + contract.m_currency + "\n"
        + "localSymbol = " + contract.m_localSymbol + "\n"
        + "execId = " + execution.m_execId + "\n"
        + "time = " + execution.m_time + "\n"
        + "acctNumber = " + execution.m_acctNumber + "\n"
        + "executionExchange = " + execution.m_exchange + "\n"
        + "side = " + execution.m_side + "\n"
        + "shares = " + execution.m_shares + "\n"
        + "price = " + execution.m_price + "\n"
        + "permId = " + execution.m_permId + "\n"
        + "liquidation = " + execution.m_liquidation + "\n"
        + "cumQty = " + execution.m_cumQty + "\n"
        + "avgPrice = " + execution.m_avgPrice + "\n"
        + " ---- Execution Details end ----\n";
        return msg;
    }

value:
" ---- Execution Details begin ----
reqId = -2942
orderId = 0
clientId = 0
symbol = null
secType = null
expiry = null
strike = 0.0
right = null
contractExchange = null
currency = null
localSymbol = null
execId = Q~]l-2C+TZJT0@
time = FA: null id=2145310180  unknown=2.14531018E9  canAutoExecute
acctNumber = #54I>t
executionExchange =  ?r.k'ywgbV>e-~
side = null
shares = -1073741824
price = 0.0
permId = -877
liquidation = 13
cumQty = 3
avgPrice = 3614.83
 ---- Execution Details end ----
"


code:
    static public String currentTime(long time) {
		return "current time = " + time +
		" (" + DateFormat.getDateTimeInstance().format(new Date(time * 1000)) + ")";
    }

time

type: long


code:
    static public String contractDetails(int reqId, ContractDetails contractDetails) {
    	Contract contract = contractDetails.m_summary;
    	String msg = "reqId = " + reqId + " ===================================\n"
    		+ " ---- Contract Details begin ----\n"
    		+ contractMsg(contract) + contractDetailsMsg(contractDetails)
    		+ " ---- Contract Details End ----\n";
    	return msg;
    }

msg

value: "reqId = 2039 ===================================\n ---- Contract Details begin ----\nconid = 0\nsymbol = null\nsecType = null\nexpiry = null\nstrike = 0.0\nright = null\nmultiplier = null\nexchange = null\nprimaryExch = null\ncurrency = null\nlocalSymbol = null\nmarketName = null\ntradingClass = null\nminTick = 0.0\nprice magnifier = 0\norderTypes = null\nvalidExchanges = null\nunderConId = 0\nlongName = null\ncontractMonth = null\nindustry = null\ncategory = null\nsubcategory = null\ntimeZoneId = null\ntradingHours = null\nliquidHours = null\n ---- Contract Details End ----\n"


code:
	public static String faMsgTypeName(int faDataType) {
		switch (faDataType) {
		case GROUPS:
			return "GROUPS";
		case PROFILES:
			return "PROFILES";
		case ALIASES:
			return "ALIASES";
		}
		return null;
	}


code:
    static public String receiveFA(int faDataType, String xml) {
    	return FINANCIAL_ADVISOR + " " + EClientSocket.faMsgTypeName(faDataType) + " " + xml;
    }


code:
    static public String updateAccountTime(String timeStamp) {
    	return "updateAccountTime: " + timeStamp;
    }

timeStamp

value: algoStrategy=


code:
    static public String deltaNeutralValidation(int reqId, UnderComp underComp) {
    	return "id = " + reqId
    	+ " underComp.conId =" + underComp.m_conId
    	+ " underComp.delta =" + underComp.m_delta
    	+ " underComp.price =" + underComp.m_price;
    }

unknown

value: id = 0 underComp.conId=null underComp.delta=null underComp.price=null


code:
    static public String managedAccounts( String accountsList) {
    	return "Connected : The list of managed accounts are : [" + accountsList + "]";
    }

value: Connected : The list of managed accounts are : [bW`;?_&A1*p1Nu]


code:
    static public String tickSize( int tickerId, int field, int size) {
    	return "id=" + tickerId + "  " + TickType.getField( field) + "=" + size;
    }


code:
    static public String scannerDataEnd(int reqId) {
    	return "id = " + reqId + " =============== end ===============";
    }


code:
    static public String tickSnapshotEnd(int tickerId) {
    	return "id=" + tickerId + " =============== end ===============";
    }


code:
  private static double distanceInMiles(double lat1, double lat2, double lon1, double lon2){
    double theta = lon1 - lon2;
    double dist = Math.sin(Math.toRadians(lat1)) * Math.sin(Math.toRadians(lat2))
    + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.cos(Math.toRadians(theta));
    dist = Math.acos(dist);
    dist = Math.toDegrees(dist);
    return dist * MAGIC_NUMBER;
  }


code:
  private static double distanceHaversineForumla(double lat1, double lat2, double lon1, double lon2){
    double dLat = Math.toRadians(lat2 - lat1);
    double dLon = Math.toRadians(lon2 - lon1);
    double a = Math.pow(Math.sin(dLat/2d), 2) +
               Math.cos(lat1) * Math.cos(lat2) *
               Math.pow(Math.sin(dLon/2d), 2);
    double c = 2d * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
    return EARTH_RADIUS * c;
  }


code:
	static public boolean isBlank(String value) {
		return (value.equals(""));
	}


code:
    private static double bygreesToRadians(int value) {
        return value * Math.PI / 128;
    }


code:
    private static double radiansToDegrees(double radians) {
        return radians * 180 / Math.PI;
    }


code:
    private static double bygreeToRadians(int bygrees) {
        return (bygrees - 64) * RADIANS_PER_BYGREE;
    }


code:
    private static int radiansToBygrees(double radians) {
        return (int) Math.round(64 + (radians * BYGREES_PER_RADIANS)) & BYGREE_MASK;
    }


code:
  protected String add_escapes(String str) {
      StringBuffer retval = new StringBuffer();
      char ch;
      for (int i = 0; i < str.length(); i++) {
        switch (str.charAt(i))
        {
           case 0 :
              continue;
           case '\b':
              retval.append("\\b");
              continue;
           case '\t':
              retval.append("\\t");
              continue;
           case '\n':
              retval.append("\\n");
              continue;
           case '\f':
              retval.append("\\f");
              continue;
           case '\r':
              retval.append("\\r");
              continue;
           case '\"':
              retval.append("\\\"");
              continue;
           case '\'':
              retval.append("\\\'");
              continue;
           case '\\':
              retval.append("\\\\");
              continue;
           default:
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
                 String s = "0000" + Integer.toString(ch, 16);
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
              } else {
                 retval.append(ch);
              }
              continue;
        }
      }
      return retval.toString();
   }


code:
   protected static final String addEscapes(String str) {
      StringBuffer retval = new StringBuffer();
      char ch;
      for (int i = 0; i < str.length(); i++) {
        switch (str.charAt(i))
        {
           case 0 :
              continue;
           case '\b':
              retval.append("\\b");
              continue;
           case '\t':
              retval.append("\\t");
              continue;
           case '\n':
              retval.append("\\n");
              continue;
           case '\f':
              retval.append("\\f");
              continue;
           case '\r':
              retval.append("\\r");
              continue;
           case '\"':
              retval.append("\\\"");
              continue;
           case '\'':
              retval.append("\\\'");
              continue;
           case '\\':
              retval.append("\\\\");
              continue;
           default:
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
                 String s = "0000" + Integer.toString(ch, 16);
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
              } else {
                 retval.append(ch);
              }
              continue;
        }
      }
      return retval.toString();
   }


code:
   protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
      return("Lexical error at line " +
           errorLine + ", column " +
           errorColumn + ".  Encountered: " +
           (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
           "after : \"" + addEscapes(errorAfter) + "\"");
   }

EOFSeen

type: boolean

value: true

curChar

type: char

value: y

value: Lexical error at line 803, column -3205.  Encountered: <EOF> after : "Li~QH[-K61]>5*jLf"


code:
    public static String analyze(String filename) {

        /**
         * implement placeholder implementations of Parser and Analyzer
         *       Reader rdr = new FileReader (new File (filename));
         *       ASTNode rootNode = new JMCAParser().parse(rdr);
         *       output = new JMCAAnalyzer().analyze(rootNode);
         */
        if (filename != null && !filename.equals("")) {
            Reader rdr = null;
            try {
                rdr = new FileReader(new File(filename));
            } catch (IOException ie) {
                System.err.println(ie.getMessage());
            }
            /**
             * call parser
             */
            // ASTNode rootNode = new DummyParser().parse(rdr);
            ASTNode rootNode = new JMCAParser().parse(rdr);
            if (DEVELOPMENT && rootNode != null)  showTree(rootNode, filename);
            /**
             * call analyzer
             */
            //  Analyzer analyzer = new UILayoutDisplayAnalyzer();
            Analyzer analyzer = new JMCAAnalyzer();
            analyzer.setFileName(filename);
            return analyzer.analyze(rootNode);
        }

        return new String("ERROR: Filename not entered.");

    } //end analyze()


code:
    final private boolean jj_scan_token(int kind) {
        if (jj_scanpos == jj_lastpos) {
            jj_la--;
            if (jj_scanpos.next == null) {
                jj_lastpos = jj_scanpos = jj_scanpos.next =
                        token_source.getNextToken();
            } else {
                jj_lastpos = jj_scanpos = jj_scanpos.next;
            }
        } else {
            jj_scanpos = jj_scanpos.next;
        }
        if (jj_scanpos.kind != kind) {
            return true;
        }
        if (jj_la == 0 && jj_scanpos == jj_lastpos) {
            throw jj_ls;
        }
        return false;
    }


code:
    final private boolean jj_2_20(int xla) {
        jj_la = xla;
        jj_lastpos = jj_scanpos = token;
        try {
            return!jj_3_20();
        } catch (LookaheadSuccess ls) {
            return true;
        }
    }


code:
    public String encodeString(String searchTerm) {
        try {
            searchTerm = URLEncoder.encode(searchTerm, "UTF-8");
        } catch (UnsupportedEncodingException ue) {
            //    log.debug("Encoding Scheme isn't available");
            searchTerm = URLEncoder.encode(searchTerm);
        }
        return searchTerm;
    }


code:
    public String AddtoCart(String ASIN, String quantity) {
        StringBuffer buffer = new StringBuffer();
        buffer.append(serverURL);
        buffer.append("?");
        buffer.append("ShoppingCart=add&f=xml&dev-t=");
        buffer.append(token);
        buffer.append("&t=");
        buffer.append(associatesID);
        buffer.append("&Asin.");
        buffer.append(ASIN);
        buffer.append("=");
        buffer.append(quantity);
        return new String(buffer);
    }

ASIN

value: TzYjM~@_ 'H{U$U$f


code:
    public String SearchQueryGenerator(String searchType, String searchTerm, String mode, String type, String page, String offer) {
//      log.debug("SearchQueryGenerator - in");
        StringBuffer buffer = new StringBuffer();

        searchTerm = jawsUtil.encodeString(searchTerm);

        buffer.append(serverURL);
        buffer.append("?");
        buffer.append("t=");
        buffer.append(associatesID);
        buffer.append("&");
        buffer.append("dev-t=");
        buffer.append(token);
        buffer.append("&");
        buffer.append(searchType);
        buffer.append("=");
        buffer.append(searchTerm);
        buffer.append("&");
        buffer.append("mode=");
        buffer.append(mode);
        buffer.append("&");
        buffer.append("type=");
        buffer.append(type);
        buffer.append("&");
        buffer.append("page=");
        buffer.append(page);
        buffer.append("&");
        buffer.append("offer=");
        buffer.append(offer);
        buffer.append("&");
        buffer.append("f=xml");
//     log.debug("SearchQueryGenerator - out");
        return new String(buffer);
    }

offer

value: all

searchType

value: "UpcSearch"

type

value: "lite"


code:
    public String ModifyCart(String itemId, String quantity, String cartId, String hmac) {
        StringBuffer buffer = new StringBuffer();
        buffer.append(serverURL);
        buffer.append("?");
        buffer.append("ShoppingCart=modify&f=xml&dev-t=");
        buffer.append(token);
        buffer.append("&t=");
        buffer.append(associatesID);
        buffer.append("&Item.");
        buffer.append(itemId);
        buffer.append("=");
        buffer.append(quantity);
        buffer.append("&CartId=");
        buffer.append(cartId);
        buffer.append("&Hmac=");
        buffer.append(jawsUtil.encodeString(hmac));
        return new String(buffer);
        /*
          http://xml.amazon.com/onca/xml3?ShoppingCart=modify
          &f=xml& dev-t=[ [developer's token goes here]
          &t=[associates ID goes here]
          &Item.[itemID goes here]=[quantity goes here]
          &CartId=[cart ID goes here]
          &Hmac=[HMAC goes here]
        */
    }

itemId

value: "Theatre Release Date - "

buffer

value: "http://xml.amazon.net/onca/xml3?ShoppingCart=modify&f=xml&dev-t=DSB0XDDW1GQ3S&t=popcornmonste2-20&Item.Theatre Release Date - =Theatre Release Date - &CartId=*Q.9c_rgmK*&Hmac=M%3B"


code:
    public String GetItemsFromCart(String cartId, String hmac) {
        StringBuffer buffer = new StringBuffer();
        buffer.append(serverURL);
        buffer.append("?");
        buffer.append("ShoppingCart=get&f=xml&dev-t=");
        buffer.append(token);
        buffer.append("&t=");
        buffer.append(associatesID);
        buffer.append("&CartId=");
        buffer.append(cartId);
        buffer.append("&Hmac=");
        buffer.append(jawsUtil.encodeString(hmac));
        return new String(buffer);
        /*
          http://xml.amazon.com/onca/xml3?ShoppingCart=get
          &f=xml& dev-t=[ [developer's token goes here]
          &t=[associates ID goes here]
          &CartId=[cart ID goes here]
          &Hmac=[HMAC goes here]
        */
    }


code:
    public String AddToExistingCart(String ASIN, String quantity, String cartId, String hmac) {
        StringBuffer buffer = new StringBuffer();
        buffer.append(serverURL);
        buffer.append("?");
        buffer.append("ShoppingCart=add&f=xml&dev-t=");
        buffer.append(token);
        buffer.append("&t=");
        buffer.append(associatesID);
        buffer.append("&Asin.");
        buffer.append(ASIN);
        buffer.append("=");
        buffer.append(quantity);
        buffer.append("&CartId=");
        buffer.append(cartId);
        buffer.append("&Hmac=");
        buffer.append(jawsUtil.encodeString(hmac));
        return new String(buffer);
        /*
          http://xml.amazon.com/onca/xml3?ShoppingCart=add&f=xml&
          dev-t=[ [developer's token goes here]
          &t=[associates ID goes here]
          &Asin.[ASIN goes here]=[quantity goes here]
          &CartId=[cart ID goes here] &Hmac=[HMAC goes here]
        */
    }

ASIN

value: "Mode = "

quantity

value: "MPAA Rating - "

value: "http://xml.amazon.net/onca/xml3?ShoppingCart=add&f=xml&dev-t=DSB0XDDW1GQ3S&t=popcornmonste2-20&Asin.Mode = =MPAA Rating - &CartId=null&Hmac=Theatre+Release+Date+-+"


code:
    public String RemoveFromCart(String itemId, String cartId, String hmac) {
        StringBuffer buffer = new StringBuffer();
        buffer.append(serverURL);
        buffer.append("?");
        buffer.append("ShoppingCart=remove&f=xml&dev-t=");
        buffer.append(token);
        buffer.append("&t=");
        buffer.append(associatesID);
        buffer.append("&Item.");
        buffer.append(itemId);
        buffer.append("&CartId=");
        buffer.append(cartId);
        buffer.append("&Hmac=");
        buffer.append(jawsUtil.encodeString(hmac));
        return new String(buffer);
        /*
          http://xml.amazon.com/onca/xml3?ShoppingCart=remove
          &CartId=CART
          &Hmac=HMAC=
          &Item.17120277375791359165
          &Item.1813019710362345961
          &dev-t=TOKEN&t=test&f=xml&type=lite
        */
    }


code:
    public String ClearCart(String cartId, String hmac) {
        StringBuffer buffer = new StringBuffer();
        buffer.append(serverURL);
        buffer.append("?");
        buffer.append("ShoppingCart=clear&f=xml&dev-t=");
        buffer.append(token);
        buffer.append("&t=");
        buffer.append(associatesID);
        buffer.append("&CartId=");
        buffer.append(cartId);
        buffer.append("&Hmac=");
        buffer.append(jawsUtil.encodeString(hmac));
        return new String(buffer);
        /*
          http://xml.amazon.com/onca/xml3?ShoppingCart=clear
          &f=xml& dev-t=[ [developer's token goes here]
          &t=[associates ID goes here]
          &CartId=[cart ID goes here]
          &Hmac=[HMAC goes here]
        */
    }


code:
    public String stripString(String allowedChars, String string) {
        StringBuffer returnString = new StringBuffer();
        String validString = allowedChars;
        char checkChar;
        for (int x = 0; x < string.length(); x++) {
            checkChar = string.charAt(x);
            if (validString.indexOf(checkChar) != -1) {
                returnString.append(checkChar);
            }
        }
        return returnString.toString();
    }


code:
    public BigDecimal getPrice(String price) {
        String strippedString = null;
        String allowedString = ".0123456789";
        strippedString = stripString(allowedString, price);

        try {
            BigDecimal intPrice = new BigDecimal(Double.parseDouble(strippedString));
            intPrice = intPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
            return intPrice;
        } catch (Exception e) {
            // log.error("error = " + e.toString());
            return new BigDecimal(0.00);
        }

    }


code:
    protected String extractDataUrls(String css, ArrayList preservedTokens) {

    	int maxIndex = css.length() - 1;
        int appendIndex = 0;

    	StringBuffer sb = new StringBuffer();

        Pattern p = Pattern.compile("url\\(\\s*([\"']?)data\\:");
        Matcher m = p.matcher(css);

        /*
         * Since we need to account for non-base64 data urls, we need to handle
         * ' and ) being part of the data string. Hence switching to indexOf,
         * to determine whether or not we have matching string terminators and
         * handling sb appends directly, instead of using matcher.append* methods.
         */

        while (m.find()) {

        	int startIndex = m.start() + 4;  	// "url(".length()
    		String terminator = m.group(1);     // ', " or empty (not quoted)

    		if (terminator.length() == 0) {
    		 	terminator = ")";
    		}

    		boolean foundTerminator = false;

    		int endIndex = m.end() - 1;
    		while(foundTerminator == false && endIndex+1 <= maxIndex) {
    			endIndex = css.indexOf(terminator, endIndex+1);

    			if ((endIndex > 0) && (css.charAt(endIndex-1) != '\\')) {
    				foundTerminator = true;
    				if (!")".equals(terminator)) {
    					endIndex = css.indexOf(")", endIndex);
    				}
    			}
    		}

    		// Enough searching, start moving stuff over to the buffer
			sb.append(css.substring(appendIndex, m.start()));

    		if (foundTerminator) {
    			String token = css.substring(startIndex, endIndex);
    			token = token.replaceAll("\\s+", "");
	    		preservedTokens.add(token);

	    		String preserver = "url(___YUICSSMIN_PRESERVED_TOKEN_" + (preservedTokens.size() - 1) + "___)";
	    		sb.append(preserver);

	    		appendIndex = endIndex + 1;
    		} else {
    			// No end terminator found, re-add the whole match. Should we throw/warn here?
    			sb.append(css.substring(m.start(), m.end()));
    			appendIndex = m.end();
    		}
        }

        sb.append(css.substring(appendIndex));

        return sb.toString();
    }

css

value: "PoeW"


code:
 public static int OperantNum (String op){

      if (op.equalsIgnoreCase("not") || op.equalsIgnoreCase("floor") || op.equalsIgnoreCase("ceil"))
        return 1;
      else
        return 2;
 }

op

value: "floor"

fail

value: false


code:
    public boolean is(String s) {
        return s.startsWith((mname.isEmpty() ? "" : "-") + mname + (mhasArg ? mdelim : "")) && !misSet;
    }


code:
    private int count(char c) {
        int result = 0;
        for (int i = 0; i < values.length; i++) {
            if (values[i] == c) {
                result++;
            }
        }
        return result;
    }


code:
    public boolean isFalse(int a, int b) {
        for (int i = a; i <= b; i++) {
            if (werte[i]) {
                return false;
            }
        }
        return true;
    }


code: public boolean contains(String obj){return tempList.contains(obj);}

obj

value: "Fv Rj ~"zn{S&"


code:
    public String get(int index){
        return tempList.get(index);
    }


code:
    public static String removeStrings(String in, String[] strings){

        if (in==null || strings==null) return null;

        StringBuffer buff = new StringBuffer(in.trim());

        int pos1, length;

        for (int i=0; i<strings.length; i++){

            pos1 = buff.toString().indexOf(strings[i]);
            length = strings[i].length();

            while (pos1!=-1){
                buff.delete(pos1, pos1+length);
                pos1 = buff.toString().indexOf(strings[i]);
            }
        }

        String tempStr = buff.toString();

        return tempStr;

    }


code:
    public static String[] searchStrings(String[] strings, String fragment){

        String[] tempArray=null;

        if (strings!=null && fragment!=null){

            String tempStr, tempStr2;
            StringList hold = new StringList();

            for (int i=0; i<strings.length; i++) {

                tempStr2 = strings[i].toLowerCase();
                tempStr = fragment.toLowerCase();

                if (tempStr2.indexOf(tempStr)!=-1){
                    hold.add(strings[i]);
                }
            }

            if (!hold.isEmpty()) tempArray=hold.toArray();
        }

        return tempArray;
    }


code:
	static int addUnique(String[] list, String str, int last) {
		int i;
		for (i = 0; i < last; i++)
			if (list[i].equals(str))
				break;
		if (i == last)
			list[last++] = str;
		return last;
	}

str

value: "not directory"


code:
	public static String[] spaceSplit(String str) {
		if( str==null || str.length()<=0 )return null;

		int l = 0, r, cnt = 0;
		String[] list = new String[str.length() / 2];
		boolean lastIsQuoted = false;
		str = str.trim();
		while ((r = str.indexOf(' ', l)) >= 0) {
			if (str.charAt(l) == '"') {
				l += 1;
				r = str.indexOf('"', l);
				if (r == -1)
					return null;
			}
			String name = str.substring(l, r);
			if (name.endsWith(File.separator))
				name = name.substring(0, name.length() - 1);
			list[cnt++] = name;

			l = r;
			do {
				l++;
				if (l == str.length()) {
					lastIsQuoted = true;
					break;
				}
			} while (str.charAt(l) == ' ');
		}

		if (!lastIsQuoted) {
			if (str.charAt(l) == '"') {
				l += 1;
				r = str.indexOf('"', l);
				if (r == -1)
					return null;
			}
			String name = str.substring(l);
			if (name.endsWith(File.separator))
				name = name.substring(0, name.length() - 1);
			list[cnt++] = name;
		}

		for (int i = 0; i < cnt; i++) {
			if (list[i].endsWith("\"")) {
				list[i] = list[i].substring(0, list[i].length() - 1);
			}
		}

		String[] tmp = list;
		list = new String[cnt];
		System.arraycopy(tmp, 0, list, 0, cnt);

		return list;
	}


code:
	public static String[] starExpand(String[] fileList, String curDir) {
		int i, j, n, cnt = 0;
		String[] newList = new String[4096]; // !!! Ouch...
		String[] curDirList = (new File(curDir)).list();
		String path, curFile;

		for (i = 0; i < fileList.length; i++) {
			curFile = fileList[i];
			path = "";
			n = curFile.indexOf('*');
			if (n == -1) {
				cnt = addUnique(newList, curFile, cnt);
				continue;
			}
			String[] dirList;
			File f = new File(curFile);
			if (!f.isAbsolute()) {
				dirList = curDirList;
			} else {
				String dir = f.getParent();
				if (dir == null)
					dir = new String(File.separator); // !!! Ouch...
				dirList = (new File(dir)).list();
				curFile = f.getName();
				path = dir + File.separator;
				n = curFile.indexOf('*');
			}

			String pre = curFile.substring(0, n);
			String post = curFile.substring(n + 1);
			for (j = 0; j < dirList.length; j++) {
				String name = dirList[j];
				if (name.startsWith(pre) && name.endsWith(post)) {
					cnt = addUnique(newList, path + name, cnt);
				}
			}
		}
		String[] tmp = newList;
		newList = new String[cnt];
		System.arraycopy(tmp, 0, newList, 0, cnt);
		return newList;
	}


code:
    private static String getDisplayableCommand(String[] command) {
        StringBuilder displayable = new StringBuilder();
        for (int i = 0; i < command.length; ++i) {
            displayable.append(command[i]);
            if (i + 1 < command.length)
                displayable.append(' ');
        }
        return displayable.toString();
    }

command

value: dot -V