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

> I have the basic knowledge in C++ and C.
Better start off with some console based games. They would help you in concentrating on the logical aspects of the game without wasting your time in developing the GUI.

Plus commercial games make use of API's like DirectX and OpenGL and not just plain old Win32. Once a console based program is ready, making a graphical version of it won't be much difficult.

thekashyap commented: Good point abt commercial games.. +2
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Read this.

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

The this pointer is not compulsory. Try it out without the 'this' and it would still work out to be fine. Since this function is executed in the context of some form element (text box in the example given below), 'this' here refers to the element under consideration.

Read this for more on this in javascript.

function ajaxFunction(strURL) { 
    var xmlHttpReq = false; 
    var self = this; 
    // Mozilla/Safari 
    if (window.XMLHttpRequest) { 
        self.xmlHttpReq = new XMLHttpRequest(); 
    } 
    // IE 
    else if (window.ActiveXObject) { 
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); 
    } 
    self.xmlHttpReq.open('POST', strURL, true); 
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x- 
www-form-urlencoded'); 
    self.xmlHttpReq.onreadystatechange = function() { 
        if (self.xmlHttpReq.readyState == 4) { 
            updatepage(self.xmlHttpReq.responseText); 
        } 
    } 
    self.xmlHttpReq.send(getquerystring()); 
} 

<form name="myForm">
Name: <input type="text" onkeyup="ajaxFunction(time.jsp);" name="username" />
Time: <input type="text" name="time" />
</form>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Maybe this holds the key to your question.

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

Javascript, DHTML and AJAX have advanced fair enough, so making a site which has all the eye candy is no problem as such. Look into third party JS libraries to add effects to your site. (Drag and drop, rollovers, tool tips etc.)

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

The poor software developer. :-(

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

You can also try out the ones by Creative and IRiver.

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

It seems that you are new to J2EE technology, so maybe starting here would be a better choice. If after going through the tutorials you get stuck with a code example, post it here. Its pretty simple.

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

> one of them said that C uses 2 bytes in windows for int
Someone trying out a sizeof(int) on a prehistoric compiler would definitely say that.

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

JSP's are nothing but Servlets in disguise, introduced for the purpose of separating presentation from logic. Read this.

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

Read the data from the database and store it in a string. Write the given string to the JSP file using the JSPWriter. Set the content type as 'text/plain' and the page will be rendered to the user as plain text.

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

The term page is generally used in context of a variable scope. Read it here.

pageContext allows you to access the attributes of a particular JSP page. Read it here.

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

I :-)

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

> and on purpose, anybody here knows a free js editor with line numbers and autocomplete?
Yes, you can find it here. For its tutorials, see here.

> and thank ya very much s.o.s, your always helping the needed.
You are welcome, fellow Javascripter. ;-)

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

> By the way, is it possible for say or 6 programmers get together and write heir own game engine
You can say that.

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

As far as the replies in this thread are concerned, you are a clear winner.
:-)

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

function changeSrc(clicked)
{
clicked.style.backgroundImage = 'someotherimage.someformat' //this won't work in IE7!
}

Try this:

function changeSrc(clicked)
{
   clicked.style.backgroundImage = "url(imageName)";
   //the above stmt assumes that the image is present 
   //in the same path as that of the html file
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> you obviously have magical powers of which i do not.
Nah, I just like poking at things. ;-)

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

> sorry what i meant was i dont believe you can change a
> background image via javascript. my bad

Something like this;

<html>
<head>
    <script>
    function changeOver(id)
    {
        var elem = document.getElementById(id);
        elem.style.backgroundImage = "url(submit.gif)";
        elem.style.cursor = 'pointer';
        elem.style.cursor = 'hand';
    }
    function changeOut(id)
    {
        var elem = document.getElementById(id);
        elem.style.backgroundImage = "url(search.gif)";
    }
    </script>
</head>
<body>
    <span style="background-image: url(search.gif); color: white;" id="myP" onmouseout="changeOut(this.id);" onmouseover="changeOver(this.id);">
    Hello to all of you. This text is white
    </span>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

>villa! there it is!
Its actually voilà

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

And don't create multiple threads for the same question.

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

