Hi
i'm facing the following problem, i have to re-write an existant code to improve his performances. the old version was using a parser defined like this :
newtype Parser Char a = Parser {runParser :: [Char] -> [(a,[Char])]}
to parse lines from files. but it was too slow and required a lot of memory to achieve the computation upon l...
I have to parse a XML structure in JAVA using the SAX parser. The problem is that the structure is recursive with an unspecified count of recursions. This still is not such a big deal the big deal is that I can't take advantage of the XML namespace functionality and the tags are the same on every recursion level.
Here is an example of t...
I'm trying to find an elegant way to parse a string like:
EVENT_TYPE(param1;param2; ...)
EVENT_TYPE is one of many string constants, each has zero or more parameters.
So far I thought that given the sting "s" contains EVENT_TYPE(param1;param2) I'd write:
if (boost::istarts_with(s, "EVENT_TYPE")) {
std::istringstream iss(s);
int p...
Hey
I couldn't find any similar question, so I start a new one.
I need to remove all whitespace from string, but quotations should stay as they were. I'm building a personal kind of minifier.
Here's an example:
string to parse:
hola hola "pepsi cola" yay
output:
holahola"pepsi cola"yay
Any idea? I'm sure this can be done with rege...
I'm trying to figure out how to parse a string in this format into a tree like data structure of arbitrary depth.
"{{Hello big|Hi|Hey} {world|earth}|{Goodbye|farewell} {planet|rock|globe{.|!}}}"
[[["Hello big" "Hi" "Hey"]
["world" "earth"]]
[["Goodbye" "farewell"]
["planet" "rock" "globe" ["."
"!"]]]]
...
Hi,
I'm looking to do the following : let's say I have a number like 125.625 => I would like to be able to tell my program that is 1 * 100 + 2 * 10 + 5 * 1 + 0.625. How could I do that please ?
thanks
...
Hello Team,
Here I am posting the Json Response:
{"ResultSet":
{"Result":[
{"Phone":"(650) 473-9999",
"Distance":"2.59",
"MapUrl":"http://maps.yahoo.com/maps_result?q1=441+Emerson+St+Palo+Alto+CAgid1=28734629",
"Categories":
{"Category":[
{"content":"Salad Restaurants",
...
I'm trying to parse an HTML file with simplehtmldom and I'm getting this error:
zend_mm_heap corrupted
after about 4 seconds of execution on a 8231 lines HTML file. Could this be a bug or just excessive memory usage?
...
Can you recommend any OS, ready-to-go, well-documented and not dead MT940 format parser for Python?
...
Hi everyone!
I am looking for a parser (or generated parser) in java that is capable of followings:
1- I will provide sentences that are already part-of-speech tagged. I will use my own tag set.
2- I don't have any statistical data. So if the parser is statistical, I want to be able to use it without this feature.
3- Adaptable to other...
Hi the aim is to parse a sizeable corpus like wikipedia to generate the most probable parse tree,and named entity recognition. Which is the best library to achieve this in terms of performance and accuracy? Has anyone used more than one of the above libraries?
...
I'm mirroring some internal websites for backup purposes. As of right now I basically use this c# code:
System.Net.WebClient client = new System.Net.WebClient();
byte[] dl = client.DownloadData(url);
This just basically downloads the html and into a byte array. This is what I want. The problem however is that the links within the h...
Hi,
I have a data string 'yyyymmddhhmmss' example: '20101001151014', how Do I parse this to date in C#?
...
I just need to write a simple python CGI script to parse the contents of a POST request containing JSON. This is only test code so that I can test a client application until the actual server is ready (written by someone else).
I can read the cgi.FieldStorage() and dump the keys() but the request body containing the JSON is nowhere to ...
hi
i've wrote the following Haskell code
import Data.Attoparsec (Parser)
import qualified Data.Attoparsec.Char8 as A
import qualified Data.ByteString.Char8 as B
someWithSep sep p = A.sepBy p sep
the code is suppose to work this way :
main*> A.parse (someWithSep A.skipSpace A.decimal) $ B.pack "123 45 67 89"
Done "" [123,45,67,89]...
I have the following code:
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringRea...
As the question says am trying to parse one of the elements of an string array into a int variable. although the code is right in terms of syntax, when I try to run it, I get the following error message.
Error 1 Building content threw FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(St...
I just joined StackOverflow after having found many great answers here in the past. Here's my first question:
EDIT: I feel bad... my first question to StackOverflow turned out to be a "wild goose chase". The problem is in the data, not the code reading the data. I was looking for a solution in the wrong place! I will explain in a commen...
I am not sure what I am doing wrong here. I have a simple plist on my server.
I am using the ASIHTTPRequest framework, so I can get both the data object and a string.
Outputting: [[NSString alloc] initWithData:[request responseData] encoding:NSUTF8StringEncoding] works just fine and the output it the plist.
However, I cannot get this ...
Long time reader, first time poster.
In Android, capturing date from datepicker and storing as string in sqlite. Sorting by date doesn't work because they're strings (unless I'm doing it wrong.
I've googled this issue for ~5 days, and it looks like there should be a way to capture the date from the date picker, convert it to a Long, s...