~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
<script>
function changeStyle(id, newClass)
{
    document.getElementById(id).style.className = newClass;
}
</script>
....
<td id="oneTd" class="style1" onclick="changeStyle(this.id, 'style2');" >
Hello
</td>

// Or simply in one line

<td id="oneTd" class="style1" onmouseover="this.style.className='style2';">
Hello
</td>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Making your code not portable.
AFAIK, the code is portable, the behavior is undefined. Though it might work for you on each run, the same can't be said about it on another machine, compiler or architecture.

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

Read for gets() and fflush(stdin).

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

Bah, spammers. ;-)

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

It doesn't return anything, the comparison just uses the value of *s to control the loop. The moment it equals to '\0' i.e. the moment the null terminator character is copied from the destination string, the condition *s != '\0' becomes false and the loop breaks.

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

No, explode.

Aia commented: Oh no!, we all are going to die.... someday. +5
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Is your avatar a pic of your son?
No, he is Dave. :D

PS: Sorry Dave couldn't resist it.

Dave Sinkula commented: Danke +11
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Write a program that will read in an unknown number(not more than 40) of dates from a text file in the form mm/dd/yyyy. In orger to sort them chronologically, the program must convert the date into the form yyyymmdd. After sorting, reconvert the date back to its original format and display the list of dates in sorted order from old to recent.

Something like this:

  • Open the file for reading, and if error occurs, exit the program
  • Read from the file, one line at a time by the method given by Iamthwee.
  • Parse out the individual parts like month, day and year from the line just read. Create a new string from the parts read, something like "yyyymmdd".
  • Convert the given string to long using string streams.
  • Perform this procedure for each line and store each entry is an array of long.
  • Sort this set of numbers in ascending order.
  • Read the sorted array of longs and perform the reverse process.

This is as simple as it gets, though is not a very generic and efficient implementation, it should help you get started.

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

I am sure everyone out there who is against 'MySpace crowd' would shudder at this thought. :-)

*scary thought*

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

> I bet you never thought that would happen when ya joined
But come to think of it, we have one more competitor competing against Dani in post count, guess who? ;-)

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

> 13? Thats all
Maybe its because I have more rep power. I am sure the same thing when translated to a beginner would be much more than :-)

> hmm.. I joined kinda late too.. and I'm not a mod.. and I don't have much rep.. or posts..
Hey don't complain, you are 13th when it comes to post count. (coincidence!!)

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

It means you would have to personally call up the companies interested in taking students in for out house projects. Talk with your friends from other / same college and try to get as much information as possible.

That would be the best way of getting an out house project.

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

Aww..that's not good. I guess the rep power has a serious dependency on the date of joining which I don't like at all. :-(

Josh = 13 ;-)

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

Josh, if you will notice all the people here who are against discussions like 'lolz', 'lmao' etc. are the ones who are much older than you, currently supporting and having a family, working in a more professional environment etc etc. Call us old hags, senile if you want us to, but yes, the facts are there in front of you.

That being said, I firmly believe kids should be given their own space so that they can think and make their own decisions, no point in forcing something on them. Time is the best teacher. Who knows, maybe in 2020 when someone posts a l337 post, you would be the first one to spank him. One never knows...

PS: You sure read some old posts. :-)

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

Its OK, I guess he is non-English and has not much experience. In such cases, we make exceptions and try to make things easier for him. Imagine how would he have felt after seeing three people spank him and one giving him a negative rep.
:-(

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

Maybe posting a working code will help us in finding out the cause.

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

Not more than 25 I guess...

joshSCH commented: Close.. 23. I think even I give more than that ;) heh jk +13
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Nope.

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

Glad you could figure it out. Try reading some good tutorials to solidify your concepts of Javascript and you won't run into such simple problems.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
function doIt(){
alert(document.getElementById('a2z:saveMessage').value);

if(document.getElementById('a2z:saveMessage').value=true)
{
alert("Supplier Saved");
document.getElementById('a2z:saveMessage').value=false;
}
}

thanks to all your help i was able to solve the no properties error.. now i've got a new problem, even if the value is false it keeps entering the condition and I cant find out why..

Do this:

