hag++ 24 Junior Poster

I see 2 potentials points of failure in your code. The first thing is if the users email or the product ID returns no results (because the the email or product ID specified in the URL didn't exist in the database) then the condition in the while() loop will not evaluate to true.

The other point of failure is what if one query returned results but the other didnt? That would also cause the condition to evaluate to false.

hag++ 24 Junior Poster

hey when you will post the solution for me :) still waiting

hits ::
just copy above code
run it
its will display data if you see the source code its xml data which is returned from servers
so you have to just parse return xml data ($data) and assign them to separate variables like $ip,$isp,$org etc

Nobody here is going to do your work for you and you shouldn't be waiting on people to solve your issue.

Start off here and learn this class well:

http://php.net/manual/en/book.dom.php

hag++ 24 Junior Poster
hag++ 24 Junior Poster

Can someone help me?

How to design a php page with an image and a user-clickable button which will trigger a different php function in a simple fashion!
The code in my first post runs through some error as described.

Thanks!

Honestly it sounds like you need to do more research on the language before you continue on. I would reccomend this book:
http://www.amazon.com/MySQL-Dynamic-Sites-Fourth-ebook/dp/B005GXM63U/ref=sr_1_2?ie=UTF8&qid=1328306153&sr=8-2

I have read both this book and his advanced PHP book and they are fantastic.

hag++ 24 Junior Poster

Ok well it really all depends if you want this to be a browser based chat client or a desktop based client. If you want it to be desktop based you can user Frame or JFrame and if you want it to be browser based use Applet or JApplet.

hag++ 24 Junior Poster

Look at those compiler warnings. The compiler will also suggest to you an argumnet to use during compilation. Do so, and it will tell you exactly what needs to be changed.

This ^^. Most likely you will have to use the xlint switch and specify deprecated.

hag++ 24 Junior Poster

I'm definitely not a PHP wizard but good old OOP rules says your function is declared as static. You can't use the "this" reference in a static context.

hag++ 24 Junior Poster

I'm not sure if it is just an issue with my browser but you're code is almost un-readable. One question I do have is why would someone be able to select both male and female? Another question is how did you generate your WSDL? I'm assuming you wrote the service for the server and then generated a WSDL off of that service. What is the value specified in the WSDL?

hag++ 24 Junior Poster

So... what's your question?

hag++ 24 Junior Poster

Hey All,

I have been diving into the sweet (yet sometimes unforgiving) world of RESTful web services lately and I have come across an excellent tool for testing your requests before implementing the programmatic solution. I know Soap UI has a REST based component but I find it a little overkill for just running a quick test to see if you have your endpoint, HTTP headers, body and auth correct. It is a very simple tool but I have found it immensely helpful so hopefully it will help other people and prevent further headaches.

Link to software

hag++ 24 Junior Poster

Hey All,

I didn't know where else to post this so if there is a better place let me know and i'll move it. Anyways, I have been diving into the sweet (yet sometimes unforgiving) world of RESTful web services lately and I have come across an excellent tool for testing your requests before implementing the programmatic solution. I know Soap UI has a REST based component but I find it a little overkill for just running a quick test to see if you have your endpoint, HTTP headers, body and auth correct. It is a very simple tool but I have found it immensely helpful so hopefully it will help other people and prevent further headaches.

Link to software

*EDIT: I just realized there is Web Services under "Web Dev". I don't see how to move this thread though so if a mod can do it that would be great. Thanks!

hag++ 24 Junior Poster

Well for one it seems like you are catching an OleDbException and showing a MessageBox with the Source property in it. Calling the Source property alone doesn't really tell you much about why the exception is being thrown. Try putting the Message property in the message box instead and let us know what that says. Since I don't use access I can't really test your code locally.

hag++ 24 Junior Poster

My senior said me that java doesn't support pointers due to Security reasons. Because we make client-server program on java so the pointer may be used to break the security so we don't use pointers in java....

Is he right???

Seems like a borderline troll question....

