stephen84s 550 Nearly a Posting Virtuoso Featured Poster

hi.....
i need to do a project on bulk sms.
i request you to send
java application for sending bulk sms from pc to mobile
by
kareena

I think the idea of it being your project is that you should make the application, not rip someone's hard work for your marks (if its an academic project) or money (if you are doing it commercially).

You have in this thread what you need to start making your own application, if you run into any road blocks you can definitely count on the people in this community to help out, but only if you put in the effort.

peter_budo commented: Obviously some students do not get it that in deed has to be their work not stolen material +15
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

@prem2

After changing the package statement, have you recompiled the HelloWorld.java file ?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Are you giving the code or asking for help ?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

With the first line of your HelloWorld.java file, you have specified the class to be a part of package 'world':-

package world;

That is why the 'world' folder is identified as a valid package, but 'javaprograms' is not.
If you would like it to be recognized as a valid java package, then you would have to declare your HelloWorld class to be a part of package 'javaprograms.world' as below:-

package javaprograms.world;

i.e. 'javaprograms' would be your parent package, and world its sub-package, then your program would run in the final case.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

From the looks of the error, it seems that your 'dbquery' tag requires the attribute 'uri' to be specified.
From the TLD it seems like you are using the tag file approach to create your own 'dbquery' custom tag. If so check your tag file, 'WEB-INF/dbquery' (I assume), for the following line:-

<%@attribute name="uri" ..... required="true" %>

Now change value for 'required' from true to false or remove the line completely since you do not seem to use it.

P.S. : This is just a guess, I need to see the actual contents of your tag file, to suggest anything concrete.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Ok ... If the JSP file is not too long could you post it ?
Cause I can't spot any reason for that error, from what has been posted.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster
<%
----
---
-----

UrlGen urlg = new UrlGen(request.getQueryString(), "UTF-8");
String url = "Contacts.jsp"+"?"+urlg;

%>
<a href="<%=url%>"><img src="images/hide.gif" border=0 align="middle">
</a>
<%
--
--
%>

If that is the exact reproduction of your JSP file, then you are bound to get errors and tons of them cause, "---" is not valid Java syntax.
Remove all those hyphens ("-") and retry.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I created the package and I am able to run it on Windows environment but I have now shifted to Ubuntu Linux, and unable to run on that and of the most unable to set the class path...................plz help me out!!!!!!!

I have been using Linux with Java for a few years now, so *maybe* I could help, but you have to first clearly state what the problem is, in a thread of you own .. not a fossilized thread from a decade ago.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

i never asked you to write my code. i merely asked for an example. you just haven't been helpful at all and don't seem to understand what i am trying to do. don't come up with some lame excuse as "we're not here to write your code." just because you don't know how. simply be a man about it and state that you don't know.

@charat
NormR1 has a habit of obfuscating his answers so that people new to Java like yourself do some exploring on their own. He already has given you sample code on how to use Arrays and pointed you in the direction of achieving your goal of 'infinite amount of numbers', unfortunately your pride has taken over and instead of looking at the pointers to solve your problem, you are getting overworked on nothing.

So be a man about it, and learn to spot what you need, after all if you do not get your project done, its not going to matter to him but yourself only.

BTW This is all you had to do to get your answer.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

A Quote from the announcement section:-

Also, to keep DaniWeb a student-friendly place to learn, don't expect quick solutions to your homework. We'll help you get started and exchange algorithm ideas, but only if you show that you're willing to put in effort as well.

So ... where is your effort ?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I gave you a link on how to use arrays, similarly mustafa gave another solution, I dont see you having tried any of them, If you dont try any of the solutions, how can we help ???

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

it says that the amount variable has not been initialized

Thats cause in the futureInvestmentValue() method if for some reason you 'while' condition is never satisfied, then the amount variable would contain just garbage, hence the compiler is pointing it out to you beforehand by giving that error, just initialise it to 0 and you should be good to go.

when i set amount to "0" the program compiles but when i enter all the values nothing happens and the program still continues to run instead of terminate.

Observe the lines 35,36 and 37 thoroughly:-

// Create formula
			while (year <= years)
				amount = investmentAmount * monthlyInterestRate * year;
				year++;

It actually is:-

// Create formula
			while (year <= years)
				amount = investmentAmount * monthlyInterestRate * year;
			year++;

The year++ is outside your 'while' body. So the 'while' condition is never violated and the program goes into an infinite loop.