I have written a script for a drop down menu on my site which on mouse over the menu item changes from blue to yellow and show the drop down item but now I'm stuck,i want to use background images instead of colors.On mouse over, it changes from image A to image B and still show drop down items.Any clue or suggestions?

Maybe pasting your code here would help us provide some concrete suggestions.

> i dont believe javascript holds a method to directly change a css background
Something like this:

<html>
<head>
    <script>
    function changeOver(id)
    {
        var elem = document.getElementById(id);
        elem.style.backgroundColor = '#aabbcc';
        elem.style.cursor = 'pointer';
        elem.style.cursor = 'hand';
    }
    function changeOut(id)
    {
        document.getElementById(id).style.backgroundColor = '#ffffff';
    }
    </script>
</head>
<body>
    <span id="myP" onmouseout="changeOut(this.id);" onmouseover="changeOver(this.id);">Place your mouse over this text</span>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Your basics need a bit of reworking.

This code:

else if (choice == N)
    cout<<"Not displaying albums in Database!!!"<<'\n';
    return -1;

doesn't do what you intend it to do. Here N is interpreted as a variable and not a literal, which it should have been. Plus just because two statements are indented doesn't mean they lie in the same block, this is C++ not Python. Plus your return statement returns from the main function, so the code following it is never executed.

You need to accept the input as character, check if it is 'N' or 'Y' (quotes are important) and depending on that display search result or display error message.

I think your basics are not strong enough to attempt something like this. Read some good tutorials here and here.

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

Post some code so we can easily help you out without rewriting the same thing over again.

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

Thats because there is a space after the word when you enter it into the collection while when you search for it, you don't. Try pressing a single space after entering your query and it should work.

So you need to insert the data in the collection without spaces and trim spaces from the input entered by the user.

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

There are some bugs in your code. Considering that you pass the size as 5 but have a Song array of size 4 causes you to access an location which doesn't belong to you. Also make your function 'search' return void since the return value is not serving any purpose.

Here is the partially modified code:

//Untested
#include<iostream>
#include<iomanip>
#include<cstdlib>
#include<string>

using namespace std;

struct Song
{
    string title;
    int track;
};

struct Album
{
    string albumName;
    string artistName;
    Song songList[4];
};

void search(Album collection[], int size, string albumName)
{
    int location = 0;
    bool found = false;
    for(int i = 0; i < size; ++i)
    {
        if(collection[i].albumName == albumName)
        {
            if(!found)
                found = true;
            cout << albumName << " by " << collection[i].artistName << '\n';
            for(int j = 0; j < size; ++j)
            {
                cout << '\t' << collection[i].songList[j].track << ". "
                    << collection[i].songList[j].title << '\n';
            }
        }
    }
    if(!found)
        cout << "No such album found!!!";
}

int main()
{

    Album collection[4];

    collection[0].albumName = "Private Investigations";
    collection[0].artistName = "Dire Straits";
    collection[0].songList[0].title = "Sultans of Swing";
    collection[0].songList[0].track = 2;
    collection[0].songList[1].title = "Romeo and Juliet ";
    collection[0].songList[1].track = 4;
    collection[0].songList[2].title = "Money for Nothing ";
    collection[0].songList[2].track = 9;
    collection[0].songList[3].title = "Walk of Life ";
    collection[0].songList[3].track = 10;
    collection[1].albumName = "The Millennium Collection ";
    collection[1].artistName = "The Who ";
    collection[1].songList[0].title = "My Generation ";
    collection[1].songList[0].track = 1;
    collection[1].songList[1].title = "Pinball Wizard ";
    collection[1].songList[1].track = 2;
    collection[1].songList[2].title = "Who are You ";
    collection[1].songList[2].track = 3;
    collection[1].songList[3].title = "Squeeze Box ";
    collection[1].songList[3].track …
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Its not a 'do' statement. Its called a 'do..while' loop, much like the 'while' loop except that the enclosing block is guaranteed to run at least once.

int i = 0;
while(i)
{
   //some code, this would never be executed
   // since the condition is checked before entering the block
}

do
{
    //this code will be executed at least once.
} while(i);

Its just a convenience thingy. Most people find some solutions more expressive using the do..while loop. For example, since I know that my application menu should be displayed at least once irrespective of the user input, I would use a 'do...while' loop. That being said, all 'while' loops can be converted to 'do...while' loops by losing / gaining some expressiveness.

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

You must ask specific questions, one at a time.

Linked List
is a type of data structure in which data is stored in nodes and each node points to the next node in the list. That is as simple as it gets.

FIFO means First In First Out. The data structure which is FIFO is the one in which the first element to be inserted is the first one to come out. Eg. Queue

LIFO means Last In First Out. The data structure which is LIFO is the one in which the last element to be inserted is the first one to come out. Eg. Stack

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

Search for some open source Real time strategy or RPG games. You will find a lot of things for your use.

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

|>The difference of course being that the Java application was well
|>architectured, easy to maintain, and performant while the ROR
|>application was a mess, impossible to maintain, and can't survive
|>under load.

That I hear from each and every Java programmer. ;-)

