3,892 Posted Topics
Re: > For example, if I have an Animal named germanShephard, is there some way I could say > String gerSh = "germanShephard"; and then treat gerSh as if it was the equivalent of > saying germanShephard in my program? You can't because gerSh is now a String. The closest you … | |
Re: I agree with the OP there; Ruby is much more than just another web development language. It falls in the same league as Python, Perl and the other scripting languages out there. Moving it to the Software Development Category would be a good decision. | |
Re: It can be done using HTML only; just use the `size' attribute of the SELECT element. | |
Re: > If anyone can do this I will spam +rep on your for the remainder of your DaniWeb life Pity, you haven't got any left. | |
Re: Use the Error Console feature of Firefox to track down Javascript errors. Use the Firebug extension of Firefox for debugging Javascript application. Also don't search for parent elements of node, just use the parentNode property of the Node. | |
Re: The simplest way would be to use the [URL="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html#shuffle(java.util.List)"]Collections#shuffle(List<?> list)[/URL] method which delivers decent performance and output. If you have an assignment to create such a shuffling algorithm, then look at the source code of the Collections class for hints. | |
Re: > makes me wonder if they somehow cheated Yes, sort of. Inserting a few records in the database ain't that tough. ;-) | |
Re: [QUOTE=gangsta1903;733171]As far as I know, exceptions that are not subclasses of runtime exception or error should be caught (handled). When a file exception occurs, it should be caught because its a subclass of exception class, but how can it be recovered? If file is not found,it sounds silly to recover … | |
Re: Google for createElement and insertBefore. | |
Re: > In a few years that won't be a joke. And we would have a band of outlaws who would be completely against this. Good setting for an anime, can't wait for this one... ;-) | |
Re: No, both your usages of isNaN won't work since they would also work for input such as "3E3". A better way would be to make sure that your form field only contains dots and digits. Also in both the cases, there is an implicit conversion from Javscript String object to … | |
Re: Apache Tomcat is the most mature and stable servlet container out there used in a lot of production deployments. There are a lot of Tomcat resources out there and all Servlet / JSP books out there use Tomcat to showcase their examples. | |
Re: For anyone out there who wants to have a nice dinner with a hot chick and that too for free: - Ask a chick out for a date in a four/five star hotel. (preferably one who doesn't know where you live) - Take her to a hotel far away from … | |
Re: Don't create multiple threads for the same problem if you don't intend on reading the replies given in your previous threads. In [URL="http://www.daniweb.com/forums/post721873.html#post721873"]this [/URL]thread, you were given a thorough explanation of how arrays work; if you still don't get it then maybe this assignment is too tough for you. | |
Re: ..or use EJB's to simplify your task. For each of the two applications, create an equivalent local Home and Remote interfaces and you are good to go. Incase you don't know EJB's, try out the alternative suggested to you by Masijade. | |
Re: Don't override [ICODE]service[/ICODE]; just override the method which you want to support and accordingly override the [ICODE]doGet()[/ICODE] or [ICODE]doPost()[/ICODE] method. The `action' attribute of the [ICODE]FORM [/ICODE]tag is mandatory. You don't need to use Javascript, just use the action attribute of [ICODE]FORM [/ICODE]tag with a normal submit button. Also there … | |
Re: [ICODE]return[/ICODE] in looping constructs is considered conditional and hence the given compiler error. The compiler acts pretty much as a pessimist here and assumes the loop will never be entered unless the condition includes only literals. [code] // Won't work public int doIt() { final int min = 0; final … | |
Re: > Is it possible to establish a jdbc connection within the jar. > The jar I will be using has the database file. Just reference the file inside your jar [in your case required for a standalone database like SQLite] like any other resource. Read [URL="http://www.cejug.org/display/~htmfilho/How+a+jar+file+application+can+access+files+in+itself"]this[/URL]. | |
Re: > and the meaning of this is that in this case we must call the base constructor with super() > but my question is how in th first class CounterDemo extends Counteexample we do not > need super(); In case you don't provide a constructor for your class, the compiler … | |
Re: > This should be an easy project You have seriously got to be joking... > Also executing packaged-classes might be a bit tricky. Take a look at how Ant handles such things. | |
Re: > Hello, I'd like to create a function _______________________^^^^^ Method would be the correct terminology here. > that accepts two objects and compares properties between them. That largely depends on the type of those properties. If they are primitives, the comparison operator will do the job. If they are reference … | |
Re: > I'm trying to read in a text file character by character. However, when I try to read it in it > using the readChar method in DataInputStream it gives me a IOException. Heres what I > have so far You are using a wrong approach IMO. Even though you … | |
Re: The script in case of a SCRIPT element may be defined inside the contents of the SCRIPT element or in an external file. The only difference here is that an additional request is made in the case of an external script file. Hence you can treat your script as though … | |
Re: Attach a function to the onclick and onfocus event handlers which would do something like this: [code=javascript] function focusChild() { if(my_window) my_window.focus(); }[/code] Here my_window is a global variable which holds the reference to the newly created popup window. It follows that as long as the child window is alive … | |
Re: I guess this is because your last two Readers end up using the same underlying stream to read from the source; here [icode]file[/icode]. Because of this, when the third [ICODE]BufferedReader [/ICODE]finishes, the end of stream has already being reached for the [icode]file[/icode] and further reading obviously returns [icode]null[/icode]. Either create … | |
Re: Why doesn't the [icode]hashCode()[/icode] method of URL suffice your needs? | |
Re: > 1. Should we use any FrameWorks ? if yes. which one is better and simpe ? Yes, using one of the Frameworks out there would be far better a choice, no point in reinventing the wheel as long as you know what goes behind the scenes. I have worked … | |
Re: @stephen84s To exclude a piece of text as being interpreted as BBCode, use the `noparse` tag. With the use of noparse, you can write something along the lines of `[noparse][code=java]your code here[/code][/noparse]` and be sure it won't be interpreted by the BBCode parser of vBulletin. | |
Re: I guess the same is with `IT Professionals'. ;-) I still wonder how many of the regular posters here code for a living; but maybe that's a question which demands its own thread. | |
Re: Two reasons come to mind: - A rogue implementation which manifests itself as the number of documents to be transferred increases. Profile the application thoroughly looking for memory leaks and unintentional object retention. - The default heap size doesn't suit well for your current processing needs. Tune your JVM by … | |
Re: You don't need `session' to display the request parameters; just use [ICODE]request.getParameter("parameterName")[/ICODE] inside your servlets' [ICODE]doGet[/ICODE]/[ICODE]doPost [/ICODE]and you should be good to go. BTW, you can get a reference to the `session' using the [ICODE]HttpServletRequest[/ICODE]; read the API docs. | |
Re: If possible, set up a version control system so that at every point in time the entire team has a view of the functionality currently existing in the system. Follow good J2EE practices by making use of JSTL instead of using scriptlets so that you don't end up creating messy … | |
Re: > here it is impossible to add variables to the url and success Why is it impossible? What prevents you from creating a URL of the form [icode]http://somesite.net/en/page?name=somename&age=someage[/icode]? Anyways, if the operation involves POSTing data rather than GETting it, consider using POST requests rather than GET ones when making asynchronous … | |
Re: Look into the DOM methods [ICODE]createElement [/ICODE]and [ICODE]createTextNode [/ICODE](a simple google search should give you a lot of food for thought). | |
Re: > use a for loop for a known size Not necessary; while loops can be completely avoided. A `for' loop can easily replace a `while' and `do while' looping constructs.[code] // while equivalent String line = null; for( ; (line = reader.readLine()) != null; ) { // process the line … | |
Re: > "Why do they sterilize the needles for lethal injections?" How many lethal injection sessions have you witnessed to state that with conviction? > If electricity comes from electrons, does morality come from morons? No, morals. > "If Wile E. Coyote had enough money to buy all that ACME crap, … | |
Re: > can somebody give me some good example of how to iterate over list, Just use an [ICODE]Iterator[/ICODE]/[ICODE]ListIterator [/ICODE]for iterating over a List in a implementation agnostic manner. Iterators have the benefit of being able to allow you to add / remove an element without any additional effort. Using a … | |
Re: Dear Ming, We are also very much interested in helping you study Java programming, but we strongly feel that handing out source code hinders the learning process. We recommend you start something and come back again to this message board once you are stuck. If you still feel that grabbing … | |
Re: > I would really appreciate it if anyone could help me as i understand most of the concepts of > java Are you sure? The line [icode] while (operationS != 'q') && (operationS != 'Q');[/icode] is choke full of syntactic errors. Make sure you concentrate on understanding the concepts rather … | |
Re: Don't use scriptlets; use JSP's only for view purposes. Use JSTL along with servlet. > whenever i retrieve that data in my jsp page, it only shows this > Ljava.lang.String@123EGa something similar to this.. This is because you are trying to print a [ICODE]String [/ICODE]array and the above just happens … | |
Re: >The problem is, I am not the author of the original and as such have not clue as to what > methods the classes have and in which class. Then how do you propose on adding additional functionality as mentioned in your first post? | |
Re: > Don't be shy! Share some information for my Survey! %_% OK, here is an interesting fact for your survey; I don't have a credit card. :-) | |
Re: Whenever in need of a sane string representation of your instance, override the [ICODE]toString()[/ICODE] method for the given class. This makes sure that each class is responsible for giving out its own representation without having to write the same temporary code again and again. For pretty printing arrays, convert them … | |
Re: ...struggling to keep a straight face after reading all those; priceless. :-) | |
Re: > If this means anything to anyone here I think it will be a small miracle. IMO, it isn't that difficult given the keywords in that post; most probably an assignment to create a simple compiler. *miracle* | |
Re: > You are using the value "X" in the .equals(Object) method which expects an Object as a > parameter. Huh? Firstly, the equals method is overridden in the String class. Secondly, if a method accepts an Object, you can pass any reference type to that method. The problem here is … | |
Re: Use the [ICODE]tabindex [/ICODE]property supported by the [ICODE]A[/ICODE], [ICODE]AREA[/ICODE], [ICODE]BUTTON[/ICODE], [ICODE]SELECT[/ICODE], [ICODE]INPUT[/ICODE], [ICODE]OBJECT [/ICODE]and [ICODE]TEXTAREA [/ICODE]elements. BTW, this has got nothing to do with JSP or in fact any server side language; it's a pure markup question. | |
Re: Your HTML document is not valid; it lacks a DOCTYPE. Also your question isn't very clear here. What kind of an help do you need since except for a few problems it pretty much looks OK. As for the formula, you would be the best person to come up with … | |
Re: Post a compilable piece of code; what you posted isn't even remotely a valid Java program. In Java, multi-dimensional arrays are represented as array of array. This allows you to ignore the second dimension when defining a two dimensional array. Generically speaking, this concept allows you to ignore all the … | |
Re: [code] for(int number = 10; number >= 0; --number) { oRocket.countDown(number); }[/code] No? But this seems to be logically wrong since the `driver' class shouldn't be the one performing the countdown; the rocket instance should be provided with a default counter which would be decremented and the rocket would take … |
The End.