masijade 1,351 Industrious Poster Team Colleague Featured Poster

System is a class, using it directly in this manner means you want to use a public static item from it.

out is the public static item you are using. It is an OutputStream that is used for the Standard Output (STDOUT, there is another for STDERR) of the running java application.

println() is of course a method of an OutputStream object that prints bytes to the device pointed to by the OutputStream object. In this case, usually the command line or an Application Console, unless redirected.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You can't, generally, compare strings with == you should do it as follows:

if ((usermame == null) || (username.length() == 0)) {
}

or

if ((usermame == null) || (username.equals(""))) {
}

Since getParameter can return a null value, and I don't believe that

"".equals(username)

will return true if username is null, a check for the null string is needed as well as the check for a nonempty value.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I would suggest searching www.cpan.org for some memory management module that might provide this functionality. Even if it is possible from straight perl, it is probably complicated or convoluted and a module from CPAN would probably make it a bit simpler to use (or at least let you study it to find out how to do it on your own).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

With a field as follows:

<INPUT TYPE="HIDDEN" NAME="variableName" VaLUE="">

Then in Javascript you can do:

document.form.variableName.value="value";
form.submit();

and the JSP can evaluate the param "variableName". Remember though, that a Parameter is always a String (or an array of strings if accessed through a different method) so you will need a way to transform this string to what you want, if you want something other than a String (e.g. an Integer).

Bt to tell you the truth I am not sure what you by a null value in javascript. Don't forget that anything that the JSP reads from the params, must then turn around and insert the value back into the hidden field to be read by the javascript on the client (or actually modify the javascript in the JSP before returning the html to the client).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You can't. JSP runs on the server, Javascript (which is NOT Java) runs on the client. You might want to look into something like AJAX which will allow your javascript to make a complete connection to the server, receive data, and then update your page, which will make it look like you are doing what you are asking, but it takes longer than a true programmatic connection.

P.S. Don't come back and ask for more info concerning AJAX. That is another thing does not belong on this forum.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And, yes it would have helped. Using an Updateable ResultSet was not the fix. There is no need to evaluate what is returned from an executeUpdate. Using an updateable resultset in this situation is complete overkill. Removing the return help would have fixed the problem posted. Any additional error was probably in the formulation of your query. Had you made the change requested, then posted again with the next error, we would have helped you get your query right. Which probably would have entailed telling you to use a PreparedStatement which would be used almost exactly like an updateable resultset without having to fetch anything from the database. You will probably, as time goes on, find out that this portion of your application gets slower, and slower, and slower, since in order to update the record you are trying to update, you must first fetch all users out of the database which will use up time and resources (and as you get more users these things will not be trivial) that you don't need to use.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, you might not be getting an error message, because you have commented out the contents of your catch block, effectively ignoring any errors. Remove the comment symbols in the catch block and try it again in order to check whether or not you actually get any error messages.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

executeUpdate returns an int indicating how many rows were affected by the query. It does not return a resultset. So, on the line where you are carrying out an executeUpdate, you should not be expecting a ResultSet as the return value.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Maybe this is just self-promotion, and then again, maybe it will help you. Here is a perl script I have written for sending mail with attachments as a command line utility for unix. It uses the GetOpt::STD, Net::Domain, and MIME::Base64 Modules, all of which should be in the standard Perl distribution. It sends a multipart mime message using sendmail (with a subject). It sets the From, To, CC, and BCC Addressees as well. You will almost definately need to change the top line to point to your perl command.

#!/usr/bin/perl -w
#########################################################################
#                                                                       #
# Name:    maila                                                        #
#                                                                       #
# Author:  Martin L. Simons                                             #
#                                                                       #
# Usage:   maila [-a <attach,...>] [-b <bcc,...>] [-c <cc,...>]         #
#                [-f <from>] [-h] [-t <text file>] [-T <Text string>]   #
#                [-r] [-s <subj>] [-p <path>] <Addressee> [<Addressee>] #
#  Options:                                                             #
#    -a  comma seperated list of files to send as attachments.          #
#    -b  comma seperated list of blind carbon copy recipients.          #
#    -c  comma seperated list of carbon copy recipients.                #
#    -f  full address for the "From:" line (Default: User@Host.Domain). #
#    -h  print this message.                                            #
#    -p  Full path to sendmail command (Default: /usr/lib/sendmail).    #
#    -r  set the official replier.                                      #
#    -s  subject (Default:  Mail from "From Addressee").                #
#    -t  name of file containing text for mail (without this or the -T  #
#        option the message will be typed until a "." by itself).       #
#    -T  a text …
masijade 1,351 Industrious Poster Team Colleague Featured Poster