hag++ 24 Junior Poster

Then how would you describe reference variables?

I don't know what you mean by this. Java does not have "reference variables" like C++. Reference in Java refers more to Polymorphism, where a declared Base class can be instantiated as any of it's super classes. When you pass an object to a method in Java they are always passed by reference. The only way to get around this is to instantiate a new object, calling it's copy constructor and passing the new object to the method.

hag++ 24 Junior Poster

Java has pointers BEHIND the scenes. They are not accessible to the programmer using the language. Remember that Java is built upon C/C++. Java is a managed language, hence no pointers. When you instantiate an object using the "new" keyword the C function "malloc" is used to allocate memory on the heap for that object. All memory for user defined types is allocated on the heap (the same place a pointer is placed in an un-managed environment). The only thing in Java that is located on the stack are primitive types.

hag++ 24 Junior Poster

I don't know if you mean is there a way to "hack" into the database or if there is an API to access it. I would say No to both questions.

hag++ 24 Junior Poster

I can already tell that you didn't try to compile it since it does have errors

public bool equals(int x, int y)

There is no "bool" type. Should be...

public boolean equals(int x, int y)
hag++ 24 Junior Poster

I got involved in several open source Android projects and I am now working on my own (Available soon in an app market near you). It's a lot of fun so far and mobile development is now a big part of this industry. Might want to give it a shot!

hag++ 24 Junior Poster

Also see this for definition of recursion:

http://www.toves.org/books/java/ch18-recurex/index.html

hag++ 24 Junior Poster

When you do a deep copy you need to copy ALL instance variables as well. In this case you are copying the char* but none of the int's

hag++ 24 Junior Poster

Ok first things first... please use code tags. This isn't too bad to read since it is so short but it's still messy.

As far as the logic is concerned, you could go a lot of ways with this. You could use a Map and link the values to the number of occurrences that way. You could also create your own "Number Tracking" class to keep track of the value and how many times you have encountered it.

hag++ 24 Junior Poster

You can also do:

if(grades[i] < 60)
// print 1 star
else if(grades[i] < 70)
// print 2 stars
// etc etc ...
hag++ 24 Junior Poster

Your method can easily check versus size and return the minimum of the requested number or the remainder of the list. As Norm already mentioned, you just need to keep track of your current list index.

Exactly... for example:

// Something like this
remoteBean.getPreviousTweets(5);

// More code here
// .....................

// definition of getPreviousTweets() method
public Tweet[] getPreviousTweets(int numberOfTweets) {

   // decide which is smaller, our current index or the supplied number of Tweets to return
   int numberToTrace = Math.min(numberOfTweets, m_currentIndex);

   // Perform rest of operations here
}
hag++ 24 Junior Poster

Please re-post your updated code

hag++ 24 Junior Poster

The entire program was working perfectly with the same function... but now I just did multiple inheritance for one class and this is what I am getting. And yes, according to me, region is valid in all the cases. Wouldn't you mind looking at the code?

We need teh codez!!!

hag++ 24 Junior Poster

This is not the preferred way to get a character and it won't work if you are actually trying to get a string:

cin >> userInput[26];

It should be:

cin >> userInput; // Get a string

Or this:

cin.get( userInput[26] ); // Get a character.

Also, what is this?? This isn't correct either. I am not even sure what you are trying to do here.

char string[1000] = string;
hag++ 24 Junior Poster

You never actually stated a question...??? What do you actually need help with? If you post code you also need a question to go along with it.

hag++ 24 Junior Poster

And don't get mad C people, I didn't mean it, C is still widely used language. :)

Don't try to back track now... the damage is already done... especially with that C# comment

hag++ 24 Junior Poster

I am a little fuzzy on this subject but I believe the problem lies in the fact that the copy constructor is not always called by default when using the assignment operator on your objects. Your best best is to either manually override the assignment operator. Feel free to correct me if I'm wrong

EDIT:
Narue beat me to it.

hag++ 24 Junior Poster

