parsing

Command line switches out of order

Hey all - I'm working on a C++ program that accepts a filename as a command line input, reads a bunch of data from that file, computes two things about the data, then exits. One of those computations must be done, but the other is much more optional, so I thought it would be neat to add a -c flag to turn it off. Naively, I would just a...

Benchmarks for JSON parsers?

I'm interested in benchmarks for various JSON parsing libraries, ideally, comparing Java and C/C++ implementations. Java only benchmarks by the Jackson folks: http://www.cowtowncoder.com/blog/archives/2009/02/entry_204.html Thanks! ...

how to skip undefined properties in JSON?

When I parse JSON fields coming from google maps, etc., it is a mess. Because they are not made specifically for my script I have to verify many details, epecially because the addresses are different in every country. Short question: when the script finds a undefined property the script breaks...error.. How can I verify the property is...

raw text storage vs text parsing (BBCODE(PHP))

Im making my little site where users can create blogs, and have studied publishing tools like wordpress and vbulletin. When a user creates a post with BBcodes/mark up language, should i parse it into HTML and insert in db, and then only echo the text for the user, or should insert it with bbcode in the db, and let the php page parse it ...

parsing XML with PHP need to display the embedded HTML as markup

I'm writing a simple atom XML parser with PHP I have trouble displaying the proper content inside the <content> tag if there is additional HTML tag within. Ex. If I want to parse the following XML <entry> <title>Test entry #3</title> <id>http://example.org/article3&lt;/id&gt; <updated>2006-10-03T13:14:34Z</up...

how do i throw exceptions with meaningful messages with a scala combination parser?

I'd like to throw an exception when the language doesn't conform to the grammar for a scala combination parser. Here's an example of a rule: def record: Parser[Record] = "-" ~ opt(recordLabel) ~ repsep(column, ",") ^^ { case "-" ~ label ~ columns => new Record(label, columns) } Let's say in the repsep(column, ",") part, they accid...

Data collection task

I have data that follows this kind of patten: ID Name1 Name2 Name3 Name4 ..... 41242 MCJ5X TUAW OXVM4 Kcmev 1 93532 AVEV2 WCRB3 LPAQ 2 DVL2 . . . As of now this is just format in a spreadsheet and has about 6000 lines. What I need to do is to create a new row for each Name after Name1 and asso...

Parsing a list into a url string

I have a list of tags that I would like to add to a url string, separated by commas ('%2C'). How can I do this ? I was trying : >>> tags_list ['tag1', ' tag2'] >>> parse_string = "http://www.google.pl/search?q=%s&amp;restofurl" % (lambda x: "%s," %x for x in tags_list) but received a generator : >>> parse_string 'http://&lt;generator...

Parsing 64-bit unsigned integer on iOS.

I have very big unsigned integral number in NSString. This may be big to 2^64. Is there an existing functions/classes parsing this? As I know, it's unsigned long long value, but, It's hard to know what kind of method should I use to parse this. ...

Parse a large JSON file in ActionScript 3

I need to parse a large trace file (up to 200-300 MB) in a Flex application. I started using JSON instead of XML hoping to avoid these problems, but it did not help much. When the file is bigger than 50MB, JSON decoder can't handle it (I am using the as3corelib). I have doing some research and I found some options: Try to split the fi...

bash: extract double from string

hello I have this string in bash: str=sdk.iphoneos4.1.sdk and I would like to have a variable with '4.1' in it is there any way to parse a float/double value in bash ? ...

How to parse the uploaded apk file with Java code?

I want to know how to implement java code to parse the apk file, get the android application version number and so on, such as after you uploaded android application in Android Market, it will get the version number, permissions. Anyone can give me idear? Thanks a lot. ...

Could you share a link to an URL parsing implementation?

...

C# Simple Text to HTML Conversion

I have a very simple asp:textbox with the multiline attribute enabled. I then accept just text, with no markup, from the textbox. Is there a common method by which line breaks and returns can be converted to <p> and <br/> tags? I'm not looking for anything earth shattering, but at the same time I don't just want to do something like...

Parse column value based on delimeters

Here is a sample of my data: ABC*12345ABC BCD*234() CDE*3456789(&(& DEF*4567A*B*C Using SQL Server 2008 or SSIS, I need to parse this data and return the following result: 12345 234 3456789 4567 As you can see, the asterisk (*) is my first delimiter. The second "delimiter" (I use this term loosely) is when the sequence of numbers ST...

jquery like lib in java

I am looking for a simple lightweight java library that parses HTML. I have looked a lot and there are many options out there. But I cannot find something simple. I really would like to have something like pyquery in python except in java. My requirements are: fast, easy to use and lightweight. What do I need it for? Not sure if this m...

C Lexical analyzer in python

Hey, I'm creating a C Lexical analyzer using python as part of developing a parser.Here in my code i have written some methods for identifying keywords,numbers,operators etc. No error is shown after compiling. While executing i could input a .c file.My output should list all the keywords,identifiers etc in the input file. But it is not ...

HTML Comments Extracter

Hey Dudes, I am well aware that parsing HTML with regex has its many caveats and vociferous opponents. So rather than trying to re-invent the wheel, I'm looking for a tool that I can point to a web page and say "Get me the comments, b*tch". Anyone able to advise? I was reading some OWASP documentation or a security blog, and I'm almos...

HTML Agility Pack & VB.NET

There's plenty of examples out there for other languages. Are there any examples for vb.net? ...

How to parse word-created special chars in java

I am trying to parse some word documents in java. Some of the values are things like a date range and instead of showing up like Startdate - endDate I am getting some funky characters like so StartDate ΓÇô EndDate This is where word puts in a special character hypen. Can you search for these characters and replace them with a regular ...