Search Results

Search found 21350 results on 854 pages for 'url parsing'.

Page 89/854 | < Previous Page | 85 86 87 88 89 90 91 92 93 94 95 96  | Next Page >

  • Parsing string, with Boost Spirit 2, to fill data in user defined struct

    - by Surya
    I'm using Boost.Spirit which was distributed with Boost-1.42.0 with VS2005. My problem is like this. I've this string which was delimted with commas. The first 3 fields of it are strings and rest are numbers. like this. String1,String2,String3,12.0,12.1,13.0,13.1,12.4 My rule is like this qi::rule<string::iterator, qi::skip_type> stringrule = *(char_ - ',') qi::rule<string::iterator, qi::skip_type> myrule= repeat(3)[*(char_ - ',') >> ','] >> (double_ % ',') ; I'm trying to store the data in a structure like this. struct MyStruct { vector<string> stringVector ; vector<double> doubleVector ; } ; MyStruct var ; I've wrapped it in BOOST_FUSION_ADAPT_STRUCTURE to use it with spirit. BOOST_FUSION_ADAPT_STRUCT (MyStruct, (vector<string>, stringVector) (vector<double>, doubleVector)) My parse function parses the line and returns true and after qi::phrase_parse (iterBegin, iterEnd, myrule, boost::spirit::ascii::space, var) ; I'm expecting var.stringVector and var.doubleVector are properly filled. but it is not the case. What is going wrong ? Thanks in advance, Surya

    Read the article

  • Parsing XML using xml.etree.cElementTree

    - by Andre
    I have the following XML in a string named 'xml': <?xml version="1.0" encoding="ISO-8859-1"?> <Book> <Page> <Text>Blah</Text> </Page> </Book> I'm trying to get the value Blah out of it but I'm having trouble with xml.etree.cElementTree. I've tried the find() and findtext() methods but nothing. Eventually I did this: import xml.etree.cElementTree as ET ... root = ET.fromstring(xml) element = root.getchildren()[0].getchildren()[0] Element now equals the element, which is what I want (for this solution anyway), but how do I get the inner text from it? element.text does not work. Any ideas? PS: I am using Python 2.5 atm. As an extra question: what is a better way to parse xml strings in python?

    Read the article

  • yaml-cpp parsing strings

    - by Jason
    Am i missing some thing or isnt it possible to parse YAML formatted strings with yaml-cpp? at least there isnt a YAML::Parser::Parser(std::string&) constructor. i get a yaml-string via libcurl from a http-server.

    Read the article

  • FasterCSV Parsing issue?

    - by Schroedinger
    G'day guys, I'm currently using fastercsv to construct ActiveRecord elements and I can't for the life of me see this bug (tired), but for some reason when it creates, if in the rake file i output the column I want to save as the element value, it puts out correctly, as either a Trade or a Quote but when I try to save it into the activerecord, it won't work. FasterCSV.foreach("input.csv", :headers => true) do |row| d = DateTime.parse(row[1]+" "+row[2]) offset = Rational(row[3].to_i,24) o = d.new_offset(offset) t = Trade.create( :name => row[0], :type => row[4], :time => o, :price => row[6].to_f, :volume => row[7].to_i, :bidprice => row[10].to_f, :bidsize => row[11].to_i, :askprice => row[14].to_f, :asksize => row[15].to_i ) end Ideas? Name and Type are both strings, every other value works except for type. Have I missed something really simple?

    Read the article

  • Extracting and Parsing data with soapUI

    - by James G
    Hi. So I am in need to learn how to use soapUI pretty quick. I'm finding it pretty tedious to start so I was hoping I might be able to get some help here. Here's what I need to do. Lets say we have Company A and Company B which is a subset of Company B. Now Company A offers a webservice accessible by Company B such that Company B can gather daily aggregated data from Company A's database. Now Company B wants to take this data and publish it on their website. What I'd like is a very basic overview of what I need to do to extract and parse the data onto a website. Just the outline of the process so I can get started. What languages should I be using at what stages and what not. Any help would be highly appreciated.

    Read the article

  • Parsing unicode XML with Python SAX on App Engine

    - by Derek Dahmer
    I'm using xml.sax with unicode strings of XML as input, originally entered in from a web form. On my local machine (python 2.5, using the default xmlreader expat, running through app engine), it works fine. However, the exact same code and input strings on production app engine servers fail with "not well-formed". For example, it happens with the code below: from xml import sax class MyHandler(sax.ContentHandler): pass handler = MyHandler() # Both of these unicode strings return 'not well-formed' # on app engine, but work locally xml.parseString(u"<a>b</a>",handler) xml.parseString(u"<!DOCTYPE a[<!ELEMENT a (#PCDATA)> ]><a>b</a>",handler) # Both of these work, but output unicode xml.parseString("<a>b</a>",handler) xml.parseString("<!DOCTYPE a[<!ELEMENT a (#PCDATA)> ]><a>b</a>",handler) resulting in the error: File "<string>", line 1, in <module> File "/base/python_dist/lib/python2.5/xml/sax/__init__.py", line 49, in parseString parser.parse(inpsrc) File "/base/python_dist/lib/python2.5/xml/sax/expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "/base/python_dist/lib/python2.5/xml/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/base/python_dist/lib/python2.5/xml/sax/expatreader.py", line 211, in feed self._err_handler.fatalError(exc) File "/base/python_dist/lib/python2.5/xml/sax/handler.py", line 38, in fatalError raise exception SAXParseException: <unknown>:1:1: not well-formed (invalid token) Any reason why app engine's parser, which also uses python2.5 and expat, would fail when inputting unicode?

    Read the article

  • String parsing help

    - by Click Upvote
    I have a string like the following: $string = " <paragraph>apples are red...</paragraph> <paragraph>john is a boy..</paragraph> <paragraph>this is dummy text......</paragraph> "; I would like to split this string into an array contanining the text found between the <paragraph></paragraph> tags. E.g something like this: $string = " <paragraph>apples are red...</paragraph> <paragraph>john is a boy..</paragraph> <paragraph>this is dummy text......</paragraph> "; $paragraphs = splitParagraphs($string); /* $paragraphs now contains: $paragraphs[0] = apples are red... $paragraphs[1] = john is a boy... $paragraphs[1] = this is dummy text... */ Any ideas? P.S it should be case insensitive, <paragraph>, <PARAGRAPH>, <Paragraph> should all be treated the same way.

    Read the article

  • NULL value when using NSDateFormatter after setting NSDate property via XML parsing

    - by David A Gibson
    Hello, I am using the following code to try and display in a time in a table cell. TimeSlot *timeSlot = [timeSlots objectAtIndex:indexPath.row]; NSDateFormatter *timeFormat = [[NSDateFormatter alloc] init]; [timeFormat setDateFormat:@"HH:mm:ss"]; NSLog(@"Time: %@", timeSlot.time); NSDate *mydate = timeSlot.time; NSLog(@"Time: %@", mydate); NSString *theTime = [timeFormat stringFromDate:mydate]; NSLog(@"Time: %@", theTime); The log output is this: 2010-04-14 10:23:54.626 MyApp[1080:207] Time: 2010-04-14T10:23:54 2010-04-14 10:23:54.627 MyApp[1080:207] Time: 2010-04-14T10:23:54 2010-04-14 10:23:54.627 MyApp[1080:207] Time: (null) I am new to developing for the iPhone and as it all compiles with no errors or warnings I am at a loss as to why I am getting NULL in the log. Is there anything wrong with this code? Thanks Further Info I used the code exactly from your answer lugte098 just to check and I was getting dates which leads me to believe that my TimeSlot class can't have a date correctly set in it's NSDate property. So my question becomes - how from XML do I set a NSDate property? I have this code (abbreviated): -(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *) string { if ([currentElement isEqualToString:@"Time"]) { currentTimeSlot.time = string } } Thanks

    Read the article

  • How to parse text fragments located after tag by simplehtmldom?

    - by moogeek
    Hello! I'm using simplehtmldom to parse html and i'm stuck in parsing plaintext that is located outside of any tag (but between two different tags): <div class="text_small"> <b>?dress:</b> 7 Hange Road<br> <b>Phone:</b> 415641587484<br> <b>Contact:</b> Alex<br> <b>Meeting Time:</b> 12:00-13:00<br> </div> Is it possible to get this values of Adress, Phone, Contact, Meeting Time? I wonder if there is a opportunity to pass CSS Selectors into nextSibling/nextSibling functions...

    Read the article

  • Static error page served by nginx when my application is down

    - by dreeves
    If my (Rails) application is down or undergoing database maintenance or whatever, I'd like to specify at the nginx level to server a static page. So every URL like http://example.com/* should server a static html file, like /var/www/example/foo.html. Trying to specify that in my nginx config is giving me fits and infinite loops and whatnot. I'm trying things like location / { root /var/www/example; index foo.html; rewrite ^/.+$ foo.html; } How would you get every URL on your domain to serve a single static file?

    Read the article

  • Unusual request URL in ASP.NET health monitoring event

    - by Troy Hunt
    I’m seeing a rather strange occurrence in the request information section of an ASP.NET health monitoring email I hope someone can shed some light on. This is a publicly facing website which runs on infrastructure at an Indian hosting provider. Health monitoring is notifying us of server errors via automated email but every now and then the requested URL appears as a totally different website. For example: Request information: Request URL: http://www.baidu.com/Default.aspx Request path: /Default.aspx User host address: 221.13.128.175 User: Is authenticated: False Authentication Type: Thread account name: NT AUTHORITY\NETWORK SERVICE Obviously the site in question is not Baidu and obviously this attribute is not the referrer either; the “Request URL” value is the path which has generated the error. The IP address is located in Beijing (coincidental given the Baidu address?) and in this instance it looks like the SQL server backend was not accessible (I haven't included the entire error message for security's sake). What would cause the request URL attribute to be arbitrarily changed to that of another site? I’ve never seen this occur in a health monitoring event before. Thanks!

    Read the article

  • Parsing plain Win32 PE File (Exe/DLL) in C#.NET

    - by Usman
    Hello, I need to parse plain Win32 DLL/Exe and need to get all imports and exports from it and to show it on console or GUI(say Win Forms). Is it possible to parse Win32 DLL/Exe in C#.NET, read its export table,import table and get managed types from it. As its unmanaged PE(.NET doesn't allows you to convert unmanaged PE files to managed .NET assemblies, only it generates COM managed assemblies). So how to parse export and import tables of PE files and take all methods(signatures from it) in managed form.(e.g if char* as argument, it should display as IntPtr) Regards Usman

    Read the article

  • Parsing an RFC822-Datetime in .NETMF 4.0

    - by chris12892
    I have an application written in .NETMF that requires that I be able to parse an RFC822-Datetime. Normally, this would be easy, but NETMF does not have a DateTime.parse() method, nor does it have some sort of a pattern matching implementation, so I'm pretty much stuck. Any ideas? EDIT: "Intelligent" solutions are probably needed. Part of the reason this is difficult is that the datetime in question has a tendency to have extra spaces in it (but only sometimes). A simple substring solution might work one day, but fail the next when the datetime has an extra space somewhere between the parts. I do not have control over the datetime, it is from the NOAA.

    Read the article

  • parsing html pages from tcl

    - by mithunmo
    Hello , I using tdom version 0.8.2 to parse html pages. From the help pages I found the following commands to get the ElementById TCL code set html {<html> <head> </head> <body> <div id="m"> </div> </body> </html> } package require tdom set doc [ dom parse -html $html ] set node [ $doc getElementById m] But when I execute the second set command I get a empty string . But cleary the tag has an id of m . Can someone tell where am I going wrong ? Regards, Mithun

    Read the article

  • ASP.NET MVC - creating and handling with URLs with Greater Than and Less Than characters

    - by pcampbell
    Consider a link to a page for a user's profile. A page is creating that URL like this: //Model.Name has value "<bad guy>" Html.ActionLink("foo, "ViewUser", new { id=5, title=Url.Encode(Model.Name) }) The actual outcome was http://mysite/Users/5/%253cbad%2guy%253e When navigating to that URL, the server generates a HTTP Error 400 - Bad Request. Question: Given that the Model.Name may contain Unicode characters, or characters otherwise illegal in URLs, what's the best way to strip out illegal characters, or otherwise encode them? The problem surfaces when testing out 'interesting' user inputs with < and >, but anything could come from the user, and therefore be put in a URL by way of Model.Name.

    Read the article

  • Parsing Line Breaks in PHP/JavaScript

    - by Matt G
    I have a text area in my PHP application where users can enter notes in a project. Sometimes this is displayed on the page via PHP and sometimes it is displayed via javascript. The problem is, if the note is across multiple lines (i.e. the user presses enter while entering notes in the text area), it causes the JS to fail. It's fine when it's being done by the PHP. The line of code in question is: var editnotes='<textarea class="desc_text" style="width:20em;" id="notes_editor"><?php print $notes; ?></textarea>'; So, if the note is over multiple lines, the PHP builds the pager as: var editnotes='<textarea class="desc_text" style="width:20em;" id="notes_editor">This is a test note over multiple lines </textarea>'; And this obviously causes problems for the js. So my question is, what can I do to prevent this? As the code is being built by PHP before it even gets to the browser, I'm thinking that the best approach may be to parse it in the PHP so that the output is something more like this: var editnotes='<textarea class="desc_text" style="width:20em;" id="notes_editor">This is<br/>a test note<br/>over multiple lines<br/></textarea>'; Will this work? How would I do it? Thanks

    Read the article

  • Parsing a file with hierarchical structure in Python

    - by Kevin Stargel
    I'm trying to parse the output from a tool into a data structure but I'm having some difficulty getting things right. The file looks like this: Fruits Apple Auxiliary Core Extras Banana Something Coconut Vegetables Eggplant Rutabaga You can see that top-level items are indented by one space, and items beneath that are indented by two spaces for each level. The items are also in alphabetical order. How do I turn the file into a Python list that's something like ["Fruits", "Fruits/Apple", "Fruits/Banana", ..., "Vegetables", "Vegetables/Eggplant", "Vegetables/Rutabaga"]?

    Read the article

  • Parsing SOAP response using libxml in Ruby

    - by abhishektiwari
    I am trying to parse following SOAP response coming from Savon SOAP api <?xml version='1.0' encoding='UTF-8'?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns:getConnectionResponse xmlns:ns="http://webservice.jchem.chemaxon"> <ns:return> &lt;ConnectionHandlerId>connectionHandlerID-283854719&lt;/ConnectionHandlerId> </ns:return> </ns:getConnectionResponse> </soapenv:Body> </soapenv:Envelope> I am trying to use libxml-ruby without any success. Basically I want to extract anything inside tag and the connectionHandlerID value.

    Read the article

  • Parsing SOAP XML in Oracle

    - by user258587
    Hi I am new to Oracle and I am working on something that needs to parse a SOAP request and save the address to DB Tables. I am using the XML parser in Oracle (XMLType) with XPath but am struggling since I can't figure out the way to parse the SOAP request because it has multiple namespaces. Could anyone give me an example? Thanks in advance!!! edit It would be a typical SOAP request similar to the one below. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.service.****.com"> <soapenv:Header /> <soapenv:Body> <soap:UpdateElem> <soap:request> <soap:att1>123456789</soap:att1> <soap:att2 xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> <soap:att3>L</soap:att3> ..... </soap:request> </soap:UpdateElem> </soapenv:Body> </soapenv:Envelope> I need to retrieve parameters att1, att2... and save them in to a DB table.

    Read the article

  • Parsing a UTF-16 encoded xml file in ruby with REXML

    - by Matthew Toohey
    Hello, I'm trying to parse the following UTF-16 encoded xml file in REXML: http://www.abc.net.au/triplej/feeds/playout/triplejsydneyplayout.xml?_523525 REXML encounters an error after the following: >> require 'rexml/document' => true >> include REXML => Object >> require 'net/http' => true >> triplejString = Net::HTTP.get('www.abc.net.au', '/triplej/feeds/playout/triplejsydneyplayout.xml?_523525') => "\377\376<\000?\000x\000m\000l\000 \000v\000e\000r\000s\000i\000o\000n\000=\000\"\0001\000.\0000\000\"\000 \000e\000n\000c\000o\000d\000i\000n\000g\000=\000\"\000u\000t\000f\000-\0001\0006\000\"\000?\000>\000<\000a\000b\000c\000m\000u\000s\000i\000c\000_\000p\000l\000a\000y\000o\000u\000t\000>\000<\000c\000h\000a\000n\000n\000e\000l\000>\000J\000J\000J\000<\000/\000c\000h\000a\000n\000n\000e\000l\000>\000<\000p\000u\000b\000l\000i\000s\000h\000t\000i\000m\000e\000>\000F\000r\000i\000,\000 \0003\0000\000 \000A\000p\000r\000 \0002\0000\0001\0000\000 \0001\0001\000:\0005\0007\000:\0001\0007\000 \000G\000M\000T\000<\000/\000p\000u\000b\000l\000i\000s\000h\000t\000i\000m\000e\000>\000<\000i\000t\000e\000m\000s\000>\000<\000i\000t\000e\000m\000>\000<\000p\000l\000a\000y\000i\000n\000g\000>\000n\000o\000w\000<\000/\000p\000l\000a\000y\000i\000n\000g\000>\000<\000t\000i\000t\000l\000e\000>\000D\000o\000c\000t\000o\000r\000,\000 \000D\000o\000c\000t\000o\000r\000<\000/\000t\000i\000t\000l\000e\000>\000<\000t\000r\000a\000c\000k\000i\000d\000>\000<\000/\000t\000r\000a\000c\000k\000i\000d\000>\000<\000p\000l\000a\000y\000e\000d\000t\000i\000m\000e\000>\000F\000r\000i\000,\000 \0003\0000\000 \000A\000p\000r\000 \0002\0000\0001\0000\000 \0001\0001\000:\0005\0007\000:\0001\0007\000 \000G\000M\000T\000<\000/\000p\000l\000a\000y\000e\000d\000t\000i\000m\000e\000>\000<\000p\000u\000b\000l\000i\000s\000h\000e\000r\000>\000<\000/\000p\000u\000b\000l\000i\000s\000h\000e\000r\000>\000<\000d\000a\000t\000e\000c\000o\000p\000y\000r\000i\000g\000h\000t\000e\000d\000>\0002\0000\0000\0003\000<\000/\000d\000a\000t\000e\000c\000o\000p\000y\000r\000i\000g\000h\000t\000e\000d\000>\000<\000d\000u\000r\000a\000t\000i\000o\000n\000>\0001\0006\0003\000<\000/\000d\000u\000r\000a\000t\000i\000o\000n\000>\000<\000a\000u\000s\000t\000>\000N\000o\000<\000/\000a\000u\000s\000t\000>\000<\000t\000r\000a\000c\000k\000n\000o\000t\000e\000>\000<\000/\000t\000r\000a\000c\000k\000n\000o\000t\000e\000>\000<\000t\000r\000a\000c\000k\000l\000i\000n\000k\000>\000<\000/\000t\000r\000a\000c\000k\000l\000i\000n\000k\000>\000<\000s\000h\000o\000w\000>\000<\000/\000s\000h\000o\000w\000>\000<\000t\000a\000l\000e\000n\000t\000>\000<\000/\000t\000a\000l\000e\000n\000t\000>\000<\000a\000l\000b\000u\000m\000>\000<\000a\000l\000b\000u\000m\000n\000a\000m\000e\000>\000D\000r\000i\000v\000i\000n\000g\000 \000F\000o\000r\000 \000T\000h\000e\000 \000S\000t\000o\000r\000m\000/\000D\000o\000c\000t\000o\000r\000 \000D\000o\000c\000t\000o\000r\000<\000/\000a\000l\000b\000u\000m\000n\000a\000m\000e\000>\000<\000a\000l\000b\000u\000m\000i\000d\000>\0008\0003\000-\0004\0002\0002\0006\0009\000<\000/\000a\000l\000b\000u\000m\000i\000d\000>\000<\000a\000l\000b\000u\000m\000i\000m\000a\000g\000e\000>\000h\000t\000t\000p\000:\000/\000/\000w\000w\000w\000.\000a\000b\000c\000.\000n\000e\000t\000.\000a\000u\000/\000t\000r\000i\000p\000l\000e\000j\000/\000c\000o\000v\000e\000r\000s\000/\000G\000y\000r\000o\000s\000c\000o\000p\000e\000 \000-\000 \000D\000r\000i\000v\000i\000n\000g\000 \000F\000o\000r\000 \000T\000h\000e\000 \000S\000t\000o\000r\000m\000/\000D\000o\000c\000t\000o\000r\000 \000D\000o\000c\000t\000o\000r\000 \000(\0002\0000\0000\0003\000)\000.\000j\000p\000g\000<\000/\000a\000l\000b\000u\000m\000i\000m\000a\000g\000e\000>\000<\000/\000a\000l\000b\000u\000m\000>\000<\000a\000r\000t\000i\000s\000t\000>\000<\000a\000r\000t\000i\000s\000t\000n\000a\000m\000e\000>\000G\000y\000r\000o\000s\000c\000o\000p\000e\000<\000/\000a\000r\000t\000i\000s\000t\000n\000a\000m\000e\000>\000<\000a\000r\000t\000i\000s\000t\000i\000d\000>\000<\000/\000a\000r\000t\000i\000s\000t\000i\000d\000>\000<\000a\000r\000t\000i\000s\000t\000n\000o\000t\000e\000>\000<\000/\000a\000r\000t\000i\000s\000t\000n\000o\000t\000e\000>\000<\000a\000r\000t\000i\000s\000t\000l\000i\000n\000k\000>\000<\000/\000a\000r\000t\000i\000s\000t\000l\000i\000n\000k\000>\000<\000/\000a\000r\000t\000i\000s\000t\000>\000<\000/\000i\000t\000e\000m\000>\000<\000/\000i\000t\000e\000m\000s\000>\000<\000/\000a\000b\000c\000m\000u\000s\000i\000c\000_\000p\000l\000a\000y\000o\000u\000t\000>\000" >> xmlDoc = REXML::Document.new(triplejString) REXML::ParseException: #<REXML::ParseException: malformed XML: missing tag start Line: Position: Last 80 unconsumed characters: <?xml version="1.0" encoding="utf-16"?><a> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parsers/baseparser.rb:356:in `pull' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parsers/treeparser.rb:22:in `parse' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/document.rb:227:in `build' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/document.rb:43:in `initialize' (irb):19:in `new' (irb):19:in `irb_binding' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb/workspace.rb:52 ... malformed XML: missing tag start Line: Position: Last 80 unconsumed characters: <?xml version="1.0" encoding="utf-16"?><a Line: Position: Last 80 unconsumed characters: <?xml version="1.0" encoding="utf-16"?><a from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parsers/treeparser.rb:92:in `parse' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/document.rb:227:in `build' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/document.rb:43:in `initialize' from (irb):19:in `new' from (irb):19 Any ideas?

    Read the article

  • parsing numbers in a javascript array

    - by George
    Hi I have a string of numbers separated by commas, "100,200,300,400,500" that I'm splitting into an array using the javascript split function: var data = []; data = dataString.split(","); I'm trying to parse the values of the array using parseFloat and then store them back into the array. I'd then like to add up the numbers in the array and store it as another variable, "dataSum". I've got the following code, but I can't get it working: var dataSum = ""; for (var i=0; i < data.length; i++) { parseFloat(data[i]); dataSum += data[i]; } So at the end of all this, I should be able to access any of the parsed numbers individually data[0], data[1], etc... and have a total number for dataSum. What am I doing wrong?

    Read the article

  • PHP library for keeping your site Indexed by Google Bing etc

    - by Ole Jak
    I need some library which would be able to keep my urls Indexed and described. So I want to say to it something like Index this new url "www.bla-bla.com/new_url" with some key words or something like that. And I want to be soure that If I told my lib about my new URL Google and others will 100% find it As soon as possible and people will be able to find this URL on the web. Do you know any such libs?

    Read the article

  • Parsing XML feed into Ruby object using nokogiri?

    - by Galen King
    Hi all, I am pretty green with coding in Ruby but am trying to pull an XML feed into a Ruby object as follows (ignore the ugly code please): <% doc = Nokogiri::XML(open("http://api.workflowmax.com/job.api/current?apiKey=#{@feed.service.api_key}&accountKey=#{@feed.service.account_key}")) %> <% doc.xpath('//Jobs/Job').each do |node| %> <h2><%= node['name'].text %></h2> <p><%= node['description'].text %></p> <% end %> Basically I want to iterate through each Job and output the name, description etc. What am I missing? Many thanks, Galen

    Read the article

  • Parsing tables, cells with Html agility in C#

    - by Kaeso
    I need to parse Html code. More specifically, parse each cell of every rows in all tables. Each row represent a single object and each cell represent different properties. I want to parse these to be able to write an XML file with every data inside (without the useless HTML code). This is the way I thought it out initially but I ran out of ideas: HTML: <tr> <td class="statBox" style="border-width:0px 1px 1px 0px; background-color: #FFFFFF"> 1 </td> <td class="statBox" style="border-width:0px 1px 1px 0px; background-color: #FFFFFF" align="left"> <a href="/ice/player.htm?id=8471675">Sidney Crosby</a> </td> <td class="statBox" style="border-width:0px 1px 1px 0px; background-color: #FFFFFF" align="center"> PIT </td> <td class="statBox" style="border-width:0px 1px 1px 0px; background-color: #FFFFFF" align="center"> C </td> <td class="statBox" style="border-width:0px 1px 1px 0px; background-color: #FFFFFF" align="right"> 39 </td> <td class="statBox" style="border-width:0px 1px 1px 0px; background-color: #FFFFFF" align="right"> 32 </td> <td class="statBox" style="border-width:0px 1px 1px 0px; background-color: #FFFFFF" align="right"> 33 </td> <td class="statBox sorted" style="border-width:0px 1px 1px 0px; background-color: #E0E0E0" align="right"> <font color="#000000"> 65 </font> </td> <td class="statBox" style="border-width:0px 1px 1px 0px; background-color: #FFFFFF" align="right"> 20 </td> <td class="statBox" style="border-width:0px 1px 1px 0px; background-color: #FFFFFF" align="right"> 29 </td> <td class="statBox" style="border-width:0px 1px 1px 0px; background-color: #FFFFFF" align="right"> 10 </td> <td class="statBox" style="border-width:0px 1px 1px 0px; background-color: #FFFFFF" align="right"> 1 </td> <td class="statBox" style="border-width:0px 1px 1px 0px; background-color: #FFFFFF" align="right"> 3 </td> <td class="statBox" style="border-width:0px 0px 1px 0px; background-color: #FFFFFF" align="right"> </td> <td class="statBox" style="border-width:0px 1px 1px 0px; background-color: #FFFFFF" align="right"> 0 </td> <td class="statBox" style="border-width:0px 1px 1px 0px; background-color: #FFFFFF" align="right"> 154 </td> <td class="statBox" style="border-width:0px 1px 1px 0px; background-color: #FFFFFF" align="right"> 20.8 </td> <td class="statBox" style="border-width:0px 1px 1px 0px; background-color: #FFFFFF" align="right"> 21:54 </td> <td class="statBox" style="border-width:0px 1px 1px 0px; background-color: #FFFFFF" align="right"> 22.6 </td> <td class="statBox" style="border-width:0px 0px 1px 0px; background-color: #FFFFFF" align="right"> 55.7 </td> </tr> C#: using HtmlAgilityPack; using System.Data; namespace Stats { class StatsParser { private string htmlCode; private static string fileName = "[" + DateTime.Now.ToShortDateString() + " NHL Stats].xml"; public StatsParser(string htmlCode) { this.htmlCode = htmlCode; this.ParseHtml(); } public DataTable ParseHtml() { var result = new DataTable(); HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(htmlCode); HtmlNode row = doc.DocumentNode.SelectNodes("//tr"); foreach (var statBox in row.SelectNodes("//td[@class='statBox']")) { System.Windows.MessageBox.Show(statBox.InnerText); } } } }

    Read the article

< Previous Page | 85 86 87 88 89 90 91 92 93 94 95 96  | Next Page >