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

You first need to draw the cirle and then do a flood fill, not after it. Swap the 'circle' and 'floodfill' statements.

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

Maybe coding in this fashion would be less confusing:

public class Employee
{
   private String name;

   public String getName()
   {
       return name;
   }

   public void setName(String name)
   {
       this.name = name;
   }
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Hello, and congratulations for this beautiful and meticulous forum.
Hello and welcome. :-)

Now to your problem. 'display' property of CSS decides how an element would be displayed. Since you already have a table, it doesn't make sense to set the display property to table.

Normally this property is used to alter the way a paragraph, a div block or a span block i.e. any container tag displays the data. So what to do when the tag under consideration is a 'table' tag? Simple, set its property to nothing.

<table id="tab" border="1" width="100%">
  <tr>
    <td width="100%">test</td>
  </tr>
</table>

and when making it hidden do something like:

<html>
<head>
    <script type="text/javascript">
    function hide(id)
    {
        document.getElementById(id).style.display = 'none';
    }
    function show(id)
    {
        document.getElementById(id).style.display = '';
    }
    </script>    
</head>
<body onmousedown="hide('tab');" onmouseup="show('tab');">
<table id="tab" border="1" width="100%">
    <tr>
        <td>test</td>
    </tr>
</table>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Is there any possible way to execute some functions, only on
> closing the browser window(in firefox)?
As far as I know, no.

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

The coordinates are working fine in my case. There must be some error on your part. Post the code if it still doesn't work.

As for executing a function when the window closes, you can use the onunload callback function.

Here is an example:

<html>
<head>
<script>
    function doSomething(e) {
        var posx = 0;
        var posy = 0;
        if (!e) var e = window.event;
        if (e.pageX || e.pageY)     {
            posx = e.pageX;
            posy = e.pageY;
        }
        else if (e.clientX || e.clientY)     {
            posx = e.clientX + document.body.scrollLeft
                + document.documentElement.scrollLeft;
            posy = e.clientY + document.body.scrollTop
                + document.documentElement.scrollTop;
        }
        alert(posx + ", " + posy);
    }
    
    function confirmMe()
    {
        alert("Thank you for visiting us!!");
    }
</script>
</head>
<body onunload="confirmMe();">
    <div onclick="doSomething(event);">Hello there</div>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

But you have got to realize that the window.print() method provides little or no control over the printing settings. Its just a nicety and is equivalent to pressing Ctrl + P.

Even the documentation doesn't provide any significant information about this function. It actually makes sense since its the user who decides what and how things have to printed and not the site developer. Messing around a bit with your printer settings is the only way to go.

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

What happens when the print method is called? Does it directly print the page or pops up a print dialog?

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

A real world use of two dimensional arrays is for representing matrices. Here is an example of 3 x 3 identity matrix:

int matrix[3][3] = {0};
for(int i = 0; i < 3; ++i)
{
    for(int j = 0; j < 3; ++j)
    {
        if(i == j)
            matrix[i][i] = 1;
    }
}

//For printing this matrix
    for(int i = 0; i < 3; ++i)
    {
        for(int j = 0; j < 3; ++j)
        {
            cout << "   " << matrix[i][j]) << "   ";
        }
        putchar('\n');
    }

The output after printing this matrix would be:

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

Why pre-declare variables when C++ doesn't mandate it and anyways you are not using 'i' outside the loop?

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

Every C program is a valid C++ program.(except for the deprecated header declarations). C++ is the functional superset of C. It seems that you need to read a few good C++ tutorials and books to get your concepts of 'structs' right.

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

Single Precision numbers (4 bytes storage) have 23 bits for mantissa i.e. approximately 7 decimal digits. Eg. 1.123456

Double precision numbers (8 bytes storage) have 52 bits for mantissa i.e. approximately 16 decimal digits as their precision.

Floating point numbers have two properties, accuracy and precision.

Accuracy is layman's terms is the biggest number that can be represented and depends on the number of exponent bits (8 bits in single precision and 11 in double precision).

Precision is the number of digits that can occur after the decimal point. So even if your floating point numbers can represent really big numbers, they have limited precision.

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

This a a cross browser compatible script for finding out the mouse coordinates using Javascript. Referred from this site.

function doSomething(e) {
        var posx = 0;
        var posy = 0;
        if (!e) var e = window.event;
        if (e.pageX || e.pageY)     {
            posx = e.pageX;
            posy = e.pageY;
        }
        else if (e.clientX || e.clientY)     {
            posx = e.clientX + document.body.scrollLeft
                + document.documentElement.scrollLeft;
            posy = e.clientY + document.body.scrollTop
                + document.documentElement.scrollTop;
        }
        alert(posx + ", " + posy);
    }
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You can include any file you want using server side includes to avoid duplication of code. For eg. each page of a website has a common header and footer section. Instead of repeating the code, the header and footer sections are stored in separate files and included in every page using your favourite server side language.