It is because of errors such as these the Sun Java Code Conventions always recommends to use brace brackets with all your loops, even if the body may contain a single line of code.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

kindly discuss about the scanner class and its importance

Looks like a homework assignment question to me.
Anyway you are in luck, I found the answer you are looking for here

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Just to complicate it some of the books have more than one author

No offence meant here, but problem seems like an outcome of bad table design. There are are currently two entities which I can see in your data model: Author and Title.

Now one Author can have multiple Titles, while a single Title can have multiple Authors. This is a many-many relationship and to model it correctly you need a third table (example AuthorTitleMap), which maps the title_id to the author_id and they together will form the primary key of the third table. (Also you would have to remove the title_id in the author table)

Also while inserting the data insert first into the Title Table, them the Author table and finally into the AuthorTitleMap.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Yes I do use open source software. My own computer (not work pc) uses linux and a whole suit of open source software.

Well if you are on linux, the office suite that you are using will be OpenOffice, which is one of the largest Open Source Java efforts.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Wow, a perfect zero of a post. Can we make this a sticky, under the heading "how not to ask for help"?

It is not correct to rebuke new members jon.

@anju_soosan
Here is a comprehensive list of mini projects you can do in Java

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

but somebody tell me why i was getting this error?

You did not post the contents of your web.xml file, so unless and until someone has a crystal ball here which can look into your past, it cannot be answered. All that can be guessed is, you did not add your servlet correctly the first time around to your web.xml

@Override - is an annotation, a marker, If a method marked with @Override fails to correctly override a method in one of its superclasses, the compiler generates an error.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

As you ask me what link,I understand that you do not know how to give a link for a cron.daily job

You said :-

can we write links in cron.daily?I have read that u can write a link in cron.daily?

So definitely he asked what link.

And next you are not exactly invoking a link, you are feeding the link to 'links' a text based browser which is doing the job of invoking the link of your JSP for you.

What masijade said and I concur is this is not a job for a JSP, covert it to a Java application (since then you can reuse the code), and run that Java application via cron.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

u could hv used code tags to post d code here

n plz also post wht errors u r getting

Since you are reminding each other of the rules, here is one for both of you:-

Keep It Clean
We strive to be a community geared towards the professional. We strongly encourage all posts to be in full-sentence English. Please do not use "leet" speak or "chatroom" speak.

http://www.daniweb.com/forums/faq.php?faq=daniweb_policies

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Quote from the Announcement at the top of the Java forum:-

..., to keep DaniWeb a student-friendly place to learn, don't expect quick solutions to your homework. We'll help you get started and exchange algorithm ideas, but only if you show that you're willing to put in effort as well.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

i tried using it without package

without package its working fine

plz help

Try running it is

java -cp . admins.admins

'-cp', abbreviation for ClassPath tells the JVM where to look for your class files (or libraries or the top level package folder in this case)
The '.' after '-cp' tells it to look in the current directory, since you are running the program from the parent directory of 'admins'.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

mmm...still stuck lor......can u guide me to use array ?

Post the code that you have tried.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

how to use array to store user input bro?....

My Post had a link on how to use Arrays:-
http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/java/nutsandbolts/arrays.html

Even musthafa's solution is a good option, although I would suggest using a StringBuilder as opposed to StringBuffer.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Bro.... i need to display result of sum int by int that keep in by user....right now i just can display all sum...what i need is output like this.....

"( 1+3=4+5=9+66=75+88=163 - the program will terminted cause exceed than 100)

how to do..plz help me...

Use an Array to store the numbers keyed in by the User.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Since you decided to just post the code and describe nothing about the problem, I will just point to the lines which *could* be holding the issues:-

Snippet1: Line 8

Snippet2: Line 6


Very helpful isn't it, so next time post a description of the problem you are facing.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Post the contents of your web.xml file, since the problem appears to be there.
Also I hope you have placed your class file (of the Servlet class), at the correct location (WEB-INF/classes or WEB-INF/lib[for jars]).

Another thing is remember to close your PrintWriter once you are done using it, like in processRequest().

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well you have not mentioned the problem and just visually going through the code, I am guessing its a compile error caused by a missing double quote on line 47:

System.out.println(execeed 100 =  "+ sum +" )");

Should be:-

System.out.println("execeed 100 =  "+ sum +" )");
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

My suggestion again, use an IDE like Eclipse and take advantage of the auto-completion, it lists for you the API of a class and what each method does.

