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

Glad I could be of some help.

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

This is an old one.

I would give the car to the business-man and ask him to drop the old woman to the hospital and wait with the woman of my dreams on the bus stop. :)

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

^
A well behaved kid, avoids l337 speak.

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

There is something that doesn't work here:

The lengthy processing function requires values to be passed to it from the error display process. It does nothing to the values displayed, but it does need them to know what to calculate default values for.

I can't pass the values to the processing function if they haven't been set yet.

Also, site policy says I should not modify the html code with scripts. I need to set styles and values instead.

Also, you put in an alert. That alone will cause the display to complete. But I don't want to distract the user from what he is doing with an alert.

I guess I still don't get the big picture. As far as the processing function requiring the data is concerned, you can always make the function which is called before the processing function to make changes to the global variable(map or associative array). This way you don't need to pass anything. Plus you get to decide when to call the processing.

And the 'alert()' in my code was just an example.

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

The code you pasted above seems to be working for me. What problems do you experience?

<html>
<head>
<script>
    var wnd = new Array();
    function openWindow(url,id)
    {
        if(!wnd[id] || wnd[id].closed)
            wnd[id] = window.open(url,"" + id, "width=" + screen.availWidth + 
            ",height=" + screen.availHeight +
            ",resizable=1,scrollbars=0,menubar=0,toolbar=0,directories=0," +
            "location=0,status=1,left=0,top=0,ScreenX=0,ScreenY=0");
        else
            wnd[id].focus();
    }
</script>
</head>
<body>
    <input type="button" value="Button1" onclick="openWindow('http://www.google.com', 1);" />
    <input type="button" value="Button2" onclick="openWindow('http://www.google.com', 2);" />
    <input type="button" value="Button3" onclick="openWindow('http://www.google.com', 3);" />
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

So maybe next time you should place the entire requirement instead of letting us guess whether you want 2 or 3 windows....

<html>
<head>
    <script>
    var wnd = new Array();

    function openit(id)
    {
        if(!wnd[id] || wnd[id].closed)
            wnd[id] = window.open("http://www.google.com");    
        else
            wnd[id].focus();
    }
    </script>
</head>
<body>
    <form>
        <input type="button" value="Open1" onclick="openit(0);" /><br/>
        <input type="button" value="Open2" onclick="openit(1);" /><br/>
        <input type="button" value="Open3" onclick="openit(2);" /><br/>
    </form>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Why not keep the function which just does only processing in background for while i.e. make use of setInterval and setTimeout functions which would give the code which displays names enough time to do its job.

Something like this:

<html>
<head>
    <script>
    var counter = 0;
    var hnd = null;
   
    function doSomething()
    {   
        //your lengthy processing function
        hnd = setInterval("calculate()", 3000);

        //your display function
        var d = document.getElementById('d');
        d.innerHTML = "<b>Hello to all</b>";
    }
   
    function calculate()
    {
        alert("Sum of 3  and 5 is 8");
        clearInterval(hnd);
    }
    </script>
</head>
<body onload="doSomething();">
    <div id="d"></div>
</body>
</html>

This way you can keep the function which consumes the most of CPU cycles to run at a later moment.

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

Abraham Lincoln was special, you know. :)

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

I guess my rep is going down day by day, -20 points. :)

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

> HTML code is DISABLED
Of course, phpBB's use bbcode for formatting and not HTML.

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

> This still isn't working. Can someone help?
I am sorry to say this, but you have lost the ability to see things as they are. My first post pointed out the mistakes in your code, my second post was a piece of working code and you still come back and say it isn't working?

If you plan on ignoring our posts and advice, do let us know in advance.

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

Good point, I missed that one. But considering there are no attributes having the name 'name' in the global namespace (window), there is no harm as such. I for one, don't prefer using such names as my variable names.

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

Do something like this:

<SCRIPT>
    var name = null;
    function openWindow(url, named)
    {
    
    if(!name || name.closed)
    {
    var windowHeight,windowWidth,windowTop,windowLeft
    windowHeight = screen.availHeight;
    windowWidth = screen.availWidth;
    windowTop = 0;
    windowLeft = 0;
        
    var varStore = "";
    varStore = varStore + "width=" + windowWidth;
    varStore = varStore + ",height=" + windowHeight;
    varStore = varStore + ",resizable=" + "1";
    varStore = varStore + ",scrollbars=" + "0";
    varStore = varStore + ",menubar=" + "0";
    varStore = varStore + ",toolbar=" + "0";
    varStore = varStore + ",directories=" + "0";
    varStore = varStore + ",location=" + "0";
    varStore = varStore + ",status=" + "1";
    varStore = varStore + ",left=" + windowLeft;
    varStore = varStore + ",top=" + windowTop;
    varStore = varStore + ",ScreenX=" + windowLeft;
    varStore = varStore + ",ScreenY=" + windowTop;
    name = window.open(url,name,varStore)
    }
    else
    {
    name.focus();
        }
   }
</SCRIPT>
<P align="center"><A href="javascript:openWindow('member_panel.php?page=BO_Home','BO_Home')"><IMG src="http://qlx3.net/images/home.png" alt="Home" width="256" height="217"></A></P>

