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

> it seems that there are shorthand key/value array constructors
Actually it's called an 'object literal'.

Encode the data you want to send by using a PHP binding for JSON at the server and decode the same using Douglas Crockfords' Javascript library for JSON.

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

Post the question in the ASP forums with the relevant code snippets so there would be a better chance of getting help.

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

> How to coding title bar in an alert dialog box?
You can't customize the alert box if that's what you are trying to do.

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

>When pressing the enter button, the javascript function would work on IE but not in Firefox.
This is because, in Firefox, the event is passed as a parameter to the event handler. event property of the window object is IE only.

function enterHere(e)
{
    e = e || window.event;
    var code = e.keyCode || e.which;
    if(code == 13)
        find();
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

» You can't use the <body> tags when using <frameset> tags. Remove those from your main.html » You are referring to the frames in a wrong manner. Use the 'top' property of the window object to refer to the parent window. You can then access the frames using top.frames['frameName']. » For your document.write to write to the desired frame and not the current frame, use the target property of the <a> tag and set it to the frame you want. Something like: <a href="#" target="right" onclick="something();">Linky</a> » <title />State Statistics</title> is an incorrect way of writing the <title> tag.

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

Guitars FTW.

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

The articles on this page should get your going.

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

I know, but since this is a problem with the functioning of the site, Dani would be interested in knowing this. :-)

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

Every primitive value in Ecmascript is one of the following types: Null, Undefined, Number, Boolean and String. Null is a type in Ecmascript having only one value, null. The details are implementation specific. Calling it a pointer would be wrong.

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

Hello,

The 'Mark this forum read' link present in the 'Forum Tools' drop down menu on each page doesn't work for me i.e. is non-clickable. On viewing the source code I came across this:

<tr><td class="thead">Forum Tools<a name="goto_forumtools"></a></td></tr> <tr><td style="cursor: default;" class="vbmenu_option vbmenu_option_alink"><a href="newthread.php?do=newthread&amp;f=29">Post a New Thread</a></td></tr> <tr><td style="cursor: default;" class="vbmenu_option vbmenu_option_alink"><span>Mark This Forum Read</span></td></tr>

As you can see, there is no anchor tag nested inside the 'td' of 'Mark this forum as read' as there is for other options.

Just wanted to let you know. :-)

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

r5ing:

A few things:
» Don't use scanf or it's non-standard variants for accepting user input. There are better ways of achieving it. Read this.

» The way you expose the interface doesn't seem to be right. Make encode() return a char array instead of nothing.

» Also since Morse code is case insensitive you might consider converting the user input to uppercase before applying encode function to it.

> char *ch;
> printf("please enter char to convert to morse: ");
> scanf_s("%s", &ch);

How do you expect this to work? You are assigning the string entered by the user to something which doesn't belong to you. You need to allocate enough memory. Something like char ch[BUFSIZ] = { 0 }; Plus scanf requires you pass the starting address of the memory location. Since ch itself is a char array you just need to pass ch instead of &ch .

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

65 seconds. :-)

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

> Can there be any other ways so that i won't have to manually append each value to the
> same variable before posting the data?
Not that I know of. You can of course write your own function 'serializeForm()' which would work in all cases by returning a string equivalent of the form values.

Or use one of the many libraries out there which could simplify this task for you.

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

As long an HTML input element exists, it's value can never be null. It can be a blank string (string of length zero), but not null. And if that element doesn't exist, it gives you an 'undefined' instead but never null.

<html>
<body id="bdy">
	<form action="#" name="frm">
		<input id="txt" name="txt" />
	</form>
	<script>
		alert(document.forms['frm'].elements['txt']);
		alert(document.forms['frm'].elements['ok']);
	</script>
</body>
</html>

So, to check whether an element exists or not:

if(typeof(document.forms[0].elements['elementName']) === 'undefined')
{
   // an element by the name of 'elementName' doesn't exist
}

Also keep in mind that the DOM function getElementById() returns a 'null' when an element is not found in the DOM tree.

