I Have a question about finding html tags using Java and Regex.
I am using the code below to find all the tags in HTML, documentURL is obviously the HTML content.
The find method return true, meaning that it can find something in the HTML but the matches() method always return false and I am completly and utterly puzzled about this.
I...
Hi, I'm writing a little project which interacts with a set of servers using HTTP 1.1 GET and POST. The server gives me the response after some header lines, so I though on using strtok() function using \n as the delimiter but there is a crash whenever I try to do so.
Is there any simple way to parse a HTTP response in C? I would like n...
I have the following file like this:
2 qid:1 1:0.32 2:0.50 3:0.78 4:0.02 10:0.90
5 qid:2 2:0.22 5:0.34 6:0.87 10:0.56 12:0.32 19:0.24 20:0.55
...
he structure is follwoing like that:
output={}
rel=2
qid=1
features={} # the feature list "1:0.32 2:0.50 3:0.78 4:0.02 10:0.90" output.append([rel,qid,features])
...
How can I write my ...
I have a paragraph of text below that I want to use an input source. And I want the doSpin() function to take the stream of text and pick one value at random, from each [%group of replacement candidates%].
This [%should|ought|would|could%] make
it much [%more
convenient|faster|easier%] and help
reduce duplicate content.
So th...
Why doesn't php support this syntax:
$s = explode('-', 'foo-bar')[0];
?
...
In the following XML:
<myxml>
<photos>
<photo url="1.jpg"/>
<photo url="2.jpg"/>
<photo url="3.jpg"/>
<photo url="4.jpg"/>
</photos>
</myxml>
How do I use e4x to extract the urls and push them in an array with the least possible code?
...
Hi, i need some help please,
i want to show an image on my Page depending of the first directory of the URL.
Example:
In Any of this URLs will show the image1.jpg
www.mysite.com/audio/amplifiers/400wats.html
www.mysite.com/audio/
www.mysite.com/audio/amplifiers/
In any of this others will show the image2.jpg
www.mysite.com/video...
I have an XML file full of bookmarks from Google Bookmarks. (File: http://gist.github.com/324844) I want to pull the bookmark based on this path: xml_api_reply->bookmarks-bookmark->labels->label.
So, my question is How can I use SimpleXML to grab the bookmarks that have the label Inspiration? Some bookmarks may have more than one bookm...
How can one insert a Unicode string CSS into CleverCSS?
In particular, how could one produce the following CSS using CleverCSS:
li:after {
content: "\00BB \0020";
}
I've figured out CleverCSS's parsing rules, but suffice that the permutations I've thought sensible have failed, for example:
li:
content: "\\00BB \\0020" // beco...
I am new to iphone development.I want to retrieve a particular data from a HTML page (Data inside a particular tag like This is title).I have the link of the web page.How should i use xpathQuery to retrieve "This is title" inside the tags.Please help me out.Thanks.
...
I see questions every day asking how to parse or extract something from some HTML string and the first answer/comment is always "Don't use RegEx to parse HTML, lest you feel the wrath!" (that last part is sometimes omitted).
This is rather confusing for me, I always thought that in general, the best way to parse any complicated string i...
I can't comprehend how it works without using eval - what's the secret behind this?
Edit: Could someone present a trivial example of how the tree structure is converted to an object?
...
Hello,
I want to make a generic string to numeric converter, and provide it as a string extension, so I wrote the following code:
public static bool TryParse<T>( this string text, out T result, IFormatProvider formatProvider ) where T : struct
try
{
result = (T)Convert.ChangeType( text, typeof( T ), formatProvider );
return true;...
We want to design a simple domain specific language for writing test scripts to automatically test a XML-based interface of one of our applications. A sample test would be:
Get an input XML file from network shared folder or subversion repository
Import the XML file using the interface
Check if the import result message was successfull...
The following code throws System.UriFormatException:
var uri = new UriBuilder("ftp://user:pass#[email protected]:21/fu/bar.zip");
System.UriFormatException: Invalid URI: A port was expected because of there is a colon (':') present but the port could not be parsed.
Removing the # symbol from the password field solves the issue.
...
I'm developing a script using the ruby Treetop library and having issues working with its syntax for regex's. First off, many regular expressions that work in other settings dont work the same in treetop.
This is my grammar: (myline.treetop)
grammar MyLine
rule line
string whitespace condition
end
rule string
...
I pass in the following XML to XMLin:
<root foo="bar" foo2="bar2">
<pizzas>
<pizza>Pepperoni</pizza>
</pizzas>
</root>
I then edit part of the root element via hash array. I don't care about the pizza, but I do need that XML to come back out exactly as it was. However, I get the following from XMLout:
<root foo="bar" foo2="bar2">
<...
Hallo.
I am writing a tier2 ordering software for network usage. So we have client and server.
On the client I create Objects of TBest in which the Product ID, the amount and the user who orders it are saved. (So this is a item of an Order).
An order can have multiple items and those are saved in an array to later send the created ord...
I am trying to parse some data to no success. Can anyone recommend a good introduction with a lot of examples to Recursive Descent Parsing? I haven't been able to find any.
...
I have a simple XAML page that load fine when it is loaded as part of any application within Visual Studio. However, when I deploy this application using ClickOnce, I get the following exception:
Type : System.Windows.Markup.XamlParseException, PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
...