Search Results

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

Page 96/854 | < Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >

  • C++ option/long option implementation

    - by K Hein
    I am working on a parser for meta programming language using C++ on Linux platform. Right now, I need to implement option/long option for the parser to provide some additional features. Basically, if the user pass in some additional option, the parser needs to store statistics while parsing the text files. I can think of two ways to implement it. One way is to user global to store options entered by users. Another way is to create a singleton class to store options. So I would like to know if there is any other way to implement it. What is the best/most recommended way of implementing it? Thanks in advance. Regards, K.Hein

    Read the article

  • Detecting regular expression in content during parse

    - by sonofdelphi
    I am writing a parser for C. I was just running it with some other language files (for fun, to see the extent C-likeness). It breaks down if the code being parsed contains regular expressions... Case 1: For example, while parsing the JavaScript code snippet, var phone="(304)434-5454" phone=phone.replace(/[\(\)-]/g, "") //Returns "3044345454" (removes "(", ")", and "-") The '(', '[' etc get matched as starters of new scopes, which may never be closed. Case 2: And, for the Perl code snippet, # Replace backslashes with two forward slashes # Any character can be used to delimit the regex $FILE_PATH =~ s@\\@//@g; The // gets matched as a comment... How can I detect a regular expression within the content text of a "C-like" program-file?

    Read the article

  • How to catch YouTube embed code and turn into URL

    - by Jonathan Vanasco
    I need to strip YouTube embed codes down to their URL only. This is the exact opposite of all but one question on StackOverflow. Most people want to turn the URL into an embed code. This question addresses the usage patttern I want, but is tied to a specific embed code's regex ( Strip YouTube Embed Code Down to URL Only ) I'm not familiar with how YouTube has offered embeds over the years - or how the sizes differ. According to their current site, there are 2 possible embed templates and a variety of options. If that's it, I can handle a regex myself -- but I was hoping someone had more knowledge they could share, so I could write a proper regex pattern that matches them all and not run into endless edge-cases. The full use case scenario : user enters content in web based wysiwig editor backend cleans out youtube & other embed codes; reformats approved embeds into an internal format as the text is all converted to markdown. on display, appropriate current template/code display for youtube or other 3rd party site is generated At a previous company, our tech-team devised a plan where YouTube videos were embedded by listing the URL only. That worked great , but it was in a CMS where everyone was trained. I'm trying to create a similar storage, but for user-generated-content.

    Read the article

  • Table transformation / field parsing in PL/SQL

    - by IMHO
    I have de-normalized table, something like CODES ID | VALUE 10 | A,B,C 11 | A,B 12 | A,B,C,D,E,F 13 | R,T,D,W,W,W,W,W,S,S The job is to convert is where each token from VALUE will generate new record. Example: CODES_TRANS ID | VALUE_TRANS 10 | A 10 | B 10 | C 11 | A 11 | B What is the best way to do it in PL/SQL without usage of custom pl/sql packages, ideally with pure SQL? Obvious solution is to implement it via cursors. Any ideas?

    Read the article

  • Nokogiri Not Parsing File

    - by Jesse J
    I'm using Nokogiri to parse pepXML files from different peptide search engines. I have two pepXML files, both of which appear, inasmuch as I can tell, to be of correct format, and puts Nokogiri::XML(IO.read(file)) will output the whole XML file for both files. The problem is, doc.xpath("any valid xpath") will parse the tag from one of the files, but not the other. No errors are given, so I have no idea why it won't parse. Anyone know of any reasons why Nokogiri wouldn't parse something out?

    Read the article

  • JSON parsing using JSON.net

    - by vbNewbie
    I am accessing the facebook api and using the json.net library (newtonsoft.json.net) I declare a Jobject to parse the content and look for the specific elements and get their values. Everything works fine for the first few but then I get this unexplained nullexception error " (Object reference not set to an instance of an object) Now I took a look at the declaration but cannot see how to change it. Any help appreciated: Dim jobj as JObject = JObject.Parse(responseData) Dim message as string = string.empty message = jobj("message").tostring The error occurs at the last line above.

    Read the article

  • parsing email text reply/forward

    - by Theofanis Pantelides
    Hi, I am creating a web based email client using c# asp.net. What is confusing is that various email clients seem to add the original text in alot of different ways when replying by email. What I was wondering is that, if there is some sort of standardized way, to disambiguate this process? Thank you -Theo

    Read the article

  • Embed URL from variable in HTML file in Rails application

    - by TejasM
    hi, I have a doubt which might be silly for experience Rails developers. I am creating an application which is suppose to embed a video player with URL passed to it. So while displaying i.e in XXX.html.erb file i am writting below code. Now problem is @movie.trailer is my variable in ruby code which has URL value . I want the embedded video to load with URL given by this variable value. Any suggestion how am i suppose to place the value of Ruby variable(@movie.trailer) in part. <object width="425" height="344"> <param name="movie" value="<% @movie.trailer %>"> </param><param name="allowFullScreen" value="true"> </param><param name="allowscriptaccess" alue="always"> </param><embed src="<% @movie.trailer %>" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object> Note :- This code is working perfectly fine if i statically give value of URL. Please help

    Read the article

  • Polymorphic urls with singular resources

    - by Brendon Muir
    I'm getting strange output when using the following routing setup: resources :warranty_types do resources :decisions end resource :warranty_review, :only => [] do resources :decisions end I have many warranty_types but only one warranty_review (thus the singular route declaration). The decisions are polymorphically associated with both. I have just a single decisions controller and a single _form.html.haml partial to render the form for a decision. This is the view code: = simple_form_for @decision, :url => [@decision_tree_owner, @decision.becomes(Decision)] do |form| The warranty_type url looks like this (for a new decision): /warranty_types/2/decisions whereas the warranty_review url looks like this: /admin/warranty_review/decisions.1 I think because the warranty_review id has no where to go, it's just getting appended to the end as an extension. Can someone explain what's going on here and how I might be able to fix it? I can work around it by trying to detect for a warranty_review class and substituting @decision_tree_owner with :warranty_review and this generates the correct url, but this is messy. I would have thought that the routing would be smart enough to realise that warranty_review is a singular resource and thus discard the id from the URL. This is Rails 3 by the way :)

    Read the article

  • jQuery .getJSON() Not Parsing All Objects

    - by Brad
    I'm using jQuery's .getJSON function to parse a set of search results from a Google Search Appliance. The search appliance has an xslt stylesheet that returns the results as JSON data, which I validated with both JSONLint and Curious Concept's JSON Formatter. According to FireBug, the full result set is returned from the XMLHTTPRequest, but I tried dumping the data (with jquery.dump.js) and it only ever parses back the first result. It does successfully get all the Google Search Protocol stuff, but it only ever sees one "R" object (or individual result). Has anybody had a similar problem with jQuery's .getJSON? I know it likes to fail silently if the JSON is not valid, but like I said, I validated the results with several validators and it should be good to go. Edit: Clicking this link will show you the JSON results returned for a search for the word "google": http://bigbird.uww.edu/search?client=json_frontend&proxystylesheet=json_frontend&proxyrefresh=1&output=xml_no_dtd&q=google jQuery only retrieves the first "R" object, even though all "R" objects are siblings.

    Read the article

  • Regular expression help parsing SQLIO output

    - by jaspernygaard
    Hi I've been working on a regular expression to parse the output of a series of SQLIO runs. I've gotten pretty far, but not quite there yet. I'm seeking a 100% regex solution and no pre-manipulation of the input. Could anyone assist with a little guidance with the following regular expression: .*v(?<SQLIOVersion>\d\.\d).*\n.*\n(?<threads>\d*)\s.*for\s(?<Seconds>\d+).*\n.*using\s(?<clustersize>[0-9]*)KB.*\n.*\n.*size:\s(?<currentfilesize>\d+).*\n.*\n.*\n.*\n.*\s(?<IOs>\d*\.\d*).*\n.*\s(?<MBs>\d*\.\d*).*\n.*\n.*\s(?<MinLatency_ms>\d+).*\n.*\s(?<AvgLatency_ms>\d+).*\n.*\s(?<MaxLatency_ms>\d+).*\n.*\n.*\n\%\:..(?<ms>\d*\s+)* Here's a snippet of the output - note the headers, which change during the SQLIO batch run: File

    Read the article

  • Simple string parsing with C++

    - by Andreas Brinck
    I've been using C++ for quite a long time now but nevertheless I tend to fall back on scanf when I have to parse simple text files. For example given a config like this (also assuming that the order of the fields could vary): foo: [3 4 5] baz: 3.0 I would write something like: char line[SOME_SIZE]; while (fgets(line, SOME_SIZE, file)) { int x, y, z; if (3 == sscanf(line, "foo: [%d %d %d]", &x, &y, &z)) { continue; } float w; if (1 == sscanf(line, "baz: %f", &w)) { continue; } } What's the most concise way to achieve this in C++? Whenever I try I end up with a lot of scaffolding code.

    Read the article

  • Parsing response from the WSDL

    - by htf
    Hello. I've generated the web service client in eclipse for the OpenCalais WSDL using the "develop" client type. Actually I was following this post so not really going in detail. Now when I get the results this way: new CalaisLocator().getcalaisSoap().enlighten(key, content, requestParams);, I get the String object, containing the response XML. Sure it's possible to parse that XML, but I think there must be some way to do it automatically, e.g. getting the response object in the form of some list whatsoever?

    Read the article

  • Parsing CSV File to MySQL DB in PHP

    - by Austin
    I have a some 350-lined CSV File with all sorts of vendors that fall into Clothes, Tools, Entertainment, etc.. categories. Using the following code I have been able to print out my CSV File. <?php $fp = fopen('promo_catalog_expanded.csv', 'r'); echo '<tr><td>'; echo implode('</td><td>', fgetcsv($fp, 4096, ',')); echo '</td></tr>'; while(!feof($fp)) { list($cat, $var, $name, $var2, $web, $var3, $phone,$var4, $kw,$var5, $desc) = fgetcsv($fp, 4096); echo '<tr><td>'; echo $cat. '</td><td>' . $name . '</td><td><a href="http://www.' . $web .'" target="_blank">' .$web.'</a></td><td>'.$phone.'</td><td>'.$kw.'</td><td>'.$desc.'</td>' ; echo '</td></tr>'; } fclose($file_handle); show_source(__FILE__); ?> First thing you will probably notice is the extraneous vars within the list(). this is because of how the excel spreadsheet/csv file: Category,,Company Name,,Website,,Phone,,Keywords,,Description ,,,,,,,,,, Clothes,,4imprint,,4imprint.com,,877-466-7746,,"polos, jackets, coats, workwear, sweatshirts, hoodies, long sleeve, pullovers, t-shirts, tees, tshirts,",,An embroidery and apparel company based in Wisconsin. ,,Apollo Embroidery,,apolloemb.com,,1-800-982-2146,,"hats, caps, headwear, bags, totes, backpacks, blankets, embroidery",,An embroidery sales company based in California. One thing to note is that the last line starts with two commas as it is also listed within "Clothes" category. My concern is that I am going about the CSV output wrong. Should I be using a foreach loop instead of this list way? Should I first get rid of any unnecessary blank columns? Please advise any flaws you may find, improvements I can use so I can be ready to import this data to a MySQL DB.

    Read the article

  • Actionscript 3 svg XML parsing bug?

    - by Mahir
    Hey I get two different results when using the for each loop below. As far as I can tell there's no difference aside from attributes in the two XML literals. for each (var pathXML:XML in svg.path) { // do stuff... trace(pathXML.@stroke) } // This one works, the loop iterates once over the single path element... var svg:XML = <svg> <path stroke="#00FF00" /> </svg> // This one doesn't, the loop just exits. var svg:XML = <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="612px" height="792px" viewBox="0 0 612 792" enable-background="new 0 0 612 792" xml:space="preserve"> <path fill="#FFFFFF" stroke="#000000" d="M160.333,372.444c0,0,17.778-115.555,60-63.333s27.778-106.666,78.889,40" /> </svg>

    Read the article

  • Parsing returned array in javascript

    - by Dan
    I'm making a call to PayPal's credit card processor, and after a successful/unsuccessful transaction it returns me a string that looks like this: DoDirectPayment failed: Array ( [TIMESTAMP] = 2010%2d05%2d02T23%3a33%3a28Z [CORRELATIONID] = 8c503f5c6c861 [ACK] = Failure [VERSION] = 51%2e0 [BUILD] = 1268624 [L_ERRORCODE0] = 10527 [L_SHORTMESSAGE0] = Invalid%20Data [L_LONGMESSAGE0] = This%20transaction%20cannot%20be%20processed%2e%20Please%20enter%20a%20valid%20credit%20card%20number%20and%20type%2e [L_SEVERITYCODE0] = Error [AMT] = 90%2e00 [CURRENCYCODE] = USD ) I'm not a javascript pro, but how exactly can I turn that into a parseable array? Thank you!

    Read the article

  • Javascript handling textarea

    - by bbenton
    Hi all, I'm a bit new to Javascript and am trying to create a delimited string from a textare. The problem is when passing in the textarea, it adds newlines for each row on the textarea. I need to have the entire textarea parsed into a string with a delimiter for each line (replacing the newline char). So for example, if you passed in a textarea with the following lines (which is also how it looks when using the alert function): abcd efgh ijkl It would look like: abcd-efgh-ijkl after parsing. function submitToForm(form) { var param_textarea = form.listofplugins.value; var test = param_textarea.replace(/\\r?\\n/, /:/) alert(test); } Thanks a lot!

    Read the article

  • Need help parsing HTML with a regex in python

    - by laspal
    Hi, My string is mystring = "<tr><td><span class='para'><b>Total Amount : </b>INR (Indian Rupees) 100.00</span></td></tr>" My problem here is I have to search and get the total amount test = re.search("(Indian Rupees)(\d{2})(?:\D|$)", mystring) but my test give me None. How can I get the values and values can be 10.00, 100.00, 1000.00 Thanks

    Read the article

  • Unable to get nodeValue using DOMDocument class in PHP

    - by Harish
    I am Parsing a HTML document using DOMDocument Class in PHP, i wanted to get the nodeValue of a div element, but it is giving me null, <div id="summary"> Hi, my name is <span>ABC</span> <br/> address is here at stackoverflow... <span>.... .... <div> want to get the value inside the div, and the code i wrote wass $div_node=$dom->getElementById("summary"); $node_value=$div_node->nodeValue; but it is giving me a null value, please help.

    Read the article

  • Problem with parsing SQL into table variable

    - by Stanley Ross
    I'm using the following code to read a SQL XML Variable into a table variable. I am getting the following error. " Incorrect syntax near '.'. " Can't quite Figure it out DECLARE @LOBS Table ( LineGUID varchar(40) ) DECLARE @lg xml SET @lg = '<?xml version="1.0" encoding="utf-16" standalone="yes"?> <Table> <LOB> <LineGuid>d6e3adad-8c53-4768-91a3-745c0dae0e08</LineGuid> </LOB> <LOB> <LineGuid>4406db8f-0d19-47da-953b-afc1db38b124</LineGuid> </LOB> </Table>' INSERT INTO @LOBS(LineGUID) SELECT ParamValues.ID.value('.','VARCHAR(40)') FROM @lg.nodes('/Table/LOB/LineGuid') AS ParamValues(ID)

    Read the article

  • IIS7 Rewrite rule being duplicated across 2 different websites (unwanted)

    - by Matt
    We have a IIS7 on Windows Server 2008. It is hosting a handful of sites, on a handful of ip addresses. 2 of those sites are actually wildcards on the domain: *.firstdomain.com *.seconddomain.com However, I am finding that any URL Rewrite rules I add for one of these "websites", is automatically in the URL Rewrite section for the other. Similarly, if I disable the rule in in one, it disables in the other. This doesn't happen with the other sites defined on this server, just these two. I look at the parent (top level, the server as a whole), and the rule is not there. Any idea what's going on here?

    Read the article

  • Parsing XML file using a for loop

    - by Johnny Spintel
    I have been working on this program which inserts an XML file into a MYSQL database. I'm new to the whole .jar idea by inserting packages. Im having an issue with parse(), select(), and children(). Can someone inform me how I could fix this issue? Here is my stack trace and my program below: Exception in thread "main" java.lang.Error: Unresolved compilation problems: The method select(String) is undefined for the type Document The method children() is undefined for the type Element The method children() is undefined for the type Element The method children() is undefined for the type Element The method children() is undefined for the type Element at jdbc.parseXML.main(parseXML.java:28) import java.io.*; import java.sql.*; import org.jsoup.Jsoup; import org.w3c.dom.*; import javax.xml.parsers.*; public class parseXML{ public static void main(String xml) { try{ BufferedReader br = new BufferedReader(new FileReader(new File("C:\\staff.xml"))); String line; StringBuilder sb = new StringBuilder(); while((line=br.readLine())!= null){ sb.append(line.trim()); } Document doc = Jsoup.parse(line); StringBuilder queryBuilder; StringBuilder columnNames; StringBuilder values; for (Element row : doc.select("row")) { // Start the query queryBuilder = new StringBuilder("insert into customer("); columnNames = new StringBuilder(); values = new StringBuilder(); for (int x = 0; x < row.children().size(); x++) { // Append the column name and it's value columnNames.append(row.children().get(x).tagName()); values.append(row.children().get(x).text()); if (x != row.children().size() - 1) { // If this is not the last item, append a comma columnNames.append(","); values.append(","); } else { // Otherwise, add the closing paranthesis columnNames.append(")"); values.append(")"); } } // Add the column names and values to the query queryBuilder.append(columnNames); queryBuilder.append(" values("); queryBuilder.append(values); // Print the query System.out.println(queryBuilder); } }catch (Exception err) { System.out.println(" " + err.getMessage ()); } } }

    Read the article

  • How to redirect a form's get variables with IIS7

    - by Gareth
    Is it possible (and if so how) to redirect the url from a forms get variables into something more url friendly using IIS 7's URL Rewrite module. An example would be /Catalog/Search/Title=Something&Order=Price into /Catalog/Search/Title/Something/Order/Price Thanks for any suggestions

    Read the article

  • Parsing NTFS Partition in C

    - by DooriBar
    Hello all, I'm just a beginner and I have a need to parse a NTFS partition for the purpose of extracting Security Descriptors. (I been trying to use the native functions of the Windows API, but my conclusion is that something is seriously wrong with the functions' behavior, or their documentation.) I was wondering if anybody here experienced with such requirement, and could give me few hints, references, guidance... where to begin? (I've found www.ntfs.com, seems to have NTFS structure information, but I'm afraid I'll need something more to get started...) My intention is to use it under Windows XP. Thanks in advanced, Doori Bar

    Read the article

  • Parsing/executing C# code in C++ (on Linux)?

    - by Stick it to THE MAN
    I want to be able to add scripting functionality to my application. One of the language bindings I am considering is C# (and possibly VB.Net). The challenge is this: My application is developed in C++ My application runs on Linux I am aware of Mono, but I dont know (as yet), what is required to allow my C++ appliaction (running on linux), to be scriptable with .Net languages. Is this feasible? Am I crazy for even thinking of doing this? If I'm not crazy, can anyone provide some guidelines on how to go about implementing this? Help, tips, ideas, suggestions anyone?

    Read the article

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