parsing

ksoap2 blackberry webservice problem, sample need

Hi! I'm new in blackberry, Currently I'm working at a program, in which I'm fetching data from the php based web service using ksoap2 lib. Everything works smoothly. App connects and fetches the data from the webservice, But now the problem is that, I don't know how to parse the resulting data. It is complex data and contains many rows a...

Parsing JSON to Java POJO's using GSON

I have a very straight forward issue here. I need to take JSON coming from the API and convert it to objects I created for them. This far, it will deserialize them into my List but each Metric object has null values JSON COMING IN { "metrics": [ { "metric": { "type": 1, "name": "slide-11-start", ...

Python: Fetching and parsing text from html files

I'm trying to work on a project about page ranking. I want to make an index (dictionary) which looks like this: file1.html -> [[cat, ate, food, drank, milk], [file2.html, file3.html]] file2.html -> [[dog, barked, ran, away], [file1.html, file4.html]] Fetching links is easy - look for anchor tags. My question is - how do I fetch text...

Parse KSoap2 response in android

So I managed to call a webservice using KSoap2 in android but I can't find a way to parse the response... So here's what I receive from the webservice anyType{ WORCCategoriaSubcategoriaRecord=anyType{ssENCategoria=anyType{Id=1; Nome=Problema na rua; }; ssENSubcategoria=anyType{Id=1; Nome=Falta de acesso; Imagem=anyType{}; CategoriaId=1;...

Resume (CV) parsing (analysis)

Hi All, I need any help regarding resume (CV) analysis (a.k.a parsing).. any opensource lib, any specs, any docs.. urgently.. Thanks. ...

PHP array parsing

I am wondering if there are any classes for parsing PHP arrays in the general sense that you are looking back and forth over elements matching search patterns. For example, lets say that If element "xyz" was found then I want to search backwards through the array until element "abc" or "cba" is found (or X number of steps backward is re...

HTML::TreeBuilder::XPath: identifing the xpath-expression

Hello good evening dear -Coder on Stackoverflow! finally back again! i am currently workin on a parser script: I have to parse all the detail-pages of this site here: [link text][1] Note: a very big and powerful suiss site - a governmental server with lots of power! There are several ways to do it. i have to get rid of a lot of crap b...

Parsing poorly formatted Log files?

I'm working with some log files that are very poorly formatted, the column delimiter is an item that (often) appears within the field and it isn't escaped. For example: sam,male,september,brown,blue,i like cats, and i like dogs Where: name,gender,month,hair,eyes,about So as you can see, the about contains the column delimiter which...

How do you dynamically identify unknown delimiters in a data file?

I have three input data files. Each uses a different delimiter for the data contained therein. Data file one looks like this: apples | bananas | oranges | grapes data file two looks like this: quarter, dime, nickel, penny data file three looks like this: horse cow pig chicken goat (the change in the number of columns is also intent...

<: cannot begin a template argument list

I get an error <: cannot begin a template argument list on g++ compiler. Code template<typename T> class SomeClass; class Class; SomeClass<::Class>* cls; ...

Parsing apache logs using PostgreSQL

This O'Reilly article gives an example of a PostgreSQL statement that parses an Apache log line: INSERT INTO http_log(log_date,ip_addr,record) SELECT CAST(substr(record,strpos(record,'[')+1,20) AS date), CAST(substr(record,0,strpos(record,' ')) AS cidr), record FROM tmp_apache; Obviously this only extrac...

How can I modify a local HTML file in Perl?

Is there a CPAN module or code snippet that I can use to modify local HTML files without using a regExp? What I want to do : Change the start tag ( example : <div> to <div id="newtag"> ) Add a tag before another ( example : </head> to <script type="text/javascript"> ...</script></head> Remove tags Read the content of a given tag. (<-...

Delphi XE IDE code parser error ?!?

After adding a IdUDPServer to my form and trying to put some code into the OnUDPRead event, I'm not able to add any component to my form at design time, nor can I run the application. is there any way to solve this ? ...

parse an active log file

Looking for a little help getting started on a little project i've had in the back of my mind for a while. I have log file(s) varying in size depending on how often they are cleaned from 50-500MB. I'd like to write a program that will monitor the log file while its actively being written to. when in use it's being changed pretty quickl...

What is the name of the character that designates literals when lexing an input sequence?

I want to know what is the 'terminology name' of the character that designates a start of a literal in a lexing process. For example: a string starts and ends with an " character. a regular expression literal - with an / character. ...

Catch first and last <li> inside php variable

echo $ul; // gives this code: <ul id="menu"> <li id="some_id" class="some_class">...</li> <li id="some_id" class="some_class">...</li> <li id="some_id" class="some_class">...</li> </ul> How to add some class for the first and the last <li>? Need a regex solution. echo $ul; should give (if we add class my_class for the last <li>): <...

need some explanation in Earley algorithm

I would be very glad if someone can make clear for me example mentioned ono wikipedia: http://en.wikipedia.org/wiki/Earley_algorithm consider grammar: P → S # the start rule S → S + M | M M → M * T | T T → number and input: 2 + 3 * 4 Earley algorithm works like this: (state no.) Production (Origin) # Comment ----...

Ruby: How can I process a CSV file with "bad commas"?

I need to process a CSV file from FedEx.com containing shipping history. Unfortunately FedEx doesn't seem to actually test its CSV files as it doesn't quote strings that have commas in them. For instance, a company name might be "Dog Widgets, Inc." but the CSV doesn't quote that string, so any CSV parser thinks that comma before "Inc." ...

Get XML page from path name

I am working on a site server side that has uses XML to get data. The path to the XML I need is something like "/image/user/username/" I need to get the XML file from that resulting link using something like <script type="text/javascript"> imagesByUser('/../image/user/{{ user.username }}/') I know that the link is working becaus...

AWK/BASH: How to remove duplicate rows from file with known field range?

Hi all, I was wondering if there was a way to use bash/awk to remove duplicate rows based on a known field range. For example: Easy Going USA:22 May 1926 Easy Going Gordon USA:6 August 1925 Easy Life USA:20 May 1944 Easy Listening USA:14 January 2002 Easy Listening ...