stephen84s 550 Nearly a Posting Virtuoso Featured Poster

And how exactly is the target file shared on the network ?? FTP, HTTP ?? or just by SMB (Windows Sharing) ??

You need to divulge more details as to what exactly are you trying to achieve.

Also although I know its useless saying this but still read this essay and learn how to frame your questions on a forum like this, it is you who will benefit most because if you ask questions correctly or ask the correct questions, more people will feel like answering to your query.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

because it was under style analysis, it compiled fine.

And you forgot to mention that which was the most important piece of information.

public String toString() {
    return "The value of the coin is: " + cents +
          "\nThe coin is facing:"+flipCoin.toString();
}

try to split that using split command

and then concatenate....

I have no clue as to why you suggested that.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Just got the wonderful Line is longer than 80 characters error.

Strange never heard of this one before (at least not yet), Give us exactly what your compiler is throwing up at you.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Thank you for your suggestion. Can you direct to me to a good source where I find out how to use this expression? I'd like to finish this and move on to another project involving a JSlider.

Again, thanks for taking the time!

What he has used are called Regular Expressions and in my very first post, if you had cared to see properly, would have found the tutorial for them. But then here it is again:-

http://java.sun.com/docs/books/tutorial/essential/regex/

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

This Link should answer all your questions regarding JOptionPane.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

662

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

658

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

654

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Click on Tomcat Icon that comes up in the System tray, and go to Configure Tomcat (Alternatively you go to the Services section in Administrative tools and right click and select configure on the Tomcat Instance you wish to run as "you"), I remember that one of the tabs has a "username" and "password" field to make the tomcat service run as a different user.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

bead

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Hi can any one send me the code for receving sms through gateway using java program.

first i want recevie the sms from mobile through gateway and the i want to send sms to mobile through gateway..plz send me the sample code to achieve this.. Thanks in advance..

No I am not going to even consider giving you a hint this time, Cause the last time itself We had told you to part from your CODE MONKEY ways. Not only that I remember telling you how you should frame your questions and the information you should provide if we are to help you, but you just do not wish to learn and rather bee a leech feeding on information / code provided by other people. Plus another fact that irritates me is that one part of the question has already been answered and deducing the other part from it is also pretty trivial.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

