parsing

Date.TryParseExact - What is the provider parameter used for?

The method signature for Date.TryParse is: Public Shared Function TryParseExact ( _ s As String, _ format As String, _ provider As IFormatProvider, _ style As DateTimeStyles, _ <OutAttribute> ByRef result As DateTime _ ) As Boolean I understand what format does, but what is the provider parameter for? I understand ...

Strip signatures and replies from emails

I'm currently working on a system that allows users to reply to notification emails that are sent out (sigh). I need to strip out the replies and signatures, so that I'm left with the actual content of the reply, without all the noise. Does anyone have any suggestions about the best way to do this? ...

Spliting child node from XML file into their own XML files

I have an XML file below and I want to create multiple files: <ParentNode> file1: <ChildNode> <ParentNode> <node></node> <ChildNode> </childNode> <node></node> <ChildNod...

XML parsing in Python

I'd like to parse a simple, small XML file using python however work on pyXML seems to have ceased. I'd like to use python 2.6 if possible. Can anyone recommend an XML parser that will work with 2.6? Thanks ...

Parsing XML Data with LINQ

I am new to LINQ and there is an urgent need to finish this project quickly. I need to return the id with the correct price information for todays date for each MPrice. Any advice is well appreciated! Here is an example of the XML: <Pricing> <MPrice> <Id>0079</Id> <Price> <Price>31.25</Price> <StartDt>2009-8...

dynamic keyword, c# compilation service - how to run code that is not yet available at compile time?

I'm writing a small visualization tool in wpf, the idea is that average users can create interesting visualizations without being programming wizards. I have a controller class that has methods like StartPath(double x, double y) and LineTo(x,y) CurveTo(...) etc. The idea is that a user can type these commands into a textbox and have it...

VBA to read hierarchical ini-like files/what are these files?

Hello, I am trying to find an efficient way to read through a report file generated by a machine where I work. I was reading this page about using the Windows API to read and write .ini files from VBA. I was hoping to use a similar approach on a different type of file, but I don't really know what this file is. It is a text report fil...

PHP parsing on includes

I'm including a file init.php which defines path constants. So if I include init.php in a file (index.php) and then in another file (layout/header.php)... is init.php parsed before being added to these files or is it added to the parent file and then the parent file is parsed as a whole? EDIT: Why this is important is because init.php d...

PHP: Defining relative paths compatible with HTML Tags

Consider the following directory structure: ROOT ------ images ............... logo.png ------ includes ............... vars.php ------ layout ............... content.php ------ index.php How do I define a path constant for logo.png in vars.php that is accessible in both index.php and content.php? Should be compatible with HTML Tags ...

PyParsing simple language expressions

I'm trying to write something that will parse some code. I'm able to successfully parse foo(spam) and spam+eggs, but foo(spam+eggs) (recursive descent? my terminology from compilers is a bit rusty) fails. I have the following code: from pyparsing_py3 import * myVal = Word(alphas+nums+'_') myFunction = myVal + '(' + delimitedList( ...

PHP Parsing Case Sensitivity

I'm parsing a file that is set up like so: <blah-name name="Turkey"> <blah-city name="Test"/> <CAPS> <type type="5"> <type-two type="6"> </CAPS> At the top of my file, I create $xmlobj, like so: $xmlobj = simplexml_load_file("TEST.XML"); I'm then inserting the values into a table by creating a class that takes all of these as p...

xml parsing in iPhone-sdk 3.0

// ResxmlParser is globally declared as NSXMLParser -(void)parsingXML:(NSString *)resXml { NSData *xmlNsData =[resXml dataUsingEncoding:NSASCIIStringEncoding]; ResxmlParser = [[NSXMLParser alloc] initWithData:xmlNsData ]; [ResxmlParser setDelegate: self]; [ResxmlParser setShouldResolveExternalEntities: YES]; [ResxmlParser parse] ...

Server-side JavaScript cleanup or sandbox?

I am looking at allowing users to enter JavaScript to specify some logic in my app. The JavaScript would be entered and displayed in a browser, but it would be saved and validated server-side first. This opens up obvious security implications. Ideally, I would want to only allow a subset of the JavaScript language. Intuitively, an op...

Implementing a XML translator using XML's EBNF

I'm contemplating the idea of implementing a XML translator using a compiler generator, based on the W3C's XML 1.1 spec, which includes a complete EBNF grammar. More precisely, I plan to use Qi-YACC because I want to learn this tool. It will be my first foray into using any compiler-compiler. The first kind of translation I'm planning ...

Simplest way to correctly load html from web page into a string in Java

Just what the title says. Help greatly appreciated! ...

evaluating/parsing javascript from a programatically downloaded webpage

I was wondering if there was some type of library (preferably for .NET) that allows a web page downloaded (for instance, using HttpWebResponse) that can evaluate javascript variables and evaluate and parse javascript procedures. ...

Parsing text in C

I have a file like this: ... words 13 more words 21 even more words 4 ... (General format is a string of non-digits, then a space, then any number of digits and a newline) and I'd like to parse every line, putting the words into one field of the structure, and the number into the other. Right now I am using an ugly hack of reading th...

Code Golf: Mathematical expression evaluator (full PEMDAS)

I challenge you to write a mathematical expression evaluator that respects PEMDAS (order of operations: parentheses, exponentiation, multiplication, division, addition, subtraction) without using regular expressions, a pre-existing "Eval()"-like function, a parsing library, etc. I saw one pre-existing evaluator challenge on SO (here), b...

parsing a XML file in java

I have wrote a SAX parser. It works fine when the attibute values are nested in double quotes. But if i dont use quote it throws a exception. I want my parser to parse the XML file whose attributes values are not inside quotes. I want to parse following type of file: <root> <tag1 attribute1=value1 > my data </tag1> </root> Note t...

parsing and editing html in php

Can anybody tell me how to parse and edit HTML in PHP? ...