Search Results

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

Page 98/128 | < Previous Page | 94 95 96 97 98 99 100 101 102 103 104 105  | Next Page >

  • Deserialize Xml with empty elements in C#

    - by user204086
    Trying to deserialize some xml snippits into objects. The problem is that I'm getting an invalid format on every empy element tag. I can deserialize the object no problem when all of the elements have values. Or the empty elements are ommitted. Xml Snippit: <foo><propOne>1</propOne><propTwo /></foo> C# Class: [Serialilbe()] public class foo { public foo(){} [XmlElementAttribute(IsNullable = true)] public int? propOne {get;set;} [XmlElementAttribute(IsNullable = true)] public int? propTwo {get;set;} } Is there a setting on the class I can make to adjust the parsing? or Is there an easy way I can apply xsl to remove these elements? or Should I use regEx to remove the empty elements be fore desrializing? or an even better way?

    Read the article

  • Question in Flex (parser)

    - by shkk
    Hello... I want to ask you a question about Flex, the program for parsing code. Supposing I have an instruction like this one, in the rules part: "=" BEGIN(attribution); <attribution>{var_name} { fprintf(yyout, "="); ECHO; } <attribution>";" BEGIN(INITIAL); {var_name} is a regular expression that matches a variable's name, and all I want to do is to copy at the output all the attribution instructions, such as a = 3; or b = a; My rule though cannot write with fprintf the left member of the attribution, but only = 3; or =a; One solution for that might be that, after I make the match "=" and I am in the attribution state, to go 2 positions back as to get the left operand as well. How can I do that in Flex?

    Read the article

  • How does one receive and post text messages on a website, a la Twitter?

    - by Jason
    I've looked around at pretty much all the SMS posts here on SO and the best answer I've come up with so far is ZeepMobile. The only problem is, they're "in beta" and aren't readily accepting users. Is there a workaround for this, maybe receiving an email via text (kind of like how TwitPic does it?) somehow and parsing it? Basically all I want to do is have people text the site so that their message posts... I don't need to send any messages (actually I would prefer not to). Pretty much the same functionality as Twitter (same functionality, but no I'm not building a Twitter-esque service because I am not crazy). PS this will be a VB.NET ASP.NET 3.5 solution. Anyone have any ideas? Thanks

    Read the article

  • How can I parse free text (Twitter tweets) against a large database of values?

    - by user136416
    Hi there Suppose I have a database containing 500,000 records, each representing, say, an animal. What would be the best approach for parsing 140 character tweets to identify matching records by animal name? For instance, in this string... "I went down to the woods to day and couldn't believe my eyes: I saw a bear having a picnic with a squirrel." ... I would like to flag up the words "bear" and "squirrel", as they appear in my database. This strikes me as a problem that has probably been solved many times, but from where I'm sitting it looks prohibitively intensive - iterating over every db record checking for a match in the string is surely a crazy way to do it. Can anyone with a comp sci degree put me out of my misery? I'm working in C# if that makes any difference. Cheers!

    Read the article

  • regex to match specific html tags

    - by Rco8786
    I need to match html tags(the whole tag), based on the tag name. For script tags I have this: <script.+src=.+(\.js|\.axd).+(</script>|>) It correctly matches both tags in the following html: <script src="Scripts/JScript1.js" type="text/javascript" /> <script type="text/javascript" src="Scripts/JScript2.js" /> However, when I do link tags with the following: <link.+href=.+(\.css).+(</link>|>) It matches all of this at once(eg it returns one match containing both items): <link href="Stylesheets/StyleSheet1.css" rel="Stylesheet" type="text/css" /> <link href="Stylesheets/StyleSheet2.css" rel="Stylesheet" type="text/css" /> What am I missing here? The regexes are essentially identical except for the text to match to? Also, I know that regex is not a great tool for HTML parsing...I will probably end up using the HtmlAgilityPack in the end, but this is driving me nuts and I want an answer if only for my own mental health!

    Read the article

  • Creating interruptible process in python

    - by Glycerine
    I'm creating a python script of which parses a large (but simple) CSV. It'll take some time to process. I would like the ability to interrupt the parsing of the CSV so I can continue at a later stage. Currently I have this - of which lives in a larger class: (unfinished) Edit: I have some changed code. But the system will parse over 3 million rows. def parseData(self) reader = csv.reader(open(self.file)) for id, title, disc in reader: print "%-5s %-50s %s" % (id, title, disc) l = LegacyData() l.old_id = int(id) l.name = title l.disc_number = disc l.parsed = False l.save() This is the old code. def parseData(self): #first line start fields = self.data.next() for row in self.data: items = zip(fields, row) item = {} for (name, value) in items: item[name] = value.strip() self.save(item) Thanks guys.

    Read the article

  • Repairing broken XML file - removing extra less-than/greater-than signs

    - by peku
    I have a large XML file which in the middle contains the following: <ArticleName>Article 1 <START </ArticleName> Obviously libxml and other XML libraries can't read this because the less-than sign opens a new tag which is never closed. My question is, is there anything I can do to fix issues like this automatically (preferably in Ruby)? The solution should of course work for any field which has an error like this. Someone said SAX parsing could do the trick but I'm not sure how that would work.

    Read the article

  • Using * Width & Precision Specifiers With boost::format

    - by John Dibling
    I am trying to use width and precision specifiers with boost::format, like this: #include <boost\format.hpp> #include <string> int main() { int n = 5; std::string s = (boost::format("%*.*s") % (n*2) % (n*2) % "Hello").str(); return 0; } But this doesn't work because boost::format doesn't support the * specifier. Boost throws an exception when parsing the string. Is there a way to accomplish the same goal, preferably using a drop-in replacement?

    Read the article

  • Converting byte array to image in xcode?

    - by arizah
    I am getting a byte array(I reckon) in NSMutableArray's object.The NSMutableArray i get is from Xml parsing from a service URL..Now I need to convert that byte array to UIImage ..Gone through google and found to convert to NSData and then UIImage but couldn't understand how..? How can I do it ? My array looks like this : ( { Name = "John"; Image = "/9j/4AAQSkZJRgABAQAAAQABAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJS kcgSlBFRyB2NjIpLCBxdWFsaXR5ID0gODAK/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXF BYWGh0lHxobIxwWFiAsICMmJykqKRkfLTAtKDAlKCko/9sAQwEHBwcKCAoTCgoTKBoWGigoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgo/8AAEQgEKwZAAwEiAAIRAQMRAf/........ //big byte array } ) First of all I need to clear whether it is a byte array ?How can I extract image from this ?

    Read the article

  • How can I pass a type as a parameter in scala?

    - by rsan
    I'm having a really hard time trying to figure out how can I store or pass a type in scala. What I want to achive is something like this: abstract class Foo( val theType : type ) object Foo{ case object Foo1 extends Foo(String) case object Foo2 extends Foo(Long) } So at some point I can do this: theFoo match{ case String => "Is a string" case Long => "Is a long" } and when obtaining the object being able to cast it: theFoo.asInstanceOf[Foo1.theType] Is this possible? If is possible, is a good aproach? What I'm trying to achieve ultimately is writing a pseudo schema for byte stream treatment. E.g if I have an schema Array(Foo1,Foo1,Foo2,Foo3,Foo1) I could parse Arrays of bytes that complain with that schema, if at some point I have a different stream of bytes I could just write a new schema Array(Foo3, Foo4, Foo5) without having to reimplement parsing logic. Regards,

    Read the article

  • Any way to make GetTypes() less brittle.

    - by scope-creep
    I'm iterating through all the types in GAC, GAC_32 and GAC_MSIL looking for specific types, fundamentally to match those using clauses in my source code, so when I compile the source. I'll know exactly what assembly dll's to provide. I'm getting all the file names from each of those directory and applying GetTypes to each assembly in turn and comparing the returned types against my using list. But the problem I have is that GetTypes() keeps crapping out with an exception, when it can't load the types from a loaded assembly. Is their any way to make GetTypes() less brittle. For instance, when parsing this assembly on my box, {blbmmc, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35}, it craps out. Any suggestions welcome. I know this is a fairly lengthly process, but I figure i'll eventually use a subset of common assemblies to search, or possibly cache the list of types-assembly dll name at program start. Thanks.

    Read the article

  • Design cache mechanism

    - by Delashmate
    Hi All, I got assignment to write design for cache mechanism, This is my first time writing a design document, Our program display images for doctors, and we wan't to reduce the parsing time of the images So we want to save the parsed data in advance (in files or inside database) Currently I have several design key ideas Handle locks - each shared data structure should be handled, also files Test - add test to verify the data from the cache is equal to the data from the files To decouple the connection to the database- not to call directly to the database Cleanup mechanisem- to delete old files if the cahce directory exceed configurable threshold Support config file Support performance tool in the feature I will also add class diagram, data flow charts, and workflow What do you think I should add to the key ideas? Do you know good link to atricales about design? Thanks in advance, Dan

    Read the article

  • Using a database/index sequential file independently of the Unix distribution

    - by Helper Method
    What I'm planning to do is a) parse a file for some lines matching a regular expression b) store the match in some sort of database / file so I don't have to do the parsing again and again c) call another program passing the matches as arguments While I can imagine how to do a) and c), I'm a little bit unsure about b). The matches are of the form key:attribute1:attribute2:attribute3 where attribute 2 may be optional. I'm thinking of storing the results in a simple database but the problem is the database needs to available on a number of Unix platform for the program to work. Are there any (simple) databases which can be found on any Unix platforms? Or should I use some sort of index-sequential file?

    Read the article

  • Can a parser tell the lexer to ignore a newline?

    - by chollida
    I'm writing a preprocessor for my language. In the preprocessor I've output a line that wasn't in the source file. This causes any error messages that Anltr creates to be incremented by one line. The Lexer handles the line count so I'm wondering if there is a way for the parser to tell the lexer to decrement the line count, or to ignore a specific newline. I'm also open to other suggestions on how to work around this. The only constraint I have is putting the extra line inline with the existing code. I'd prefer to keep it on it's own line to keep my parsing sane.

    Read the article

  • Get machine name for remote computer on local network

    - by durza
    Hi, I've 2 machines with names Comp1, Comp2. There is a DNS name for them, that mask them as one, let say DNSName. I get IP addresses for both machines via Dns.GetHostEntry("DNSName"). But when I try get Dns.GetHostEntry(ipAddress) entry.HostName always contains DNSName. I found some way to get name through WMI. But our policy doesn't allow WMI on remote machines. I can do parsing of nbstat -a output, but I would like to do some clean aproach to this. Is there some way?

    Read the article

  • Strings - Filling In Leading Zeros Wtih A Zero

    - by headscratch
    I'm reading an array of hard-coded strings of numeric characters - all positions are filled with a character, even for the leading zeros. Thus, can confidently parse it using substring(start, end) to convert to numeric. Example: "0123 0456 0789" However, a string coming from a database does not fill in the leading zero with a 'zero character', it simply fetches the '123 456 789', which is correct for an arithmetic number but not for my needs and makes for parsing trouble. Before writing conditionals to check for leading zeros and adding them to the string if needed, is there a simple way of specifying they be filled with a character ? I'm not finding this in my Java book... I could have done the three conditionals in the time it took to post this but, this is more about 'education'... Thanks

    Read the article

  • IE 8 Error - What's the cause?

    - by DanCapitanDePlai
    I have two magento eshops that worked perfectly in the past on all major browsers except IE 7. After I installed WINDOWS XP on my computer and accessed my eshops with IE 8, I almost had a heartattack seeing that they aren't working as they should. Before installing Windows XP I was running Windows 7 and the websites were looking good on IE 8. Now, the same IE version, but on different operating systems, gives me headaches! Now, can someone explain me how to 'debug' the ie 8 parsing engine for seeing the errors and try to modify the templates? Thanks.

    Read the article

  • client-side vs server-side

    - by amalafrida
    In general, should one design in order to place processing load on client-side? More specifically, a search engine to locate subscriber information requires a fair amount of parsing (multiple phone numbers to sort and format, hour of day, timezone, comparisons for possible substitutions of user information, etc.). Again, in general, is it preferred that one have client-side do the work? It seems to me 'yes' in a situation in which one will have many thousands of hits per minute. Use php for quick database queries ... process retrieved data client-side. yes ... no?

    Read the article

  • Possible to exclude a column from `*` ?

    - by Earlz
    Is it possible to exclude a column from a select * from table statement with SQL Server? I have a need for this and this is my only option other than parsing a raw SQL string to get out the required field names (I really don't want to do that). Just to be bold. When the query is made I do not have access to the list of fields needed from the table but I do know which field I do not need. This is part of a complex multi-part query. Surely there must be some way even if it's "hackish" such as using table variables or views

    Read the article

  • Is using a DataSet's column Expression works in background same as manual calculation?

    - by Harikrishna
    I have one datatable which is not bindided and records are coming from the file by parsing it in the datatable dynamically every time. Now there is three columns in the datatable Marks1,Marks2 and FinalMarks. And their types is decimal. Now for making addition of columns Marks1 and Marks2 's records and store it into FinalMarks column,For that what I do is : datatableResult.Columns["FinalMarks"].Expression="Marks1+Marks2"; It's works properly. It can be done in other way also is foreach (DataRow r in datatableResult.Rows) { r["FinalMarks"]=Convert.ToDecimal(r["Marks1"])+Convert.ToDecimal(r["Marks2"]); } Is first approach same as second approach in background means is both approach same or what? EDIT: I want to know that first approach works in background as second approach.

    Read the article

  • Parse items from text file

    - by chris
    I have a text file that includes data inside {[]} tags. What would be the suggested way to parse that data so I can just use the data inside the tags? Example text file would look like this: 'this is a bunch of text that is not {[really]} useful in any {[way]}. I need to {[get]} some items {[from]} it.' I would like to end up with 'really', 'way', 'get', 'from' in a list. I guess I could use split to do it.. but seems like there might be a better way out there. I have seen a ton parsing libraries, is there one that would be perfect for what I want to do?

    Read the article

  • C# method contents validation

    - by user258651
    I need to validate the contents of a C# method. I do not care about syntax errors that do not affect the method's scope. I do care about characters that will invalidate parsing of the rest of the code. For example: method() { /* valid comment */ /* <-- bad for (i..) { } for (i..) { <-- bad } I need to validate/fix any non-paired characters. This includeds /* */, { }, and maybe others. How should I go about this? My first thought was Regex, but that clearly isn't going to get the job done.

    Read the article

  • Get link position on screen from google search results

    - by Revelation
    I want to make an app in .net to search on google for a keyword and click on a specific link from the results. Like a bot. How can I get the coordinates of screen where the specific link appears in search results so I can do a click on it. The component where the page loads will have javascript enabled so just parsing the html is not enought. It must look like a real user is clicking on the link.( it`s for a school project involving seo) or What is the best approach to do this ?

    Read the article

  • Make network changes permanent - C++

    - by pparescasellas
    I need to allow an external client to change the IP of the Linux machine where the program is running (C++). I already know how to list all the local interfaces and the current IPs assigned to them. I also know how to programatically change said IPs. What I need to know is how to make this change permanent so, if the machine reboots, it keeps the same network configuration. What's the best way to do this? Manually parsing /etc/network/interfaces? Calling some linux command? Edit: I'm using Debian. Thanks!

    Read the article

  • c# FormatException was unhandled

    - by poco
    I'm parsing chat from a game and i get this string "?68 00 00 37 00 45 00 00" recipe = recipe.Replace("?", ""); string[] rElements = new string[8]; rElements = recipe.Split(' '); int num = int.Parse(rElements[0]); I get a Format exception on that last line that i don't understand. It says that input string is not in the right format. I have checked the debugger and the first element says it is "68". Anyone have any clue what is happening?

    Read the article

< Previous Page | 94 95 96 97 98 99 100 101 102 103 104 105  | Next Page >