parsing

How to get the class contained by a Vector - Reflection

Hi, I'm using QDox to parse a .java file. The file contains a method like this: public int getSomething (Vector<Integer> numbers); the problem is I don't know how to get the Integer class using the reflection which QDox provides. Any idea of how can I get it? ...

Reading a Shapefile with ColdFusion

I am trying to read a binary file and parse the bytes I have the white paper spec on Shapefiles to know how to parse the file, however I cannot seem to find the correct functions in ColdFusion to handle reading bytes and deciding what to do with them. <cffile action="READBINARY" file="mypath/www/_Dev/tl_2009_25_place.shp" var...

how to parse a HTML page with PHP5 and DOM?

hi there! i'm working on some piece of code that should get the contents of a very specific html-tag of an html-document given. $html = "<html>..........truncated.........<div>blablabla<br />xy</div>....."; $dom = new DomDocument(); $dom->loadHTML($html); $divs = $dom->getElementsByTagName('div'); echo $divs->item(0)->nodeValue.'<br>...

PHP Version 5.2.14 / Parse error: syntax error, unexpected T_FUNCTION, expecting ')'

Hi, I have a certain piece of code that I'm trying to use with PHP Version 5.2.14 . Is it incompatible?? I run the following, jailshell-3.2$ php -l /XYZ/functions.php And it gives: Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /XYZ/functions.php on line 2115 Errors parsing /XYZ/functions.php The code...

Could not convert javascript argument

After trying to append some code to a div layer I received the following error and don't know why. uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsIDOMDocumentFragment.appendChild]" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: http://code.jquery.com/jquery-latest.min.js...

How to implement similar html page scrubber like Arc90's Readability or Instapaper?

I'm interested to find out how to scrub a html page and present it nicely -- remove all the clutters and reformat the main text into a very readable format -- like http://lab.arc90.com/experiments/readability or Instapaper. Is it a simple page parsing and removing elements that are not within ? Was this discussed else where? ...

sed extract multiple possible(?) values from a file

Hi Folks I have a file that has multiple lines like the following: "<sender from="+919892000000" msisdn="+919892000000" ipAddress="" destinationServerIp="" pcfIp="" imsi="892000000" sccpAddress="+919895000005" country="IN" network="India::Airtel (Kerala)" "<sender from="+919892000000" msisdn="+919892000000" ipAddress="" destinationServe...

Parsing dates and times from string in many combinations

Hi. I need to parse dates and times from strings. The Problem is that the strings can have any possible format. But I also get the format strings. So i get: Date = "9/15/2010" Time = "16:12:45" DateFormat = "M/dd/yyyy" TimeFormat = "h:mm:ss" TimeZone = "+2:00:00" // +/- and time in TimeFormat But i have some problems parsing these ...

Why am I getting an "Out of memory" error with Perl's XML::Simple?

Edited:: Hi All, I have a XML file like this, <message> <c1> <rrcConnectionSetupComplete> <rrc-TransactionIdentifier>2</rrc-TransactionIdentifier> <criticalExtensions> <c1> <rrcConnectionSetupComplete-r8> ...

Parsing string and making list of required data

hi, I am using **<style>..{data inside}..</style>** which is there in following code.i have taken all the data between style tags in one string ,say string tempStyle and all operations are to be done on that string only. I am looking for function which will take make a list of all "style" data. i.e. only style1,style2,style15,style20 i...

How to get a xml file from iphone's email and use it in my app

Suppose i want to open an xml file which i have in my email through my app. How should i go for this. Thanks, ...

Regex to figure out a complex string.

I am trying to parse some text files into a database and there is a string that includes 2 pieces of information in it. There are a few options for what the string can look like. It can either look like a single word Word or it can have that first word, followed by a dash, followed by any number of other words like Word - Second. The key...

Does Google Closure support multiple "packages" of Javascript files?

Say I had 1 MB of compressed Javascript, all combined into one file using Google Closure. Now 500 KB of it is only needed for one section of the site. So I want to combine & compress the Javascript, but separate it into two packages: Package A - 500 KB - used across the site Package B - 500 KB - used only in one section of the site ...

vbscript return string of whole words <=specified limit

I want to, in vbScript (Classic ASP), parse a string to a specified length without cutting words. The final string may be less than the specified length (to avoid cutting words), but should not exceed it.. ...

Parsing XML with javascript problem

I have some javascript in which I need to step through all the elements of some XML. An example of the XML is shown below: <rules><and><eq propName="Unit1"/><gt propName="Unit2"/><or><startsWith propName="Test"/></or></and></rules> I need check each part as I need to create objects based on the contents. Can someone supply a basic co...

php parse error

hi guys, this was working for me for the last couple of days until this morning when I must have changed something by accident. I thought I changed back everything but it's still not working. This is the error I'm getting Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in C:\wamp\www\xxxxx\reg.php on...

Generating parser in Python language from JavaCC source???

I do mean the ??? in the title because I'm not exactly sure. Let me explain the situation. I'm not a computer science student & I never did any compilers course. Till now I used to think that compiler writers or students who did compilers course are outstanding because they had to write Parser component of the compiler in whatever langu...

separating values in a URL, not with an &

Each parameter in a URL can have multiple values. How can I separate them? Here's an example: http://www.example.com/search?queries=cars,phones So I want to search for 2 different things: cars and phones (this is just a contrived example). The problem is the separator, a comma. A user could enter a comma in the search form as part...

Parsing JSON and customizing it for SIMILE's Timeline Widget

I have a valid JSON dataset: [ { "date": "2008-02-04 19:30:00", "authors": [ { "first_name": "Nassim Nicholas", "last_name": "Taleb" } ], "icon": "djlongnow_media/seminar_icons/salt-020080204-taleb.jpg", "slug": "the-future-has-always...

Xml Parsing Error

Hello All! I am getting this error while trying to Parse the Xml response from the Web Service by SAX Parser in Android. ERROR in LogCat :- " Response =====> org.xml.sax.InputSource@43b8e230 " I got to know that I need to convert the response in String may be by toString() Method, but the problem is I don't know how to do that as I ...