There are numerous studies which suggest that babies who are given baby walkers tend to develop their walking, crawling skills much later than the ones deprived of them.
Same way if you are going to use stilts in the form of IDEs while taking your first baby steps in programming, you are bound to go dependent on the stilts for walking,

Masijade's post here makes the point perfectly clear.

It may seem helpful to a beginner, but it's not. IDE's are for people who already know what they're doing in order to increase their effeciency. You need to understand the tools and the processes behind everything and an IDE shields that from you.

Also if the O.P. could not write even a basic outline of code on his own, I doubt he would find his way around in Eclipse. No insult directed at the O.P., this comes from personal experience, learning how to use an IDE effectively is no Joke, so first get the basics of Java and then launch into an IDE. The "Starting Java" thread actually covers the ideal way you should go about learning the language.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

do you have sample code
please do the needful.

Ehhh . . . . .Why ?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Sorry don't have crystal ball so can't predict the future !!!

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

It's about an application that can be able to send sms to the users mobiles phone and receive sms from them.

Since you are looking to send and receive messages as well, you will need a GSM modem (to at least receive messages), SmsLib is a popular library to achieve that end.
As far as sending messages is concerned you could either use the GSM modem for that as well, or you could look up some bulk sms service providers for your area who can give you SMS at cheaper rates, some may even allow you to use the service for free, provide you reserve a certain amount of words for their advertising.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I do not think you have yet compiled the code, else you should get an error at the following line in aMethod() method:-

names.add(name2[i]);

The error should be 'Cannot refer non-static variable from static context.'. The names variable should also be declared static to be accessible from a static method.
Also I do not think any duplicates would be encountered in the bMethod() cause, names is already a Set, and the duplicate elements would have already been filtered out when you were adding the elements to the 'names' TreeSet in aMethod() method.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

636

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Create an HTML form with a hidden field containing the value of the variable and the action attribute pointing to the servlet you want to call
Finally On click of the Hyperlink, use javascript to perform a post action on the form.

A few references:-
Calling a javascript function in Hyperlink.
Submit a form via javascript

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Now if I use the correct wordings, a ThreadSafe class basically guarantees that any operations performed on it would not cause the data in it to get corrupted. This is what the ConcurrentHashMap guarantees, but the situation you are talking about is performing two separate operations atomically on a ConcurrentHashMap, hence you need to put the two operations in a synchronized block, so that no other operation (from any other thread) is slotted between them.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Yep, thats it.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

It probably doesn't because it extends AbstractMap which already defines equals to perform content based comparison, not reference based.

AbstractMap defines the equals method based on which Maps, extending it can be compared. It seems to me that you are confusing it with the equals() method of the 'keys' which are stored inside the Map.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

how do i go about checking for the last character of the line if I just want to discard the line that has H at the end of it and wants the other lines that contains C, O and N?

Thats the reason why I have added link to the regex tutorial, read it and construct your pattern according to what you wish to check, I already have given an example pattern which checks the Starting and ending character of a String.

Read your input file one line at a time into a String against which you check for the occurrence of your pattern (using the matches() method). If the match is successful concatenate this String, with a third string which contains the data you want to write to the new file.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

hi taywin so I can assign firstword = ATOM and lastword != H? is it possible for me to do that? and I have a question, how do i show the output? System.out.println(linString.split);

@yap_1991
Instead of reading the first and last word, read the entire line and match it to your REGEX as I have mentioned in this thread.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Using regular expressions you can check for patterns in your input.
Example:

String a = new String("1234");
if (a.matches("[0-9]+")) {
  System.out.println("String is a number");
}

In the above chunk of code the regex "[0-9]+" tests if the Given String is a number, you can construct a regular expression for your pattern along similar lines.
Example If I want to test for a String starting with "A" and ending with "N" the regex (regular expression) would be "[A][.]*[N]"

Use the regular expression to test if the input matches your pattern, if it does, then concatenate the data you wish to write to the file in another String variable (ex: dataToWrite).
Once you are done processing the input use File IO to dump the data in your dataToWrite variable into a File.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Use Regular Expressions for Pattern Matching.
Tutorial for Regular Expressions:- http://java.sun.com/docs/books/tutorial/essential/regex/

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I STORED THEM. BUT HOW DO I CONVERT THEM BACK TO NUMBERS.