sendmail does to include subject. You simply need to have a "Subject: ldsfgfdg" line in the text.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

See your other post. I get the feeling that you are in WAY over your head.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I am sorry, but do you even know what you are talking about? C++ is a high level language that needs to be compiled. Once it has been compiled, the resulting output IS is an exe (or at least a dll).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

??????????

What is your question/problem?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Investigate JFileChooser (a swing component).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Once again the String method toLowerCase() Look it up.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

The same advertisement was also in this thread

http://www.daniweb.com/techtalkforums/thread49624.html

but has also since been deleted/removed/whatever.

Also, as you can see, both in the reply above and the one in the other thread, the "subject" line is "website design" and not the title of the current topic. I did not change the subject line. I am not sure what he did to your site to place and then remove the advertisements, but they were there.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I can't read that link (I am not a member of that site so it simply brings me to a login page).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I think masijade has been smoking something:

http://www.daniweb.com/techtalkforums/thread49624.html

No, yesterday there was a large advertisement for someones site selling all sorts of scripts. Seemingly it has now been removed (either by a moderator or the individual who posted it).

But I wouldn't mind a little smoke, and Amsterdam is not far away.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Stop Spamming

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Stop spamming

masijade 1,351 Industrious Poster Team Colleague Featured Poster

This is the Java Server Pages (JSP) page. Note Server in that name. Javascript is a scripting language that runs in the browser on the client and has absolutlely nothing to do with this forum. If you truely want help with a Javascript problem, then find a Javascript forum. If this concerns a JSP, then rewrite, and resubmit your question.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No there isn't. The only thing that a cgi would have access to are the attribute headers and (possibly) form paramters. The email address is not contained in the attribute headers (and they cannot be counted on anyway, since the browser can spoof every last one of them). Also, you will only have form parameters if you use javascript to tweak your href into a submit, and then you will only have email address if they have entered it into the form, as this is not a system or user property of any sort, you not even able to use any javascript/activex/whatever tricks to get this info (at least not at all easily, although there are ways, which I am not going to expand upon).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What do you have so far?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Think Scanner and a couple of loops. That's all you need, and from us, for your homework, that is all you will get until you do something yourself.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

what is this my friend ??? it has nothing to do with my requirements

And yes it does have to do with your requirements, since you will not be able to do anything in the network without this package. He is simple not just handing you a finished product that you can copy without doing anything yourself.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What help do you expect on the Perl forum.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

This is your /var/mail/mqueue directory. But 800 mails should not be a problem. How large is your /var partition? You may wish to create a /var/mail partition to add space, and protect the rest of your /var partition if the mails do make it overflow.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You probably need to change your sendmail configuration (or whichever mail program you really use) to not automatically send a copy to root. But if this is not your machine, it may be that the administrator has purposely set this up this way, and you then will not be able to change it. I, mysel, am not exactly sure what needs to change in your mail program, but it is there that it needs to change, it has nothing to do with perl. Get/Borrow a book or Google for it.

As far as your second question, which buffer?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

We will not do your homework You know that you need for loop, that is good. Look at the man page for shell built-ins, pick up a book, or google for the shell you are using and for loop.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

if n.sh doesn't contain anything but functions and variables (i.e. no actual executed code) then add ". <path>/n.sh" to the top of n1.sh. If n.sh is a full functional script, then you cannot do this. If you have common functions that you wish to use over multiple scripts, then place these functions into their own file (preferable without a "#!" line at the top). In this way, every script that wants to use those functions can include them using the "." line presented earlier.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

The "END" tag to your so-called "here" document (started by the <<END expression) needs to be at the left hand side. That means it must be placed at the start of line without any whitespace in front of it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I coould be completely wrong, because I always put it against the left edge anyway, but I believe the "END_SCRIPT" marker you are using to end the so-called here document, needs to be against the left hand side, in otherwords at the beginning of the new line.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Actually, if it is suppossed to be a fuel efficiency calculation, then it is miles/gallons (mpg miles per gallon).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

DYOH (Do Your Own Homework).

If you have a specific question, about a specific part of code that you are having problems wih, then please, ask. BUT, we are NOT going to do YOUR homework for you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What have you tried so far, or, at least, what are your ideas as to how it could work?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, illegal expression normally means that you have not closed a ( ) pair, a { } pair, or have forgotten a ;. Judging by your comments I am assuming you have not closed the { } pair that defines the method that contains your "outer for" loop.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Have you read the WebLogic documentation? It is all fully detailed there.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