function doIt()
{
    alert(document.getElementById('a2z:saveMessage').value);
    if(document.getElementById('a2z:saveMessage').value == "true")
    {
        alert("Supplier Saved");
        document.getElementById('a2z:saveMessage').value = "false";
    }
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I still won't whether you completely understand Javascript and its use. I see a lot of hanging useless pieces of <script> tags scattered all over the pages and even after the closing </html> tag !!!

I see a lot of problems:

1. The function definition should be something like:

<script type="text/javascript" language="javascript">
    function doIt(id)
    {
        if(document.getElementById(id).value == "true")
        {
            alert("Supplier Saved");
            document.getElementById(id).value = "false";
        }
    }
</script>

....pass to doIt the id of the hidden field whose value you want

<body onload="doIt('a2z:_link_hidden_');">

....

And stop changing the id and names of your fields, you just end up confusing us. And decide on which fields value is required for you to display the error message.

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

I don't think everyone would learn a new game just to help you out, so you should at least post the complete relevant code and the exact nature of the problem(warnings, errors, bugs). The current description seems so lost.

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

In that case you would have to create your own virtual screen by making those components visible.

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

Ruby on Rails, Java, Python, C#, Web development using PHP, AJAX, MySQL are the way to go nowadays. One or more of the above skills will land you up with a good job provided you have the required expertise.

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

Programming fetches good money if you are comfortable with it, and believe me, not many people are. They just jump on the IT bandwagon, thinking that if everyone can do it, so can they, but alas, lack of interest kills everything.

It doesn't matter where you are, the only thing that matters is that you should have an interest in that field and be the best.

That being said, if you seriously think that programming is for you, going that way wouldn't harm you in any way. After getting an entry level programming job life would be tough for a few months/ years, but once you get the hang of things, it can be pretty rewarding. Considering that you still haven't got your MCSE, trying your hand at programming wouldn't harm you.

But do keep in mind the competition out there. The above applies only if you completely understand the development scenario at your place and already know what it takes to get into programming.

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

> Would it increse my ability to get to a job?
Yes, definitely. Certifications, though not popular among core developers who think of it as just scrap paper, are certainly the way to go when going for a job interview. The more the merrier.

That being said, it is also necessary that you showcase the required skills which should go along with your certifications.

That being said, if you are in need of a sure shot job, always do something which has become a buzzword. Java, Ruby on Rails, Python, C# will get you the best jobs.

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

Zandiago, by now, you should have learned how to use code tags.

Enclose your code in code tags.

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

> beaten, abused, malnurished
Spanking is overrated. You are using big words for something as trivial as getting things right. Like I previously said, its not just the community or the intelligence. Why do you think you find many rich suckers vandalizing things, becoming punks etc? Were they hammered into being demented or were they made to live in the company of vandals?

Like I previously said, many kids are born that way, and if not put on a straight road, would just end up going the wrong way.

> So by doing this we can almost create a copy of any person in the world, Including me.
Even the word _almost_ couldn't salvage your thoughts from being funny.

Maybe you might be smart, handsome, intelligent etc. But you still have to grow up. A lot changes with age, you will realize that in the coming years...

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

Then it must be due to something else. Logically speaking, the error must have gone away. It must be because the document not being well formed. Have you moved the declaration of the form tag after the body tag and made sure you close them in the end? Post the new generated html.

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

One way would be to do the same thing when the body has completely loaded. Try something like this:

<html>
<head>
<script>
    function doIt(id)
    {
        alert(document.getElementById(id).value);
    }
</script>
</head>
<body onload="doIt('a');">
    <form>
        <input type="text" id="a" name="a" value="sanjay" />
    </form>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

So is there any special criteria which distiguishes these 3000 records from the other records. If there is, you can use that clause to delete the required rows. If this is just a mass delete and if your primary key is ordered, you can delete the rows based on the value of primary keys.

delete from mytable 
where key <= 3000;
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I don't know how exactly MS SQL behaves, but here is an equivalen in MySQL. Try to modify this to your needs:

select substring(zip, 1, 3) as ZIP, sum(AvailNums) as SUM 
from AvailHomeZips group by ZIP;
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Your <form> tags start before the <body> tag, not to mention most of the tags haven't been even terminated. The code is so cluttered that its difficult to mark down anything.

But considering that the statement 'document.getElementById()' is directly placed in the script tags in the head section, it would be executed as as when the page loads, a time when your hidden field hasn't been even rendered.

You need to encapsulate that logic in some sort of function and get that called on some event for the statement to work since it needs the element to be present which is not there when the page has just started getting loaded.

Even this small snippet will have the same problem and for the same reasons:

<html>
<head>
<script>
    alert(document.getElementById('a').value);
</script>
</head>
<body>
    <form>
        <input type="text" id="a" name="a" value="sanjay" />
    </form>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Reading this should definitely help you out, if not then post your code.

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

Sorry but I will have to disagree with you. I have never been beaten and I really don't consider myself spoiled, stupid, and rotten. (In fact, I consider myself quite the opposite) Beating the child may (in fact it might have just the opposite effect) improve discipline but it will definetely not improve respect or appreciation for the parents. Instead of beating your children (which I consider highly unintelligent and hallmarks of a uneducated parent), wouldn't it be better to explain to the child what they did wrong, why it was wrong, and leave the question on whether it was wrong debatably? Respect and appreciation cannot be bought or demanded, it must be earned. For one day, they will decide what nursing home you will be sent to.

Sorry to let you know, but this is not an all Strum land. Not everyone is the same, has the same thought process, has the same way of looking at things etc. Expecting everyone _would_ follow your suite isn't realistic.

Just because you were nice and listened to gentle talking doesn't mean that everyone would. Assuming it would be foolishness.

Just because you love Linux doesn't mean everyone would, just because you like C++ programming doesn't mean that everyone would, just because you don't know how to deploy a EJB doesn't mean that no one would. Accepting that everyone is a snowflake and so has to be handled differently.

Magic numbers in code aren't cool and I still play …

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

Better yet, use an IRC Search Engine to search for your favourite IRC channels.

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

Maybe this will help you in understanding what enums _can_ and _can't_ do. BTW, why would you need enums? Do you need the first character of the symbols? Do you need the number representing the symbols?

If you need the character, just use inputword[0] (after you have trimmed the string). If you need the number, do something like this:

string inputword;
cout << "Enter a string and press enter: ";
if(!getline(cin, inputword))
    exit(1);
char x = inputword[0];
if(isupper(x))
    cout << "\nThis is it " << (x - 'A') << '\n';
else
    cout << "\nWrong / bad input." << '\n';
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Maybe you need to see this.

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

Its always a good practice not to ignore warnings which appear when you compile your code. A warning about 'converting from float to int' would have given you the reason why your program is not working.

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

But seriously, I can't stand kids who call their mother 'bitch'. Maybe after a few years when you will have a real family, you would see things in a different light...

christina>you commented: Completely agree! +18
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

It seems like you failed to frame your question properly in your first post, since what I mentioned is exactly how things are normally done using servlets. As you can see, you are not _directly_ invoking the private function of the Java class but requesting the servlet to execute the method which you want. There is a big difference you know.

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

The only reason I don't like Mac, their price and customer service. Its too expensive for a normal person to buy plus there is not much I gain by using it. That being said, I am sure there must be a pretty good reason for all those people out there using Mac.

>The right to information that isn't yours? The right to information
>that companies poured millions of dollars into creating?
Yes, and all they manage to come up with is IIS, SQL Server and what not _I_don't_care_about_standards_, while software foundations like Apache coming up with a web server the world uses, and guess what, its free.

Mind you, like Linux, I don't share the same point of view that nothing should be closed source and they are immoral in holding back. I guess its fine, there is not much we can do.

>That is really unfair.
Actually it really is.

>Them being writers, not open source geeks, have probably never
>even heard of other formats such as the Open Document Textfile.
Yes, ignorance really is bliss. Breaking out of it seems so hard.


>While open source is definitely a nice thing, you've got a pretty
>screwed perspective if you believe that it's immoral not to release source code that people have spent years of labor to produce.
Agreed on this one.

>I'm sure that if Microsoft Office were inferior to OpenOffice, .odt
>would …

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

> Eric Cartman is my hero.. I want to be just like him.
Then you must be really a dangerous guy to know and make friends with. Yes, he really is special, he is the most demented person I have ever seen on my TV screen. :-)

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

