Choosing the right IOS XML parser [closed]

Best comparison I’ve seen on the subject: http://www.raywenderlich.com/553/how-to-chose-the-best-xml-parser-for-your-iphone-project The difference between the slowest and fastest parsers in his case was a factor of 2. Depending on your feature requirements, there are definitely parsers that can cut your parsing time in half.

What is the decimal separator symbol in JavaScript?

According to the specification, a DecimalLiteral is defined as: DecimalLiteral :: DecimalIntegerLiteral . DecimalDigitsopt ExponentPartopt . DecimalDigits ExponentPartopt DecimalIntegerLiteral ExponentPartopt and for satisfying the parseFloat argument: Let inputString be ToString(string). Let trimmedString be a substring of inputString consisting of the leftmost character that is not a StrWhiteSpaceChar and all characters to the right of that … Read more

Evaluating a string of simple mathematical expressions [closed]

Assembler 427 bytes Obfuscated, assembled with the excellent A86 into a .com executable: dd 0db9b1f89h, 081bee3h, 0e8af789h, 0d9080080h, 0bdac7674h, 013b40286h dd 07400463ah, 0ccfe4508h, 08ce9f675h, 02fc8000h, 013b0057eh, 0feaac42ah dd 0bedf75c9h, 0ba680081h, 04de801h, 04874f73bh, 04474103ch, 0e8e8b60fh dd 08e8a003fh, 0e880290h, 0de0153h, 08b57e6ebh, 0d902a93eh, 046d891dh dd 08906c783h, 05f02a93eh, 03cffcee8h, 057197510h, 02a93e8bh, 08b06ef83h dd 05d9046dh, 02a93e89h, 03bc9d95fh, 0ac0174f7h, 074f73bc3h, 0f3cac24h … Read more

Looking for a clear definition of what a “tokenizer”, “parser” and “lexers” are and how they are related to each other and used?

A tokenizer breaks a stream of text into tokens, usually by looking for whitespace (tabs, spaces, new lines). A lexer is basically a tokenizer, but it usually attaches extra context to the tokens — this token is a number, that token is a string literal, this other token is an equality operator. A parser takes … Read more

How can I parse this JSON in Android?

Use the JSONObject // Get some JSON from wherever String json = getJSONFromServer(); // Parse the JSON response into an object JSONObject object = new JSONObject(json); // Get the results array JSONArray users = object.getJSONArray(“results”); for(int i = 0; i < users.length(); i++) { // Each element in the results array is a JSONObject with … Read more

Handling extra operators in Shunting-yard

Valid expressions can be validated with a regular expression, aside from parenthesis mismatching. (Mismatched parentheses will be caught by the shunting-yard algorithm as indicated in the wikipedia page, so I’m ignoring those.) The regular expression is as follows: PRE* OP POST* (INF PRE* OP POST*)* where: PRE is a prefix operator or ( POST is … Read more