Nice attitude, but you might remember I mentioned something about ARRAYs and even pasted the same link to you twice.
You are instead using a String to store your numbers,hence the pains of getting them back. Heres a few pointers:-

A variable example 'n1' on Line 10 of the code you posted, can hold only ONE value at a time, if you do 'n1=10', then it stores the value 10, next if you do 'n1=92', it stores the value 92, the value '10' is overwritten and you can't get it back, thats what is happening in your first time code you posted. In every iteration of your first while, the statement n1=Integer.parseInt(input); was overwriting the old value entered by the user (in the previous iteration) with the new value, hence at the end of the loop, 'n1', would contain only the last value.
An Array on the other hand can store a group of values. Example int[] n = new int[10] , now 'n' can store 10 different integer values at the indices from 0 to 9. Heres an Example:-

int[] n = new int[10];
int index = 0;
Console console=System.console();
while (index < n.size) {
  input=console.readLine();
  n[index]=Integer.parseInt(input);
  index = index + 1;
}

The above chunk of code would read 10 numbers from the console and store them in your array. Suppose this should give you clear idea on Arrays and *hopefully* you …

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

-Xbootclasspath/p:'D:\Document's\Downloads\wiiuse\SampleAppWiiuseJ\${endorsed.classpath}'

Checkout line 199 in your build-impl.xml, and see if the extra quote in Document's is valid, if you have no such folder, then delete the quote.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

i am unable to enter the price value and the response after running is Usage: java salestax price thanks

So, it says Usage: java salestax price So on the console you should type: java salestax <price> Ex: java salestax 10 (where 10 is the price)

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

i can get the average of the input.

but i need to keep a record of everything the user types... (All his numbers)

i need that record to compare to the average of all the numbers he used

I repeat from my first post in this thread !!!
Store all the numbers entered by the user in an Array. So you can perform processing on them later.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Hey guys, just noticed today that Clicking on bbcode tags link in the section below the forum title (in Software Development / Web Development forums)displays a blank page.

Our Software Development forum category encompasses topics related to application programming and software design. When posting programming code, encase it in [code], [code=syntax], where 'syntax' is any language found within our Code Snippets section, or (icode), for inline code, bbcode tags. Also, to keep DaniWeb a student-friendly place to learn, don't expect quick solutions to your homework. We'll help you get started and exchange algorithm ideas, but only if you show that you're willing to put in effort as well.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Ehhh... We knows you have problem, but What is the problem doc ?

Double.valueOf(args[0]).doubleValue()

Extracts a double value from the given String object (args[0]). Same can be achieved a bit more easily by just Double.parseDouble(args[0])

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

@NewOrder
Use Code Tags the next time you post code.

Now when it comes to your program, first store all the numbers entered by the user in an Array. So you can perform processing on them later.

Calculating the Average is simple, just sum up all the numbers
The following chunk of code shouts out loud that you haven't given it clear thought or run your program even once.

for(count=0;count<100;count++){ 
  sum=(n1+sum)/count;

The code would always throw you a divide by zero error, as count is equal to 0 at the start of your loop and your program execution would terminate.

To calculate the average, take the sum of all the numbers the user entered (which you have stored in an array, using a loop) and then divide that total by the count of numbers entered.

Once you have calculated the average, once again parse through the entire array of numbers using a loop. Inside the loop use a switch or an If statement, to find out whether the number at the given position in the array is above average and print it.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster
} catch (IllegalArgumentException e) {
			System.out.println(e);
		} catch (NullPointerException e) {
			System.out.println(e);	
		} catch (IOException e) {
			System.out.println(e);	
		}

Instead of System.out.println(e) use e.printStackTrace() , as just instead of the name of the exception, it will give you exactly on what line the exception occurred. Right now any suggestion I give would involve pure guess work as I do not know on what line the 'NullPointerException' was encountered.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

lets first clear our concepts here first, Netbeans is an IDE, not your implementation language (unless you meant Netbeans RCP), what you are coding in is Java.

Any ideas????

You told us what you are planning on doing, so I am a little blank here on what ideas you are expecting.

trying to get data from the Internet

Well for that then you will need to

  • Find a Site which gives you the information on the books from their ISBN, also even if such a Site exists, I do not think it would be free. An alternative method could be web scrapping, Sites like Amazon give functionality to search based on the ISBN of a book. So you could shoot the request to their site by checking their search API and parse out the details of the book from the returned webpage.
  • After step (1), learn how to perform an HTTP POST or GET operation and read the response.