~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> but, it works with what lovetwins wants to do, since it will evaluate if package equals to 'a' or || 'A'...
No. It evaluates to case 1, so entering 'a' or 'A' would give the message 'Enter only a, b or c for package'.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> What vector? I don't see any vectors.
I guess he meant the list.

list<humanPlayer>::iterator iter;
for(iter = jailHouse.begin(); iter != jailHouse.end(); ++iter)
{
    //now dereference the iterator and you get access to your instance
   cout << iter->getPlayerName();
   cout << (*iter).getPlayerTurnNum();
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Don't copy if you can't paste!!

At training program for top management. *

A well-known motivational speaker gathering the entire crowd's
attention, said, "The best years of my life were spent in the arms of a woman who wasn't my wife !"

The crowd was shocked!

He followed up by saying, "That woman was my mother!"

The crowd burst into laughter and he gave his speech, which was well received.

About a week later, one of the top managers who had the training decided to use that joke at his house. He tried to rehearse the joke in his head. It was a bit foggy to him.

He said loudly, "The greatest years of my life were spent in the arms of a woman who was not my wife!"

Naturally, his wife was shell shocked, murmuring.

After standing there for almost 10 seconds trying to recall the second half of the joke, the manager finally blurted out "... and I can't remember who she was !"

As expected, he got thrashing of his life time....

Moral of the story: *Don't copy if you can't paste*

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Yea.. basicly ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
<html>
<head>
    <script>
    function loop()
    {
        var list = document.getElementById('list');
        var chkBox = document.getElementById('chk');
        if(chk.checked)
        {
            for(var i = 0; i < list.options.length; ++i)
                list.options[i].selected = true;
        }
        else
        {
            for(var i = 0; i < list.options.length; ++i)
                list.options[i].selected = false;
        }    //alert(list.options[i].value);
    }
    </script>
</head>
<body>
    <form>
        <select name="list" id="list" size="3" multiple="multiple">
            <option value="India">India</option>
            <option value="US">US</option>
            <option value="Germany">Germany</option>
        </select>
        <br /><br />
        <input type="checkbox" id="chk" name="chk" onchange="loop();"/>
    </form>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
<html>
<head>
    <script>
    function loop()
    {
        var list = document.getElementById('list');
        for(var i = 0; i < list.options.length; ++i)
            alert(list.options[i].value);
    }
    </script>
</head>
<body>
    <form>
        <select name="list" id="list">
            <option value="India">India</option>
            <option value="US">US</option>
            <option value="Germany">Germany</option>
        </select>
        <br /><br />
        <input type="button" id="btn" value="Button" id="btn" onclick="loop();" />
        <div name="myDiv" id="myDiv"></div>
    </form>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Here is another:

NEVER LIE TO A WOMAN!!


A man called home to his wife and said, "Honey I have been asked to go fishing up in Canada with my boss & several of his Friends.
We'll be gone for a week. This is a good opportunity for me to get that Promotion I'v been wanting, so could you please pack enough Clothes for a week and set out my rod and fishing box, we're Leaving From the office & I will swing by the house to pick my things up" "Oh! Please pack my new blue silk pajamas." The wife thinks this sounds a bit fishy but being the good wife she is, did exactly what her husband asked.

The following Weekend he came home a little tired but otherwise looking good. The wife welcomed him home and asked if he caught many fish? He said, "Yes! Lots of Salmon, some Bluegill, and a few Swordfish. But why didn't you pack my new blue silk pajamas like I asked you to Do?"

You'll love the answer...
*
*
*
The wife replied, "I did. They're in your fishing box....."

christina>you commented: Cute. :-) +17
Aia commented: Christina was refering to the joke, not you!, just kidding +4
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Try out the approach provided by thekashyap in post #11.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Video tutorials are hard to find, not to mention they are pretty rare. Just google for 'C# tutorials', 'J# tutorials' and 'C++ tutorials' and you would get enough content to keep you busy for days.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Post the entire code of the JSP file. Posting bits and pieces here and there would in no way help you out.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The page not found error is normally thrown when the container fails to find the file. It AFAIK, is in no way related to the session space since the session is limited by the amount of physical memory your server machine has.

Without more code or explanation, it would be difficult to be of any further help.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> but then why is the cpp book explaining that one must use stdio.h
> and math.h if it is wrong.
Either the book is a relic or not its worth. Get a better book. The book most people seem to be recommending around here is 'Accelerated C++'. If you can't get hold of some decent books, try looking around for tutorials on the Internet; there are many out there.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Probably do what ~s.o.s~ said, he knows better than me. ;-)
You are too kind my friend. ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> What is it's basis?
Its simple mathematics, no complications of memory location involved. The XORing takes care of all that. See this.

But like Salem has already pointed out, XOR swap is the thing of the past not drawing out and 'ooh' or 'aah' in present day scenarios.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

In such a scenario, its always recommended that the function 'getName()' return an newly created array instead of incurring the pain of creating an array variable and passing it around.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Also, if you need high performance concatenation of many strings use a StringBuffer instead.

StringBuffer is thread safe. If programming in a single threaded environment, I would recommend StringBuilder.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

There is no function name 'ln' in standard C++. Its the 'log' function which you need to look into. You also need to refer the Math library for completing your task.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

No need for a pointer. Just keep on passing the array name wherever you like, a pointer to the array would be automatically passed since the array name is the pointer to its first element.