Oh and BTW, get into the habit of using lowercase alphabets for tag names as we are now in the XHTML era.

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

How about posting some code so that we have something to chew on?

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

Your code does not run because you ignore the important aspects of the code posted by me. You have a global variable called 'name' and at the same time have a local variable 'name'. Because of this the local one hides the global one. Change the name of the function variable to something else than 'name'.

The second mistake you make is of not assigning the reference of the newly opened window to the variable 'name'. See my previous example for more info and post your code if it still doesn't work.

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

This problem occurs when at the time of installation of Tomcat you make it point to JRE instead of JDK. Reinstall Tomcat and when it asks for Java path, provide it the path to your JDK instead of the default JRE which appears there.

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

Bleh, good luck OP. :)

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

Maybe something like this?

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

When the button is clicked, check to see if the window is already open using the 'window.closed' property which returns a boolean. If the child window is open, just give it the focus using the function 'focus()' and if it isn't then open a new one.

<html>
<head>
    <script>
    var wnd = null;
    function openit()
    {
        if(!wnd || wnd.closed)
            wnd = window.open("http://www.google.com");    
        else
            wnd.focus();
    }
    </script>
</head>
<body>
    <form>
        <input type="button" value="Open" onclick="openit();" />
    </form>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> IE7 must not follow CSS like IE6 does
CSS !?

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

> I didn't know that this sort of work is so low valued
I don't think so. Think of it this way, the same rep cancellation has happened to each and everyone out there. :-)

BTW, nice work Dani. Now only if you could work towards implementing the Devshed pointing system as pointed out by me and Dave, it would be really nice. :)

PS: Bleh, from 9 dots to 6 is no fun. ;-)

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

Attach an event handler to the form element which would be fired as soon as the element gets focus and which would update the form name variable. Something like:

<html>
<head>
    <script type="text/javascript">
    function doSome(e)
    {
        alert("Name: " + e.form.name + "  ===== ID: " + e.form.id);
    }
    </script>
</head>
<body>
    <form name="frmName" id="frmID">
        <input type="text" id="txt1" onfocus="doSome(this);" />
    </form>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Ah..that explains things. ;-)

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

Criticizing things without knowing where they are used and how they impact the software world is a bit uncalled for...

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

Maybe this would help.

peter_budo commented: Nice one. I didn't know I can add APPLET that way +4
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

There are no issues whatsoever concerning posting images as long as they don't break the site rules, which in this case is not the issue. Keep posting good jokes and enjoy, I am sure Dani won't mind. :-)

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

Here is the library which you should use if you want logging to be enabled.

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

> Well if she has brains, she can learn.
Or if she is _hot_, she can make me cook. :-)

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

It seems that you have never interacted with clients who insist on having a 'popup' window or some clean up routines to be performed when the user attempts on closing or unloading the window. Though this may seem like a nonsense requirement for public domain sites, it becomes a nifty feature for intranet sites.

Even Google makes use of this confirmation thingy (try composing a mail and going back to inbox without sending it) by either using the 'onunload' event or some other trick for rich and interactive user experience. Come to think of it, when you think of web revolution in terms of applications which behave more and more like the desktop applications, the onunload suddenly seems to be a required feature.

Think out of the box and you would see of the different ways in which you can use such events for the betterment of applications as well as UI.

My personal experience has been that Opera scales the worst when it comes to handling events displaying the most random behavior.

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

There is no 'onmouseclick' attribute, its 'onclick' you are looking for...

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

A simple script like this should do the job:

<html>
<head>
    <script>
    var INIT_SZ, MAX, MIN;
    
    var init = function()
    {
        INIT_SZ = 14;
        MAX = 24;
        MIN = 10;
        var elem = document.getElementsByTagName('body');
        elem[0].style.fontSize = 14;
        alert(elem[0].style.fontSize);
    }
    
    var enlarge = function()
    {    
        var elem = document.getElementsByTagName('body');
        var size = parseInt(elem[0].style.fontSize.replace("px", ""));
        if(size < MAX)
        {
            elem[0].style.fontSize = (size + 1) + "px";
        }
    }
    
    var shrink = function()
    {    
        var elem = document.getElementsByTagName('body');
        var size = parseInt(elem[0].style.fontSize.replace("px", ""));
        if(size > MIN)
        {
            elem[0].style.fontSize = (size - 1) + "px";
        }
    }
    </script>
</head>
<body onload="init();">
    <p>hello to all</p>
    <br />
    <input type="button" value="+" onclick="enlarge();" /><br />
    <input type="button" value="- " onclick="shrink();" />
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

'innerHTML' introduced by IE, is now supported by Firefox, Opera, iCab and Safari.

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

> Firefox, I don't know. Do they remember JS state through navigation history?
Yes, only when the user doesn't provide an 'onunload' event handler. Read more about caching in Firefox.

Plus as far as I know, there is a bug in Opera related to the 'onunload' event.

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