> I want to call on the server side and on the servlet I'm doing a compareTo and I'm calling the
> required function.

Let me guess, you pass a string which would probably be the name or the code of the function which you want to call in the servlet. This string is received by the goGet() or doPost() method of this servlet which then uses a bunch of if..else statements to decide what is the code passed from the client side and then decides which function has to be executed. Isn't it?

Glad you could figure it out. :-)

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

Your concepts seem to be shaky.

OpenGL and DirectX are API's, or simply put, libraries which you can use in your program to render graphics on the screen. There are other alternatives, but these two, by far, are the best and famous. DirectX is exclusively used in almost all commercial games and is properietary to Windows.

Visual C++ is a tool, C++ is the language used for developing games and OpenGL is the API which provides the graphics rendering functionality. Your game in C++ won't look much different than a normal C++ with the exception of some API calls and mandatory entry point functions.

Considering that a primitive set of functions is provided by OpenGL and DirectX, beginners almost always make use of Game Engines which act as wrappers around these API and help in developing cross platform games(if OpenGL is supported by your game engine).

Read here for more information. But still, considering that the little information you have on this subject, it would be better to stick to console games for a while, till you get the real feel of _Game Development_.

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

> whats your user name?
The username and the display name is the same. :)

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

No, this is no bug. Considering that the thread was started way back in 2004 and this is the most common warning message one encounters when using a gcc or g++ compiler, coupled with the fact that Daniweb is highly Search Engine Optimized site, it doesn't come as a surprise to me. :-)

Look at some other threads which were started in 2003 and 2004 and you would surely find most of them having more than 10K views.

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

It has good ratings though...

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

Personally have no experience with it, but I think this would help.

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

> I would like to call a function situated on a server side servlet or in
> a jsp file with a javascript function (client side) and to show the
> results returned by the servlet's function.
Any reason for this weird requirement. There is as such no problem which requires you to do such a thing. Use normal AJAX calls and you would be a happy man.