When you look at your Form1.h and General.h header files you do not have any references to either .h file right? The only reference to Form1.h and General.h that you should have is in the General.cpp file

hag++ 24 Junior Poster

No, he was actually aiming at Smalltalk when he said that.

Ah ok that's better :D

hag++ 24 Junior Poster

Well you are performing these operation from within General.h aren't you? That would mean that the compiler cannot find the Form1 object inside Form1.h

hag++ 24 Junior Poster

Nothing like dogging on your own language huh? lol But like Narue said back then OOP concepts were still new and because of that code was not as optimized as it is now. C++ is now used in DirectX and OpenGL programming all the time.

hag++ 24 Junior Poster

It is not finding the Form1 object in the Form1.h header file. Is that the name of the object?

hag++ 24 Junior Poster

That is the addition assignment operator... You are taking the value of c and adding it to the current value of sum. So if sum is 5 and c is 2 then after that operation sum will equal 7.

hag++ 24 Junior Poster

And it is VERY common for lovers of C to naturally hate the transition to C++.... They hate dem there un-necessary classes and the "convoluted" nature of classes.....

hag++ 24 Junior Poster

Ooo Fbody beat me out by seconds haha :D

hag++ 24 Junior Poster

In your init.cpp file you are re-declaring the class. You do not need to do this since you already prototyped it in init.h. In init.cpp it should be:

void Initialization::test()
{
   // Code for test() method here
}
hag++ 24 Junior Poster

You need to declare A as a namespace. Then you can put

using A::B;

once and just use the class name.

hag++ 24 Junior Poster

Also, please use code tags!

hag++ 24 Junior Poster

Also, please don't be so lazy to write 'd' for 'the' - it is very annoying to read sentences like that.

This^^^

hag++ 24 Junior Poster

Failed? Seriously? Whoever said C++ was a failure doesn't know what they are talking about. Some people prefer to use other OOP languages over C++ because they are easier to work with and faster to learn (C++ has a lot of roots in C so it is not as user friendly as other OOP languages such as Java and C#).

hag++ 24 Junior Poster

Dont & and * cancel each other out ?

int main() {

        int x = 10;
        int *p1 = &x;

        printf("p1  %p\n",p1);
        printf("*p1 %d\n",*p1);
        printf("*&p1 %p\n",*&p1);
        printf("&*p1 %p\n",&*p1);



  return 0;
};

No because x is not a pointer you need the address of operator when assigning it to an int pointer.

OP, why do you assign memory to each variable then set it to NULL? I see that you dereference them first but.... it's still wierd...

avl *a;  a=new avl;  *a=NULL;
avl *p;  p=new avl;  *p=NULL;
avl *q;  q=new avl;  *q=NULL;
hag++ 24 Junior Poster

Is test.h still in your source directory? That error could also be telling you the file is missing or corrupted.

hag++ 24 Junior Poster

Lolz this is priceless ^^^

hag++ 24 Junior Poster

One is using the constructor to initialize the value of the string object and the other is using the overloaded operator "=" to assign that value to the string object.

hag++ 24 Junior Poster

Right that's because you made those variables private in your class. If you want to access them directly (Without using getter, setter methods) then you need to declare them as public.

hag++ 24 Junior Poster

Since regenerate() is a method it needs to have parenthesis.
Change this:

newGame.regenerate;

to this:

newGame.regenerate();
hag++ 24 Junior Poster

Oh and this is also incorrect:

if(userGuess = secretRandom)

It needs to be

if(userGuess == secretRandom)
hag++ 24 Junior Poster

In your constructor you should be passing the variable "seed" to the srand() function because if you create the object correctly in main() then the "seed" variable will have the value of time(NULL) in it. Like this:

GuessingGame(int seed)
{
   srand(seed);  // Pass seed here
   m_variable = rand() % (maxRandomNumber - minRandomNumber + 1) + minRandomNumber; // Part two of random number generator.
}

Also, can you post the code in main() so we can see how you are calling regenerate()?