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

> Yuuuuk! Impossible to read this.

Eh? Impossible to read what? The site to which I linked to?

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

The 2009 Spring Preview is here!

There are around 30 anime this time as opposed to around 23 in the previous season. As always, I'll try my best to watch everything, though Romance, Comedy and Action anime will be my first preference. :-)

Anime FTW!

javaAddict commented: For showing to the community the joy of Anime +5
Assad_2 commented: mostly, i do not get into that much anime, but recently i have managed to spare time for anime and found another type of comics as manga series +0
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

NaN. Read the section on "How NaN is created", step through your code a single method at a time and it should be pretty easy. Use a debugger; a slick one which comes with Eclipse or a primitive command line debugger like "jdb" should do the job.

Salem commented: NaN - more than just an elderly female relative :) +29
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

AFAICT, the <sql:param> tag needs to be nested inside the <sql:query> tag.

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

> How exactly do you calculate the traffic?

Most probably by the number of threads requesting for a RIA forum. :-)

I don't completely disagree with your suggestions; RIA's really *are* hot these days. But given that Dani is the final authority for these kinds of things, you can either wait for her to reply to this thread or fire off a PM to her for more details.

> Maybe some other forums such as Assembly (last activity 9 days
> ago) can be done away with.....

Haha, I like your style.

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

Or so you think. :-)

> I was wondering if we could have new forums on DaniWeb,
> especially for RIA's like Flex, JavaFx etc..

Forums or more specifically sub-forums are created only if a given technology generates enough traffic each day. Creating forums otherwise leads to "dead" forums which have little or no activity whatsoever e.g. Ruby forums. For the time being if you have any query, try posting the same in Web Design forum.

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

> The error console in firefox does not display any errors.

IMO then it can only mean two things:
- Either the Javascript on the entire page is disabled causing the script not to be executed.
- The function is executed but doesn't work as expected due to some reason. Put alerts at the start and end of function and see if it fires off.

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

You are trying to use `num' before initializing it i.e. providing it an initial value which works for member variables which have a default value but doesn't for local variables which don't.

Move the two statements which ask the user for input and parse `num' before the statement which first uses `num'.

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

> My insertion sort algorithm is failing to properly sort the points
> based on angle roughly 30% of the time.

That isn't an Insertion sort which you are trying to implement; also whichever algorithm that is, it's broken. Try it for input [5, 8, 1, 2].

Read this.

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

> " WHERE id=" + request.getParameter("'id';"); " WHERE id='" + request.getParameter("id") + "'"; .

Your query has two problems:
- request.getParameter("'id'") tries to grab or look for the value of a form field with the name 'id' which isn't obviously what you are looking for. It should be request.getParameter("id"); .
- If the ID column of your Table is of type string, then you need to have the value of the ID form field in quotes. Better yet, use another placeholder in your prepared statement.

> Class.forName ("com.mysql.jdbc.Driver").newInstance (); .

No need to create a new instance; loading the Driver class with Class.forName() will do the job of registering the Driver with the DriverManager .

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

Like it has already been mentioned, post your code which can be compiled and tested to reproduce the exact problem.

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

> Security Error:

It seems as though Firefox distinguishes between unsafe URI embedded in web pages and those written out explicitly in the location bar. IMO, this happens so because native executables when accessed using the FILE protocol directly execute and this might pose a *big* security vulnerability if the user has admin rights or if the referenced resource is something malicious. To try it out, type file://C:/WINDOWS/system32/cmd.exe in your location bar if using Windows and see for yourself.

A sensible workaround: serve the files using HTTP; i.e. run a HTTP server on the target machine or the machine on which the application is deployed and reference the resource via the HTTP protocol. FTP is also a viable option.

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

> The first time that January 1 will fall on a Sunday is the year 4300.

Oh wait, don't you have an official holiday on 1st January? ;-)

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

> would anyone explain the difference among "public static int " and
> "public final int " and "public static final int" ?

Make an attempt at answering that and we would provide corrections if needed. Giving out answers to queries without an effort is against the forum rules.

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

> could not install it due to some errors

Upgrade to a newer version of Firefox and then try it; ideally there shouldn't be any problems. What is the error you are getting?

Anyways, like I mentioned in my previous post, take a look at Error Console which is comes pre-installed with Firefox and tell me the error you see there.

BTW, what kind of an application we are talking about here? ASP. NET, Java, PHP? I need more details since this seems to be pretty unusual.

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

