parsing

How to do an Integer.parseInt() for a decimal number?

The Java code is as follows: String s = "0.01"; int i = Integer.parseInt(s); However this is throwing a NumberFormatException... What could be going wrong? ...

Algorithm for reading the actual content of news articles and ignoring "noise" on the page?

I'm looking for an algorithm (or some other technique) to read the actual content of news articles on websites and ignore anything else on the page. In a nutshell, I'm reading an RSS feed programatically from Google News. I'm interested in scraping the actual content of the underlying articles. On my first attempt I have the URLs from th...

PHP: strtotime()... again.

How do I have to write "+3 days at 12:34:56" to make strtotime() parse it properly? ...

Parsing Tweets in ColdFusion

Hi guys, I have an RSS feed that I am working on in ColdFusion 8. What I would like to do is parse the entire RSS feed and pull out trending words. I would like my output to display how many times each word is used. Much like a word cloud. Thanks! Mike ...

Searching all elements before an h2 element in hpricot/nokogiri

I am attempting to parse a Wiktionary entry to retrieve all english definitions. I am able to retrive all definitions, the problem is that some definitions are in other languages. What I would like to do is somehow retrieve only the HTML block with English definitions. I have found that, in the case that there are other language entri...

Built in header file parser in C#?

I was wondering if there was a built in runtime parser for header files in C#. I have several different C header files that I want to parse (They will later be used to determine how a network packet will be deserialized). Ideally, some option to load the .h file dynamically, create the struct, and then use reflection to somehow parse t...

Flash Media Server calling a page that returns JSON data

I am very new to Flash development. I have an asp.net mvc site that has a controller action that returns JSON. I have a Flash Media Server setup that needs to call that controller action every 15 minutes to get the current schedule. I can get the FMS to call the site (and every 15 minutes no problem) and I am getting the JSON right now...

What's the closest thing to pyparsing that exists for .NET?

What I'm especially interested in is the ability to define the grammar in the code as ordinary code without any unnecessary cruft. I'm aware I could use IronPython. I don't want to. UPDATE: To further explain what I'm looking for, I'm including some sample pyparsing code. This is an incomplete parser to convert emacs shortcut keys to ...

How to write shell script that filter for lines and count them?

I have a text file like this: Apple Orange Orange Banana Banana Orange Banana Orange Apple Orange I want to produce the following output after running a bash shell script: Apple: 2 Orange: 5 Banana: 3 It's pretty standard stuff if I use a full blown language like Java/C++ etc but what is the quickest way to do it with a shell scrip...

Basic JSON.parse question

I can't seem to access my objects. after parsing the server string: var json = JSON.parse(myJsonText): I get the below with an alert: alert(json.param1) {"ID":17,"Name":"swimming pools","ParentID":4,"Path":""}, {"ID":64,"Name":"driveways","ParentID":4,"Path":""} Now, I am trying to access ID and Name. I have tried: json.param...

pyparsing - load ABNF?

can pyparsing read ABNF from a file instead of having to define it in terms of python objects? If not, is there something which can do similar (load an ABNF file into a parser object) ...

Non-Blocking method for parsing (streaming) XML in python

I have an XML document coming in over a socket that I need to parse and react to on the fly (ie parsing a partial tree). What I'd like is a non blocking method of doing so, so that I can do other things while waiting for more data to come in (without threading). Something like iterparse would be ideal if it finished iterating when the r...

.NET date handling: parse 15-OCT-08 15.36.16.280000000

The custom date strings in .NET allow you to parse a date with seven fractional parts of a second using fffffff I need to parse data exported from Oracle SQL Developer which looks like: 15-OCT-08 15.36.16.280000000 I count nine fractional parts but fffffffff is not a valid date format. In fact: ? DateTime.Now.ToString("dd-MMM-yy H...

Character column parsing in Boost::Spirit

I'm working on a Boost Spirit 2.0 based parser for a small subset of Fortran 77. The issue I'm having is that Fortran 77 is column oriented, and I have been unable to find anything in Spirit that can allow its parsers to be column-aware. Is there any way to do this? I don't really have to support the full arcane Fortran syntax, but it d...

Looking for an information retrival / text mining application or library

We extract various information from e-mails - flights, car rentals, hotels and more. the method is to extract the body of the mail, usually in HTML form but sometime it's text or we use the information in a PDF/Word/RTF attachment. We then apply regular expressions (sometimes in several steps) in order to get information, which is provid...

Load data to the Table view from Parsed XML

Hi All, Previously i had a doubt regarding the Parsing XML. thanks for all for giving me help to clear that. Now i need to load the data which i parsed from the XML in to a table view. can any one help me in that. [What i need is to load the courses which a student enrolls. the xml file is created based on the login query.] Thanks in ...

Loading a webpage for parsing in Rails

Assume, I want to get a page from the web to my application and make some sort of parsing with it. How do I do that? Where should I start from? Should be some plugins/gems required? What is your usual practice in resolving such type of tasks? ...

How to parse Web page with dynamic web content in java?

Hi i want to parse a HTML page which contains some values displayed.That values are updated at regular intervals.I have to get that value from a standalone java program.If i parse the HTML page with some HTML parser the source of that page is displayed instead of that value.i tried with NEkoHTML parser and JTidy parser but there are not...

Effective Custom Tag Parsing with C#

I'm currently playing around with a CMS idea I've got. It's based on a MonoRail, NHibernate stack. I know there are already a million CMS solutions out there. This is more for my benefit for trying some new stuff out. Anyway, the admin side of things is going well with a plugin architecture in full flow, however I've hit a bit of a ro...

parsing new lines in jquery

I've recently asked and had answered this question and it's stopped the issue of the string literal error, however it's now caused another problem $(document).ready(function() { $("#message-list .message").click(function() { var msg_id = 1; msg_id = $(this).attr('id').split('-')[1]; $.ajax({ type: "GET", url: "ge...