Search Results

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

Page 84/854 | < Previous Page | 80 81 82 83 84 85 86 87 88 89 90 91  | Next Page >

  • Fetch excerpt from Wikipedia article?

    - by Felix
    I've been up and down the Wikipedia API, but I can't figure out if there's a nice way to fetch the excerpt of an article (usually the first paragraph). It would be nice to get the HTML formatting of that paragraph, too. The only way I currently see of getting something that resembles a snippet is by performing a fulltext search (example), but that's not really what I want (too short). Is there any other way to fetch the first paragraph of a Wikipedia article than barbarically parsing HTML/WikiText?

    Read the article

  • MalformedByteSequenceException while trying to pars XML

    - by poeschlorn
    Hey guy, maybe someone can help: I have the following .gpx data from wikipedia: <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <gpx xmlns="http://www.topografix.com/GPX/1/1" creator="byHand" version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"> <wpt lat="39.921055008" lon="3.054223107"> <ele>12.863281</ele> <time>2005-05-16T11:49:06Z</time> <name>Cala Sant Vicenç - Mallorca</name> <sym>City</sym> </wpt> </gpx> When I call my parsing method, I get a exception (see below) The call looks like this: Document tmpDoc = getParsedXML(currentGPX); My method to parse looks like this (standart parsing code, nothing exctiting....): public static Document getParsedXML(String fileWithPath){ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db; Document doc = null; try { db = dbf.newDocumentBuilder(); doc = db.parse(new File(fileWithPath)); } catch (ParserConfigurationException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return doc; } This simple code throws following exception: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence. at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(Unknown Source) at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipChar(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(Unknown Source) at Zeugs.getParsedXML(Zeugs.java:38) at Zeugs.main(Zeugs.java:25) I guess the error lies within the format of the first file, but I don't know where exactly. Can you please give me a hint?

    Read the article

  • HTML or Alternate markup for wiki site?

    - by at
    In choosing an editor for my wiki-like site, I'm debating whether to allow HTML or a custom alternate markup (maybe like wikipedia/wikimedia's or BBCode). HTML benefits: Easy for users to deal with (copying and pasting, learning) Somewhat future proof Many more editing tools available, usually WYSIWYG too Alternate markup benefits: On the server side I don't have to worry about parsing malicious javascript or styles or HTML that I don't allow Can be easy to learn Can be easier to decipher if not HTML-savvy Am I missing something, what's the best solution?

    Read the article

  • HTML parser for GAE

    - by Richard
    Generally I use lxml for my HTML parsing needs, but that isn't available on Google App Engine. The obvious alternative is BeautifulSoup, but I find it chokes too easily on malformed HTML. Currently I am testing libxml2dom and have been getting better results. Which pure Python HTML parser have you found performs best? My priority is the ability to handle bad HTML over speed.

    Read the article

  • Solve math question in PHP

    - by Koning WWWWWWWWWWWWWWWWWWWWWWW
    The user can enter a math problem like 5 + 654, 6 ^ 24, 2!, sqrt(543), log(54), sin 5, sin(50). After some reformatting (e.g. change sin 5 into sin(5)), and doing an eval, PHP gives me the right result. However, this is quite unsafe. Can anyone point me in the right direction parsing and solving a math question like the examples above, which is safe? Thanks.

    Read the article

  • What quality, parser-generator options exist for ruby?

    - by cartoonfox
    What open source (preferably gem-based) parser-generator options do I have in Ruby? I've used (flex&bison)|(lex&yacc) from C in the past, and I'm comfortable with BNF-style specifications. I've heard of treetop, but it looks a bit alien and verbose compared to yacc... Purpose: I want to convert my text markup language to a BNF and generate the parsing code. I think it's a better strategy than my first-order solution: http://github.com/dafydd/semantictext/blob/master/lib/semantictext/rich_text_parser.rb

    Read the article

  • Best 3rd Party Resume Parser Tool

    - by Krishna Kumar
    We are working on a hiring application and need the ability to easily parse resumes. Before trying to build one, was wondering what resume parsing tools are available out there and what is the best one, in your opinion? We need to be able to parse both Word and TXT files.

    Read the article

  • What grammar based parser-generator tools exist for ruby?

    - by cartoonfox
    What open source (preferably gem-based) parser-generator options do I have in Ruby? I've used (flex&bison)|(lex&yacc) from C in the past, and I'm comfortable with BNF-style specifications. I've heard of treetop, but it looks a bit alien and verbose compared to yacc... Purpose: I want to convert my text markup language to a BNF and generate the parsing code. I think it's a better strategy than my first-order solution: http://github.com/dafydd/semantictext/blob/master/lib/semantictext/rich_text_parser.rb

    Read the article

  • How to parse responses from a Django server in android?

    - by primal
    Hi, In the Android application I am building, I want to be able to communicate with a local server developed in Django. (Basically a login page and a home page populated with posts and images from users) So do I need to use XML Parsers for the parsing the response from a Django server or is it possible for the server to respond with strings which can be directly used? Also what about images? Regards, Primal

    Read the article

  • PHP - Read TXT from specific position

    - by user1466766
    I'm having trouble with PHP text parsing I have a txt file which has this kind of information: sometext::sometext.0 = INTEGER: 254 What i need is to get the last value of 254 as variable in PHP. in this txt file this last value can change from 0 to 255 "sometext::sometext.0 = INTEGER: " this part doesn't change at all. It has a length of 36 symbols, so i need get with PHP what is after 36 symbol into variable. Thank you.

    Read the article

  • Objective C - Parse NSData

    - by EZFrag
    I have the following data inside an NSData object: <00000000 6f2d840e 31504159 2e535953 2e444446 3031a51b 8801015f 2d02656e 9f110101 bf0c0cc5 0affff3f 00000003 ffff03 I'm having issues parsing this data. This data contains information which is marked by tags Tag 1 is from byte value 0x84 to 0xa5 Tag 2 is from byte value 0xa5 to 0x88 Tag 3 is from byte value 0x88 to 0x5f0x2d Tag 4 is from byte value 0x5f0x2d to 0x9f0x11 How would I go about to get those values from the NSData object? Regards, EZFrag

    Read the article

  • is there any faster way to parse than by walk each byte?

    - by uray
    is there any faster way to parse a text than by walk each byte of the text? I wonder if there is any special CPU (x86/x64) instruction for string operation that is used by string library, that somehow used to optimize the parsing routine. for example instruction like finding a token in a string that could be run by hardware instead of looping each byte until a token is found.

    Read the article

  • What is the best way to modify a few fields in an XML using Java

    - by Kailas J C
    I have a big XML which contains around 300 elements. I need to modify 2 or 3 elements in this xml using Java. I don't want to go for conventional marshalling and unmarshalling as it involves the parsing of the whole XML. How is XPath/XSLT manipulation? I know that I can easily read the data but i need to modify the same and put in back in the same XML. The primary concern here is performance. Kindly advise

    Read the article

  • Preventing access to files if a user types the full url on the address bar

    - by bogha
    i have a website, some folders on the websites contains images and files like .pdf , .doc and .docx . the user can easly just type the address in the url to get the file or display the photo http://site/folder1/img/pic1.jpg then boom.. he can see the image or just download the file my question is: how to prevent this kind of action, how can i guarantee a secure access of the files. any suggestions UPDATE TO CLARIFY MY IDEA i don't want any user who is browsing the website to get access to these files normally by just writing the URL of the file. those files are a CV files, they are being uploaded by the users to a specific folder on the server which we host outside the company. those files are only being viewed by the HR people through a special system. that's the scenario we want. i don't want a WEB GEEK who just wants to see what files has been uploaded to this folder to download them easly to his/her computer and view them or publish them on the internet. i hope you got my idea

    Read the article

  • Getting around url block for game

    - by Josh T
    So I play a game called Battlefield Play4Free (www.battlefield.play4free.com). Its essentially a giant browser plugin. The admin on my computer used to have the url battlefield.play4free.com/en/playnow.html blocked which only blocked the page that launches the game (i found a way to launch the game without going to that page and the game worked fine). Now it blocks battlefield.play4free.com which thus blocks all subpages. However, I have found that if I change it to an https and go to https://battlefield.play4free.com/en/login.html to login and then https://battlefield.play4free.com/en/playnow.html I can launch the game. However, when the game launches the borders and everything show but the window content is just a giant blockpage (the same one that shows up when I go to battlefield.play4free.com in the browser) and the blocked page is battlefield.play4free.com (main page). Is there any way I can get around this? I need a way to make the game access the server without going through the browser i.e. make the game use a proxy to get the data or somehow get past the besafe block. I was thinking perhaps you could get around it if you could get the game to make a direct request to the server and not through the url/browser, I know this works because I have a torrenting app that even tho torrent sites are blocked in the browser, the app makes a direct request and thus is not blocked. By the way, the program that blocks everything is besafe or besecure something like that. I do have access to an admin account (on the computer not the besafe program) as well as router access and pretty much anything else. Thanks so much!

    Read the article

< Previous Page | 80 81 82 83 84 85 86 87 88 89 90 91  | Next Page >