It's not officially against the rule since any valuable addition to a thread discussion is more than welcome. Useless bumps to old threads are simply forked off as new threads. Just report any such occurrence and the moderator team would act accordingly.

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

The browser in use can make a difference, the OS doesn't. Which browser are you using on Linux? If Firefox, try using the Firebug addon which provides Javascript debugging capabilities. For looking at Javascript errors if any, open up the Error Console [Tools -> Error Console].

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

> However, the program runs without any problems in JCreator.

Check for possible hardcodings in your Java source files and the .bat files. Do a text search for the old directory name in your project directory and you might just stumble upon something.

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

ohs?.. you're a warrior? & your wife is beautiful?.. I don't think so..
I guess both of you are aliens..

Um...please refrain from making personal remarks and naming names.

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

> Which link would give a detailed explanation.

For future references, almost all the links in this thread are pretty good for someone starting out with Java; worth a look.

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

> java.lang.NoclassDefFoundError

You need to show us the command line invocation of `java' which you are using to run your program. If your class 'Z' is inside a package 'my.pkg' inside the directory 'test', you need to use a command like:

c:\test>java my.pkg.Z

Read the links specified in the forum sticky for a detailed explanation.

>I got the file to right with that method, but with out the serialization
>package working I cant really see if the file size is different and we
>have improved performance.

Huh? Improved performance?

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

> Hmm, okay so I have to use the installer?

AFAIK, yes.

IMO, using a language like VB or C# might make creation of such a tool easier.

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

defaultWriteObject is equivalent to the default serialization performed in the absence of a writeObject method and is normally used in conjunction with custom writes to persist transient or extra data. Hence you might want to resort to something else.

One solution might be to grab the contents of the entire binary tree in a List, serialize that list using ObjectOutputStream.writeObject in the writeObject method, read the same and populate your tree.

Here I am assuming that the elements inserted in the BinaryTree have natural ordering i.e. implement the Comparable interface.

> I see a lot of views, but may be I am not asking the question right.

Consider using code tags and proper indentation when posting code.

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

You would of course have to use the provided installer, there is no easy way of bypassing it. You would have the option of spawning OS processes from Java using the ProcessBuilder class.

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

> Yes, I am taking a class

You should convey to your professor the problems you are facing and ask him to help you out even if it means spending some extra time for it. One-to-one help is far better than trying to understand the same by asking on message boards.

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

Use the split() method of the String class which returns a String array; loop over the array and apply the Integer.parseInt() method on each String token. If an exception is thrown; the string token isn't a valid integer.

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

This should considerably ease your pain.

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

> I want the BufferedReader object to read from a variable

If you are talking of having a Reader sort of wrapper for a target String, look into StringReader and Scanner.

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

> Hi, i have made those changes

It seems you haven't since I still see the call "MM_callJS('order(this.form)')"; re-read reply 10.

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

> hell

Yeah, I guess that's what all the kool kids say these days. :-)

Ezzaral commented: hehe :D +17
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Either of them would do; the point I was trying to put across is that for comparison use the == or === operator instead of = operator. Though, using switch seems to be the logical solution here.

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

Have you made the fix suggested in my previous post? Re-post the entire code and point out the line which is having problems.

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

> MM_callJS('order(form1)')

Replace the above with order(this.form); .

> and i also change the form1 in my function to this.form

Like I mentioned, change form1 to this.form only in onchange and onclick handlers and not anywhere else. The form1 in your function is the form reference which is passed as an argument to the order() function.

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

For comparison its == or === [strict type safe equals] and not = [assignment operator].

var op = document.getElementById("someId").value;
switch(op) { //switch by default using === operator
  case "add":
    alert("addition");
    break;
  case "sub":
    alert("subtraction");
    break;
  // and so on
}

You are using an improper way of accessing form elements; read this link for more details.

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

> But it is giving error that x is null. Can any one please correct it?

Because the `style' property is only set when inline style sheets are used. To get the style details of the element whose style is set using linked or embedded style sheets, you need to put in a bit of effort. Read this.

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

> Who can solve this?

You, of course will try or show us what you have tried/thought so far and the forum members will try to help you out.

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

Rather than using the window.open() function, use the URL passed in the function as the value of the HREF attribute of the ANCHOR element.

document.write('<a href="<?php echo $product_flypage ?>">');

assuming that the echo part writes out the URL.

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