var e = document.getElementById('elementId');
if(e == null)
{
   // an element by the id of 'elementId' doesn't exist
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> How could i tackle this issue?
By preserving the incomplete data submitted by the user and populating your HTML controls with it. Just store those user preferences in a bean class and store it in a session variable.

On the dynamic page, just read those values. If they are not null, populate the corresponding HTML control with it, otherwise use the default value for that control.

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

A lot of problems to begin with.

» You are accessing form elements the wrong way. Read this.

» prompt() returns a string and you are treating it as a number which in itself is introducing a lot of problems.

» setTimeout() takes it's second parameter as milliseconds and not seconds.

» I see a lot of needless calculations going on in showTime() function. Don't touch the DOM unless absolutely necessary. For eg. since we know that the value of the 'hour' text field would only change after 60 minutes, there is no point in updating it every second.

» In javascript, numbers are represented using 64 bit double precision format as per the IEEE floating point standards. Showing the amount of 'seconds' left in decimals would be not desirable. Use the toFixed() function of Number to get away with those extra digits after the dot.

Follow the suggestions, format and indent the code and come up with a fresh solution.

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

Maybe this would help if you want to load a local XML file.

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

Ajax is asynchronous.

The time taken by the request to be completed and the response to reach the client depends on the time take at the server for processing each of the requests which may vary. A better way would be to call the 'loadSubjectList()' function inside the 'onreadychange' event handler of 'insertNew()' when the response is ready.

Also consider using a lightweight library for handling Ajax functionality since this can make you more productive and help you concentrate on the logic instead of cleaning the mess left by your Ajax code.

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

What can be done by pop-ups can be gracefully implemented using 'div'. You just need to know how to do it.

And BTW, web design and web application development and two mutually exclusive entities. The proper application of one results in the successful development of another.

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

Implementations which use pop-ups are anyways yucky. They break the rules of site usability and are a strong force in driving away your customers (if it is not an intranet website in which case this point is moot). Read this and this.

Hence you shouldn't think of pop-ups as a solution to any of your problems unless specifically mentioned by the client.

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

> Why does the JVM initialise the data fields with default values
AFAIK, design decision by the language implementors. Also makes sense since I wouldn't want the members of my newly created instance to have a value of 'undefined'.

> What is the need for such a procedure of calling the default constructor?
Instances in Java are created by the invocation of a series of constructors. The first line of each constructor is a call to it's superclass's constructor except in the case of 'Object' class. If Java doesn't provide a default constructor, it would become necessary for the programmer to specify a default constructor for each class so as not to break the constructor chaining mechanism and thereby the language specification.

Jishnu commented: Thank you! +2
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Is the event which initiates the sending of information from one page to another user initiated? Do you want this to be done server side or client side?

If you want to do it server side, just set those values in hidden fields, extract those using the server side language of your choice and send the response page to the client with the given values set (here I am talking about J2EE servets). If you want to do it using Javascript, just set the href property of the location object. location.href = 'http://www.google.com?var1=' + var1 + '&var2=' + var2; Encode values if needed.

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

Both the snippets you posted are fundamentally broken in the sense they supply a non-existent 'id' to the function getElementById() which returns an element based on id supplied to it.

Just because the second snippet works doesn't mean it is not broken. IE and Opera display a strange behavior in that they are capable of fetching the element using the getElementById() function even when it is supplied a name. This behavior is not to be relied on.

To fix your code, just assign an id to your element and everything should turn out to be fine.

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

In a layman's terms:

J2SE stands for Java 2 standard edition and is normally for developing desktop applications, forms the core/base API.

J2EE stands for Java 2 enterprise edition for applications which run on servers, for example web sites.

J2ME stands for Java 2 micro edition for applications which run on resource constrained devices (small scale devices) like cell phones, for example games.

Netbeans is an IDE (Integrated development environment) developed in Java which eases your job of application development.

And yes, Java is free and open source.

Google is your friend.

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

Just convert the given boolean array to an integer array by looping through the contents and pass it to your existing function.

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

Maybe something like this:

public class DirTest
{
    public static final String PATH = "c:/DELETE_THIS";

    public static final String NAME = "inventory.dat";

    public static void main(String[] args)
    {
        try
        {
            File base = new File(PATH);
            if (!(base.exists() && base.isDirectory()))
                if (!base.mkdir())
                    throw new IOException("Directory creation failed");
            File file = new File(base, NAME);
            BufferedWriter buf = new BufferedWriter(new FileWriter(file));
            try
            {
                buf.write("Hello world");
            }
            finally
            {
                if (buf != null)
                    buf.close();
            }
        }
        catch (IOException e)
        {
            System.out.println(e);
            System.exit(1);
        }
    }
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Can we use static nested classes practically?
Look at the source code of the 'Entry' inner class of 'HashMap'. The source can be found in the JDK directory in src.zip.

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

> So, by now it seems like C++ will be the futures programming language.
I was expecting something along the lines of Java or C if you are going by popularity though it would be nice to know the source of your conclusion.

> Write down every thing about programming language that pops up on your mind!
You mean this?

> But what do you think of the future of programming languages??
They would be good at hiding complexities from the developer, complexities which don't concern the developer or the solution achieving process as whole.

> COBOL and Fortran are still hugely popular in their respective fields
That would be not by choice. :-)

> I don't mean to reply rudely, but C++ is a terrible programming language, a complete mess.
It doesn't seem right to look at a tool which you used to use and say that. Just acquiring some new tools doesn't make the old ones terrible, just inappropriate given the boiler plate code you have to write given there are languages out there which can deliver better and more expressive solutions.

'The next big programming language' can be an interesting read.

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

Maybe this can help.

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

> <!*************SHIPPING INFO*********************> Your commenting is off. It should be: <!--*************SHIPPING INFO*********************--> > if (cardChoice = false) You are assigning a value of false to cardChoice and then testing it, hence this condition would never be true irrespective of the value of cardChoice before. Maybe if(!cardChoice) is what you wanted to do.

> // STOP HIDING FROM INCOMPATIBLE BROWSERS -->
Not needed. Almost all modern browsers support javascript nowadays. If you still want to play it safe, use a <noscript> tag instead.

You are not using stylesheets which is a bad idea in itself. Separation of presentation, data and logic is crucial for todays' web apps. Also consider linking to an external script file.

Always use a validator to check the validity of the web pages you author. I would save both yours as well as the time of the person helping you out once it is known that the web page is a valid one. Consider keeping a DOCTYPE at the top of your page and validating against it using the online validator.

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

I don't claim to possess a solution, but lets analyze it this way.

There has to be a reason for each and every post made, a motivation for an expert to post on the forums. Let's come up with a few of them.

Money
Yes, money. Money makes the world go round and is one of the factors which might drive some experts to take part in your forums. But I guess this trick has already been tried out with the blogging competition without any visible success. And I don't think any of the moderators / contributors here need that kind of money or do it for money. The core members contribute for the sake of Daniweb and not for some other ulterior motive (at least me). ;-)

Freedom
One of the finest examples of the best kind of forums out there is 'Google groups'. The people who render help there know the subject under consideration like the back of their hand. So what is so special about those groups? Freedom. No obligation to follow any rules. They are free to go off-topic. They are free to say 'STFU' to any poster and get away with it, no issues as such. Or maybe they are just comfortable with newsgroups. Who knows?

Another contender here is Devshed. AFAIK, Devshed has been around for longer than Daniweb, from a time when forums were not in abundance. Maybe it has got some of it's member because of …

Dani commented: Good post. Thanks. +31
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Yes, cookies can store any kind of textual data, if that's what you are looking for.

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

> I hold by my statement, that RPGs don't ( generally ) have physics like FPS. Correct me if
> I'm wrong
Agreed. The amount of physics in 'sports' games is also worth taking into consideration. RPG's as such don't rely much on physics as FPS and Sports games do since the focus is never on fast paced game-play or real time physics.

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

Maybe this would be of some help to you.

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

Use the 'id' of the element to do the same.

var s = document.getElementById('results').style;
var b = document.getElementById('buttonId');
if(!s || !b)
   return;
b.onclick = function() {
   s.display = 'none';
};
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Can't be done in Javascript, at least not if you are not using Ajax. You must be using some kind of server side technology, yes? Use that to ship back data to the server so that the changes made by the client are persisted and shown to him next time he logs in your site.

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

What is 'photoslider.filters'? Where is it defined? You just can't paste any random code here and expect someone to figure out what is going on.

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

var acc = document.getElementById('accept') assigns the reference of the checkbox element of your form to acc. Checkboxes have a property checked which determines whether a checkbox is checked or not.

Thus !acc.checked means 'when checkbox is not checked'.

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

'Head Rush Ajax' is certainly a good book to start off with. You can read the book review here.

Explore that site and read the reviews of some other Ajax books to get the feel of things.

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

> some use className as i am aware
Almost all browsers out there support className. IE doesn't play well with setAttribute so it's wise not to use it.

> document.framename.location = 'url';
IFrames don't have a property named as location. Use the src property instead.

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

A comprehensive guide to handling javascript cookies.

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

Though that works, it's an incorrect way of doing things.

The location property of the global object window is an object and not a string. What you need to do here is set the href attribute or property of the location object. And BTW, no need to prepend it with window since it is implied. location.href = 'http://www.google.com/'; And come to think of it, there is no need to drag javascript into this. You can do this with simple HTML assuming you don't need to dynamically generate the link. <a href="http://www.google.com/"><input type="button" value="Go!!" /></a>

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

> ps the sure way to kill a thread is to insult the folk participating in it
I agree completely. A few blunt comments here and there with a bit of mud slinging will be instrumental in putting this thread to sleep.

PS: We have done this before... ;-)

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

Look into the Apache File Upload module to ease the task of file uploads.

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

Pizza hut hut.

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

The problem is with the statement reverse(s.substring(1) + s.charAt(0)); . This effectively ends up passing the same string to the 'reverse()' function because of which it never breaks out. A proper way of doing it would be return(reverse(s.substring(1)) + s.charAt(0)); .

But as such this solution seems memory intensive since strings in java are immutable and you manipulate them for a greater part of the program. A slightly better and more OO way would be:

public class Recursion
{
    public static void main(String[] args)
    {
        Reverser r = new Reverser("123");
        System.out.println(r.reverse());
        r.setString("HellO");
        System.out.println(r.reverse());
    }
}

class Reverser
{
    char _arr[];

    int _pos;

    StringBuilder _buf;

    public Reverser(String str)
    {
        setString(str);
        init();
    }

    public String reverse()
    {
        init();
        return (doReverse().toString());
    }

    private StringBuilder doReverse()
    {
        int pos = _pos;
        if (pos == _arr.length - 1)
        {
            return (_buf.append(_arr[pos]));
        }
        else
        {
            ++_pos;
            return (doReverse().append(_arr[pos]));
        }
    }

    public void setString(String str)
    {
        _arr = str.toCharArray();
    }

    public String getString()
    {
        return (new String(_arr));
    }

    private void init()
    {
        _pos = 0;
        _buf = new StringBuilder(_arr.length);
    }
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> pic1.src="http://herproom.5.forumer.com/index.php?act=Attach&type=post&id=9886";
AFICT, the src attribute requires an absolute image path. In other words, it requires an URL and not an URI.

From what I can see, you are trying to send a request to the server with some given parameters which would after required processing would return an image as a response. If yes, then no, this won't work. Something like pic1.src="http://herproom.5.forumer.com/images/image1.jpg would be a good thing to try out. :-)

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

Happy B'Day girly. ;-)

May you live a long and prosperous life.

PS: Infractions for those who don't wish you. :-)

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

I was able to hear till E (21.1kHz) and I am quite old. Maybe I really am a mosquito. ;-)

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

Your program is thoroughly broken due to improper commenting. Instead of typing the entire 100 line program, write it in chunks and keep compiling at regular intervals. It would save you a lot of hassle. It's no fun debugging / removing compiler errors from a behemoth code snippet.