void createArray()
{
    int* myArr = new int[10];
    useArray(myArr, 10);
}

void useArray(int arr[], int sz)
{
    for(int i = 0; i < sz; ++i)
        arr[i] = 0;
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Yea, thats a bunch of bs
> But no.. not paris.. damn spoiled whore

*Ahem*

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Something like this?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

As for the randomness, you can store the text in a Javascript array. The same goes with images. Then generate two random numbers. If they are not equal display the combination, and if equal, then generate another set within the specified bounds.

The positioning is more of CSS + XHTML than Javascript.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> [^o]*(.*?)n(.*?)i[^o]*ns. is a regular expression (perl form)
> that matches the string: "philosophy, cabbages, and regular
> expressions?"
How about: (onions)+ +, +(philosophy)+ +, +(cabbages)+ +, +(regular expressions)+ Now you can have any amount of onions, philosophies, cabbages and regexes as you want, with the added advantage of multiple spaces being handled. ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Bah, we are getting nowhere with all this. :) But yes, there are many ways of looking at the same thing, and digging in specifics doesn't help the cause of 'what is the real advantage of having default values for constructor parameters'. But nice discussion it was.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Of course yes, its our national language. Every Indian _must_ know it. :)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Inserting a few records in the database ain't that tough, I mean for the developer of course. :-)

And If I could, you would have seen a different score chart, with ~s.o.s~ topping the list. ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> What is your native language?
You wouldn't have heard of this, but what the hell, its called 'Punjabi' if that makes any sense. ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

That doesn't disprove that the statement n=5 doesn't evaluate true; it is indeed an assignment, but it will evaluate to true:

this is better proof, of the statement by EnderX being correct.

#include<iostream>
using namespace std;
int main()
{
    int n=0;
    if(n=5){
    cout << "yes, n=5 is true" << endl;
    };
    cout<<n<<"\n";
    return 0;
}

Not all assignments evaluate to true.

if(x = 0)
    puts("This won't be executed");
else
    puts("I am sure of this.");

Its the value to which the variable evaluates to which influences the branching and not the assignment.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> In java, "==" is used as an "equal to" operator
Only when you need to compare references or primitives. In case of objects, you use the function 'equals' to compare values.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> makes me wonder if they somehow cheated
Yes, sort of. Inserting a few records in the database ain't that tough. ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Its bitwise OR operator. Read this.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I guess what he meant was:

> and to provide c>you et al an opportunity to
and to provide you, with other things, an opportunity to

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Happy coding. :)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> I can't imagine why you're so popular.
Friendly would be more like it.

> I'm several orders of magnitude worse than you and nobody bats an eyelash.
Maybe they have got used to you.

> Maybe you're too nice. Try being meaner and you'll be accepted.
Maybe an official training from you would do the job. ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

But the fact remains that you _do_ have to study them by hook or by crook. Otherwise how do you expect to clear the test?

Here is a site which would help you in learning them with those pretty visualizations.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Heh good one. But since it seems that I seem to be the center of most discussions there, maybe its time someone else started playing the part of a scape goat. ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> i do not know these algorithms
You would have to learn them to solve the problem at hand. Try the wikipedia. It should help you in getting started at least.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Pushing twigs with one's nose never was interesting... :-)

Plus, the more interesting my signatures become, the more debate it sparks and more are the threads created in the Moderators Place. ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Where did you find that sentence? It's nowhere in this thread.
Yes, its my damned signature. :D

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Just replace each occurrence of 'char' with 'std::string' and you should be good to go.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You forgot to pass 'w' to the function passed in the setTimeout().

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I was just kidding.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Yes, it says the 'Operation was completed successfully. You are now a complete dork.' ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> there is no way to programmtically identify this mistake.
You mean something like:

int result;
for(int i = 1; i <= 10; ++i)
    result += i;

You normally don't make up for bad programming practices by changing the way things originally work. (at least in all real life scenarios).

OK, lets assume that you _somehow_ manage to check invalidity of those three fields, what would you do when stuck with a class with around 10-20 fields? There are better ways of solving the same problem / programming blunders like keeping a dirty flag which will give an indication whether the instance has been touched by other mutators before being used by accessors.

Also, it doesn't make sense to create a point object which takes no values. Point p; //doesn't make sense You would rather normally create a variable with the information available with you or delay the variable creation rather than creating them beforehand.

Remember, variables ideally should only be created just prior to their first use (esp objects).

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You must have made changes to your original code. Post the most recent, working code as it is.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

As answered by Stroustrup:

In C++, the definition of NULL is 0, so there is only an aesthetic difference. I prefer to avoid macros, so I use 0. Another problem with NULL is that people sometimes mistakenly believe that it is different from 0 and/or not an integer. In pre-standard code, NULL was/is sometimes defined to something unsuitable and therefore had/has to be avoided. That's less common these days.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Edited the code.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Different methods of finding the square root.

> Try it with a few others as well where one is the square root of the other.
Yes, logarithmic method seems to be a good choice.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> It says I'm a dork.
Maybe you didn't get the joke.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> They learned based on what they see in chat rooms and forums,
> not realizing it's not proper English.
Yes, that seems to be one of the reasons. Laziness the other. ;-)

> I thought it was difficult learning a second language..
Nah, especially when you have most of those languages in your study curriculum.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> How many languages do you know fluently, Sanjay?
Hindi (our national language), English, Marathi and my native language. So four in all. :)