masijade 1,351 Industrious Poster Team Colleague Featured Poster

thnx so much for the quick response...but this will not effect if in linux plateform rt?????
thnx again

What do you mean by this (the bold part)? I have no idea what you are asking, especially when combined with your earlier wish to use odbc. You do realize that odbc would only work on Windows, right? Unless, maybe, you have some special Linux kernel module that I know nothing of.

The JDBC drivers are simple Java jarfiles. They depend on, unless otherwise explicitly stated, only the JRE or JDK. So, as long as you have a JRE or JDK (which will contain a JRE) installed, a downloaded JDBC driver will work, regardless of the OS platform.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Even when you use odbc, from Java, you are using jdbc (it is called the jdbc-odbc bridge for a reason). And the advantage of using a real driver over the odbc one, is that the odbc driver is severly limited (and, if I remember right, not even thread safe, which it would need to be to be reliably abd safely used in a servlet or JSP).

For a real Driver try here:

http://jdbc.postgresql.org/

And read it's documentation after downloading it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Oh, man. I hope this is a homework a question and not something needed for your job. In the latter case, I think you would be better off polishing up your resume (by the looks of it, it needs it anyway).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

"Q4. A text file contains a list of numbers, one per line. Write a program that will print out 5 most commonly occurring numbers, one per line, without surrounding whitespace, in descending order. Assume that the numbers are contained in a file called numbers.txt =="

Thanks for the hint. First things first. This isnt homework and if i knew where to look to do my own homework i wouldnt have posted...? This is genuinely for a job.

Again i sincerely thank you for the help, but less of the sarcasm.

I'm sorry (maybe not), but what kind of job "interview", "application", or whatever, has the above quoted question. Have never seen, or heard of this sort of thing. And, even if it is some sort of job application that has this, giving a full solution to the question still amounts to the same thing, cheating. Only, in the case that it is truly some sort of job application, it is even worse than cheating on homework, as it would help to get you a job for which you would not be qualified. That, as I said, is even worse than cheating on homework.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Bad disguise of a homework question if, you ask me. So, do your own homework.

As a hint, look at the man pages for the command sort. Then use a for loop, a counter variable, if, and echo (in that order).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You should move it out to a Servlet, bean, custom JSTL tag, or other application context item. This type of code should never be found in a JSP.

Other than that, yes it is possible.

Try going through the following:
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/
(although it is one version outdated now)

masijade 1,351 Industrious Poster Team Colleague Featured Poster
import java.io.*;
import java.util.*;
import Employee;

The problem is with import Employee; --- you can't import classes from the same package without at least giving the package name/whatever.

Just remove import Employee; and you should be fine. As long as the classes are in the same directory/package, they're automatically available to one another. ;)

Part of the problem, is tht they are not in a package at all.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

It is frowned upon to place classes in the "main" or "default" or "unnamed" package. And this is one of the problems that arise from that. Place each of these classes into a package, then import package.Employee and everything will be okay. Also, if they are in the same package, you don't need the import statement, at all.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

100% 0 miles 251 secs.

Got a little lucky, in that they didn't ask for Nebraska, Kansas, Tennessee, and the like until I had a state that should at least touch a corner of them so I had some reference on those. If those types of states come first, you haven't got a chance. It would be much better if they provided reference points, i.e. a simple dot on the map somewhere near the center of each of the states, then expect you to place the center of the state somewhere very close to one of those spots. That would at least make it fair. An attempted judging of the distances, with a state in the middle (or middle right for all those states just off the eastern seaboard) is doomed to fail.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Sorry, misread.

Checked Exceptions are exceptions that should be caught by your code.

Unchecked Exceptions are exceptions that are based from RuntimeException and are not expected to be caught by your code. They indicate an unusal Runtime error/condition.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

JavaScript to do it directly at the source or post the info in a submit to a servlet and let the servlet mail it using JavaMail. Here is something to get you started on the servlet side:

http://java.sun.com/j2ee/1.4/docs/tutorial/doc/

And, no I am not going to give you the complete code for a servlet to do what you want. Read through the tutorial and learn a litlle more about j2ee programming.

I would also suggest you learn more about html and the other technologies used in web programming (at least some of the basics) before you attempt to go much further.

If you wish to know how to do it in JavaScript, then find a JavaScript forum and ask again (or better yet, find a JavaScript Tutorial/Learning site and learn how to use it).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

The only thing I can see, at a quick glance is on line 19. Take a close look at that Line.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You also forgot the semicolon in the library method on the following line:

yearpublished = yrpub

which is exactly what your first error message says:

libmainsys.java:19: ';' expected
yearpublished = yrpub
^
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, your trying to match "Exit" and you entered "exit". It is case sensitive, you know.

If that is truly the case try the following