I already provided the fix in my previous post. If what you posted really is your code then you shouldn't have problem understanding the fix I suggested. Anyways like I mentioned, you need to replace `form1' with `this.form' in your event handlers: onclick & onchange.

> Would u kindly provide me a code snippet as to how it should be
> done, i am really lost

Sifting through the entire code to fix the issue would be way too time consuming; you need to start learning Javascript using the links I provided.

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

> I need to integrate the python script with a java application to put
> all the tools in a single pipeline to function as a continuous workflow

There are a few things I can think of:
- If only one component of the workflow executes at a given time and if the execution of component `n' commences only after the execution of component `n - 1', you can simply create a shell script which sequentially executes the processes. Something like:

python some.py | java pkg.class | java otherpkg.otherclass

But this approach is crude and might not work if there are other complications involved.

- Instead of a Jython wrapper, create a pure Java wrapper which initiates and executes the entire workflow. You can try embedding the Python interpreter to execute your Python scripts from Java.

- Don't believe the FUD floating around about Jython being slow; try it for your application and see if it works out within the given expectations. Using a recent JVM [1.6] and the latest Jython build might help speed things up.

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

Use the focus() function of the DOM element to focus on the given element.

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

It is only in IE[and some other buggy browsers] that the NAME or ID attribute of an element represents the element in consideration; which actually isn't correct. You actually need to grab the element in consideration by either traversing the DOM [getElementById] or using the form reference each form element holds.
- Replace the `form1' with `this.form'
- Move the entire code snippet in the onchange handler and then invoke that function with `this.form' passed in to that function

Also, you shouldn't use eval; there is always a better way of doing things. Read:
http://www.jibbering.com/faq/#eval
http://www.jibbering.com/faq/faq_notes/form_access.html

As mentioned earlier, read the forum for the use of code tags as many people might ignore posts with code without code tags.

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

Sifting through that massive piece of code would be time consuming. If developing on Firefox, look into the Firebug addon which adds capabilities like Javascript debugging, error detection etc. Look at the errors which pop up in the Error Console; it will point you to the exact source of the problem.

Also, use code tags when posting code so that its easier to read; refer the forum announcements for more details.

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

> Why is it too hard to find a girl friend who is as smart as Narue(dont
> take this one seriously )

Because for you "Life is much simpler without women." :-)

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

> But on the other hand, you have to start somewhere, right?

Indeed; a dead forum sounds just right! :-)

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

> the option of returning the boolean would not be a bad one.

But this limited implementation falls short when the functionality is extended to work for both primitives and reference types. Since this very likely looks like a homework / learning exercise, the OP needs to know the problems he can face with the boolean implementation. My point here being, the boolean approach has a distinct drawback in selected cases; the index approach works without a hitch in each and every case.

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

> I am assuming here he doesn't intend to do some calculations that
> would require the index number.

This is the very reason the API designers decided to return the zero based position rather than a simple yes/no answer; since the way the result of the search is going to be used is something the API developer can't foresee or comprehend beforehand.

Returning the zero based index is pretty useful when querying an array of objects rather than primitives since there can be two distinct objects in memory which are logically equivalent.

In short, returning a zero based index kind of *fits the bill* and seems a pretty good choice over maintaining different contracts for different situations; and that too at absolutely no overhead. Take a look at the API of the binarySearch method Arrays utility class which goes a step ahead of returning a normal zero based index.

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

Or of course there is the NumberFormatException which gets thrown if the conversion was unsuccessful, no matter the reason.

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

> how can you convert a string, which is stored in a vector, into an
> integer?

Consider searching the archives on the web as a first resort before posting a question. This question has already been answered numerous times. It'll save you a lot of time and will be a step forward in making you an independent/better programmer.

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

> How can I resolve this?

Consider returning the zero-based position of the element in the array and -1 if the element doesn't exist.

//Sample invocation
int[] arr = {1, 2, 3, 4};
int pos = Utils.search(arr, 1);  // 0
pos = Utils.search(arr, 11);  // -1

Alternatively, take a look at the contract specified by the binarySearch method of the Arrays utility class.

returns the index of the search key, if it is contained in the list; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the list: the index of the first element greater than the key, or list.size(), if all elements in the list are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.

Or you can make the search method return an Object representing the element in which case a `null' return is legal.

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

> I know that you do 6.83783 * 10^3 as 6.83783E3, but how do I do
> that number times 10 to the negative third? 6.83783E-3