First of all why do you wish to run multiple tomcat instances on the same machine ?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I do not know this will suite you but try simply redirecting to that file so that the PDF will directly open in the browser (if the client's browser supports it ) or it will ask the Client whether he wishes to download the file on his machine and open it.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

648

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Calling method from JSP is not working why?

Because you messed up somewhere.

Quite simply you should learn a more polite way to ask questions and ideally read this essay by Eric Raymond to learn how you should ask questions so that more people start paying attention to you.

Post the code of the JSP page (at least the relevant parts) that YOU PERCEIVE to not be working and envelop them in [code=jsp] and [/code] tags, so that the syntax highlighting makes it more readable.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

This should answer all your questions on precompiling JSP files.

http://tinyurl.com/5l62lo

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Honestly I have no clue what you trying to say, can you please be divulge more details and especially the relevant code / SQL query you are dealing with.
Also on what basis are you reorganizing your records every week, you have just shown us how it should appear not why or the Logic behind it.
Also please keep in mind to read essays like these, they will be very helpful in teaching you how to construct your questions so that more people will actually pay attention to you.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

You are working on Glassfish (At least it seems so). I would have given you the exact data how to deploy, but the net at my place is ridiculously slow so you will have to find it out from the following link yourself.
https://glassfish.dev.java.net/downloads/quickstart/index.html
Normally we make a WAR file and deploy using the "admin" interface of glassfish.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

@bugmemnot,
I am pretty sure the thread starter has already solved his problem by now.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

To quote the Javadocs this is how substring(int,int) works :-

Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. Thus the length of the substring is endIndex-beginIndex

So this:

begin.substring(1, begin.length() - 1)

Would always skip the last character of your string.

Use this instead :-

begin.substring(1)

Since you want the entire substring till the end.

You need to go through the Java docs of the String class first so that you know how to use these functions. You can check that out here.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

642

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

The split() function of the String class accepts a Regular Expression as an argument, You seem to be under the impression that it accepts comma separated characters which is incorrect.
If you want to check more about Regular Expressions in Java, this is the best place.
Also note the double back slashes (\\) mentioned by legilimen, the first back slash tell the Java compiler that the following "\" is not an escape sequence ( like "\n" is used to indicate a new line). So in effect when the regex parser encounters it the expression is reduced to "\.?!", this "\" indicates to the regex parser that the following "." is not a regex quantifier.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Also another suggestion as far as using StringTokenizer is considered, to quote the javadocs :-

StringTokenizer is a legacy class that is retained for compatibility reasons although its use is discouraged in new code. It is recommended that anyone seeking this functionality use the split method of String or the java.util.regex package instead.

So always make it a habit to go through the Javadocs if you are using Any class for the first time.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well you could have at least mentioned what problem you are encountering and what output you are currently getting so we can check where you are actually going wrong .... instead of going through the entire code.

Now first mistake which I found :-

String str = ("Data: " + data + "\nMean: " + mean);

"data" is an array, you cannot directly print the contents of an array like that. You need to iterate through each index of the array and then append it to the string which you are printing out. Kind of like :-

int myArray[] = new int[...];
.
.
.
String dataToPrint=new String("");
for (int i=0; i<myArray.length; i++)  {
  dataToPrint = dataToPrint + myArray[i];
}
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

634

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

@ben98
I am pretty sure the thread starter must have found one by now, so why did you have to resurrect this relic ?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

It's quite annoying to edicts like those going on in here. I use Mapbasic as a basic GIS tool. There is no GUI developer and it's a pain in the arse. I genuinely believe that developers who make suggestions like 'oh you know nothing if you use a GUI designer' are just people in ivory towers; I don't know how you operate, but I have time frames to adhere to and if there's a tool that does something quicker for me, rather than doing it long hand, then it gets adopted and adopted quickly. My advice would be to find an IDE that you find intuitive (we all find them different by the way) and just get used to using it.

I guess the Luddites were quick to slam machines working for the owners as they weren't being properly hand crafted. Ad hominem attacks are spiteful and there's no place for them.

I emply a front end graphics person for my web sites. She uses Dreamweaver and the work she produces no developer could. Find an IDE you find ok to use and learn about it. Or just use what makes your life easier mate.

Well phallett, in school while learning the English language we were taught one very important thing "Reference to Context".

I suggest you refresh some of that, Peter over here is obviously speaking in context to a beginner, who is just starting out with Java and hence advising him to avoid using GUI designers directly …

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

glue-->Fevicol

Fevicol -> Adhesive

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

If this is what I think it is try Ctrl + Alt + Up Arrow to see if your screen returns to normal orientation

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

i checked everywhere i could for the answer.

Really ?? Then you would found the answer already, making such claims basically will just irritate some people (like me) trying to help you. And it also illustrates that you did not care to even glance through the article I had linked to on how to ask questions the smart way.

Well that aside, most probably you have seen the answer but you could not figure out whether it was the answer. And just as I had mentioned in my first post :-

Now from what I see in your post I am assuming that some sort of file manipulation operation is being performed in the index() method, and throws a FileNotFoundException in case some file access error occurs, so either you handle the exception by catching it or at least add it to the "throws" clause of the method (and methods where this method is being used if you are not catching it there either and so on) where you have written this code.

What stultuske has done in is catch the FileNotFoundException which was the first option I had suggested.

Also you need to learn about Exception Handling in Java, else you will be telling everyone that you finished looking everywhere but could not find a solution everytime you encounter a problem with exceptions.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well I guess your actual problem has been solved by stultuske, But still I would like to mention a few things by looking at your code :-

Firstly Java is an object oriented language and its true power is manifested in that only, but you have basically pulled it down to the level of a Structured Programming Language.

Secondly instead of those big line of "if" statements have you ever considered using "switch case", It would solve the problem which stultuske is mentioning about, if you need help in that too then just go here.

And finally I also remember you had asked for a better IDE for Java as compared to BlueJ. Honestly judging from your code here, you are just starting out with Java so stick with either BlueJ or JCreator Lite do not try to start using Netbeans or Eclipse, you will simply be lost there.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

What to google ?
I guess its Yahoo then, Live search is still too awful.

Acidic or Basic

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

First is you need to know how to send SMSes via the Computer, there are basically two ways :-

  1. GSM Modem or a GPRS Modem (or a Cell Phone acting as one) connected to your Computer
  2. SMS Service Provider, this is the second method and the preferred method for you since you are planning around 1000 smses per day.

For Sending SMSes via the GSM Modem you will need to search for some PHP API which can be used as such, I am aware only of a Java API which will allow you to connect to a GSM Modem, it is called SMSLib. Note the SIM card that you will be putting in your GSM Modem will be charged for each message you send.

However for you a Bulk SMS Service provider would be a more viable option since they will definitely offer cheaper rates than what your network service provider is offering. Also they might give you an HTTP API which you can directly call from within your PHP pages and no need to worry about GSM Modems or anything like it (I know cause the firm where I work offers that). Just google for "bulk sms providers india" or something similar and you should get a pretty comprehensive list of sms providers. Also many providers also give you Delivery Reports from which you can ascertain whether an SMS actually reached the cell phone or not.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

honestly I can't make any sense of what you are trying to say. You are mentioning that you want to do some String manipulation but then suddenly you are talking about the compiler complaining about the FileNotFoundException being not caught or mentioned in the throws clause.
Please paste your complete code and the actual compile errors that you are getting and what is the exact motive of your program. Also while you are at it, you could read this article on how you should be actually asking questions on a public forum.

Now from what I see in your post I am assuming that some sort of file manipulation operation is being performed in the index() method, and throws a FileNotFoundException in case some file access error occurs, so either you handle the exception by catching it or at least add it to the "throws" clause of the method (and methods where this method is being used if you are not catching it there either and so on) where you have written this code.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Could be but why do you want to know ?

Does the sun rise in the east ?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Guess So . . . . Cause It displays correctly at 1280x768 on my Laptop which also has Open Suse 11.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well I do not know if anyone else mentioned this but the Edit Profile page looks pretty awful at 1024x768 resolution.
I got some snapshots attached.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

626

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

It is what it is supposed to be.

Do all Tigers have stripes ?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Even if it wasn't resolved then, you were definitely aware that we had given you the information you needed, all you had to do was recheck that thread so it still doesn't justify you posting the same question again.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

624

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Actually I never got exposed to IntelliJ IDEA cause of the fee for the license, ever since my college days when I got exposed to Java, I had to stick to the free one available, cause my college (and now my work place) would never agree on spending cash on any development tools (and I dislike using pirated software) also I can use the same IDE at home. So I have learned to stick with the free alternatives.

And I also agree JCreator Lite was my first real Java IDE and is the recommended way to go for beginners.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I do not know what theheck you have done here, but it seems plain wrong to me.

private void calculateperimeter(){
		int perimeterx = VectorA.getX()-VectorB.getX();
		int perimetery = VectorB.getY()-VectorC.getY();
		int perimeterz = VectorC.getX()-VectorA.getX();
		perimeter=Math.sqrt ((perimeterx * perimeterx) + (perimetery * perimetery) + (perimeterz * perimeterz));
	}

If your instructor is ignorant enough this time too I guess you will get away with this also. According to me that is completely the wrong way to calculate the perimeter.

I had already given you the formula for calculating the length of the sides of the triangle (Square_Root [(x2-x1)^2 + (y2-y1)^2]) from which you could calculate the perimeter and then the area.

But to me this appears plain wrong it will give you the incorrect perimeter and will also finally give you a wrong answer for the area of your triangle.

BTW if you do not know what a perimeter is, it is supposed to be the length of the shape, so for the triangle it would be the sum of the length of all the three sides, But honestly such things are basic geometry you should know about.

<EDIT>
Also a word of advice, do not simply program to get the marks, Soon no one is going to care whether you got 50 on 50 or 49 on 50 for a kiddy assignment, do it to learn and honestly from the way you have done both your assignments your attitude is nowhere near that.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Your question was already answered more that two months ago, in this thread started by you.
I remember cause I was one of the repliers. Please do not ask the same questions again and again.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Honestly the two big names that come to my mind are :-

  1. Eclipse
  2. Netbeans

Personally I prefer Eclipse, but NetBeans is a pretty good IDE too. But I would not recommend either if you are just near the beginner level, but if you are feeling too tied down in BlueJ may be its time to give either of the two a try.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

620

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

616

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

610

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Now let us consider your traingle has three vertices
A (x1, y1)
B (x2, y2)
C (x3, y3).

Now if you want to calculate the distance between any two points ex P(x1,y1) and Q (x2, y2) on a plane the formula is:-
Square_Root [(x2-x1)^2 + (y2-y1)^2]

So using that formula you can get the length of all the three sides of the triangle. Next to calculate the Area of the triangle Whose length of sides are a,b and c the formula is :-

Area = Square_Root [s(s-a)(s-b)(s-c)]
where s -> Semiperimeter that is half the perimeter.

I think this is called the Herons Formula or something similar.

Now I have given you the formulae just convert them to your code.

Plus are you sure the code you have pasted is the working code ?? Cause the area of a rectangle is (base (areax) * height(areay)) why do you have "(area * area)" added to it ??? Are you sure about what you are doing here ??
Also your program would fail if the rectangle is not perfectly horizontal that is the base is inclined at some angle with the X-Axis.

I hope this is good enough to get you on the way.

<Edit> I think you code is currently working cause since the variable area is declared at the class level, it is by default initialized to 0, hence (area * area) would give you just …

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Its refreshing to see that some posters pay attention to atleast some of the rules before posting, but we wont give you ready made code, but we'll help you write it yourself.