Tagged Questions
-1
votes
1answer
59 views
Parsing large text area - difficulty extracting info - Javascript [closed]
I am writing a program that will deal with formatting the text in a text area.
The user will use Ctrl + A, Ctrl + C to copy the entirety of a web page, then paste that text into a text area. The ...
4
votes
1answer
84 views
Is my PHP script/embed remover robust?
The goal of this question:
Your goal here is to find a security hole in my code which allows a user to create input that contains a script doing anything they want, without that script being stopped ...
3
votes
1answer
185 views
JQuery Promise Interface for a (very) simple JSON Parser
I have written a parser function that returns a JQuery Promise. You can see from the code that this is the top level parser and it delegates out to two other more specific parsers.
At the minute it ...
1
vote
0answers
85 views
Javascript XML Parser rapper
I created an XML rapper to easily access XML data.
Please tell me what do you think about it.
Performance
Scalability
Anything else...
This is how you use it:
var xml = new Xml(dataString);
...
3
votes
1answer
201 views
DnD dice roll parser
Some time ago I've written a small parser (about 250 LoC) which is capable of executing the four arithmetic operators +-*/ as well as a dice-roll operator, NdM, which "rolls a dice", DnD style. The ...
2
votes
1answer
613 views
Code to Parse dollars and cents?
I've written code to parse dollars and cents entered by the user. The value returned is the total number of cents.
For example:
f('$1.50') = 150
f('1.5') = 150
f('0') = 0
f('1000') = 1000
...
3
votes
2answers
2k views
Parsing JSON with JavaScript
I need to write some JavaScript code that will take a JSON string, parse it, and return the names of the most-deeply nested properties. For example, for this input:
var json =
"{\
foo: {\
bar: ...
5
votes
3answers
316 views
Is this query-string parser bug-free?
I tried to implement a definitive, reliable URL query string parser that handles every corner case:
it tries to be efficient by avoiding regex
it takes full URLs or just query strings (as long as ...
5
votes
3answers
381 views
Javascript Object Placement / String Parsing Method
This JS function is intended to retrieve or place a value into an object with the nested keys as a string.
For example
var obj = {a: {b: [4]}};
parse_obj_key(obj, "a.b.0") should equal 4.
...