The request object in a servlet is a passed in Object, not some sort of magical reference. You would have to rewrite this to either pass the request object into the called method or retrieve it from the ServletContext. But, in either case, you will also need to import a couple of further classes from the J2EE packages.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, here is one possibility.

http://www.onjava.com/pub/a/onjava/excerpt/swinghks_hack41

But I thought there was also a way to set transparency for the frame, but I can't seem to find it at the moment

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If you are suppossed to be writing one, then write one, and if you have a specific problem, check back with us. If you simply want to find one to use, check with Google, there are more than enough out there.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

This doesn't seem to be very good design, but you could define a public
method in A for setting whatever field should be set with the data then let A pass a reference to itself when calling B's constructor. Then B can call aRef.method to pass the data.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No problem. And have fun.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Looking at your string I assume that the different parts of the string are
seperate4d by a TAB character. If so do the following:

String line = "BATHROOM TOI    48157   Y   DOVE BWASH MCDAMIA 375ML             6  NEW" ;
String[] parts = line.split("\\t");
//parts[0] = "BATHROOM TOI";
//parts[1] = "48157";
// etc. etc
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Look back at the code I posted again. I had "played around" with these quiz variables a little. Also, when calling a method, you provide only defined variables as parameters without a type declaration preceeding them. It is in a method declaration that variable types and names are provided.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I am sorry to say this, but it sounds as those your computer may be infected with something. (Whether virus or dialer or something else I don't know). But, in any case, this is definately not the place. Get your computer serviced somewhere. Look in the yellow pages.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

This should be a quick fix (I have not tried to compile):

import java.util.scanner;
public class Jungmichel3
{
     int quizzes;
     int midterm;
     int finalTestGrade;
     int finalNumGrade;
     char letterGrade;
 
     public void overallNumGrade()
     {
   System.out.println("Please enter grade from quiz 1:");
   System.out.println("Please enter grade from quiz 2:");
   System.out.println("Please enter grade from quiz 3:");
   Scanner keyboard = new Scanner(System.in);
   int quiz1 = keyboard.nextInt();
   int quiz2 = keyboard.nextInt();
   int quiz3 = keyboard.nextInt();
   quizzes = (quiz1*.833 + qui2*.833 + quiz3*.833);
 
   System.out.println();
   System.out.println("Please enter the midterm grade:");
   midterm = keyboard.nextInt();
   System.out.println();
   System.out.println("Please enter the final grade:");
   finalTestGrade = keyboard.nextInt();
   finalNumGrade = (quizzes*.25) + (midterm*.35) + (finalTestGrade*.40);
   System.out.println("The final numerical grade is " + finalNumGrade);
  }
  public void letterGrade()
  {
   if ( (finalNumGrade <= 100) && (finalNumGrade >= 90) )
   {
    System.out.println("The letter grade is an A");
    lettergrade = 'A';
   }
   else if ( (finalNumGrade <= 89) && (finalNumGrade >= 80) )
   {
    System.out.println("The letter grade is a B");
    lettergrade = 'B';
   }
   else if ( (finalNumGrade <= 79) && (finalNumGrade >= 70) )
   {
    System.out.println("The letter grade is a C");
    lettergrade = 'C';
   }
   else if ( (finalNumGrade <= 89) && (finalNumGrade >= 80) )
   {
    System.out.println("The letter grade is a D");
    lettergrade = 'D';
   }
   else
   {
    System.out.println("ERROR: The number grade does not compute.");
   }
  }
    public static void main(String[] args)
    {
       Jungmichel3 a = new Jungmichel3();
       a.overallNumGrade();
       a.letterGrade();
    }
}

Pay attention to the differences. These are the main points in a simple
class that you should pay attention to. It should not, …

masijade 1,351 Industrious Poster Team Colleague Featured Poster

you don't have a closing brace at the end of your main method, or
you are trying to declare that method within your main method, which you cannot do.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Granted, you should not use those codes, but you also do not need to attempt to handle these conditions for yourself either. The system/shell will generally take care of these for you.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

exit in the script, or any thing else designed to exit the shell, will only exit
the subshell that the script is operating under (that #! line at the top of
the script). If you want your login shell to exit with the script then you
have to execute the script as "exec scriptname" rather than just
"scriptname". This way, when the script ends, the login shell ends.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

There are no system wide standard exit codes other than 0 is success
and other than 0 is generally regarded as an error. It is completely up
to you how you want to handle exit codes.