But considering that many professional sites have been made using ROR, there is no harm in atleast trying it out, esp if the OP has yet to learn a language.

peter_budo commented: Good point +6
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

>I'd love to be able to find that poll thread again, but alas, it seems to
>have disappeared, perhaps moved to another forum where the
>public can no longer view it.
True, due to many issues, it has been moved to the 'Area 51'.

joshSCH commented: Must be some pretty confidential stuff there... ;-) +11
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Why did so many moderators leave concerning the IntelliTXT issue?
I still doubt it was a IntelliTXT issue. It was more like something which was building inside of them from the start, the IntelliTXT such provided an easy outlet.

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

IMO, building up a strong logic is more important than learning X++, Y++ or any other language as a matter of fact. Queues will be queues, stacks will be stacks, binary trees would be based on the same principle, no matter which programming language.

Like I always say, if you have started programming for a living, concentrate on the language, get used to the API. If you have started programming for gaining knowledge or academic reasons, building up good concepts would be more like it, the expertise of the language would follow with time.

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

> Why does this not work,
...and next time describing the problem in detail along with error messages would be recommended rather than the so famous 'this does not work' statement.

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

Because it has to be only accessible by geeks... ;-)

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

...and as long as the code works when copy pasted.

;-)

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

> I seems Dani and I are the only two active team members left -- what happened to everyone else?
Maybe a concept like the one used at Devshed should rope in a few more members. Of course considering that you need really good computers to Fold, only the ones with a decent configuration would be able to contribute.

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

Good to know that. :)

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

> Wow. I think he just insulted the moderating team, and dared
> them to give him an infraction...
No, you seem to misunderstanding things, there is no insult here, only his strong feelings for the site at display.

He really must have contributed something of importance to not allow Daniweb to (seemingly?)deterioriate in front of his eyes.

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

IT Professionals after death:

christina>you commented: lol =) +17
joshSCH commented: b/c your nice :) +11
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I didn't mean the newsgroups, I meant the posts. Of course spam is everywhere, but you should not let it get in your way. You have to agree with me that the legitimate posts do pack a punch, don't you?

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

The spam post was deleted.

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

> every one ive ever been on is full of wanable hackers and pirates
> as well as people trying to sell you viagra online.
Then you must be looking at wrong places.

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

Ah, scrap the sqlapi, it just offers a trial version unless you order it, so I guess it is out.

The only option left with you is to download the API provided by PostgreSQL instead. This page is your last hope.

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

Are you allowed to use third party API's in your project? If so, then try using sqlapi, a C++ library for connecting to SQL databases.

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

Torque is AFAIK a properietary game engine. You can't get it for free, you have to purchase it. Visit the official site for more details.

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

Post your latest code so that it would be easier for someone to help you out.

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

> Hey people -- it's a JOKE
...a thing which most of the people here find it difficult to digest. :-)

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

> all of the other sites that I participate in are geared toward a mature membership
I would give you a nice example. If you must be knowing, newsgroups are the sites which are mentioned now and then when it comes to 'mature people', but even there, the discussion tends to go offtopic, not to mention newbies bumping threads. Considering that the spam or pointless posts aren't deleted, they still are doing a good job, don't you think so?

> I guess it's an adult thing. goodbye
You are implying things, but its OK. In case you are forgetting, this is the Geek's "lounge". Things are bound to go offtopic and casual.

If you still think a post is so disgusting it can't be ignored, there is always a 'report bad post' link.

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

AFAIK, no, there is no certification in C.