parsing

Parsing and Converting TED Talks JSON Subtitles

This question is related to this other question @ SuperUser. I want to download the TED Talks and the respective subtitles for offline viewing, for instance lets take this short talk by Richard St. John, the high-resolution video download URL is the following: http://www.ted.com/talks/download/video/5118/talk/70 And the respectiv...

Velocity (VM) template: how to disable for a block of jquery

I have Apache Velocity. I have some jQuery code. I think VM doesn't like when I do things like $img.css("float","left"). How can I completely disable VM parsing within a block of HTML/Javascript ? Thanks ...

Html parsing using Simple Html dom parser

I am using simple html dom parser to parse some html. I have an html like this <span class="UIStory_Message"> Yeah, elixir of life!<br/> <a href="asdfasdf"> <span>asdfsdfasdfsdf</span> <wbr/> <span class="word_break"/> 61193133389&ref=nf </a> </span> My code is $storyMessageNodes = $story->fin...

How to pass data from client to server when using gSOAP ?

I am trying to exchange data between client and server using gSOAP. Actually, I succeeded to send data from client to server but not from server to client. So, could someone please explain what functions to use to pass data from server to client? Thanks for your time and replies, ...

[C#] How to output contents of tags <div> in listbox

On the form is textbox in which the site address is entered(http://localhost.com/index.html). I want that in listbox contents of tags were output. How it can be made? ...

Java Scanner with empty delimiter

I'd like to parse some text using an hand-written descending parser. I used Scanner with the following delimiter : "\\s*". Unfortunately, the fact that this pattern matches an empty String seems to make every hasNextFoo and nextFoo matching nothing anymore. The doc doesn't say anything about possibly empty delimitors. ...

Email threading

I'm working at a helpdesk application where i have a standalone script that queries a mail server and parses the mail it finds there. I'm facing the following issue: How do i figure it out in a reliable way what mail is in reply to what mail? I could add something in the subject like "[ticket:21312]" and look for that but what if the use...

C++ Hex Parsing

I'm wondering how to convert a hex string to a human readable string (if that makes any sense) this would be my first real encounter with hex values so I'm still learning about them and how to manage them. I have a program which is reading in data from a file which contains raw packet data (hex) and I need to parse this information so i...

How to generate AST from Java source-code?

As far as I know, the only way to parse Java source-code into an AST (Abstract Syntax Tree) is to use the Java Compiler Tree API: com.sun.source.tree I have two questions: What JDKs support com.sun.source.tree? Is there a portable replacement that works for all JDKs? ...

How to parse/extract data from a mediawiki marked-up article via python

Source Mediawiki markup Right now I'm using a variety of regexes to "parse" the data in the mediawiki mark-up into lists/dictionaries, so that elements within the article can be used. This is hardly the best method, as the number of cases that have to be made are large. How would one parse an article's mediawiki markup into a variety...

What languages have strong string parsing capability like Perl's?

Hi, I am familiar with Perl's strong parsing abilities using regular expressions. Is it efficient? What other languages have strong parsing ability and perform efficiently? ...

How to parse a file for iphone? Should I use NSScanner?

Hi, So I am new to iphone development, but am trying to learn how to take a file that is CSV and read it and save it using Core Data (I think that is the best way?) so that I can display it in a tableview on the iphone. Below is an example of the type of csv file I am working with; 13,1,1,History,,,,,,1 ,263,1,Smith,Bob,Freshman ,317,...

How to use pyparsing to parse and hash strings enclosed by special characters?

The majority of pyparsing examples that I have seen have dealt with linear expressions. a = 1 + 2 I'd like to parse mediawiki headlines, and hash them to their sections. e.g. Introduction goes here ==Hello== foo foo ===World=== bar bar Dict would look like: {'Introduction':'Whoot introduction goes here', 'Hello':"foo\nfoo", 'World...

Android XML Parsing omitting "&amp;"

Hi again friends... The problem again is that though i have succesfully implemented a SAX parser in my code... It is behaving wierdly. It jus skips the enteries after the & and goes to the next entry. Just wanted to know whether this is the typical working of SAX parser or m i implementing it wrongly??? I have implemented org.xml.sax.Co...

Reading and parsing the width/height property of a bitmap

I'm trying to write a bitmap (.bmp) parser/reader by reading raw bytes from the file and simply checking their values, and I've come across something I simply cannot wrap my mind around. The image I'm trying to read is 512x512 pixels, and when I look at the width property (at 0x12 and 4 bytes onward) it says 00 02 00 00 (when viewed in ...

Testing with multiple regexps at the same time (for use in syntactic analysis)

I am writing a simple syntax highlighter in JavaScript, and I need to find a way to test with multiple regular expressions at the same time. The idea is to find out which comes first, so I can determine the new set of expressions to look for. The expressions could be something like: /<%@/, /<%--/, /<!--/ and /<[a-z:-]/ First I tri...

access namespace element/attribute in xml/atom document with simplexml

Hello, I may have a simple question, I need to know how to get to nested namespace attributes/elements like below <gf:marketValue> <gd:money amount='150990.0' currencyCode='USD'/> </gf:marketValue> this is from the google-api Also, I am now not sure wich one I should use the url .../portfolio or portfolio/1/positions to get t...

Using Scanner/Parser/Lexer for script collation

I'm working on a JavaScript collator/compositor implemented in Java. It works, but there has to be a better way to implement it and I think a Lexer may be the way forward, but I'm a little fuzzy. I've developed a meta syntax for the compositor which is a subset of the JavaScript language. As far as a typical JavaScript interpreter is c...

Best approach to pass hash type data in string form from Rails/Ruby to a C# app?

Hi, I need to pass (via string content of a HTTP request/response body) name value pairs of data (like a hash) back from a Ruby on Rails server to a C# client. Anyone happen to know offhand what would be the best format to do this in? Probably XML I would guess? tks PS. So overall the requirement is find a C# method that convert f...

Parsing UPS Worldship shipping zone dat file

For licensing reasons, our shipping product tries to obtain UPS rate information without using the API. Most of this is reasonably straight-forward, but obtaining a complete set of zipcode-to-zipcode postal zones is a large hassle. We're looking at the Worldship databases (with UPS's permission, but not support) for rate infromation, an...