Jump to content
xisto Community

slu

Members
  • Content Count

    27
  • Joined

  • Last visited

About slu

  • Rank
    Newbie [Level 2]

Contact Methods

  • Website URL
    http://lund.dk.eu.org/
  1. Several options for interactive mode already exists. Perl has a builtin debugger, that enables you to try code (and scripts) interactively. To get an debugging prompt start Perl like this: CONSOLE $ perl -d -e 1 Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main:-e:1): 1 DB<1> print "Hello\n"; Hello DB<2> exit; Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, h q, h R or h o to get additional info. DB<3> q $ you can read the man pages "man perldebtut" and "man perldebug" or perldebug and perldebtut to learn more. If the debugger isn't your thing, you can try the Perl Console, that seems to be very similar to the Python interactive mode: http://www.sukria.net/perlconsole.html It looks like this: Another option is The Perl Shell (psh), which is exactly that: a shell aiming at being a replacement of your favorite shell (i.e. bash). It's a bit different fromt the debugger and console, but you might like it: https://sourceforge.net/projects/psh/
  2. ...or let MySQL do the counting: $result = mysql_query("SELECT count(*) as count FROM users WHERE username='$username'");$count = mysql_result($result, 0, "count"); and I would change the compare to $count > 0 in the if statement, just to be sure.
  3. I've never had the need (urge) to write a desktop app. (in any language). My first choice for doing such a thing, would be Perl. My second choice would be Java. Several GUI toolkits exists for Perl: Tk, Gtk, Win32, QT, and wx. Perl/Tk is the oldest and simplest, and it's cross platform. Wx is what I would check out first, unless the app. should only run on Linux or Windows - then I would go for Gtk or Win32... But if it's a game you're doing you have to look at Perl/SDL, which is a toolkit aimed at game. For inspiration check out the great and addictive arcade game Frozon Bubble - written in 100% Perl!
  4. Your code does not work. Depending on the final if-statement $seconds might be undefined. A much simpler version would use the standard localtime() funtion: sub ConvertSeconds { my ($secs, $minutes, $hours, $days) = localtime(shift); return $days-1,$hours-1,$minutes,$secs;}
  5. Check out phpchartPlus and Libchart. They offer similar features for generating charts. Both are free to use.
  6. Your're confusing the terms a bit here. A session really isn't an alternative to using cookies. When using a session, the default behavior is to store the session using a cookie, which will happen automatically. Check out the documentation of start_session(), which you need to call to use sessions: http://dk2.php.net/manual/en/function.session-start.php If you don't want to rely on cookies at all, you either add the Session ID (SID) to all your urls/links or enable automatic url rewriting. You can read more about this here: http://forums.xisto.com/no_longer_exists/
  7. slu

    Searching In Mysql

    I'm guessing that $text = 'First Second'... You need to insert some wild cards, like this $search_text = '%' . str_replace(' ', '%', $text) . '%'; and then do: SELECT * FROM `$table` WHERE `row` LIKE '$search_text' this should search for everything that includes the two words... You might need to put some extra spaces in the $searc_text...
  8. The textarea tag does not use a value attribute. Instead you should place you contents between a start and end tag. Like this: <textarea type="blah" etc... value="><?php echo &_POST['note_wide'] ?></textarea>
  9. Why wouldn't the perl script work? Have you tried ActivePerl? Most perl scripts work across platforms. And if ActivePerl doesn't work you could try installing Cygwin, where you get a more complete UNIX/Linux-like environment (including perl) on a Windows-system. I would suggest using a proper build tool. In the case of Java development Apache Ant is the standard. It has the ability to compile, sign and upload - just what you need...
  10. You can get an excellent Java book for free: Thinking in Java by Bruce Eckel.
  11. No, Opera's appName is Netscape! It might seem weird, but it has been chosen for compatibility reasons.... You need to check the User Agent String to detect whether a Opera browser is used. The User Agent String will include the name "Opera", so your code could be written like this: if ((navigator.userAgent).indexOf("Opera") != -1) { your code etc etc;} If you really want to go in to the gory details of browser detection check out the Browser Capabilities Project.
  12. Yeah, the Evolt browser archive is a nice thing, esp. if you have a user/customer using some old system... But the guys at BrowserCam are a bit smarter. Here you can submit an url and a set of screen dumps are created automatically on several combinations of operating systems and browsers. See https://www.browsercam.com/ Only bad thing: it's a paid service, but you can try it out for free, and the prices are reasonable. Implementing the functionality of BrowserCam yourself wouldn't be impossible. Start by installing some kind of virtualisation system (e.g. qdos or vmware), and you would be able to run several different operating systems on one machine. Alternativly you could make a multi boot machine, but then the machine had to do a reboot everytime a new OS was needed. Now each OS should be set up to do the following when starting (booting): 1. look for an url (or list of urls) on a FTP-server, 2. open the urls in the installed browsers 3. taking screen shots of each browsers, and upload the image to the FTP-server Now the FTP-server could be on the same physical machine, where we are running all the test OS's virtually... the process might take some time, but it would run automatically, and your web design would be tested across several OS'es and browsers! It's not rocket science, but it will proberly take some trial and error.
  13. That would be print. Here's the most simple perl/cgi-script: #!/usr/local/bin/perlprint "Content-Type: text/plain\n\n";print "hello";Notes: * You might need to change the path in the first (shebang) line, it depends on your platform... * Change text/plain to text/html if you want to return HTML * print is standard perl and has nothing to do with CGI/LWP - everything sent to standard out is send to the users browser.
  14. An Apache webserver can not run servlets/jsp's... you need an servlet engine for that, for example Apache Tomcat - http://tomcat.apache.org/ The Apache Tomcat has its own built-in webserver, but can also be used in conjunction with the Apache webserver. For developmet I deploy and run applications directly on the tomcat server. There's some ok documentation on the tomcat website. After having installed tomcat try the Application Developer's Guide - it's short and pretty east to follow: http://tomcat.apache.org/tomcat-5.5-doc/appdev/ JSP and Servlets are not the same from a logical point of view, but when Tomcats "sees" a JSP-file it converts it into Java code which is compiled into a Servlet.
  15. You're trying to run Java code compiled with 1.5 SDK on an earlier VM (e.g. 1.4). Version 49 => Java 1.5 and 48 => Java 1.4 By default compiling code with a 1.5 Java compiler will generate bytecode that only runs on a 1.5 VM, but you can set flags to make the bytecode backwards compatible. Tomcat 5.5.x is (AFAIK) buildt with 1.5 SDK, but with backwards compability enabled. Thus Tomcat can run on an 1.4 VM... You could either upgrade the VM Tomcat is running on, or compile your code with the "-target 1.4" option, e.g. javac -target 1.4 MyCode.java
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.