Search Results

Search found 3176 results on 128 pages for 'parsing'.

Page 12/128 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • The Oldest Big Data Problem: Parsing Human Language

    - by dan.mcclary
    There's a new whitepaper up on Oracle Technology Network which details the use of Digital Reasoning Systems' Synthesys software on Oracle Big Data Appliance.  Digital Reasoning's approach is inherently "big data friendly," as it leverages multiple components of the Hadoop ecosystem.  Moreover, the paper addresses the oldest big data problem of them all: extracting knowledge from human text.   You can find the paper here.   From the Executive Summary: There is a wealth of information to be extracted from natural language, but that extraction is challenging. The volume of human language we generate constitutes a natural Big Data problem, while its complexity and nuance requires a particular expertise to model and mine. In this paper we illustrate the impressive combination of Oracle Big Data Appliance and Digital Reasoning Synthesys software. The combination of Synthesys and Big Data Appliance makes it possible to analyze tens of millions of documents in a matter of hours. Moreover, this powerful combination achieves four times greater throughput than conducting the equivalent analysis on a much larger cloud-deployed Hadoop cluster.

    Read the article

  • Parsing stdout with custom format or standard format?

    - by linquize
    To integrate with other executables, a executable may launch another executable and capture its output from stdout. But most programs writes the output message to stdout in custom format and usually in human readable format. So it requires the system integrator to write a function to parse the output, which is considered trouble and the parser code may be buggy. Do you think this is old fashioned? Most Unix-style programs do that. Very few programs write to stdout in standard format such as XML or JSON, which is more modern. Example: Veracity (DVCS) writes JSON to stdout. Should we switch to use modern formats? For a console program, human readable or easy parsable: which is more important ?

    Read the article

  • TBXML parsing issue while the value cannot get in UILabel

    - by Dany
    In my app I'm using TBXML parser where I need to get a value from xml file and print it on the label. This is my xml file in server <gold> <price> <title>22 K Gold</title> </price> <price> <title>24 K Gold</title> </price> </gold> any my Viewcontroller.h looks like #import <UIKit/UIKit.h> #import "TBXML.h" @interface ViewController : UIViewController{ IBOutlet UILabel *lab; IBOutlet UILabel *lab1; TBXML *tbxml; } @end and my Viewcontrooler.m looks like - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. NSData *xmlData = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:@"http://www.abcde.com/sample.xml"]]; tbxml = [[TBXML alloc]initWithXMLData:xmlData]; TBXMLElement * root = tbxml.rootXMLElement; if (root) { TBXMLElement * elem_PLANT = [TBXML childElementNamed:@"price" parentElement:root]; while (elem_PLANT !=nil) { TBXMLElement * elem_BOTANICAL = [TBXML childElementNamed:@"title" parentElement:elem_PLANT]; NSString *botanicalName = [TBXML textForElement:elem_BOTANICAL]; lab.text=[NSString stringWithFormat:@"re %@", botanicalName]; elem_PLANT = [TBXML nextSiblingNamed:@"price" searchFromElement:elem_PLANT]; elem_BOTANICAL = [TBXML childElementNamed:@"title" parentElement:elem_PLANT]; botanicalName = [TBXML textForElement:elem_BOTANICAL]; lab1.text=[NSString stringWithFormat:@"re %@", botanicalName]; } } } I'm getting BAD_ACCESS thread. Am I missing anything?

    Read the article

  • How can I test a parser for a bespoke XML schema?

    - by Greg B
    I'm parsing a bespoke XML format into an object graph using .NET 4.0. My parser is using the System.XML namespace internally, I'm then interrogating the relevant properties of XmlNodes to create my object graph. I've got a first cut of the parser working on a basic input file and I want to put some unit tests around this before I progress on to more complex input files. Is there a pattern for how to test a parser such as this? When I started looking at this, my first move was to new up and XmlDocument, XmlNamespaceManager and create an XmlElement. But it occurs to me that this is quite lengthy and prone to human error. My parser is quite recursive as you can imagine and this might lead to testing the full system rather than the individual units (methods) of the system. So a second question might be What refactoring might make a recursive parser more testable?

    Read the article

  • Issue in Webscrapping in C# : Downloading and parsing zipped text files

    - by user64094
    I am writing an webscrapper, to do the download content from a website. Traversing to the website/URL, triggers the creation of a temporary URL. This new URL has a zipped text file. This zipped file is to be downloaded and parsed. I have written a scrapper in C# using WebClient and its function - DownloadFileAsync(). The zipped file is read from the designated location on a trapped DownloadFileCompleted event. My issue : The Windows 'Open/Save dialog is triggered". This requires user input and the automation is disrupted. Can you suggest a way to bypass the issue ? I am cool with rewriting the code using any alternate libraries. :) Thanks for reading,

    Read the article

  • Using linq to parse file [closed]

    - by Emaan Abdul majeed
    i am working parsing textfile using LINQ but got struc on it,its going outof range exception string[] lines = File.ReadAllLines(input); var t1 = lines .Where(l => !l.StartsWith("#")) .Select(l => l.Split(' ')) .Select(items => String.Format("{0}{1}{2}", items[1].PadRight(32), //items[1].PadRight(16) items[2].PadRight(32), items[3].PadRight(32))); var t2 = t1 .Select(l => l.ToUpper()); foreach (var t in t2) Console.WriteLine(t); and file is about 200 to 500 lines and i want to extract specific information so i need to split that information to different structure so how to do it this..

    Read the article

  • C# : Parsing information out of a path

    - by mbcrump
    If you have a path for example: \\MyServer\MyFolderA\MyFolderB\MyFile.jpg and you need to parse out the filename, directory name or the directory parent name. You should use the fileinfo class instead of a regex expression or a string split. See the example code below:   Code Snippet using System; using System.IO;   class Test {     static void Main(string[] args)     {         string file = @"\\MyServer\MyFolderA\MyFolderB\MyFile.jpg";         FileInfo fi = new FileInfo(file);         Console.WriteLine(fi.Name);                  // Prints File.jpg         Console.WriteLine(fi.Directory.Name);        // Prints FolderB         Console.WriteLine(fi.Directory.Parent.Name); // Prints FolderA     } }

    Read the article

  • Is this a reliable method of parsing glGetShaderInfoLog()?

    - by m4ttbush
    I want to get a list of errors and their line numbers so I can display the error information differently from how it's formatted in the error string and also to show the line in the output. It looks easy enough to just parse the result of glGetShaderInfoLog(), look for ERROR:, then read the next number up to :, and then the next, and finally the error description up to the next newline. However, the OpenGL docs say: Application developers should not expect different OpenGL implementations to produce identical information logs. This makes me worry that my code may behave incorrectly on different systems. I don't need them to be identical, I just need them to follow the same format. So is there a better way to get a list of errors with the line number separate, is it safe to assume that they'll always follow the "ERROR: 0:123:" format, or is there simply no reliable way to do this?

    Read the article

  • Parsing Parameters in a Stored Procedure

    This article shows a clean non-looping method to parse comma separated values from a parameter passed to a stored procedure. NEW! Deployment Manager Early Access ReleaseDeploy SQL Server changes and .NET applications fast, frequently, and without fuss, using Deployment Manager, the new tool from Red Gate. Try the Early Access Release to get a 20% discount on Version 1. Download the Early Access Release.

    Read the article

  • What's the best way to explain parsing to a new programmer?

    - by Daisetsu
    I am a college student getting my Computer Science degree. A lot of my fellow students really haven't done a lot of programming. They've done their class assignments, but let's be honest here those questions don't really teach you how to program. I have had several other students ask me questions about how to parse things, and I'm never quite sure how to explain it to them. Is it best to start just going line by line looking for substrings, or just give them the more complicated lecture about using proper lexical analysis, etc. to create tokens, use BNF, and all of that other stuff? They never quite understand it when I try to explain it. What's the best approach to explain this without confusing them or discouraging them from actually trying.

    Read the article

  • string parsing to double fails in C++ (Xcode problem?)

    - by helixed
    Here's a fun one I've been trying to figure out. I have the following program: #include <iostream> #include <string> #include <sstream> using namespace std; int main(int argc, char *argv[]) { string s("5"); istringstream stream(s); double theValue; stream >> theValue; cout << theValue << endl; cout << stream.fail(); } The output is: 0 1 I don't understand why this is failing. Could somebody please tell me what I'm doing wrong? Thanks, helixed EDIT: Okay, sorry to turn this into a double post, but this looks like a problem specific to Xcode. If I compile this in g++, the code works without a problem. Does anybody have an idea why this is happening in Xcode, and how I could possibly fix it? Thanks again, helixed

    Read the article

  • What's a good library for parsing mathematical expressions in java?

    - by CSharperWithJava
    I'm an Android Developer and as part of my next app I will need to evaluate a large variety of user created mathematical expressions and equations. I am looking for a good java library that is lightweight and can evaluate mathematical expressions using user defined variables and constants, trig and exponential functions, etc. I've looked around and Jep seems to be popular, but I would like to hear more suggestions, especially from people who have used these libraries before.

    Read the article

  • Examples of attoparsec in parsing binary file formats?

    - by me2
    Previously attoparsec was suggested to me for parsing complex binary file formats. While I can find examples of attoparsec parsing HTTP, which is essentially text based, I cannot find an example parsing actual binary, for example, a TCP packet, or image file, or mp3. Can someone post some code or pointer to some code which does this using attoparsec?

    Read the article

  • How can I check the content of the arrays? Parsing XML file with ObjectiveC

    - by skiria
    I have 3 classes- video { nameVideo, id, description, user... } topic {nameTopic, topicID, NSMutableArray videos; } category {nameCategory, categoryID, NSMUtableArray topics} And then in my app delegate I defined- NSMutableArray categories; I parse an XML file with this code. I try the arrays hierachy, and i think that i don't add any object on the arrays. How can I check it? What's wrong? (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict { if([elementName isEqualToString:@"Videos"]) { //Initialize the array. appDelegate.categories = [[NSMutableArray alloc] init]; } else if ([elementName isEqualToString:@"Category"]) { aCategory = [[Category alloc] init]; aCategory.categoryID = [[attributeDict objectForKey:@"id"] integerValue]; NSLog(@"Reading id category value: %i", aCategory.categoryID); } else if ([elementName isEqualToString:@"Topic"]) { aTopic = [[Topic alloc] init]; aTopic.topicID = [[attributeDict objectForKey:@"id"] integerValue]; NSLog(@"Reading id topic value: %i", aTopic.topicID); } else if ([elementName isEqualToString:@"video"]) { aVideo = [[Video alloc] init]; aVideo.videoID = [[attributeDict objectForKey:@"id"] integerValue]; aVideo.nameTopic = currentNameTopic; aVideo.nameCategory = currentNameCategory; NSLog(@"Reading id video value: %i", aVideo.videoID); } NSLog(@"Processing Element: %@", elementName); } (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { if(!currentElementValue) currentElementValue = [[NSMutableString alloc] initWithString:string]; else [currentElementValue appendString:string]; NSLog(@"Processing Value: %@", currentElementValue); } (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { if([elementName isEqualToString:@"Videos"]) return; if ([elementName isEqualToString:@"Category"]) { [appDelegate.categories addObject:aCategory]; [aCategory release]; aCategory = nil; } if ([elementName isEqualToString:@"Topic"]) { [aCategory.topics addObject:aTopic]; //NSLog(@"contador: %i", [aCategory.topics count]); //NSLog(@"contador: %@", aTopic.nameTopic); [aTopic release]; aTopic = nil; } if ([elementName isEqualToString:@"video"]) { [aTopic.videos addObject:aVideo]; NSLog(@"count number videos: %i", [aTopic.videos count]); -- always 0 NSLog(@"NOM CATEGORIA VIDEO: %@", aVideo.urlVideo); -- OK [aVideo release]; aVideo = nil; } if ([elementName isEqualToString:@"nameCategory"]) { //[aCategory setValue:currentElementValue forKey:elementName]; aCategory.nameCategory = currentElementValue; currentNameCategory = currentElementValue; } if ([elementName isEqualToString:@"nameTopic"]) { aTopic.nameTopic = currentElementValue; currentNameTopic = currentElementValue; } else [aVideo setValue:currentElementValue forKey:elementName]; [currentElementValue release]; currentElementValue = nil; }

    Read the article

  • Parsing: How to make error recovery in grammars like " a* b*"?

    - by Lavir the Whiolet
    Let we have a grammar like this: Program ::= a* b* where "*" is considered to be greedy. I usually implement "*" operator naively: Try to apply the expression under "*" to input one more time. If it has been applied successfully then we are still under current "*"-expression; try to apply the expression under "*" one more time. Otherwise we have reached next grammar expression; put characters parsed by expression under "*" back into input and proceed with next expression. But if there are errors in input in any of "a*" or "b*" part such a parser will "think" that in position of error both "a*" and "b*" have finished ("let's try "a"... Fail! OK, it looks like we have to proceed to "b*". Let's try "b"... Fail! OK, it looks like the string should have been finished...). For example, for string "daaaabbbbbbc" it will "say": "The string must end at position 1, delete superflous characters: daaaabbbbbbc". In short, greedy "*" operator becomes lazy if there are errors in input. How to make "*" operator to recover from errors nicely?

    Read the article

  • Is there a module for parsing numbers (inkl. ranges)?

    - by sid_com
    Is there a module, which does this for me? #!/usr/bin/env perl use warnings; use strict; use 5.012; sub aw_parse { my( $in, $max ) = @_; chomp $in; my @array = split ( /\s*,\s*/, $in ); my %zahlen; for ( @array ) { if ( /^\s*(\d+)\s*$/ ) { $zahlen{$1}++; } elsif ( /^\s*(\d+)\s*-\s*(\d+)\s*$/ ) { die "'$1-$2' not a valid input $!" if $1 >= $2; for ( $1 .. $2 ) { $zahlen{$_}++; } } else { die "'$_' not a valid input $!"; } } @array = sort { $a <=> $b } keys ( %zahlen ); if ( defined $max ) { for ( @array ) { die "Input '0' not allowed $!" if $_ == 0; die "Input ($_) greater than $max not allowed $!" if $_ > $max; } } return \@array; } my $max = 20; print "Input (max $max): "; my $in = <>; my $out = aw_parse( $in, $max ); say "@$out";

    Read the article

  • Is there a Perl module for parsing numbers, including ranges?

    - by sid_com
    Is there a module, which does this for me? sample_input: 2, 5-7, 9, 3, 11-14 #!/usr/bin/env perl use warnings; use strict; use 5.012; sub aw_parse { my( $in, $max ) = @_; chomp $in; my @array = split ( /\s*,\s*/, $in ); my %zahlen; for ( @array ) { if ( /^\s*(\d+)\s*$/ ) { $zahlen{$1}++; } elsif ( /^\s*(\d+)\s*-\s*(\d+)\s*$/ ) { die "'$1-$2' not a valid input $!" if $1 >= $2; for ( $1 .. $2 ) { $zahlen{$_}++; } } else { die "'$_' not a valid input $!"; } } @array = sort { $a <=> $b } keys ( %zahlen ); if ( defined $max ) { for ( @array ) { die "Input '0' not allowed $!" if $_ == 0; die "Input ($_) greater than $max not allowed $!" if $_ > $max; } } return \@array; } my $max = 20; print "Input (max $max): "; my $in = <>; my $out = aw_parse( $in, $max ); say "@$out";

    Read the article

  • What is the right method for parsing a blog post?

    - by Zedwal
    Hi guys, Need a guide line .... I am trying to write a personal blog. What is the standard structure for for input for the post. I am trying the format like: This is the simple text And I am [b] bold text[/b]. This is the code part: [code lang=java] public static void main (String args[]) { System.out.println("Hello World!"); } [/code] Is this the right way to store post in the database? And What is the right method to parse this kind of post? Shall I use regular expression to parse this or there is another standard for this. If the above mentioned format is not the right way for storage, then what it could be? Thanks

    Read the article

  • C# XML parsing with LINQ storing directly to a struct?

    - by Luke
    Say I have the following XML schema: <root> <version>2.0</version> <type>fiction</type> <chapters> <chapter>1</chapter> <title>blah blah</title> </chapter> <chapters> <chapter>2</chapter> <title>blah blah</title> </chapters> </root> Would it be possibly to parse the elements which I know will not be repeated in the XML and store them directly into the struct using LINQ? For example, could I do something like this for "version" and "type" //setup structs Book book = new Book(); book.chapter = new Chapter(); //use LINQ to parse the xml var bookData = from b in xmlDoc.Decendants("root") select new { book.version = b.Element("version").Value, book.type = b.Element("type").Value }; //then for "chapters" since I know there are multiple I can do: var chapterData = from c in xmlDoc.Decendants("root" select new { chapter = c.Element("chapters") }; foreach (var ch in chapterData) { book.chapter.Add(getChapterData(ch.chapter)); }

    Read the article

  • Parsing an XML string containing "&#x20;" (which must be preserved)

    - by Zoodor
    I have code that is passed a string containing XML. This XML may contain one or more instances of &#x20; (an entity reference for the blank space character). I have a requirement that these references should not be resolved (i.e. they should not be replaced with an actual space character). Is there any way for me to achieve this? Basically, given a string containing the XML: <pattern value="[A-Z0-9&#x20;]" /> I do not want it to be converted to: <pattern value="[A-Z0-9 ]" /> (What I am actually trying to achieve is to simply take an XML string and write it to a "pretty-printed" file. This is having the side-effect of resolving occurrences of &#x20; in the string to a single space character, which need to be preserved. The reason for this requirement is that the written XML document must conform to an externally-defined specification.) I have tried creating a sub-class of XmlTextReader to read from the XML string and overriding the ResolveEntity() method, but this isn't called. I have also tried assigning a custom XmlResolver.

    Read the article

  • different types of parsing

    - by kostas_menu
    I have read the tutorial from ibm about xml parsing (http://www.ibm.com/developerworks/opensource/library/x-android/) In this example,there are four types of xml parsing.Dom,Sax,Android Sax and xml_pull.Could you please tell me what's the difference between these four types and when i have to use each one? Also,with every way of xml parsing in this tutorial,the feeds are shown in a listView. What i have to do in order to appear every announcement in a btn for example? thanks for your time!Merry Christmas:D

    Read the article

  • Does JAXP natively parse HTML?

    - by ikmac
    So, I whip up a quick test case in Java 7 to grab a couple of elements from random URIs, and see if the built-in parsing stuff will do what I need. Here's the basic setup (with exception handling etc omitted): DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance(); DocumentBuilder dbuild = dbfac.newDocumentBuilder(); Document doc = dbuild.parse("uri-goes-here"); With no error handler installed, the parse method throws exceptions on fatal parse errors. When getting the standard Apache 2.2 directory index page from a local server: a SAXParseException with the message White spaces are required between publicId and systemId. The doctype looks ok to me, whitespace and all. When getting a page off a Drupal 7 generated site, it never finishes. The parse method seems to hang. No exceptions thrown, never returns. When getting http://www.oracle.com, a SAXParseException with the message The element type "meta" must be terminated by the matching end-tag "</meta>". So it would appear that the default setup I've used here doesn't handle HTML, only strictly written XML. My question is: can JAXP be used out-of-the-box from openJDK 7 to parse HTML from the wild (without insane gesticulations), or am I better off looking for an HTML 5 parser? PS this is for something I may not open-source, so licensing is also an issue :(

    Read the article

  • Can the csv format be defined by a regex?

    - by Spencer Rathbun
    A colleague and I have recently argued over whether a pure regex is capable of fully encapsulating the csv format, such that it is capable of parsing all files with any given escape char, quote char, and separator char. The regex need not be capable of changing these chars after creation, but it must not fail on any other edge case. I have argued that this is impossible for just a tokenizer. The only regex that might be able to do this is a very complex PCRE style that moves beyond just tokenizing. I am looking for something along the lines of: ... the csv format is a context free grammar and as such, it is impossible to parse with regex alone ... Or am I wrong? Is it possible to parse csv with just a POSIX regex? For example, if both the escape char and the quote char are ", then these two lines are valid csv: """this is a test.""","" "and he said,""What will be, will be."", to which I replied, ""Surely not!""","moving on to the next field here..."

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >