~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

Read this. Simple and short answer: As far as the standards are concerned, main() always has returned an int as its exit status.

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

You can clear the fields without reloading the form by keeping a 'RESET' button on your page.

<html>
<head>
<title>Sample</title>
<script type="text/javascript">
    function fillValue(frm)
    {
        frm.err.value = "ERROR";
    }
</script>
</head>
<body>
    <form name="frm">
    <label for="error">Error</label>
    <input type="text" id="err" name="err" />
    <br />
    <input type="button" value = "Calculate" onclick="fillValue(this.form);"/>
    <br />
    <input type="reset" value="reload" />
    </form>
</body>
</html>

Or if reloading is necessary, do something like:

<html>
<head>
<title>Sample</title>
<script type="text/javascript">
    function fillValue(frm)
    {
        frm.err.value = "ERROR";
    }
    function clearAndReload(frm)
    {    
        location.reload();
        frm.reset();
    }
</script>
</head>
<body>
    <form name="frm">
    <label for="error">Error</label>
    <input type="text" id="err" name="err" />
    <br />
    <input type="button" value = "Calculate" onclick="fillValue(this.form);" />
    <br />
    <input type="button" value="Reload" onclick="clearAndReload(this.form);" />
    </form>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

This is happening because you are setting the fill color as well as the border color of the fill to the same color i.e. RED.

This is confusing the floodfill algorithm which checks the color of the neighboring pixels to determine when to stop. By making the border RED, the check is never unsuccessful and it fills up the entire screen. This seems to be a bug with the function since this is not expected but you have got to live with it. :-)

Choose different colors for floodfilling and its border and you should be fine. Oh and BTW, main returns an int and not void.

#include<stdio.h>
#include<graphics.h>
//you don't need conio

int main(void)
{
  int driver,mode;
  driver = DETECT;
  initgraph(&driver,&mode,"\\tc\\bgi");  
  rectangle(105,90,125,110);
  setfillstyle(SOLID_FILL, RED);
  floodfill(115, 100, WHITE);
  getchar();
  closegraph();
  return(0);
}

}

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

This can't be done in Javascript since its a client side technology. The only thing a Javascript code can store on client's machine is cookies which can't exceed 4KB, so I guess its out of question.

You would require some sort of server side language with a database to store the comments.

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

Either you didn't read the entire blog or you missed the point. The point the author was trying to put across was that the Java Imaging API when compared to other languages is pretty much prehistoric. Did you glance at the Python example he demonstrated? Don't you think doing your project is Python would have consisted of significantly fewer lines of code?

Java is known for its boilerplate code. He just wanted to say that in the world of Fourth Generation languages, a matured language like Java could have done better. Come to think of it, even James Gosling agrees to it.

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

> Write an image editor. Java has an extensive image manipulation API.
You have got to be joking. ;-)

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

Satish, store the client information / state in client session i.e. session variables. Since the servlet class is loaded in memory on its first invocation and the client reqests just result in the creation of thread, storing state in servlet instance variables would make them kind of global, i.e. accessible by each and every client.

To store common information related to the entire web application, look into the <context-param> element of deployment descriptor. To store common information related to a particular servlet, look into <init-param> element of deployment descriptor.

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

Maybe posting the entire code in code tags would help your cause.

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

JAR files are normal zip files. Use any zipping software like Winrar or Winzip to open them.

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

IMO, a class provides a template for the creation of objects. It doesn't make sense to make a class synchronized. You can always make all the methods of a class synchronized if you want or place synchronized blocks inside methods and .

Read this whole thing.

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

Here you can get a (prepaid)plan for as cheap as $1 which allows you to make calls for total worth of $0.8

arjunsasidharan commented: That's rite.. Its cheap. But indian's find it a little expensive ;) +3
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Hello there, welcome to Daniweb. :)

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

Hello there Steve, welcome to Daniweb. :)

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

well damn my compiler for giving me access to for each.

let's write a while statement then!

string foo = "super duper long string of wooorrrdddsss";
int c = 0;
while ( c < foo.length() )
{
  cout << foo[c];
  c++;
}

Computationally expensive. length() function is called each time the loop is executed. Why not something simple like:

int length = foo.length();
for(int i = 0; i < length; ++i)
   cout << foo[i] << '\n';
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Not necessarily, it was a trick question. See this.

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

AFAIK, thats not standard C++. There is no 'for...each' construct in C++. Its C++/CLI.

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

Any point inside any closed figure.

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

No you can't. You can only 'delete' or 'free' dynamically allocated memory. Plus the above statement won't compile. Go figure.

And please see the date of the previous post before posting in a thread. This thread is 3 years old.

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

I think its a great age to learn anything constructive.

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

> atoe[0][0] == atoe[0][1] == atoe[0][2]
This line doesn't do what you think it does. The evaluation of this expression is from left to right so the result of the first comparison(between first and second term) is then compared with the third term.

Create a function called 'threeEqual' with something like this:

bool threeEqual(char a, char b, char c)
{
    return((a == b) && (b == c));
}

// and call it in your program as

bool WinVert( char atoe[][3]) //Boolean data type to check for winning rows/column.
{
    return (threeEqual(atoe[0][0],atoe[0][1],atoe[0][2]) ||
            threeEqual(atoe[1][0],atoe[1][1],atoe[1][2]) ||
            threeEqual(atoe[2][0],atoe[2][1],atoe[2][2]));
}

Plus you have interchanged the names of the functions. The one named WinHori should be WinVert and vice a versa.

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

Asking it on the QT forums would be more like it since many must have encountered the same issue.

~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

Yes definitely, they should get a good smacking when needed. Smack smack smack...

Aia commented: Make sure you don't leave marks. ;) +6
Rashakil Fol commented: Leave marks on the face, like a good dude. +8
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You just said it...

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

> Hey it's fine. It's the anything and everything thread.
Yeah, it has room for everything, even infractions. :p

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

> The main difference is that Java can stand on its own while
> JavaScript must be placed inside an HTML document to function.
Not necessarily. Javascript is a full-fledged scripting language which is very much capable of standing on its own feet. Read this and this.

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

Ram, please create your own thread for your question. Hijacking other peoples' thread is against the forum rules.

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

> Do you look like your avatar?.
He meant gender. And yes, I do look like my avatar. :-)

~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

Thats why I specifically highlighted the term 'functional'. If you know C its just a matter of developing the OO mentality. Plus a good beginner book doesn't dwell on the OO part of the language but what can be achieved with the language.

Come to think of it, C++ is IMO not pure OO. It gives you the impression of OO features being added to an imperative language to make it a mainstream one (OO was the buzzword in those days).

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

Done and done. :-)

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

Old is gold. Have fun. :-)

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

*cough* I know you were joking about my joking so I was just joking around *cough*

;-)

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

*cough* joking *cough*

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

> unless jocamps or myself stop narue she has a sixty percent chance of winning the tournament.
Unless you stop someone, they have an 100% chance of winning. ;-)

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

I like 'tap fingers on the keyboard' and 'sleep for minimum 10 hours' the most. They are so very constructive games, don't know why, but they have a great appeal to me.. ;-)

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

> from what i understand C++ is a subset of C
C++ is the functional superset of C.

> In reality I will need to know both.
Learning C++ should do the job. Like I said, since C++ is the functional superset of C, knowing C++ should as such make you proficient in C, though I am sure many people here would disagree with it. ;-)

~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

Removing third character from the string is pretty simple. I don't think an university assignment would be that easy. But I guess we would just have to wait for the OP to clear our doubts.

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

You end up removing the fourth character instead of the third one. Doing if(i % 3 == 2) would solve the problem.

But I still think that removing third character from each _word_ is different from removing third character from the string as a whole.

Hello World
Helo Wold
Heo Wod
He Wo

Killer_Typo commented: oops thanks for fixing my mistake! :o) +5
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Too much responsibility. Grass is always greener on the other side. ;-)

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

The way you are trying to acquire the parent element is wrong. Do something like this:

<html>
<head>
    <script>
    function remove()
    {
        var parent = document.getElementsByTagName('form')[0];
        var elem = document.getElementById('id');
        var old = (elem.parentNode).removeChild(elem);
    }
    </script>
</head>
<body>
<form name="frm">
    <iframe id="id" name="name" src="d.html"></iframe>
    <br />
    <input type="button" value="RemoveFrame" onclick="remove();" />
</form>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Wish all you Americans out here a `Happy Independence Day'. ;-)

I am sure there must a lot of fireworks in the sky tonight. Have a nice time.

~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

You can set up a text area on your web page, the way it is done on blogging sites, with two text fields for username and password which would be known to the one who wants to post announcements. After that, its a simple case of validation and updating the page from the database.

The same can be done using DHTML if you are not using any server side language.