Search Results

Search found 1568 results on 63 pages for 'tim dexter'.

Page 20/63 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Why does my Perl CGI script complain about "Can't locate CGI/Simple.pm"?

    - by dexter
    For more information see this Example use strict; use warnings; use CGI::Simple; use DBI; my $cgi = CGI::Simple->new; my $dsn = sprintf( 'DBI:mysql:database=%s;host=%s', 'cdcol', 'localhost' ); my $dbh = DBI->connect($dsn, root => '', { AutoCommit => 0, RaiseError => 0 } ); my $status = $dbh ? 'Connected' : 'Failed to connect'; print $cgi->header, <<HTML; <!DOCTYPE HTML> <html> <head><title>Test</title></head> <body> <h1>Perl CGI Script</h1> <p>$status</p> </body> </html> HTML This code gives me error: The server encountered an internal error and was unable to complete your request. Error message: Can't locate CGI/Simple.pm in @INC (@INC contains: C:/xampp/perl/site/lib/ C:/xampp/perl/lib C:/xampp/perl/site/lib C:/xampp/apache) at C:/xampp/htdocs/perl/index.pl line 4. BEGIN failed--compilation aborted at C:/xampp/htdocs/perl/index.pl line 4. , Error 500 localhost 3/25/2010 11:19:19 AM Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 What does this mean and how can I resolve it?

    Read the article

  • does php mysql_fetch_array works with html input box?

    - by dexter
    this is my entire PHP code: <?php if(empty($_POST['selid'])) {echo "no value selected"; } else { $con = mysql_connect("localhost","root",""); if(mysql_select_db("cdcol", $con)) { $sql= "SELECT * FROM products where Id = '$_POST[selid]'"; if($result=mysql_query($sql)) { echo "<form name=\"updaterow\" method=\"post\" action=\"dbtest.php\">"; while($row = mysql_fetch_array($result)) { echo "Id :<input type=\"text\" name=\"ppId\" value=".$row['Id']." READONLY></input></br>"; echo "Name :<input type=\"text\" name=\"pName\" value=".$row['Name']."></input></br>"; echo "Description :<input type=\"text\" name=\"pDesc\" value=".$row['Description']."></input></br>"; echo "Unit Price :<input type=\"text\" name=\"pUP\" value=".$row['UnitPrice']."></input></br>"; echo "<input type=\"hidden\" name=\"mode\" value=\"Update\"/>"; } echo "<input type=\"submit\" value=\"Update\">"; echo "</form>"; } else {echo "Query ERROR";} } } ?> PROBLEM here is, ....if the value i am getting from database using mysql_fetch_array($result) is like:(say Description is:) "my product" then; in input box it shows only "my" the word(or digit) after "SPACE"(ie blank space) doesn't get displayed? can input box like above can display the data with two or more words(separated by blank spaces)?

    Read the article

  • Perl - MySQL connection problem in windows

    - by dexter
    I have two folders php and perl they contain index.php and index.pl respectivly in index.pl my perl code looks like: #!/usr/bin/perl use Mysql; print "Content-type: text/html\n\n"; print "<h2>PERL-mySQL Connect</h2>"; print "page info"; $host = "localhost"; $database = "cdcol"; $user = "root"; $password = ""; $db = Mysql->connect($host, $database, $user, $password); $db->selectdb($database); when i run above code (ie type: http://localhost:88/perl/ in browser) following error comes Error message: Can't locate Mysql.pm in @INC (@INC contains: C:/xampp/perl/site/lib/ C:/xampp/perl/lib C:/xampp/perl/site/lib C:/xampp/apache) at C:/xampp/htdocs/perl/index.pl line 2. BEGIN failed--compilation aborted at C:/xampp/htdocs/perl/index.pl line 2. while this works: in browser http://localhost:88/php/ where index.php has: <?php $con = mysql_connect("localhost","root",""); if($con) { if(mysql_select_db("cdcol", $con)) { $sql="SELECT Id From products"; if(mysql_query($sql)) { $result = mysql_query($sql); if ($result)............

    Read the article

  • Stop IE users typing into the file upload input

    - by Dexter
    My testers have discovered that if you type free text into a file upload input then none of the buttons on the page work until that text is removed (so the page cannot be submitted). I am able to replicate this with the following ASPX code (with no code behind): <%@ Page Language="C#" AutoEventWireup="true" %> <!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"> <body> <form id="form1" runat="server"> <div> <asp:FileUpload ID="fuTest" runat="server" /> <asp:Button ID="btnSubmit" runat="server" Text="Submit" /> </div> </form> </body> </html> (Note that I haven't bound any handlers to the page; despite this, the page is submitted when the submit button is clicked only if no text is entered into the upload text box) Is there any way to prevent users from typing free text into a file upload control? It seems that this is only possible in IE - Firefox and Chrome natively prevent text from being entered into upload input fields. I've seen solutions elsewhere which suggest hiding input and replacing it with a label / button combo, but this seems like it might cause more problems and work inconsistently across browsers. Any thoughts?

    Read the article

  • how to check whether for each value in array is a numeric, alphabetical or alphanumeric (Perl)

    - by dexter
    i have array which values are user input like: aa df rrr5 4323 54 hjy 10 gj @fgf %d would be that array, now i want to check each value in array whether its numeric or alphabetic (a-zA-Z) or alphanumeric and save them in other respective arrays i have done: my @num; my @char; my @alphanum; my $str =<>; my @temp = split(" ",$str); foreach (@temp) { print "input : $_ \n"; if ($_ =~/^(\d+\.?\d*|\.\d+)$/) { push(@num,$_); } } this works, similarly i want to check for alphabet, and alphanumeric values note: alphanumeric ex. fr43 6t$ $eed5 *jh

    Read the article

  • getting error in perl :can't modify non-lvalue subroutine call

    - by dexter
    i have index.pl and subs.pl when i run the program user inserts date of birth and then it is passed to getage() subroutine in subs.pl . subs.pl has many subroutines. getage() than implicitly calls another subroutine called validate() which validates the date entered by user. when i run the index.pl user enters the date as: 03-04-2005 following error comes :can't modify non-lvalue subroutine call at subs.pl line 85, < line 1 and at 85th line of subs.pl i have list(my $val,my @value) = validate($dob); why such error comes any solutions

    Read the article

  • how to identify an argument as a "Year" in PERL

    - by dexter
    i have created a file argument.pl which takes several arguments first of which should be in form of a year example of argument : 2010 23 type here 2010 is a year my code does something like: use strict; use warning use Date::Calc qw(:all); my ($startyear, $startmonth, $startday) = Today(); my $weekofyear = (Week_of_Year ($startyear,$startmonth,$startday))[0]; my $Year = $startyear; ... ... if ($ARGV[0]) { $Year = $ARGV[0]; } here this code fill $Year with "current year" if if $ARGV[0] is null or doesn't exists now here instead of if ($ARGV[0]) is it possible to check that the value in $ARGV[0] is a valid year (like 2010, 1976,1999 etc.)

    Read the article

  • C++ LPTSTR to int (but memory overwrite problem using atoi)

    - by Dexter
    I have the following code, m_edit is a MFC CEdit (I know I would never use MFC but project demanded it). It's a simple loop, that gets the text from a text edit, converts it to integer after getting the first line, then stores it in m_y vector. LPTSTR szTemp; vector<int> m_y; for(int i = 0; i < m_edit->GetLineCount(); i++){ szTemp = s_y.GetBuffer(0); m_edit->GetLine(i, szTemp); // get line text store in szTemp y = atoi(szTemp); m_y.push_back(y); szTemp = ""; y = 0; } IMPORTANT EXAMPLE: So let's say the CEdit has 6 numbers: 0 5 2 5 18 6 If you use Visual Studio's debugger you will notice an anomaly!! Here's what it shows: y = 0 y = 5 y = 2 y = 5 y = 18 y = 68 Do you see that? szTemp when inserted into atoi, it returns the number 6, but concatenates the 2nd digit of the last number!!! This is why I did szTemp = "";, but the problem persists. Also, let's say the last number was 17 (not 18), then this time debugger would say y = 67, so it is definitely this problem. However, Visual Studio debugger, when you hover over szTemp during this iteration, it says '6' <--- not '68' inside szTemp. So somehow atoi is ruining it. Am I suppose to concatenate a \0 into szTemp before putting it into atoi? How do I solve this easily?

    Read the article

  • How to determine Scale of Line Graph based on Pixels/Height?

    - by Dexter
    I have a problem due to my terrible math abilities, that I cannot figure out how to scale a graph based on the maximum and minimum values so that the whole graph will fit onto the graph-area (400x420) without parts of it being off the screen (based on a given equation by user). Let's say I have this code, and it automatically draws squares and then the line graph based on these values. What is the formula (what do I multiply) to scale it so that it fits into the small graphing area? vector<int> m_x; vector<int> m_y; // gets automatically filled by user equation or values int HeightInPixels = 420;// Graphing area size!! int WidthInPixels = 400; int best_max_y = GetMaxOfVector(m_y); int best_min_y = GetMinOfVector(m_y); m_row = 0; m_col = 0; y_magnitude = (HeightInPixels/(best_max_y+best_min_y)); // probably won't work magnitude = (WidthInPixels/(int)m_x.size()); m_col = m_row = best_max_y; // number of vertical/horizontal lines to draw ////x_magnitude = (WidthInPixels/(int)m_x.size())/2; Doesn't work well ////y_magnitude = (HeightInPixels/(int)m_y.size())/2; Doesn't work well ready = true; // we have values, graph it Invalidate(); // uses WM_PAINT

    Read the article

  • log the http response codes in the file

    - by dexter
    i have created HTTP::Request which looks like this: #!/usr/bin/perl require HTTP::Request; require LWP::UserAgent; require HTTP::Cookies; $request = HTTP::Request->new(GET => 'http://www.google.com/'); $ua = LWP::UserAgent->new; $cookie_jar = HTTP::Cookies->new(); $ua->cookie_jar($cookie_jar); $cookie_jar->set_cookie(0,'testCookie','cookieValue','/','http://www.google.com/',80,0,0,86400,0); $response = $ua->request($request); if($response->is_success){ print "sucess\n"; print $response->code; print "\n"; } else { print "fail\n"; die $response->code; print "\n"; } now, When i send Request: i want to log the http response codes in the file please help thank you

    Read the article

  • set a cookie while sending PERL HTTP::Request

    - by dexter
    i have created HTTP::Request which looks like this: #!/usr/bin/perl require HTTP::Request; require LWP::UserAgent; $request = HTTP::Request->new(GET => 'http://www.google.com/'); $ua = LWP::UserAgent->new; $ua->cookie_jar({file => "testcookies.txt",autosave =>1}); $response = $ua->request($request); if($response->is_success){ print "sucess\n"; print $response->code; } else { print "fail\n"; die $response->code; } now, When i send Request: $request = HTTP::Request->new(GET => 'http://www.google.com/'); $ua = LWP::UserAgent->new; $ua->cookie_jar({file => "testcookies.txt",autosave =>1}); i want to set a cookie which might look like.. $request = HTTP::Request->new(GET => 'http://www.google.com/'); $ua = LWP::UserAgent->new; $ua->new CGI::Cookie(-name=>"testCookie",-value=>"cookieValue"); $ua->cookie_jar({file => "testcookies.txt"}); gives error though. AND, want to log the http response codes in the file please help thank you

    Read the article

  • How to re-render a page from a Google Chrome extension?

    - by Dexter
    I'm new to writing extensions for Google Chrome. I want to make an extension that only runs on a few pages (that I'll choose) and re-renders their CSS after the page has loaded (ideally I would like something similar to what you can do with GM_addStyle in greasemonkey scripts). How can I accomplish this in a Chrome extension?

    Read the article

  • How can I access a parent DOM from an iframe on a different domain?

    - by Dexter
    I have a website and my domain is registered through Network Solutions. I'm using their Web Forwarding feature which allows me to "mask" my domain so that when a user visits http://lucasmccoy.com they are actually seeing http://lucasmccoy.comlu.com/ through an HTML frame. The advantages of this are that the address bar still shows http://lucasmccoy.com/. The disadvantages are that I cannot directly edit the HTML page in which the frame is owned. For example, I cannot change the page title or favicon. I have tried doing it like so: $(function() { parent.document.title = 'Lucas McCoy'; }); But of course this gives me a JavaScript error: Unsafe JavaScript attempt to access frame with URL http://lucasmccoy.com/ from frame with URL http://lucasmccoy.comlu.com/. Domains, protocols and ports must match. I looked at this question attempting to do the same thing except the OP has access to the other pages HTML whereas I do not. Is there anyway in JavaScript/jQuery to make a cross-domain request to the DOM when you don't have access to that domain? Or is this something browsers just will not let happen for security reasons.

    Read the article

  • Embeddable database better than SQLite for java

    - by dexter
    I am creating a web application that is accessing a SQLite database in the server. I also have "clients" that updates this same database. As we know SQLite locks the entire database during INSERTs which are done by the clients and the web application is also trying to make some UPDATEs at the same time. So my problem now is about concurrency in database access. I would like to use an embeddable database like SQLite. Any suggestions.

    Read the article

  • mvn deploy to AWS (ssh via distributionManagement)

    - by Dexter
    I am working on deploying the WAR file to AWS using Maven. I am planning to use 'mvn deploy' for the same which would ssh the war file to AWS. I am following http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ssh-external.html. This is my POM file <project> ... <distributionManagement> <repository> <id>ssh-aws</id> <url>scpexe://<ec2 instance>.compute-1.amazonaws.com</url> </repository> </distributionManagement> <build> <extensions> <!-- Enabling the use of FTP --> <extension> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-ssh-external</artifactId> <version>1.0-beta-6</version> </extension> </extensions> </build> .. </project> This is my settings.xml <server> <id>ssh-aws</id> <username>aws-user</username> </server> The only issue is that I am unable to figure out the url in distributionManagement node of pom.xml. I am able to ssh in the AWS server by the following. ssh -i ~/pemfile/pemfile-key.pem aws-user@<ec2 instance>.compute-1.amazonaws.com But when I run mvn clean deploy, I receive this.. Exit code: 1 - Permission denied (publickey). -> [Help 1] Thanks in advance.

    Read the article

  • Creating a circually linked list in C#?

    - by Dexter
    What would be the best way to create a circually linked list in C#. Should I derive it from the LinkedList< T collection? I'm planning on creating a simple address book using this Linked List to store my contacts (it's gonna be a suck-y address book, but I don't care cause I'll be the only one to use it). I mainly just want to create the crucially linked list so that I can use it again in other projects. If you don't think the Linked List is the right way to go let me know which way would be better.

    Read the article

  • Java library suggestions for implementing a custom web server

    - by dexter
    I would like to create a web server that will serve/accept json files through REST. The JSON files being served will come from a database query and format the results into JSON. Any suggestions for a good java library. I have tried using Apache HTTPComponents. While maybe I can just create a servlet but I am not really allowed to install a servlet container in the server machine.

    Read the article

  • what is Perl equivalent of php $_POST and how to use it?

    - by dexter
    i have two perl files that is .pl files one is action.pl and another one is test.pl action.pl has a html form as: print $cgi->header, <<html; <form action="test.pl" method="post"> html while (my @row = $sth->fetchrow) { print $cgi->header, <<html; ID:<input name="pid" value="@row[0]" readonly="true"/><br/> Name: <input name="pname" value="@row[1]"/><br/> Description : <input name="pdescription" value="@row[2]"/><br/> Unit Price :<input name="punitprice" value="@row[3]"/><br/> html } print $cgi->header, <<html <input type="submit" value="update Row"> </form> html now, my question is what should i wright in test.pl so as to read what form is sending it?? in Other words what is Perl equivalent of PHP: $_POST['pid'] so that in test'pl we can read the data sent via form

    Read the article

  • What are the best settings of the H2 database for high concurrency?

    - by dexter
    There are a lot of settings that can be used in H2 database. AUTO_SERVER, MVCC, LOCK_MODE, FILE_LOCK and MULTI_THREADED. I wonder what combination works best for high concurrency setup e.g. one thread is doing INSERTs and another connection does some UPDATEs and SELECTs? I tried MVCC=TRUE;LOCK_MODE=3lFILE_LOCK=NO but whenever I do some UPDATEs in one connection, the other connection does not see it even though I commit it. By the way the connections are from different processes e.g. separate program.

    Read the article

  • When to use @Singleton in a Jersey resource

    - by dexter
    I have a Jersey resource that access the database. Basically it opens a database connection in the initialization of the resource. Performs queries on the resource's methods. I have observed that when I do not use @Singleton, the database is being open at each request. And we know opening a connection is really expensive right? So my question is, should I specify that the resource be singleton or is it really better to keep it at per request especially when the resource is connecting to the database? My resource code looks like this: //Use @Singleton here or not? @Path(/myservice/) public class MyResource { private ResponseGenerator responser; private Log logger = LogFactory.getLog(MyResource.class); public MyResource() { responser = new ResponseGenerator(); } @GET @Path("/clients") public String getClients() { logger.info("GETTING LIST OF CLIENTS"); return responser.returnClients(); } ... // some more methods ... } And I connect to the database using a code similar to this: public class ResponseGenerator { private Connection conn; private PreparedStatement prepStmt; private ResultSet rs; public ResponseGenerator(){ Class.forName("org.h2.Driver"); conn = DriverManager.getConnection("jdbc:h2:testdb"); } public String returnClients(){ String result; try{ prepStmt = conn.prepareStatement("SELECT * FROM hosts"); rs = prepStmt.executeQuery(); ... //do some processing here ... } catch (SQLException se){ logger.warn("Some message"); } finally { rs.close(); prepStmt.close(); // should I also close the connection here (in every method) if I stick to per request // and add getting of connection at the start of every method // conn.close(); } return result } ... // some more methods ... } Some comments on best practices for the code will also be helpful.

    Read the article

  • Is there a search engine that indexes source code of a web-page?

    - by Dexter
    I need to search the web for sites that are in our industry that use the same Adwords management company, to ensure that the said company is not violating our contract, as they have been accused of doing. They use a tracking code in the template of every page which has a certain domain in the URL, and I'm wondering if it's possible "Google" the source code using some bot that crawls the code rather than the content? For example, I bought an unlimited license for an image gallery, and I was asked to type the license number in a comment just before the script. I thought it was just so a human could look at the source and find out if someone paid, but it turned out that it was actually that they had a crawler looking for their source code and that comment. If it ran across the code on your site, it would look for the comment, and if it found one, it would check to see if it was an existing one. If not, it would first notify you of your noncompliance, and then notify the owner of the script. Edit: I'm looking to index HTML and JavaScript only, not the server-side languages or Java.

    Read the article

  • Java REST implementation: Jersey vs CXF

    - by dexter
    What do you think is the advantages/disadvantages between this two libraries? Which of these two are best suited for production environment? By the way I will be using JSON instead of XML. I also would like to know what library is most supported by the community e.g. tutorials, documentation.

    Read the article

  • Using Boost on ubuntu

    - by Dexter
    I've heard a lot of good comments about Boost in the past and thought I would give it a try. So I downloaded all the required packages from the package manager in Ubuntu 9.04. Now I'm having trouble finding out how to actually use the darn libraries. Does anyone know of a good tutorial on Boost that goes all the way from Hello World to Advanced Topics, and also covers how to compile programs using g++ on ubuntu?

    Read the article

  • move file from one location to another in putty

    - by dexter
    i have created folder on my server (ie finesse)- 'home' in which i have several perl(.pl) files as tt.pl, re.pl etc. now i have created new folder in 'home' folder called 'perl' and want to move tt.pl and re.pl in perl folder is there any command to do so (like cut-paste in windows)? note: i am using putty 0.60 on windows xp

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >