stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Elektra

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

A Simple google serach gave me this, Smack API and Yaja

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I already gave you the link to the SMSLib library in my first post

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

The best would be get an account from one the many bulk service providers, they should be cheaper, than the GSM Modem option, cause in a GSM Modem you need to insert a SIM and that will be charged for the SMSes you send.

Just google "bulk sms service providers" and you should get a pretty long list of them.
And depending on the provider he might give you a HTTP Link or an SMPP account or both.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

If you opt for using GSM Modems then SMSLib is a good place to start looking.
An HTTP API would be pretty straight forward to use. For SMPP, the OpenSMPP API would be a very good option.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

You need a GSM Modem, or an account with a Service provider who will give you an API, (HTTP link) or may be an SMPP account to connect to his server to send Smses

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Your servlet's .class file should be in WEB-INF/classes/ is that the case ?

Also once you move your servlets .class file there, you will need to either restart tomcat entirely or you will need to reload you application, by accessing the tomcat manager at http://localhost:8080/manager/html, for the URL I am assuming your tomcat is running on the same machine as you are working on and is configured to listen on port 8080 for requests

stephen84s 550 Nearly a Posting Virtuoso Featured Poster
  • No Code tags
  • All JDBC Code is directly in the JSP
  • JSPs are only supposed to display data processed by the Java Beans where your database connectivity and processing should take place
  • This is a Core-JAVA forum, There already is a JSP forum in the web development section.
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I don't really see a great importance of this code here

int chxvar = 1 << (8 * sizeof(int) - 1);

any explanations???

ssharish

If an int variable is set to "1", the very last bit is set to 1 and rest all bits are 0, 1 << (8 * sizeof(int) - 1) moves that 1 bit to the very start of memory location of that int variable, so it can be directly anded with (a-b) , to check if the sign bit is set or not.
Theres another draw back I just spotted here, if a=b, a-b=0 therefore the sign bit will not be set and the function will return saying a is greater than b.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster
int max1(int a, int b)
{
int chxvar = 1 << (8 * sizeof(int) - 1); //This initialises to a integer
if( (a - b) & chxvar)                            //of the value(100000000..)
return b;
else
return a;
}

From the code I get the hint you are checking the sign bit here, this solution would not always work. For example consider the situation where a = MAX_INT_VALUE; and b=MIN_INT_VALUE; In such a scenario (a-b) would be equal to "-1" which is less than zero, due to overflow.

Note:

MAX_INT_VALUE and MIN_INT_VALUE mentioned only for illustration,
For my compiler (GCC 4.1.2) they are
MAX_INT_VALUE=2147483647
MIN_INT_VALUE=-2147483648
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

yes I do, but can I see what you have tried, cause this looks like one of those questions with little practical application and mostly for academic use only ?

ssharish2005 commented: Well said, it is a pratical question. Remeber me doing in the university. haha +2
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Add the jar containing the jfreechart library in you class path by using the "-cp <path to jar>" argument while compiling as well as running your Java program

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Try JFreeChart, its a free API for making pie charts, bar graphs etc.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Eclipse does have some plugins for PHP

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

well, y'see... hmmm... okay, i guess i don't really know WTF you're talking about

because to declare an array of chars as either char * myString or a char myString[] is the same effect. in either case, "myString" is a pointer to the address containing the first character of that array of chars.


.

I had the same belief before, but some time ago Radical Edward had informed me in a different thread that (char * and char[]) are equivalent only when used in function declarations (eg void foo(char *abc) is same as void foo(char abc[]) ).

But I guess the link from Dave clears everything.
And I tested the above in GCC 4.1.3

jephthah commented: yeah, you were right... good post +4
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Ok so you are looking for sms-service providers, I think this hsould have been posted in the Site Management -> Internet Marketers Lounge section.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

if you are using the latest version of tomcat 6.0+ there is a "lib" folder in the ROOT directory of tomcat, you should find the servlet.jar file there.
In tomcat 5.0 I assume it should be in $CATALINA_HOME/share/lib The second way is to install the J2EE Standard Tools plugin for eclipse.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

First of all Wrong Forum, There is a JSP forum in the Web Development section where this should go.

Next you already get a ton of examples bundled with tomcat which is most probably the web server you are using to test your JSPs/Servlets

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Rules for getting help in Home Work

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

When you declare a "char" array as char *abc="alpha" , the string is not editable i.e. readonly,
You need to declare it as char abc[]="alpha"; , if you wish to edit by using the abc[index]=''; method,

Why this difference exists however I am not aware of !!

jephthah commented: false information. -1
Nick Evan commented: equalizer, as jephthah requisted :) +6
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

We want to integrate sms gateway with our website based on asp. We are looking for vendors for the same. any help?

we want to enable the advertisers on our site to receive customer inquiries by sms

What protocol are u gonna be using to submit messages to your sms gateway HTTP or SMPP or.. ???
HTTP is straight forward just call the link internally with the specified parameters, SMPP is however tricky, I do not know of any library which provided SMPP connectivity with ASP, although there are a ton of 'em for Java and even some for PHP around.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

This once again is not related to Java script, just set the default page in your webserver as "file.html" for that specific folder and voila when anyone types "http://cbuy.webs.com/file.html" he will see the file in his browser but "http://cbuy.webs.com/" in the address bar,
But why would you want to hide that is a mystery to me ??

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

can anyone please give me the code (or point me in the right direction) to be able to password protect a web page with javascript that gets the usernames and passwords from a database and displays a message if the entered password or username is wrong and points the user to a page if it is correct. and i also want it to create a cookie so that the user doesn't have to put in his/her password all the time.
can anyone help me out please!

You can't do that with pure Javascript, you need some server side script to work with you for that

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Serious on the Job programming since a Couple of years now,
Java is my main bread and butter getter,
I had done basics in C/C++ in college and loved it. Now I am luckily working on creating real world applications using it.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Hi thanks for the feedback but can u write a code for me for the output that i want. if you write code then i will ammend it according to my template. Actually i am working on one c++ template, so it would be easy for me if you provide me a simple code and then i will apply it on my template.

Why should someone else write your code for you ?
Lerner's already given you the actual ways you can go with the Logic, you just have to convert that in to your code.
As far as the way you should go, I suggest you follow the second method which Lerner suggested, hold a vector which contains the unused numbers in your range and remove each number once it gets used in your actual array.
Also to generate your number I suggest you use rand()%X , where X-> size of Vector; this would give you the number at which index in the Vector to use, and once you have used the element at that index, just "erase" it from the vector, As a result "X"(size of the vecor) would keep on decrementing and you will mostly not have to worry about rand() repeating values.
In case you want help with Vectors you can look here.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Nope by default the Java Plugin for Eclipse only includes Core Java, Servlets are not a part of that.
A short cut to resolve that error would be, in case you have tomcat / some other java enabled server installed, just check in their "lib" folder if you find any jar called "servlet.jar" or "j2ee.jar" or something similar in name and add it to your project's build path in Eclipse, this should solve the compile error.

However you will not be able to test your servlets directly via Eclipse in this case

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

How about comparing the string directly with its reverse,
You howvere will need to use the StringBuffer if you want to reverse a string directly and then directly compare it the original string.


I donno but somehow I feel its too easy to be true ?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Wrong forum, theres a JSP forum in the Web Development section !!!

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

calling an HTML page that has a USERNAME and PASSWORD field using JSP

What the heck are you talking about ?
Do you wish to redirect to the given html page ??
A simple <jsp:forward> can do the job then.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Technically what you referring are called pseudo-random numbers and not actual random numbers, BTW can we see what you have tried or instead you could find the complete details for your program here ?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Take a look at how the getche() function works.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster
// Line added here
lowest=sales[0];
for ( int x = 0; x < SZ; x++ ) {
  if( sales[x] < lowest ) {
    lowest = sales[x];
  }
}

Your "lowest" variable needs to be initialized to the first element in the array, else you will always have a problem when your lowest value is greater that 0.

Same also applies to how you find the highest value in the array, if the largest value is less than 0, you will always get 0.

Also you can combine the two loops in to one and just do both the checks in the same loop

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

In your Hardy just hit

sudo apt-get install libsdl-sound1.2-dev

in your terminal, and try compiling your code.
Also in case the problem does not get solved, hit the following command in your terminal

apt-cache search libsdl

This will give you a list of packages associated with SDL and their description,
However from your code I feel the libsdl-sound1.2-dev package should do the job, in case it doesn't you will have to go thru the package list in the output of the second command and install the one you feel is needed by ur program.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

If you mean use a DLL, then I suggest you take a look at JNI, the Java Native Interface

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Which Distro of Linux are u using, Accordingly you will need to install the SDL development package for that platform,
You seem to be working with the sound library of SDL, on Ubuntu the package that you need to install would be libsdl-sound1.2-dev

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

and i didnt watch any hour in the java cour
so i need help from any body to make my project and success in this subject
the project is about

You want someone to make your project or do u want help in making ur project ???

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I remember during my college days when I was a lazy programmer I used to use the BigDecimal and BigInteger classes for checking whether a particular string is numeric or float.

To check if a given number is an integer or not I used to just write the code

try{
  new java.math.BigInteger(<string to check>);
  System.out.println("String is numeric");
}catch(NumberFormatException ex) {
  System.out.println("String has invalid characters.");
}

same way to check for floating point numbers with the java.math.BigDecimal class.

But in recent times since I have learnt of regexes I no longer find the above approach attractive I prefer using the matches(String regex) function of the String class which is a much much better option.
Also if you are unaware of regexes in Java you can start here

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

For running the program mentioned, you need an echo server running on your system, which is provided by most UNIX machines and runs on port no 7.
To check if your Vista box has one running just hit telnet localhost 7 , if it shows connection refused or could not connect, then it means you box does not have an echo server, and hence your program will not work and thats the reason I feel for your ConnectException exception.

I know that your tutorial probably says to connect to port 7 for an echo, but try connecting to a port > 1024. Chances are your errors are due to trying to connect to a port that is in use.

Now this prob would have occurred if we were trying to create a ServerSocket on the given port, But as we are creating a client socket here to connect on the given port we apparently want the opposite, that is the port should be in use by the "echo server" so that we can connect to it.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

This should be moved to the Linux board.

What about Debian?
Slackware?
Gentoo?

Dint get you, if you meant whether Mono runs on the mentioned distros, I suppose it should at least thats what the project page says so

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I've got it working so that all fields in a row are selected. The problem is, I don't know which fields will be empty, so I cannot hard code the select statement to leave out certain fields.

First requirement of its types I have seen, Whats the schema ?

-------------
Shucks dint see the last post was 5 days ago

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

hey even i m also new....
have u put mysql connector jar in classpath.
plz check

I think the thread starter is talking about PHP and you r confusing it with the J-Connector.

So how are you connecting to the database, can we have some code to see what you tried ?
First hit the command "telnet <IP of system MySQL DB server installed on> 3306" to see if it connects.
If so are you able to login using the given user in mysql directly via the mysql command line client or via the mysql-gui tools with the given username and password?

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Drinking Tea with some Lays Chips ;)

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Just let the attribute "u" be an int array of size (c-a),
And in your constructor instead of after displaying the values just store the squares as
below:-

public class sumSquares {
  public sumSquares(int a, int c){
    // Since we need the squares of c and a also
    u=new int[c-a+1]
    while (a<=c) {
      u[u.length-(c-a+1)]=(a*a);
      a=a+1;
      System.out.println(u[u.length-(c-a+1)]);
    }
  }
  private int[] u;
}
Ezzaral commented: At least take the time to ensure your code works when you post an example. -2
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I dont know how your class is defined, but I am just gonna be doing a wild guess here:

employee *emp[10];
   emp->outputData();

Looks like an array of pointers to objects of class "employee",
First this means that your objects will not be automatically created (try putting a cout statement in your default constructor to check it out),
So to create an object and stores its reference in the "emp"array you will need to manually specify

emp[0]=new employee(...);

or some other method.

Also consider the second line, since you are creating an array of pointers, u need to tell the pointer at which index to use while using the "emp" array.
ex:

emp[0]->outputData();

However just guessing here, I couldn't try your code directly here.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Is this a webapplication in JSP/Servlets you are talking of ??

Also some code on as to what you tried would help us, help, help u !!

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

hey i have not freed "ptr" i have freed temp..OK n ne wayz if you dont know then dont come up with stupid comments like this ....i think u should learn this..what the fuck can u do ...NERD

No wonder your program doesn't work as you don't have a clue what you are doing.
....Anyways I wasnt the one begging via PM for help

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Haven't you ever heard of code indentation ?????

How can you free "ptr", ptr points to the node preceding the node to be deleted, you do not free "ptr", you free the node after "ptr"

Please think !!! do not just directly copy paste the code given here.

You really need to learn to debug !!!
How can you do:-

ptr=temp;

thats complete carelessness, it should be

temp=ptr->next

Also your while condition should change and I am not going to help u on that, you should start thinking and stop simply copy pasting points given here

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Amazing I found the exact program you needed Here

Nick Evan commented: Duckroll! +6
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well you can make our task a lot easier by INDENTING your code


Anyway thanks to Eclipse I could indent your code directly.
Now lets look at your "delet" function

void delet(struct student *first,int val)
{
	struct student *ptr,*temp;
	ptr=first;
	while(ptr!=NULL)
	{
		if(ptr->rollno==val)
		{
			temp=ptr;
			ptr=ptr->next;
			free(temp);
		}
		else
		{
			printf("The roll no does not exists");
		}
	}
}

This appears to be linked list program,
While deleting an element also need to hold a reference to the element preceding the node to be deleted, so your "if" condition should change to

ptr->next->rollno==val

and you will also need to set the "next" pointer of the node before the node-to-delete to the address of the node after the node-to-delete by writing:

ptr->next=ptr->next->next;

before invoking free on the node-to-delete

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I wouldn't recommend upgrading via this method . . cause I have awful experiences of it.
I had tried to upgrade by home PC which was running Ubuntu 7.10 Gutsy to Ubuntu 8.04 Hardy, the system downloaded all the required packages but during the installation, everything just stalled, I had to power off my system, and on restarting I couldn't boot into anything, This had happened before too while going from 6.10 to 7.04 also :'( !!!