while ( uc($command) ne "EXIT" ) {

// instead of

while ( $command ne "Exit" ) {
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Commuter Engineering. Does this mean that you sit beside the highway counting cars and attempting to think of a better way to get that many people through that area? ;-)

Here are a few, but you should really think for yourself:
Yahtzee
Chat
Chess
Checkers
All the other standard projects.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster

It's extremely easy. Prepend every String that you print through System.out.println with "DEBUG: " then simply grep out that word. Presto, there's your output, no fuss, no muss, no searching, and no special startup procedure. Simply rotate the log before you start tomcat (which you probably should be doing anyway, if you're debugging) and everything is cool.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That nobody ever reads the documentation and then attempt to solve their own problem anymore. I am truly getting sick and tired of the question "How do I deploy my application in blah blah blah?"

RTFM, try it, then, if you have a problem, ask a specific question.


Sheesh.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No. You seem to be combining too manythings in too many places, and in improper manners at that. Rather than stating what technology you want to use to accomplish what, simply

1. describe what you currently have (in some detail)
2. describe what you want to achieve (in some detail)
3. extraneous requirements/restrictions on your possibilities (i.e. must be implemented using blah blah blah)

Once you have done these three things coherently, you may have found that you have come up with a possible way of solving it yourself, if not we may give you a few suggestions.

What we will not do, is attempt to do it for you. In other words, as so many people are fond of saying, we won't "give you the codes".

masijade 1,351 Industrious Poster Team Colleague Featured Poster

No, you don't need to. Anything you print to System.out will show up in the catalina.out logfile (as long as you have that activated).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, the line of code provided to you directly implements the formula you provided. If the answer is wrong, the formula is wrong. I'm sorry, but the calculation, given the formula provided, is correct. Do it yourself using a scientific calculator (so you can enter the parens) and you will see for yourself. Check the formula again.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Using your variables it is as such:

double Payment = Loan * (1 + (InterestRate / 10)) * term * (InterestRate / 10) / (((InterestRate / 10) + 1) * Term - 1);

But I don't know if that is the right formula as it results in 1153 not 1167.

It's always ( InterestRate / 10 ) InterestRate 0.0575, but your formula states 0.00575

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That, however, is not the formula. I realise now, that the assignment probably did not have the formula in it, and it assumed you knew the formula. Unfortunately, I do not know the formula, can you post that know please. (i.e. Principal * Interest * Term / ......)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

simply go to java.sun.com, then to the downloads section for j2se/jse (however they are naming it now) and download the newest (the current link) or not more than one down from that.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yeah Gods, not only A JSP that is almost nothing but scriptlet (which I can almost understand since he is only demonstrating scriptlet in JSP even if it is wrong to do), but also compounding that by putting html tags and formatting inside the scriptlet block.

Then again, also, would that even compile? I mean no try/catch in the scriptlet. Is that allowed in JSP? I don't use scriptlet at all (or at least very, very little) so I have never tried doing anything that would need a try/catch block so I'm simply not sure if that would even compile.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Please start your own thread, and the problem should not be your computer, it is in the JavaScript that is being loaded from the server. Please start a new thread, and in a JavaScript Forum, not a Java forum.

Also, if you will note this thread was started in Aug 2004 and the last post, after a pause of nearly 2 years, was nearly a year ago.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I, personally, don't know the right formula for mortgage rate calculations, so please provide the formula you were to use as presented in your assignment instructions.

In any case, when you get the wrong number, then the problem is usually that you have entered the formula wrong, which is the reason I want to see how it was presented to you in your assignment.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Do you want anyone who wishes to access the site to have to type in your ip address (is this even reachable from the rest of the world) or do you want them to be able to use a name, i.e. www.doit.com). If they should be able to use a name then register for a domain. If you wish to be accessed through an internet provider (i.e. www.aol.de/yourinfo) then talk to them. This is a development forum, not an icann info desk.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

As a comment on your signature, many military elements, in many countries around the world, have played around with weather control, and China is actually actively attempting to manipulate the weather right now to avoid droughts in some areas of the country (it hasn't been working to well, but they are doing it). ;-)

peter_budo commented: You here to answer the question, not to make silly comments on signature. If you don't know answer leave it be +0
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Please tell me (I really want to know) how it is you think you have "knowledge" in jsp and servlet when you don't have knowledge of core java? That is patently absurd and practically impossible. Unless your knowledge of them is that you know they exist and that you know something of the maintenance of a few particular application servers. (Which, of course, still means that you have no real knowledge about jsp and servlets.)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Register for a domain name somewhere.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Since he is new, there is no need to go with servlets , you can search google to find some good codes to start with.

when u think u are perfect then jump to what my friend said and also look over struts framework.

As aniseed alluded to above, this is exactly the wrong attitude. If he were new, that would be the best reason to do right the first time, even if it may be, at first, a little harder. It is still much easier than doing it wrong first, and then attemtping to "relearn" it the right way, which will then lead to hundreds of responses in future threads of the style "but I have always done it this way ...." arguing that the good advice he is getting is wrong, because it does not fit his style of bad coding.

The comment above is just like when someone suggests a newbie should use a IDE for development and shouldn't worry about how the stuff is actually compiled and jarfiles referenced because the IDE will do it for him. Then, two weeks later, that same newbie is filling up forums because he can't compile/run his "application" to run outside of the IDE, or he now no longer has access to his IDE and now doesn't know how to conitune. Or, there is a problem in his GUI (or something), which he let the IDE generate the code for, and he has no idea how to go about …

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And nobody is going to do it for you. I will tell you though, that the biggest problem I see, off the top of my head after a two second code scan, is your WindowListener implementation. You won't be able to do this stuff in an Applet. Other than that, what is majorly different between Applet and Application (window-wise) is that you don't initialise a Frame, but simply add your stuff to the Panel that is part of the Applet.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

change (possibleValues =[1]) to (possibleValues[1].equals((String) selectedValue)) This, obviously, only checks the answer against the second element in the array, if you wish to check the value against all values in the array do as follows:

if (selectedValue != null) {
  for (int i = 0; i < possibleValues.length; i++) {
    if (possibleValues[1].equals((String) selectedValue)) {
      // do something
    }
  }
}

You may wish to read a few of the basic tutorilas again to brush up on your basic syntax (such as array indexing).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Check you oracle installation. If you do not know how yourself, then ask your Oracle DB administrator, if you have one. If this is your own Database, then ask on an Oracle forum how you can retrieve that info from the ORacle configuration (and, to be complete, how you can change it if need be).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If you wish to be able to add and delete entires, then you would be better served changing the PhoneBook[] to an ArrayList rather than an array. An ArrayList you can dynamically add to and subtract from and is not much different in use from an array.

If you insist on continuing to use an array, then in your add method simply create a new PhoneBook[] one element longer than the current one, then use System.arraycopy() to copy the old PhoneBook array to the new one then create a new PhoneBook item in the last slot in the same manner in which you created the original entries.

For deleting, the new array will be one shorter, then cycle through the original array copying the elements one at a time, leaving out the one that matches the entry to delete.

Neither of these suggestions, however, take into account any entry that might be listed twice.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That has nothing to do with jsp. Ask on a Javascript forum how you might be able to cause a parent window to close after opening a child window.

The real question is, however, why don't you just simply open the new page in the current window?

If it is a matter of erasing the history, you can also do that through JavaScript without having to open a new window. Once again, ask on a JavaScript forum.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

The code you posted so far will always return the first match of the last name. You never even look at the firstname that is entered, so as of yet you have not even accomplished the first part of your program.

Try the first part using John Smith rather than Viloet Smith, and with the way it is currently written you will still receive Violet Smith as the output.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Make sure you are using corejava.Format and not java.text.Format.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

google search for REST + Java

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If you have JDK 1.5 it is because you are not using Generics.

Read about Generics in the New Features portion of the Java SE 5 documentation on Sun.

http://java.sun.com/j2se/1.5.0/docs/index.html

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Do Your Own Homework.

We have no problem with a specific question about a specific part of your code, but we do not do wholesale homework assignments.

http://www.rentacoder.com/

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I have the feeling that what he is doing, is adding the Vector as a Vector, then clearing the Vector, assigning new values, and adding it to the Hashtable again.

@OP: If this is what you are doing then of course the values are changing for "both" Vectors, because there is only one of them. When you add something to a Hashtable, you are not adding a copy of it to the hashtable, but rather are adding a copy of the reference to the object (in this case a Vector) to the Hashtable. If you then turn around and change the object that was referenced (in this case the Vector again), then you are changing the content for the object referenced in the Hashtable as well, since it is the same object.

You need to create a new Vector, rather than editing the Vector that you have already added.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

True, but in the context of his homework, I believe that this is exactly what his teacher was looking, and the answer I wished to provide.

The other circumstances are exceptions/special cases, and, in general, do not need to be worried about.

Unless his question was not homework, but rather some stuff he was playing with that did not give the expected results.

;-)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Sorry to disagree, but a quick quote from the api

finalize()
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

From the Object class API doc.

Does this not answer the exact question he asked?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Please continue in your previous thread

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

masijade 1,351 Industrious Poster Team Colleague Featured Poster

This is definately a homework question, but I will give you a hint.

Read the API for the class that all other classes extend implicitly.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

dont you think if he wants to go in graphics designer field y in the world he wants to learn java? all he want to do is do his homework.

It doesn't matter if he is interested in it or not. If his major requires a course of this nature, then he has to do it.

In the real world you can't just simply say "I don't like that part of my job so I simply won't do it."

That would be really great. Think about it. One of the workers in a construction company doesn't like to use screw drivers so he simply places a sticker that looks like a driven-in screwhead at every spot he was suppossed to place a screw. Then your house falls apart. But don't blame him he just simply wanted to get his work done and didn't like that part of the job.

Wonderful.

Edit:

Also, whether the major demands it or not is irrelevant. He took the course, he needs to either do the work or take the hit to his record by either failing or withdrawing. Cheating is not and never was the answer. It will catch up to you sooner or later.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Why not just format the name as follows:

file_name="GLISPO`date +%Y%m%d`.dat"