I am storing object values in strings e.g.,
string[] values = new string[] { "213.4", "10", "hello", "MyValue"};
is there any way to generically initialize the appropriate object types? e.g., something like
double foo1 = AwesomeFunction(values[0]);
int foo2 = AwesomeFunction(values[1]);
string foo3 = AwesomeFunction(values[2]);
MyEnu...
Hi all
I am parsing my xml with libxml ,my code is as follows
-(void) grabRSSFeed:(NSString *)blogAddress {
// Initialize the blogEntries MutableArray that we declared in the header
blogEntries = [[NSMutableArray alloc] init];
// Convert the supplied URL string into a usable URL object
NSURL *url = [NSURL URLWithString: blogAddr...
How does Google find relevant content when its parsing the web?
Lets say for instance, Google uses the PHP native DOM Library to parse content, What methods would they be for it to find the most relevant content on a web page.
My thoughts would be that it would search for all paragraphs, order by the length of each paragraph and then f...
I have to extract this particular HTML using PHP. Since I haven't any class or unique ID I tried to use his bgcolor attrib but without success...
<td bgcolor="#F5EC97" width="154" valign="top" align="left" height="55">
<font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#CC6633">CITY</font></b><br>...
I'm looking for suggestions as to the best way to parse the following calendar... http://www.ucd.ie/events/calendar . I can't detect any well known framework being used nor can I find it in RSS/XML/JSON format.
The only possible way to parse the following that I see is to parse the raw HTML which is far from ideal especially since many...
I would need to parse some data that i get from JSON query. I get the data with
$.getJSON(JSONquery, function(data){
$.each(data, function(i,item){
$('#output....
});
The data I get from it something like this (sorry its messy and longish):
[{"name":"139930 blablabla","id":599,"contentobject_id":599,"main_node_id":565,"modified":...
I'm working on an Android application that tracks time durations of tasks. Internally, it saves these durations as a float representing how many hours were spent on the task. So 30 minutes would be 0.5, 1 hour would be 1, etc. I've got all that code working great, along with code to convert these into hh:mm format for easier reading.
...
Hi, I am working on a project which contains two servers, one is written in python, the other in C. To maximize the capacity of the servers, we defined a binary proprietary protocol by which these two could talk to each other.
The protocol is defined in a C header file in the form of C struct. Usually, I would use VIM to do some subst...
Hi,
I need a xml parser to parse a file that is approximately 1.8 gb.
So the parser should not load all the file to memory.
Any suggestions?
...
I'm going to manage some documentation using Django (I come from Sphinx) in order to have more control on the output. The docs are in rst (restructured text) in a git archive, and it's trivial to display them in HTML using a filter. My problem is that they are quite long, and I'd like to have more control on how the pagination goes, so I...
The goal is to get a byte[16] where the first element is hex value 55 and the second element is hex value AA. And the other 14 are hex value 0.
I tried
byte[] outStream = System.Text.Encoding.UTF8.GetBytes("55 AA 00 00 00 00 00 00 00 00 00 00 00 00 00 00");
but this fills the byte[] with the ascii values, not the hex values.
I tri...
I have a product-based website and I'd like to expand the number of file formats/layouts that we accept for inventory uploads. Ideally that would be done using some existing implementation that supports various file formats and assists in validating and allowing user corrections to the uploaded data.
Anything giant and "servery" like Bi...
I am looking for simple way to split parenthesized lists that come out of IMAP responses into Python lists or tuples. I want to go from
'(BODYSTRUCTURE ("text" "plain" ("charset" "ISO-8859-1") NIL NIL "quoted-printable" 1207 50 NIL NIL NIL NIL))'
to
(BODYSTRUCTURE, ("text", "plain", ("charset", "ISO-8859-1"), None, None, "quoted-prin...
I got a problem when I parse a complex file which include thousands of lines.
I already implemented my Perl script like this days ago.
my ($head, $tail) = split /=/, $line;
Nearly all my source file $line style as below:
constant normalLines = <type value> /* hello world */
and I can get the output $tail = /* hello world ...
hi..
i am doing a project on SOFWARE PLAGIARISM DETECTION..i am intended to do it with language C..for that i am supposed to create a token generator, and a parser..but i dont know where to start..any one can help me out with this..
i created a database of tokens and i separated the tokens from my program.Next thing i wanna do is to...
How can I put javascript code inside if block.
@{
#if DEBUG
$("#User").val("JDoe");
$("#Password").val("secrect");
#endif
}
When I try above code I get this compiler error:
Compiler Error Message: CS1056: Unexpected character '$'
And if I change $ to jQuery:
Compiler Error Message: CS0103: The name 'jQuery' does no...
Hey,
Basically I've wrote my own parser and I'm parsing a string into and expression and then compiling and storing to be reused later on.
For (an odd) example the type of string I'm parsing is this:-
if #name == 'max' and #legs > 5 and #ears > 5 then shoot()
The hash parts in the string are telling my parser to look at the properti...
I would need to parse this:
<?xml version="1.0" encoding="utf-8"?>
<blamatrixrix>
<name></name>
<columns number="2">
<column id="title" num="0">Title</column>
<column id="content" num="1">Content</column>
</columns>
<rows number="7"></rows>
<b>Description</c>
<bDescription text here</b>
<b>Some title 1</b>
<b>Some text blabla for Some...
Hi,
I have a text, in which only <b> and </b> has been used.for example<b>abcd efg-123</b> . Can can I extract the string between these tags? also I need to extract 3 words before and after this chunk of <b>abcd efg-123</b> string.
How can I do that? what would be the suitable regular expression for this?
...
I have two scripts in which I'm experimenting with CSV_XS. In the first, I hard-coded everything: source directory, filename, and the csv delimiter I wanted to look for. The script works great. In the second, however, I try to dynamically discover as much as possible. That script seems to run, but it outputs nothing.
I'm having trouble...