Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: PC888
  • Order by date
  1. PC888

    In need of a more efficient way to approach this task

    I notice that the file source.txt is opened once and the file compare_with.xml is opened many times. Not knowing the size of each file, I would suggest to scan source.txt once and make an array of expressions out of the file. Subsequently loop through file compare_with.xml once, and compare...
  2. PC888

    Calculator

    You can use a Stack class to create your calculator stack. The algorithm to evaluate arithmetic expressions is relatively simple. A complete example is given in Chapter 3 of Robert Sedgewick'S Algorithms in C (or the latest book, in Java), or Chapter 9 of Herbert Schildt's The art of C++ (or...
  3. PC888

    need help

    You can start by checking the cpan library for routines that allow you to surf the web using Perl, for example: http://search.cpan.org/~gaas/libwww-perl-5.808/lib/LWP.pm then there are others that help you manipulate your sql database, such as: http://search.cpan.org/search?query=mysql&mode=all
  4. PC888

    Stupidest Sort Problem Ever

    If for some security or other reasons you cannot post the data, you can successively remove the last half of the data and try the sort again. If you repeat for about 8 times (120 lines), the program is bound to work. Check what you have last removed to make it work, and you may be surprised to...
  5. PC888

    java file does not get compiled

    Even though DOS or Windows does not differentiate between upper and lower case file names, javac does. The file name that you supplied is a parameter to the compiler, and the case is sensitive for the file name (and probably for the path as well). Display the file name and the path, and try...
  6. PC888

    Poster Tool

    As far as I know, most PostScript processors don't really care if your document exceeds the paper size: the excess just doesn't show up on paper. Thus, in theory, you can send the same document to the printer four times, with the appropriate translation of the origin, you will get the required...
  7. PC888

    Formatting URL's from text file - not easy for me!

    While answering one's own question sounds a little... studpid, for lack of a better word, it is sure efficient, as you said, saving everyone else from having to work on the problem if an answer has already been found. I vote your answer with the embedded modifier as the best, as it can be...
  8. PC888

    running a perl file from another perl file

    Try: system("file2.pl"); (It works on ActiveState.)
  9. PC888

    Perl Array - Unique

    You're right, we're lucky to have the masters around, and most of all, helping out. I learn quite a bit by reading the posts and the answers. Nice talking to you, cheers.
  10. PC888

    Perl Array - Unique

    Looks like you work with Perl a lot from the number of answers you've given. I am new to Perl, so it's almost sure I will need some help from you some day! Cheers.
  11. PC888

    Perl Array - Unique

    Max1x, Perhaps I didn't express it correctly. What I mean is that the code will insert the element and quit as soon as it finds a different array in newArray. If the first element happens to be different from array[4], then it will be inserted and quit without checking for duplication of the...
  12. PC888

    a matching regular for <hi>hello</hi> ?

    Your code seems to work, but it will also catch non-matching tags, try the following, which will only match matching tags, and case-insensitive. $line ="<AB>hello</CD>"; $line1="<Hey>Good Day</HEY>"; if($line =~ m'<(\w+)>.*</\1>'i){printf("A1:%s\n",$1);} if($line1 =~...
  13. PC888

    Formatting URL's from text file - not easy for me!

    The link you provided gave the answer, I only need the letter m before delimeters other than /. Thus the line should now read, and it works perfectly. $line="http://www.abc.comHTTP://www.def.comhttp://www.ghi.com"; @array=split m'(?=http://)'i, $line; foreach $i (@array){printf("%s\n",$i);}
  14. PC888

    Formatting URL's from text file - not easy for me!

    Hello MillerH, Your code works perfectly with the look-ahead extension. While I was trying to add the modifier 'i' to make it case insensitive, I succeeded in doing it if I use '/' as a delimiter, but it leads to awkward code. I understand that a prefix operator is required if we do not use /...
  15. PC888

    Perl Array - Unique

    max1x, it looks like that the code shown will add the element as long as the $newArray[0] does not equal to $array[4]. The following code should work, perhaps a little awkward. # add fifth element if not a double in @newArray my @array=(1,4,7,10,11); my @newArray=(2,5,6,7,8,10,9); my...
  16. PC888

    Install Perl 5.6.1.638 errors

    I would try the install on another (fresh) machine to see if the problem lies with the install files, or whether there are some interactions with your existing applications.
  17. PC888

    perl scheduled task

    For users of ActiveState Perl running on Windows XP etc, try the Schedule-Cron-Events module. http://search.cpan.org/~pkent/Schedule-Cron-Events-1.8/lib/Schedule/Cron/Events.pm Note that you'd have to define the Environment variable TZ as your timeZone, or else the example won't run.
  18. PC888

    problem with environment variable

    In the line: $run = system("export envone"); if you change that to: $run = system("export $envone"); Would it have a better chance?
  19. PC888

    Help counting duplicates

    Back to the duplicate checking, you could try the following. This will work if there is uniformity in the addresses. A sort is necessary before removing duplicates. On an Intel P-3 machine, a 108,000 line file was read and processed in 4 seconds. open (IN,"<xxx.in"); open (OUT,">xxx.out")...
  20. PC888

    Kill an applet from within

    Actually, stop executing the applet, and if it is executed from a web-browser, return to the previous page. Loosely speaking, the equivalent of System.exit() in a normal Java program. If the behaviour is different between a local execution and a web applet, I would like to know what to do in...

Part and Inventory Search

Back
Top