3,892 Posted Topics
Re: [quote]How could I solve this problem?[/quote] By using a high resolution image? If you would try to zoom in on a 128 * 128 image, it would obviously look bad. Two options AFAICT: * Use a new image as the image source every time a zoom is done instead of … | |
Re: Do you have the [URL="http://nlp.stanford.edu/nlp/javadoc/gnu-regexp-docs/"]GNU Regex Java library[/URL] jars in your runtime class-path? It seems that the JAR which you got in turn depends on GNU regex library so having a JAR for the same in your classpath is a requirement. | |
Re: You can't directly execute a Java file i.e. pass it to the 'java' process and execute it. You need to first compile it to a class file which is in turn passed to the 'java' command. Also, read [URL="http://www.javaworld.com/jw-12-2000/jw-1229-traps.html"]this article[/URL] which lists the pitfalls when using Runtime.exec. | |
Here is wishing all the members of Daniweb (spammers included) a Happy New Year! :-) | |
Not sure if any of you have [URL="http://gizmodo.com/5726667/the-agonizing-last-words-of-bill-zeller"]read this[/URL], but heavy stuff there. It's so sad that someone had to go through so much his entire life. The note, yet again, shows us an unseen facet of this world we live in. RIP Bill Zeller :`( [B]PS:[/B] For those who … | |
Re: By statements do you mean "code"? If yes, then JProfiler which is included with JDK 6 can be used for CPU profiling and at the end of the run gives the total time taken by each method till now. Search around for CPU profiling JProfiler. | |
Re: Is it required that the user uses your web application for downloading files? If yes, then in that case, your web application would have to act as a "man in the middle" and stream data from the FTP server to the client. For each client request: * Retrieve the FTP … | |
Re: > I tried manipulating the blob datatype by setting.. The way you are going about to do this won't work. You can't render an image on your markup without using the IMG tag just by grabbing the binary content. You'd need to create a separate servlet mapping which would read … | |
Re: SerializedThread is an inner class i.e. a class which depends on some outer parent class i.e. there is an association between your class Main and SerializedThread. When you try to serialize SerializedThread, it also tries to serialize Main class (which doesn't implement Serializable) hence the error. A couple of solutions: … | |
Re: > how to store an image from one directory to another directory using jsp? Can you explain a bit more on what exactly are you trying to do here? > MoveTo or CopyTo method of java.nio.file.Path class. AFAICT, Path class is JDK7 only which is still in its "preview release" … | |
Re: [quote]My main concern is that like this, the harddisk is constantly being accessed for every single character - I'm sure it's highly inefficient.[/quote] Yes, it sure is. [quote]Please note that when I used 'readLine()' instead of 'read()', i got the java heap error, so im guessing i have to read … | |
Re: The name of your class should be the same as the name of your Java file i.e. Main. | |
Re: [URL="http://download.oracle.com/javase/6/docs/api/java/io/File.html#renameTo%28java.io.File%29"]File#renameTo[/URL] method | |
Re: [quote]Users log in with their username and password (maybe I can somehow incorporate google OPENID)?[/quote] [URL="http://code.google.com/p/openid4java/"]OpenId4Java[/URL] (though I haven't used it personally) [quote]What I'm not sure is if JSP/JSF gives the ability to parse HTML at a certain URL to see if it contains words[/quote] I think [URL="http://hc.apache.org/httpclient-3.x/"]Apache HTTPClient[/URL] should … | |
Re: As far as wrapping in an executable is concerned, I've heard good things about [URL="http://jsmooth.sourceforge.net/features.php"]JSmooth[/URL]. If that doesn't suit your needs, there is always [URL="http://launch4j.sourceforge.net/"]Launch4J[/URL]. Of course, this assumes that you already have *everything* bundled up in a JAR file for which you can use Eclipse or Netbeans as already … | |
Re: [quote]Why do local inner classes not allow static variables ? The static fields of the classes could at least have been allowed access from the local method ?[/quote] Because static members make little sense when it comes to "local inner classes" since these classes belong to a scope as opposed … | |
Re: The proper way to go about the task would have been to use JSTL or JSF instead of scriptlets. The official [URL="http://java.sun.com/javaee/reference/"]J2EE tutorial[/URL] would be a good starting point. Plus what you posted was far from useful; you need to post the entire relevant code instead of just the line … | |
Re: Some universities make students code in Notepad/Wordpad. Asking students to use an editor which doesn't go syntax highlighting is a sure shot way of "frustrating" the hell out of students and making them hate the course. I personally use Eclipse (work) / gvim (home). BTW, it's not "JAVA" but Java. | |
Re: Think of the JVM as a universal VM. JVM byte code is to JVM what x86 assembly is to x86 family of processors (sort of) with the difference being that this byte-code is not aimed at any specific processor architecture but rather a VM which runs on a variety of … | |
Re: No more than 30 mins without a break. If the entire premise is clear in my mind, it doesn't take a lot of time to churn out sizable amount of code. Plus given my short attention span, 30 minutes is a good enough time to keep me motivated. Oh, but … | |
Re: [URL="http://www.xyzws.com/Javafaq/why-a-protected-member-of-a-superclass-cant-be-accessed-from-a-subclass-by-using-a-superclass-reference/109"]Why a protected member of a superclass can't be accessed from a subclass by using a superclass' reference?[/URL] | |
Re: Because: [quote][URL="http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.3.1.2"]A blank final instance variable must be definitely assigned at the end of every constructor of the class in which it is declared; otherwise a compile-time error occurs.[/URL][/quote] | |
Re: Looping over the array and comparing values would be the simplest solution. If it is an array of primitive values, use the comparison operator [icode]==[/icode]. If it is an array of reference types, use the [icode]equals[/icode] method (or [icode]compareTo[/icode] if the reference type implements natural ordering). Another simple way would … | |
Re: [quote]How does the element type being available at runtime have anything to do with that ? [/quote] Because it enables fail fast behaviour. Array operations are checked at runtime since the type information is available to the JVM. [code]class Test { public static void main(final String[] args) { Object[] arr … | |
Re: > j2se vs j2ee vs j2me . Simply put: J2SE - Standard edition; standalone applications J2EE (is actually called Java EE) - Enterprise edition of Java; built on top of Java SE and adds enterprise capabilities (read specifications) like web applications, business components etc. J2ME - Java for mobile platform; … | |
Re: Regarding bad titles: just report the first post of the thread and someone from the mod forums might fix that. Plus, let's not go too off-topic here; how about wait for the OP to explain his/her situation (though I doubt it would happen). | |
Re: Do you have a package declaration at the top of your servlet? Does the "classes" directory contain the file "getname.class" placed in the folder hierarchy com/mmfsl/web ? | |
Re: There is no Math.random method which takes a seed. Simply use the Random class and its nextInt(upperBound) method and you should be good to go. Also, before lighting up the buttons, make sure the previous state of all the remaining buttons is reset. | |
Re: The wildcard [icode]<?>[/icode] is a shorthand notation for [icode]<? extends Object>[/icode] hence the normal rules apply.[code] private void traverse(final List<?> lst) { final Object o = lst.get(0); lst.add(new Object()); // compile time error }[/code] This is the same reason why you can do a "get" but not a "set". The … | |
![]() | Re: [URL="http://download.oracle.com/javase/tutorial/java/package/packages.html"]The simplest explanation related to packages.[/URL] |
Re: [quote]Does anyone know how to make the program wait for this command to complete before it moves onto the next lines of code?[/quote] Try removing the first two arguments from your string array i.e. [code]final String[] args = { "sudo cp", "/source/*", "/target" };[/code] And preferably use ProcessBuilder class for … | |
Re: [quote]What is E once the program has been compiled ? [/quote] There is no type "E" after the class has been compiled. Generics in Java are based on type erasure and are compile time constructs i.e. your code is as safe as you want it to be. Deep down inside, … | |
Re: You have posted the [icode]javac[/icode] command which you are using to compile your code. What is the [icode]java[/icode] command you are using to execute your code? Are you properly setting the classpath when spawning your Java process? Also, as already mentioned, move that mysqlconnection jar out of the JDK lib … | |
Re: If you are working exclusively wrt manipulating strings, use StringBuilder class for appending operations rather than concatenation for strings. If you still face memory issues, then they might just be valid reasons and would require you to set the heap size accordingly. What is your current heap size? | |
Re: [quote]You can't send a ref between different JVMs[/quote] Yes you can (at least for custom classes) using RMI; moving refs between JVMs is the entire premise of the "distributed objects" theme. :-) | |
Re: [URL="http://www.javamex.com/tutorials/threads/thread_scheduling_2.shtml"]The explanation[/URL] is on the same site. | |
Re: What operating system are you running on? Do you have the entire stack trace? This error normally comes up when you end up depleting your quota of the maximum acceptable file handles which can be open at a given time which in turn happens if you don't close file/socket streams … | |
Re: Which tool are you specifically referring to here for creating web services? What kind of web service (JAX-RPC, JAX-WS, JAX-RS)? | |
Re: [quote]If you ask really really nice you might ask one of the mods to remove the code you posted, leaving the rest of the post.[/quote] That would be a wrong thing since removing content from posts which don't violate any rules would be against the rules. I do admit that … | |
Re: If nothing, these certifications force you to have a closer look at the language in general, which you probably don't bother with unless you are studying for a certification. Certifications have got a pretty bad rap due to the plethora of Software Engineers with certifications who can't do a hoot … | |
Re: > Can anyone tell me or give me a hint as to how am i going to sort the words > in alphabetical order. Look into the [URL="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collections.html#sort(java.util.List,%20java.util.Comparator)"]Collections#sort[/URL] method which takes a [icode]Comparator[/icode] instance to facilitate custom sorting. | |
Re: Your question isn't very clear; when you say JDK tool, which tool are you referring to? Also, if you are talking of "java", it doesn't know the "fully qualified class name", you have to specify it. When you write:[code] java -cp . net.sanjayts.Main[/code] the executable searches for the directory structure … | |
Re: Use the [icode]getResource()[/icode] method of the ClassLoader class for loading resources in a location-independent manner relative to your classloader path. This path is normally the classpath which you set (-cp) when spawning the Java process. This method is capable of loading any classpath resource, not just packaged resources. Hence you … | |
Re: AFAIK, "the same" is a common way of referring to a previously explained/mentioned context. For e.g. compare and contrast the following two sentences:[code] I've upped the servers on the production box; please monitor the same for at least two days. v/s I've upped the severs on the production box; please … | |
Re: AFAIK, [URL="http://docs.python.org/library/socket.html#socket.socket.bind"]`bind` accepts a tuple[/URL]; just wrap those HOST and PORT in another pair of parentheses and you should be good to go. | |
A new anime season is just around the corner; [URL="http://moetron.com/uploads/20101204_winterlistv3.jpg"]preview here[/URL]! Kimi No Todoke 2nd season and Mitsudomoe 2nd season are on my must watch list but all in all this new season looks depressing. :-( | |
Re: AFAIK, no, not possible since a JAR file is just a zip file and is not capable of containing that sort of meta-data. This is the reason you'll notice that applications which rely on running a JAR also supply a shell script for that given platform which fires the JAR … | |
Re: [quote]I can't understand why s1,s2,s3 are having same hashcode although i created as strings and objects as shown[/quote] As already mentioned hashCode depends on the value of the object. Plus, when you override equals() you need to provide a logical implementation of the hashCode() method which [URL="http://www.xyzws.com/javafaq/why-always-override-hashcode-if-overriding-equals/20"]adheres to the equals-hashcode … | |
Re: If memory serves me right, this is due to the "conversion view" setting of gmail. For changing it, log in to Gmail -> Settings -> General Tab -> Conversation view -> conversation view off should go the trick. | |
Re: Which browser do you use? What kind of privacy settings do you have for that browser? Are you using Firewall? If yes, have you added Daniweb to the list of trusted sites(if there is one)? AFAIK, Daniweb solely relies on cookies for session tracking, so anything which messes with that … |
The End.