"If one sees a giant, it is recommendable to examine the position of the sun first to see if it is not the shadow of the pigmy."

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

Methinks, PHP + MySQL, with a _lot_ of servers. :)

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

An option of 'both of them' is missing so I would assume that by keeping 'none of them' you mean 'neither this nor that but the best'. So I would go with 'none of them'. :)

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

You need to post the entire code for us to test it out.

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

The best way to get help would be to remove the C# code from the code above and post just HTML and Javascript so that testing it would be easy.

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

17 year old kids talking about love is like, well I hope you get the point... :)

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

First of all, considering that this is not a C# forum, the ones who try to solve your query might not necessarily have .NET to try out your code. Secondly, you need to give exact error messages which appear in the Firefox error console and paste the relevant code removing the C# mess if you plan on getting help from this 'Javascript' forum. Either that or repost in the C# forums.

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

Why do you want to return a 2D array which is a member of the class when all you are doing in the 'population()' method is make changes to the same array? You can just call the 'population()' function in your constructor and your 2D array would have the updated/required values.

Your class design looks weird, but I will leave that up to you to figure out.

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

> no i disagree, it doesn't take long to edit each post.
I disagree. I absolutely refuse to add code tags to posts of those members who have been already warned a number of times. Maybe you have a lot of time firing up your favorite IDE, indenting it and reposting it -- many don't.

> Newbies should not be blamed for their stupidity.
Stupidity yes, casualness and carelessness no. And come to think of it, this thread has been started keeping exactly these kind of people in mind who never bother using code tags.

> We don't want to ignore them, we want to help them.
Help begets help. If someone ignores me repeatedly, I would probably do the same.

And last but not the least, I completely am in favor of a script which reminds the newbies to use code tags along with the link to the page which shows how to use code tags. Considering that they won't be able to make their post, they would definitely consider reading the announcements more carefully. But considering most people block scripts from sites, a client side script won't do the job...

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

You can either pass the array considering as a sparse array i.e. by doing void someFunc(int** myArray) or you can pass it as a normal array by leaving off at the max the first dimension i.e. void someFunc(int myArray[][COLS]) . Also read this.

Consider constructing your 2D array using vectors since it is more flexible that way.

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

It can be done in two ways. The difference between the two methods is obvious: one of them(visibility) doesn't change the page layout while the other(display) does.

<html>
<head>
    <script>
    function hide()
    {
        var elem = document.getElementById('myP');
        elem.style.display = 'none';
    }
    function show()
    {    
        var elem = document.getElementById('myP');
        elem.style.display = '';
    }
    
    function hide2()
    {
        var elem = document.getElementById('myP2');
        elem.style.visibility = 'hidden';
    }
    function show2()
    {    
        var elem = document.getElementById('myP2');
        elem.style.visibility = 'visible';
    }
    </script>
</head>
<body>
    <form>
        <h2 align="center">Using the display property of CSS</h2>
        <p id="myP">Here is some text which I want to hide</p>
        <br />
        <input type="button" onclick="hide();" value="Hide" />
        <input type="button" onclick="show();" value="Show" />        
        
        <h2 align="center">Using the visibility property of CSS</h2>
        <p id="myP2">Here is some text which I want to hide</p>
        <br />
        <input type="button" onclick="hide2();" value="Hide" />
        <input type="button" onclick="show2();" value="Show" />
    </form>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Those are called annotations and are supported from Java 1.5 and up. Hence the error.

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

Come on Dani, even you know very well that people who don't use code tags after they have been warned 2-3 times are not the ones who would like to stick around.

> Besides, I point you back to Stymiee (our super mod) who initially
> came here just to make one spam post to advertise his services and then leave.
No wonder he is so good at detecting spam. :)

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

Implementation of instance methods should occur only once -- either in the header file or the cpp file. The error message say it all : you are providing a definition of your instance methods in both the header file as well as the cpp file.

The structure of a normal project is:
• MyClass.h (the class declaration, containing the function prototypes)
• MyClass.cpp (the class definition, containing the implementation)
• Driver.cpp (the program which uses MyClass and other classes, normally the entry point of program)

So just remove the function definition from the header files keeping only the declaration. Also it doesn't make sense to keep a header file if all you are going to do is implement the methods there itself.

And BTW, its #include <cmath> and not #include <math.h>

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

> we might have lost a potential tech saavy member who otherwise could have had a lot to offer
I disagree. A 'tech savvy' member who has a 'lot to offer' would definitely try to learn how to use code tags and understand the forum rules. Its the kids who don't give a damn to anything as long as their problem gets solved, we are dealing with. :)

> Of course, if AD and the other mods are happy with correcting the missing code tags
Its not happiness, its call of duty. :)

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

I guess this suggestion was put up before, but the problem being we can't add a 5 point infraction for not using code tags and it also doesn't make any sense. A warning or two or a two point infraction at the max. Plus the ones who come here asking for help don't plan on sticking for long so they obviously don't care. Come to think of it, most of them don't even know what infractions or warnings are !!!

One way we can make them learn is by letting them know that without code tags there is no hope for getting any help...

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

Hehe, this is classic. :)