In J2EE, the common code is put in a .inc file if it contains static content and in .jsp if it contains dynamic content. Then by using the line:

//somepage.jsp

<html>
<body>
  <%@include file="header.inc" %>
  <div>Hello</div>
</body>
</html>

I am pretty sure there must be a similar construct in the server side language you are employing to get the job done.

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

> There's a reason you can't smoke in schools and hospitals. Can you guess why?
Comparing the effects of smoke on people who are fighting against death and normal people doesn't make sense. Second hand smoking is bad, but so is the smoke from vehicles, the minute spores floating, the dirt, the pollen grains etc.

And BTW, its not only smoking but also any other thing which would make the patients uncomfortable is not allowed in hospitals, so picking out smoking from all the things which are not allowed would be a moot point.

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

Bobs, I would still recommend you to read some good tutorials on C or get some good C books from a store near you to do some reading. Without putting effort or learning on your part, explaining what is wrong and what is right would be too difficult for us.

Please start reading this.

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

> The first step told me to make a wordpad document and name it:
Wordpad is not a text editor, its a word processor. It inserts its own headers in the saved file. You need to use notepad. In short you need something which saves the files in plain text format and not add its own headers.

Type the code from the book in a notepad, save it at a place you want, go to that folder, run the javac command properly (I assume that you must have set the class path).

After having completed the following steps successfully, you must get a class file in the same folder (provided you have not kept a package declaration). Use the java command to run the program.

If you want names of few good text editors, just let us know.

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

Since the frequency is initialized with 0 and can hold a maximum value of 5, we can also write:

if(frequency != 5) 
    cout << "\nThere are" << frequency << " number of your prediction that matches";
else 
    cout << "Congratulation!! All of Your Prediction Matches ";
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> I am very confused. How in the world are you going to implement a stack using function pointers?
I guess he means by using dynamic memory allocation, using a node structure which holds the data as well as the pointer to the next node.

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

The difference is this: the government is elected by the people, and could easily become corrupted if we allow them to restrict our freedoms. ON the other hand, the CIA operations are virtually unknown, and thus people do not know what the CIA really is doing (unless they release documents stating what they have done.)

So you are under the assumption that there is someone who is not corrupt? Money makes the world go round, influence can get you anything, sometimes its cheap, sometimes expensive, you just have to name the right price.

People sell their souls for money, selling their responsibility towards their country won't be that tough...

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

Sheesh, kids nowadays. ;-)

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

> Maybe the original poster (sk8?) finds smoking on the same "rudeness" level as masturbating
More likely a sarcasm gone bad, making the entire post lose its value/intent/purpose...

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

> Why?
Do you even realize why I had made that statement in my previous post? If no, then you better read the previous posts before asking such obvious questions.

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

Looking at your code, I can clearly see that you are desperately struggling with the language. Maybe you should try to get a firm grip over the langauge(or computer science concepts) rather than diving into problems straight away.

This link has some good resources for beginner C programmers.

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

> Maybe I like to masturbate.
On a serious note, I think you should keep such things out of discussion. There are better way of being sarcastic / putting across your point.

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

The "properties doesn't exists" error is usually thrown when no such element by the given element id or name exists or when you are trying to call a function which the object doesn't possess. (eg. length function on RegExp instead of String).

Something like this. In the code below, it looks for an element with an id 'a' which doesn't exists before the page has loaded. Hence the error message.

<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

FYI, the people who cause inconvenience to others by smoking or the people who make laws aren't following this discussion.

Clobbering each others feelings and views is no way to come to a conclusion. There is always a common ground and its the one on which we are standing right now.

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

'Doesn't work' is a very generic. You need to come up with a specific problem if you want help. There are loads of AJAX tutorials out there, just read a few of them and if you are still stuck, post your code here.

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

Glad it worked out for you, though I must go out to say that MS SQL sucks if it can't even allow a alias to be used with the group-by clause which is so common a thing with present databases. So much for the Enterprise level database... ;-)

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

If what you say is true, then try out this one:

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

I had tried the query pasted by me in my previous post on MySQL so I don't know what went wrong when the same was ported to MS SQL.

Try this:

select substring(zip, 1, 3) as Z, sum(AvailNums) as SUM from AvailHomeZips group by Z;

I guess MS SQL doesn't take into consideration the case hence the results. Post if it works or not.

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

If you don't care about the values which get deleted, then why not just use the method suggested by me above? If not, then you need to know Transact SQL to generate random numbers and delete entries with those primary keys.

~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

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

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

Maybe you need to see this.

~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

> 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

> 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.

~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

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

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

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