Manfred Leonhardt

Ranch Hand
+ Follow
since Jan 09, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
3
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Manfred Leonhardt

Sophia,
I think jsp:forward does a post and you want a get. Therefore, you will need to use response.sendRedirect to place something on the URL.
Regards,
Manfred.
20 years ago
JSP
Andrew,
Have you tried to create a new String and adding it to the session variable:
session.setAttribute( "TimeEntryID", new String(rsLastEntry.getObject("TimeEntryID")) );
Regards,
Manfred.
20 years ago
JSP
B,
Since Integer in java is immutable you must create it with a non-null value. There is no empty constructor. It also chokes on an empty String sent into the Integer constructor that accepts Strings.
Therefore, you must see if the request parameter exists, is not null, and has some length before you just use it.
Regards,
Manfred.
20 years ago
JSP
Elaine,
The code I showed you gives all the information that is known to the Student class:
Catherine G Banks PhD Doctor

FirstName MiddleInitial LastName DegreeInitials DegreeName
Regards,
Manfred.
20 years ago
Elaine,
You should avoid having the title be added by an outside source. Just have it added into your student constructor. That way you only need to store an index to get both types and names.

------------------------------------------------------------------

Regards,
Manfred.
20 years ago
Eric,
You have your answer in one of your posts. The following code is quite close:

The only problem I see is that you are trying to compare some strings and not objects. In that case you want to use the String equals function.
Regards,
Manfred.
Howard,
The ! operator is boolean complement and doesn't work for strings.
Try
if( strName != "" )
Regards,
Manfred.
20 years ago
Sam,
How about getting the difference in milliseconds:
d1.getTime() - d2.getTime();
Regards,
Manfred.
20 years ago
Ztopher,
I think you are using to much extra coding that is not required. You only need a File object and should not keep sending in the result list. Also the fileFilter is not really required because you can just use the isFile function. If the item found is not a file then it must be a directory. With those changes your code looks like the following:

Regards,
Manfred.
20 years ago
Jaysingh,
When you create a primitive array you can only populate it with those primitives. In your case, you can only place integers into the array (not another array). The first line is valid because the compiler is converting the line for you to make it valid:
int[][] i={{1,2,3},new int[]{3,4,5},{333},{},{6,7,8}};
is actually the same as:
int[][] i = { {1,2,3}, {3,4,5}, {333}, {}, {6,7,8} };
which is populating each value with an integer (valid!).
On the other lines you are trying to place an array in an integer placeholder, which, as you now realize, is not possible.
Regards,
Manfred.
20 years ago
Narasimha,
I will try and give this a shot.
1. You are mixing syntax with your assignment. The '\0' signifies octal notation. Therefore, '\0x0001' will try and interpret x0001 as an octal value (which is not a valid octal value). To make is hexadecimal you leave off the single quotes (i.e., 0x0001).
2. According to the Java Spec:

15.7.1 Evaluate Left-Hand Operand First
The left-hand operand of a binary operator appears to be fully evaluated before any part of the right-hand operand is evaluated.


Using that logic we can easily see that the expression will work out to:
x = (a = true) || (b = true) && (c = true);
x = true || (b = true) && (c = true);
from this point on the result of x is given because ORing true against anything else will result as true. Therefore, we don't need to perform any more steps. Since we have evaluated the a = true assignment fully then a will be true while b and c will still remain false.
3. In the m1 method, the compiler actually replaces the return c line with return '\u0001'. Therefore the return type can be shown as byte because the unicode leteral can fit into a byte. In the method m3, you are trying to convert a character into a byte which can't be done without casting.
Regards,
Manfred
John,
In order to have the print only show three values after the decimal use a DecimalFormat object:
DecimalFormat df = new DecimalFormat( "#0.000" );
System.out.println(df.format(value));

Regards,
Manfred.
20 years ago
Larry,
You are close. The for loop is the problem not the array. Remove grossPay and netPay calcs from the loop because one is constant and the other is only dependent on the final withHoldingAmount.

Then you figures come out.
Regards,
Manfred.
20 years ago
Jose,
You have a couple of problems in your code.
1. You must create a larger array for buttons. Try 5 items instead of 3.
2. You are only adding 3 of the created buttons to the panel. Therefore you will only see 3 buttons.
After those changes are made, the applet seems to change the button backgrounds correctly. Nothing gets drawn yet, because you must call repaint if you want the applet to change.
Regards,
Manfred.
20 years ago
Here is my approach to it:

Regards,
Manfred.
[ November 23, 2003: Message edited by: Manfred Leonhardt ]
20 years ago