Search Results

Search found 4962 results on 199 pages for 'parse'.

Page 14/199 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Python3k parse string re help

    - by dsaccount1
    "8,5,,1,4,7,,,,7,,1,9,3,6,,,8,6,3,9,,2,5,4,,,,,3,2,,,7,4,1,1,,4,,6,9,,5,,,,5,,,1,,6,3,,,6,5,,,,7,4,,1,7,6,,,,8,,5,,,7,1,,3,9," I'm doing a programming challenge where i need to parse this sequence into my sudoku script. Need to get the above sequence into 8,5,0,1,4,7,0,0,0,7,0,1,9,3,6,0,0,8......... I tried re but without success, help is appreciated, thanks.

    Read the article

  • php file downloads instead of being processed with ajax on apache

    - by eagleon
    I have a small website where some content is displayed within a HTML tag using AJAX. The content is simply taken from another page on the same web site. However, sometimes instead of loading the parsed PHP file, the browser displays a download box instead. I downloaded the file and this is what it looks like a text file mixed with binary or gzipped data. I can't paste the binary stuff here, but here are some of the headers: Jul 2012 18:52:16 GMT Server: Apache/2 X-Powered-By: PHP/5.3.10 Content-Encoding: gzip Vary: Accept-Encoding,User-Agent Keep-Alive: timeout=1, max=95 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html HTTP/1.1 304 Not Modified Date: Sun, 01 Jul 2012 18:52:16 GMT Server: Apache/2 Connection: Keep-Alive Keep-Alive: timeout=1, max=93 ETag: "2fc857-409-4c39691c59b40" HTTP/1.1 304 Not Modified Date: Sun, 01 Jul 2012 18:52:16 GMT Server: Apache/2 Connection: Keep-Alive Keep-Alive: timeout=1, max=92 ETag: "2fc854-3e5-4c39691b65900" HTTP/1.1 304 Not Modified Date: Sun, 01 Jul 2012 18:52:16 GMT Server: Apache/2 Connection: Keep-Alive Keep-Alive: timeout=1, max=91 ETag: "2fc847-3e3-4c3969197d480" and large blocks of stuff like this: µàl]&BaËÜk#ìÏ

    Read the article

  • Treetop basic parsing and regular expression usage

    - by ucint
    I'm developing a script using the ruby Treetop library and having issues working with its syntax for regex's. First off, many regular expressions that work in other settings dont work the same in treetop. This is my grammar: (myline.treetop) grammar MyLine rule line string whitespace condition end rule string [\S]* end rule whitespace [\s]* end rule condition "new" / "old" / "used" end end This is my usage: (usage.rb) require 'rubygems' require 'treetop' require 'polyglot' require 'myline' parser = MyLineParser.new p parser.parse("randomstring new") This should find the word new for sure and it does! Now I wont to extend it so that it can find new if the input string becomes "randomstring anotherstring new yetanother andanother" and possibly have any number of strings followed by whitespace (tab included) before and after the regex for rule condition. In other words, if I pass it any sentence with the word "new" etc in it, it should be able to match it. So let's say I change my grammar to: rule line string whitespace condition whitespace string end Then, it should be able to find a match for: p parser.parse("randomstring new anotherstring") So, what do I have to do to allow the string whitespace to be repeated before and after condition? If I try to write this: rule line (string whitespace)* condition (whitespace string)* end , it goes in an infinite loop. If i replace the above () with [], it returns nil In general, regex's return a match when i use the above, but treetop regex's dont. Does anyone have any tips/points on how to go about this? Plus, since there isn't much documentation for treetop and the examples are either too trivial or too complex, is there anyone who knows a more thorough documentation/guide for treetop?

    Read the article

  • Regular expression of unicode characters on string

    - by Marcus King
    I'm working in c# doing some OCR work and have extracted the text I need to work with. Now I need to parse a line using Regular Expressions. string checkNum; string routingNum; string accountNum; Regex regEx = new Regex(@"\u9288\d+\u9288"); Match match = regEx.Match(numbers); if (match.Success) checkNum = match.Value.Remove(0, 1).Remove(match.Value.Length - 1, 1); regEx = new Regex(@"\u9286\d{9}\u9286"); match = regEx.Match(numbers); if(match.Success) routingNum = match.Value.Remove(0, 1).Remove(match.Value.Length - 1, 1); regEx = new Regex(@"\d{10}\u9288"); match = regEx.Match(numbers); if (match.Success) accountNum = match.Value.Remove(match.Value.Length - 1, 1); The problem is that the string contains the necessary unicode characters when I do a .ToCharArray() and inspect the contents of the string, but it never seems to recognize the unicode characters when I parse the string looking for them. I thought strings in C# were unicode by default.

    Read the article

  • Input string was not in the correct format using int.Parse

    - by JDWebs
    I have recently been making a login 'representation' which is not secure. So before answering, please note I am aware of security risks etc., and this will not be on a live site. Also note I am a beginner :P. For my login representation, I am using LINQ to compare values of a DDL to select a username and a Textbox to enter a password, when a login button is clicked. However, an error is thrown 'Input string was not in the correct format', when using int.Parse. Front End: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login_Test.aspx.cs" Inherits="Login_Login_Test" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Login Test</title> </head> <body> <form id="LoginTest" runat="server"> <div> <asp:DropDownList ID="DDL_Username" runat="server" Height="20px" DataTextField="txt"> </asp:DropDownList> <br /> <asp:TextBox ID="TB_Password" runat="server" TextMode="Password"></asp:TextBox> <br /> <asp:Button ID="B_Login" runat="server" onclick="B_Login_Click" Text="Login" /> <br /> <asp:Literal ID="LI_Result" runat="server"></asp:Literal> </div> </form> </body> </html> Back End: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Login_Login_Test : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Binder(); } } private void Binder() { using (DataClassesDataContext db = new DataClassesDataContext()) { DDL_Username.DataSource = from x in db.DT_Honeys select new { id = x.UsernameID, txt = x.Username }; DDL_Username.DataValueField = "id"; DDL_Username.DataTextField = "txt"; DDL_Username.DataBind(); } } protected void B_Login_Click(object sender, EventArgs e) { if (TB_Password.Text != "") { using (DataClassesDataContext db = new DataClassesDataContext()) { DT_Honey blah = new DT_Honey(); blah = db.DT_Honeys.SingleOrDefault(x => x.UsernameID == int.Parse(DDL_Username.SelectedValue.ToString())); if (blah == null) { LI_Result.Text = "Something went wrong :/"; } if (blah.Password == TB_Password.Text) { LI_Result.Text = "Credentials recognised :-)"; } else { LI_Result.Text = "Error with credentials :-("; } } } } } I am aware this problem is very common, but none of the help I have found online is useful/relevant. Any help/suggestions appreciated; thank you for your time :-).

    Read the article

  • Hibernate - H2 db -- Could not parse mapping document from resource

    - by user1849757
    * Each of below files are in same location * Error : SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. org.hibernate.InvalidMappingException: Could not parse mapping document from resource ./employee.hbm.xml at org.hibernate.cfg.Configuration.addResource(Configuration.java:616) at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1635) at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1603) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1582) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1556) at org.hibernate.cfg.Configuration.configure(Configuration.java:1476) at org.hibernate.cfg.Configuration.configure(Configuration.java:1462) at com.yahoo.hibernatelearning.FirstExample.main(FirstExample.java:19) Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input stream at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:555) at org.hibernate.cfg.Configuration.addResource(Configuration.java:613) ... 7 more Caused by: org.dom4j.DocumentException: http://hibernate.sourceforge.net/%0Ahibernate-mapping-3.0.dtd Nested exception: http://hibernate.sourceforge.net/%0Ahibernate-mapping-3.0.dtd at org.dom4j.io.SAXReader.read(SAXReader.java:484) at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:546) ... 8 more Exception in thread "main" java.lang.NullPointerException at com.yahoo.hibernatelearning.FirstExample.main(FirstExample.java:33) Hibernate Config: hibernate.cfg.xml <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">org.h2.Driver</property> <property name="hibernate.connection.url">jdbc:h2:./db/repository</property> <property name="hibernate.connection.username">sa</property> <property name="hibernate.connection.password"></property> <property name="hibernate.default_schema">PUBLIC</property> <property name="hibernate.dialect">org.hibernate.dialect.H2Dialect</property> <property name="hibernate.show_sql">true</property> <property name="hibernate.hbm2ddl.auto">update</property> <!-- Mapping files --> <mapping resource="./employee.hbm.xml"/> </session-factory> </hibernate-configuration> Mapping Config: employee.hbm.xml <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/ hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="com.yahoo.hibernatelearning.Employee" table="employee"> <id name="empId" type="int" column="emp_id" > <generator class="native"/> </id> <property name="empName"> <column name="emp_name" /> </property> <property name="empSal"> <column name="emp_sal" /> </property> </class> </hibernate-mapping>

    Read the article

  • Parsing a given binary tree using python?

    - by kaushik
    Parse a binary tree,referring to given set of features,answering decision tree question at each node to decide left child or right child and find the path to leaf node according to answer given to the decision tree.. input wil be a set of feature which wil help in answering the question at each level to choose the left or right half and the output will be the leaf node.. i need help in implementing this can anyone suggest methods?? Please answer... thanks in advance..

    Read the article

  • Parsing RFC 2822 date in JAVA

    - by DutrowLLC
    I need to parse an RFC 2822 string representation of a date in Java. An example string is here: Sat, 13 Mar 2010 11:29:05 -0800 It looks pretty nasty so I wanted to make sure I was doing everything right and would run into weird problems later with the date being interpreted wrong either through AM-PM/Military time problems, UTC time problems, problems I don't anticipate, etc... Thanks!

    Read the article

  • html truncator in java

    - by sammichy
    Is there any utility (or sample source code) that truncates HTML (for preview) in Java? I want to do the truncation on the server and not on the client. I'm using HTMLUnit to parse HTML. UPDATE: I want to be able to preview the HTML, so the truncator would maintain the structure while stripping out the elements after the desired output length.

    Read the article

  • Ruby Rss parser and event trigger

    - by fenec
    I'm using RSS library so i can parse Atom and RSS in Ruby and Rails and store it in a model. I've looked at the standard RSS library, but is there one library that will auto-detect that there is a new rss feed so i can update my database ? what are the best practice to trigger an instruction in order to store the new rss feed ? should i use threads to handle that problem ?is it going to be slow? thank you for your help

    Read the article

  • Rich-Text Editing of Word Documents on the Web via ASP.NET

    - by Caveatrob
    My users upload Word 2007 documents to our site and I'd like to load them into a rich edit control of some kind so the users can make modifications/ comment, etc. What mechanisms are available to: load the Word document via ASP.NET, and parse/format/display the document in a rich editing control? Also, what kinds of rich editing controls are best to use in this circumstance?

    Read the article

  • jquery - get url path?

    - by KittyYoung
    I know I can use window.location.pathname to return a url, but how do I parse the url? I have a url like this: http://localhost/messages/mine/9889 and I'm trying to check to see if "mine" exists in that url? So, if "mine" is the second piece in that url, I want to write an if statement based on that... if(second argument == 'mine') { do something }

    Read the article

  • parsing a string based on specified identifiers

    - by jml
    Let's say that I have the following text: input = "one aaa and bbb two bbbb er ... // three cccc" I would like to parse this into a group of variables that contain criteria = ["one", "two", "three"] v1,v2,v3 = input.split(criteria) I know that the example above won't work, but is there some utility in python that would allow me to use this sort of approach? I know what the identifiers will be in advance, so I would think that there has got to be a way to do this... Thanks for any help, jml

    Read the article

  • Can any body help to split php source code

    - by joe-on-wp
    hi, can any body help me on separating this example of data that i need to parse and seperate text just like PHPDoc. It is PHP source code. The example string : function one_to_tree() { //bla bla bla return FALSE; } function two_to_tree() { //bla bla bla return FALSE; } function three_to_tree() { if ($sample){ //bla bla bla } return FALSE; } can anybody help me how to seperate above string based on "function" word and create and array. Thank you

    Read the article

  • Non PHP site generates php errors

    - by YsoL8
    Hello. I have this error appearing: Parse error: syntax error, unexpected T_STRING in /home/ondesign/public_html/ywamleicester.org/index.html on line 1 Which I think is a php error. However, the site in question is an out of the box iweb design with no php in it. I have no idea what could be doing it.

    Read the article

  • Automated download of website content using ASP.net

    - by Yaaqov
    Using ASP.net, what methods can I use to do the following: Open up a connection to a given URL to read HTML content Parse the given URL for hyperlinks, and place them in an array Loop through each hyperlink (only 1 level down), opening each one, saving the HTML contents in a table, and move to the next hyperlink until done. If ASP.net is not up to the task, other languages or free scripts/toolkits would be acceptable. Thanks.

    Read the article

  • Retrieving information with Python's urllib from a page that is done via __doPostBack()?

    - by Omar
    I'm trying to parse a page that has different sections that are loaded with a Javascript __doPostBack() function. An example of a link is: javascript:__doPostBack('ctl00$cphMain$ucOemSchPicker$dlSch$ctl03$btnSch','') As soon as this is clicked, the browser doesn't fetch a new URL but a section of webpage is updated to reflect new information. What would I pass into a urllib function to complete the operation?

    Read the article

  • receive string with chars

    - by Meloun
    Hi all, i am quite new in python. I am receiving (through pyserial) string with data values. How can I parse these data to particular data structure? I know that 0-1 byte : id 2-5 byte : time1 =>but little endian (lsb first) 6-9 byte : time2 =>but little endian (lsb first) and I looking for a function: def parse_data(string): data={} data['id'] = ?? data['time1'] = ?? data['time2'] = ?? return data thanks

    Read the article

  • [PHP] How to pass array as multiple parameters to function?

    - by vbklv
    I have a parameters array: $params[1] = 'param1'; $params[2] = 'param2'; $params[3] = 'param3'; ... $params[N] = 'paramN'; I have a caller to various functions: $method->$function( $params ); How can I parse the $params array, so multiple (and unlimited) parameters can be passed to any function: $method->$function( $param[1], $param[2], ..., $param[N] );

    Read the article

  • [python] parsing a string based on specified identifiers

    - by jml
    Let's say that I have the following text: in = "one aaa two bbbb three cccc" I would like to parse this into a group of variables that contain notworking = ["one", "two", "three"] v1,v2,v3 = in.split(notworking) I know that the example above won't work, but is there some utility in python that would allow me to use this sort of approach? I know what the identifiers will be in advance, so I would think that there has got to be a way to do this... Thanks for any help, jml

    Read the article

  • Parsing Range Expressions

    - by sameer karjatkar
    I have a string (R(46 - 9900)) AND ( NOT (R(48 - 9900))) where R denotes Range . If you evaluate the expression it results in R(46-47) , considering the logical operators (AND,NOT). I have a requirement where I need to parse such a string and evaluate it to a correct result . I have to use C++ as a programming tool to achieve this result . Can anyone suggest a few guide lines as to how do I proceed on this ?

    Read the article

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