hi
I want to extract from a webpage all URLs how can I do that with nokogiri?
example:
<div class="heat">
<a href='http://example.org/site/1/'>site 1</a>
<a href='http://example.org/site/2/'>site 2</a>
<a href='http://example.org/site/3/'>site 3</a>
</diV>
result should be an list:
l = ['http://example.org/site/1...
I'm working on a project for my company that uses a socket server (php) to gather data from a remote device. How can I make this perl program run directly on the stream instead of first having the server write to a tmp file then running this script on that file then writing out a csv file for insertion into a database?
I thought about ...
Hello,
By text formatting I meant something more complicated.
At first I began manually adding the 5000 lines from the text file I'm asking this question for,into my project.
The text file has 5000 lines with different length.For example:
1 1 ITEM_ETC_GOLD_01 골드(소) xxx xxx xxx_TT_DESC 0 0 3 3 5 0 180000 3 0 1 0 0 255 1 1 0 0 0 0 0 ...
How do you take paragraph or large amount of text and break it into sentences (perferably using Ruby) taking into account cases such as Mr. and Dr. and U.S.A? (Assuming you just put the sentences into an array of arrays)
UPDATE:
One possible solution I thought of involves using a parts-of-speech tagger (POST) and a classifier to determ...
Hello,
I have a txt file like :
test.txt
Symbols from __ctype_tab.o:
Name Value Class Type Size Line Section
__ctype |00000000| D | OBJECT|00000004| |.data
__ctype_tab |00000000| r | OBJECT|00000101| |.rodata
Symbols from _ashldi3.o:
N...
I’m trying to parse an XML file having ‘n’ number of questions using Objective C. I have to display those questions in labels at runtime in a view. That means ‘n’ labels for ‘n’ questions and ‘n’ labels for ‘n’ answers too. Does anyone have any suggestions about how to do this?
...
I'd hate to reinvent something that was already written, so I'm wondering if there is a ReadWord() function somewhere in the .NET Framework that extracts words based some text delimited by white space and line breaks.
If not, do you have a implementation that you'd like to share?
string data = "Four score and seven years ago";
List<st...
Hi,
I was recently asked this question in an interview:
"How could you parse a string of the form '12345' into its integer representation 12345 without using any library functions, and regardless of language?"
I thought of two answers, but the interviewer said there was a third. Here are my two solutions:
Solution 1: Keep a dictiona...
In my application, I alter some part of XML files, which begin like this:
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: version control yadda-yadda $ -->
<myElement>
...
Note the blank line before <myElement>. After loading, altering and saving, the result is far from pleasing:
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: ver...
Are there any stream-reading, parsing libraries available for json or xml formats in AS3? I'm setting up a long-polling application, using URLStream/URLRequest. I do not have control over the data I'm receiving other than a choice between formats. I'd like to have a parser that can handle fragments at a time, which would allow me to t...
I am looking for a command line parser for Qt4.
I did a small google search, and found this: http://www.froglogic.com/pg?id=PublicationsFreeware&category=getopt however it lacks support for "--enable-foo" and "--disable-foo" switches. Besides that, it looks like a real winner.
EDIT:
It seems Frologic removed this. So the best opt...
I am writing a search engine (why not hey?) and need to handle navigating relative urls such as "../about.aspx", "/about.aspx" "about.aspx" etc
Is there anything out there or in the .Net Library's which can convert these to absolute addresses?
...
Hello,
I'm building a very simple Java parser, to look for some specific usage models. This is in no way lex/yacc or any other form of interpreter/compiler for puposes of running the code.
When I encounter a word or a set of two words separated by a dot ("word.word"), I would like to know if that's a standard Java class (and method), ...
I'm trying to get the php executable to parse scripts, but it's not working. i run something like this:
php c:\test.php
and test.php contains this:
<?
echo 'hello!';
?>
and that is exactly what running the command returns. It returns the raw code. How can I get it to actually parse the code and return "hello!" instead?
...
Hi,
I would like a utility which I can give a piece of text (in a text box) and experiment with a parser grammar (through editing a BNF of similar) and token structure while I can see how the parse tree would look (and if it's not able to parse the text using my current grammar, I would see where it halted).
The key word is interactivi...
Somewhat related to this question, but in the absence of any answer about QuickBooks specifically, does anyone knows of an address parser for Java. Something that can take unstructured address information and parse out the address line 1, 2 and city state postal code and country?
...
I'm trying to find the best way of parsing the response from a "normal" (i.e. not using the API) Google Maps page in my java code.
Reason: I want to submit a query string requesting a listing (be it hotels, restaurants etc.) and then parse the JSON that comes back. I had looked into using the Google Maps API, but it doesn't seem to cov...
I'm parsing a binary file format. It encodes an integer using four bytes in a way that will naturally fit within c#'s uint type.
What is the most C#/idiomatic way to implement this function:
uint ReadUint(byte[] buffer);
Assume the buffer contains 4 elements. A complete answer might consider some of the common byte orderings caused b...
Anyone know of an easy way to parse a Lua datastructure in C# or with any .Net library? This would be similar to JSON decoding, except for Lua instead of javascript.
At this point it looks like I'll need to write my own, but hoping there's something already out there.
...
How can I find extended ASCII characters in a file using Perl? Can anyone get the script?
.....thanks in advance.....
...