parsing

Best Lightweight HTML Parser for Delphi

I need to parse out the values from some data from select boxes. Example: <option value="1">Apple</option><option value="2">Chicken</option> Usage: If option = apple then get value. Any suggestions? ...

Parsing String to Time and insert in mysqldatabase

Goal: Parse a string from an input type text into TIME type to be inserted in MYSQL Database. String start= request.getParameter("startp"); System.out.println("start:" +start); SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); long ms=0; try { ms = sdf.parse(start).getTime(); System.out.println(" the value of ms is:" +m...

Parse URL from plain text

How can I parse URLs from any give plain text (not limited to href attributes in tags)? Any code examples in Python will be appreciated. ...

JavaCC: How can I specify which token(s) are expected in certain context?

Hello, everyone! I need to make JavaCC aware of a context (current parent token), and depending on that context, expect different token(s) to occur. Consider the following pseudo-code: TOKEN <abc> { "abc*" } // recognizes "abc", "abcd", "abcde", ... TOKEN <abcd> { "abcd*" } // recognizes "abcd", "abcde", "abcdef", ... TOKEN <element1...

PHP DomDocument class unable access domnode

Hi. I dont parse this url: http://foldmunka.net $ch = curl_init("http://foldmunka.net"); //curl_setopt($ch, CURLOPT_NOBODY, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); //not necessary unless the file redirects (like the PHP example we'r...

Exception: "Invalid action number found in internal parse table." Polyglot Exception

I am using an Compiler called Polyglot which is a highly extendable compiler for Java. I seem to have run into this Exception while trying to compile some test code: "Invalid action number found in internal parse table." How can I make a valid action number for the parse table? EDIT: I solved the problem by just fixing my gram...

Parsing a String into date with pattern:"dd/MM/yyyy"

Hi, I want to insert a date having this format MM/dd/YYYY for example:04/29/2010 to 29/04/2010 to be inserted into mysql database in a field typed Date. So i have this code: String dateimput=request.getParameter("datepicker"); DateFormat df = new SimpleDateFormat("dd/MM/yyyy"); Date dt = null; try { dt = df.parse(dateimput); ...

NSObject release destroys local copy of object's data

I know this is something stupid on my part but I don't get what's happening. I create an object that fetches data & puts it into an array in a specific format, since it fetches asynchronously (has to download & parse data) I put a delegate method into the object that needs the data so that the data fetching object copies it's formatted a...

Parsing a string to date gives 01/01/0001 00:00:00

String dateimput=request.getParameter("datepicker"); System.out.printl("datepicker:" +dateimput); DateFormat df = new SimpleDateFormat("MM/dd/yyyy"); Date dt = null; try { dt = df.parse(dateimput); System.out.println("date imput is:" +dt); } catch (ParseException e) { e.printStackTrace()...

Haskell Parsec items numeration

I'm using Text.ParserCombinators.Parsec and Text.XHtml to parse an input like this: - First type A\n -- First type B\n - Second type A\n -- First type B\n --Second type B\n And my output should be: <h1>1 First type A\n</h1> <h2>1.1 First type B\n</h2> <h1>2 Second type A\n</h2> <h2>2.1 First type B\n</h2> <h2>2.2 Second ty...

insert a date in mysql database

I use a jquery datepicker then i read it in my servlet like that: String dateimput=request.getParameter("datepicker");//1 then parse it like that: System.out.println("datepicker:" +dateimput); DateFormat df = new SimpleDateFormat("MM/dd/yyyy"); java.util.Date dt = null; try { dt = df.parse(datei...

Generic type parameters using out

Im trying to make a universal parser using generic type parameters, but i can't grasp the concept 100% private bool TryParse<T>(XElement element, string attributeName, out T value) where T : struct { if (element.Attribute(attributeName) != null && !string.IsNullOrEmpty(element.Attribute(attributeName).Value)) { ...

Problem Fetching JSON Result with jQuery in Firefox and Chrome (IE8 Works)

I'm attempting to parse JSON using jQuery and I'm running into issues. Using the code below, the data keeps coming back null: <!DOCTYPE html> <html> <head> <title>JSON Test</title> </head> <body> <div id="msg"></div> <script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt; <script> $.ajax({ ...

The String source is unknown while using the parse methode!

Hi everyone, to parse a string to a date sql valid: SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); java.util.Date date = null; try { date = df.parse(dateimput); } catch (ParseException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } with dateimput is what...

Difference between Parsing and Passing?

I know its basic but whenever you give parameters to a method are you 'parsing' them, or are you 'passing' them as 'parsing' is something different?! I've just never been overly sure! Thanks ...

building an XML service parsing library

This is more of a design question I suppose. My company offers a web service to our client that spits data out in a custom xml format. I'd like to build a java library we can offer so our customers can just feed it the url and we will turn it into a set of POJOs built from the response. I can obviously just create a library that will d...

Objective-C Implementation Pointers

Hi, I am currently writing an XML parser that parses a lot of data, with a lot of different nodes (the XML isn't designed by me, and I have no control over the content...) Anyway, it currently takes an unacceptably long time to download and read in (about 13 seconds) and so I'm looking for ways to increase the efficiency of the read. ...

Issue in parsing the GridViewRows in a Telerik RadGridView

Hi, I would like to do something similar what we do in ASP.NET where we parse through all the rows in a GridView and assign a particular value to a particular cell in a row which has a matching TaskId as the current Id. This has to happen in a Tick function of a Dispatcher Timer object. Since I have a Start Timer button Column for ever...

Is there a better tool than postcat for viewing postfix mail queue files?

So I got a call early this morning about a client needing to see what email they have waiting to be delivered sitting in our secondary mail server. Their link for the main server had (still is) been down for two days and they needed to see their email. So I wrote up a quick Perl script to use mailq in combination with postcat to dump e...

Parse GoogleMarker Coordinates i.e Lat and Long

Hey I am I receiving a string values as such "(53.32000501118541, -6.223390102386475)" How can I parse this string to seperate the 2 values and remove the "(" and ")" Cheers ...