3,892 Posted Topics
Re: > You realize I was joking, right? You realize that given your position/designation on this site, you can be easily quoted out of context, right? :-) Anyways, on the topic of improved content, I do see a reduction in the "plz gimme codez and projectz", more first timers using code … | |
Re: What kind of problems are you running into? If you can read a couple of lines, you can read 95K lines... | |
Re: Take a look at the [URL="http://www.1keydata.com/sql/sqlinsert.html"]SQL insert syntax[/URL] and compare it with yours. Do you see anything wrong with it? | |
Re: Is it necessary for you to write your own lock implementation for this or are you free to use any standard classes for the same? | |
Re: Ideally the JAR files in the WEB-INF/lib folder should show up in your Java Build Path -> Libraries tab -> Web App Libraries ? Don't you see your JAR files there? | |
Re: Create a new variable guess count which keeps track of the number of times the user guesses the bean count. [code] do { if(reply == jellyCount) { // break and congratulate user } else { // increment "guessCount" and show the failure msg to user } } while(true); // since … | |
Re: [URL="http://download.oracle.com/javase/tutorial/networking/urls/readingWriting.html"]URLConnection class[/URL] should help you get started. Post your code if you are still facing problems. | |
Re: [quote]The purpose is to have limited available connections at a time[/quote] Are you sure it's limited number of "connections" you are looking into or is it limited number of serviceable connections? Because the way you have presented your sample snippet, you would anyways be consuming a "socket" on the server … | |
Re: > what is the right way to create new object All the Date class constructors except the no-arg and the one which takes milliseconds are deprecated. If the purpose of your question was to find the right way to create a Date object, look into the Calendar and SimpleDateFormat classes … | |
Re: Glad to hear that a long time lurker finally decided to join Daniweb and help out others. Welcome to Daniweb. :) | |
Re: Couple of problems with your code: - Enum declarations as per the specification can't be local i.e. placed in a method. Move the enum declaration either outside of your TemperateConverter class or either outside the main() method. - Why C, c and F, f (BTW, you have got both capital … | |
![]() | Re: Error? I think what you have posted in the `toString()` representation of the Scanner class. If your code doesn't work, you need to add some debugging statements or even better use an IDE like Eclipse/Netbeans which has debugging support. If you are getting an exception, post the entire stack trace. … ![]() |
![]() | Re: I've never used Swing/AWT but I suppose the answer to this question is pretty generic; you basically "append" the new value to the existing value rather than setting the new value as it is. So if "txtBox" is your text field, after a key is pressed, you might want to … ![]() |
Re: [quote=mattyd;318101]You are correct, Sir.[/quote] I guess that would be Madame.... ;) [B]wrcanilg[/B] | |
Re: On a related note, something which you should always keep in mind when writing code is to follow the principle of least intrusion when it comes to defining contracts; be it between methods of the same class or when exposing an external API. Let's take a trivial example of printing … | |
Re: Though I personally haven't used it, [URL="http://code.google.com/p/jmonkeyengine/"]jMonkey game engin[/URL]e looks pretty impressive. | |
Re: As per [URL="http://mindprod.com/jgloss/javacmain.html"]this article[/URL], this feature is undocumented and deprecated. If you still want to use it, the article presents presumably correct usage of the class. If you are using Java 6+, I'd recommend using the new compiler API which doesn't tie you down to a specific implementation (i.e. Sun … | |
Re: If you are open to a pure Java DB, I'd recommend [URL="http://www.h2database.com/html/performance.html"]having a look at H2[/URL]. It's faster than HSQLDB. H2 can also be used in embedded mode. Read [URL="http://stackoverflow.com/questions/154636/embedding-the-java-h2-database-programmatically/155423#155423"]this [/URL]and [URL="http://www.h2database.com/html/quickstart.html"]this [/URL]for more info. | |
Re: You are missing the assignment to "value" field of your object i.e. [icode]this.value = s[/icode]. | |
Re: [quote]what's thew benefits of dynamic loading in java?[/quote] DI frameworks like Spring are based around the concept of dynamically loading classes on fly and creating objects (aka beans) using them on demand or lazily. A servlet implementation like Tomcat picks up user defined class name from the web.xml file and … | |
Re: Please use proper punctuation and formatting, your posts are difficult to read. Also please don't use l337 speak. | |
Re: As per [URL="http://stackoverflow.com/questions/575772/the-best-way-to-calculate-the-height-in-a-binary-search-tree-balancing-an-avl-t/575859#575859"]this[/URL], the basic algorithm for calculating the height of a binary tree is: [code]height(node): if node == null: return 0 else: max(height(node.L), height(node.R)) + 1 [/code] Now come up with an implementation and post your updated code if it still doesn't work. | |
Re: > I just noticed that daniweb profiles are web searchable. I wasn't expecting this Really? | |
Re: This happens because you don't "search" for the appropriate parent node for the new node to be inserted. You'd need a solution which recursively or within a loop searches for an appropriate parent to whose left/right the new node would be inserted. Read the basic algorithm [URL="http://cslibrary.stanford.edu/110/BinaryTrees.html"]here[/URL]. | |
Re: [QUOTE=kkeith29;735106]here is the download link: [url]http://www.banditssoftball.org/chat.v3.zip[/url] Please remember that this chat will not support a lot of users. Its writing to a file and once that many people are trying to read and write from it, it will start to delete messages unexpectedly. I created it to use as a … | |
Re: IMO implementing hybrid protocols has always been a problem. Just thinking out loud here but it seems that in your case the server has no way of knowing when the "file transfer" has completed and the user now wants to pass across a string message to the server. Also, I … | |
Re: Sorry can't be done; it's against the site rules to delete threads which don't violate the rules. I see that you have asked around 15 questions in the Python forum. Deleting the threads would be make the efforts put in by the contributors go down the drain. Of course, we … | |
Re: Think of environment variables as OS specific variables e.g. JAVA_HOME. In windows you set them using the command [icode]set JAVA_HOME="c:/Java"[/icode], in *nix, you do it as [icode]export JAVA_HOME=/env/java[/icode]. [URL="http://en.wikipedia.org/wiki/Environment_variable"]More info here[/URL]. AFAIK, the CLASSPATH environment variable is used by your JVM process to "search" for classes. But I would rather … | |
Re: This can't be done in Javascript since its a client side technology. The only thing a Javascript code can store on client's machine is cookies which can't exceed 4KB, so I guess its out of question. You would require some sort of server side language with a database to store … | |
Re: Take a look at the generated source code, try to analyze it and you would know the answer to all your questions. | |
Re: Definitely strange that a fresh rewrite using Eclipse/Netbeans didn't work. I can't speak for Netbeans but with Eclipse how are you creating a fresh project? Are you able to run a simple "hello world" code in Eclipse? | |
Re: Use the Calendar class for performing Date related operations, esp the add() and set() methods. A sample snippet in Groovy: [code]import java.util.* def c = Calendar.getInstance() c.set(Calendar.DAY_OF_MONTH, 2) c.set(Calendar.MONTH, 2) // c now contains the date 2nd of March 2011 def i = 1 while(i <= 7) { c.add(Calendar.DAY_OF_MONTH, -1) … | |
Re: It would be a bit difficult to diagnose the problem without having a look at the setup. Do you get the same error for a fresh java project created which contains a single Hello world code? The build file shouldn't be a problem since AFAIK it is auto-generated by Netbeans … | |
Re: Have a look at the Javaworld article '[URL="http://www.javaworld.com/javaworld/jw-09-2004/jw-0927-logout.html"]Solving the logout problem elegantly[/URL]' to get a fair idea of how to go about doing things. | |
Re: > "Flag bad post" In case you want to rectify something you posted (of course given it follows the rules) after the 30 minute edit time frame or you have a duplicate post which you want to flag for deletion. > "Post Reply" You want to quote yourself or add … | |
Re: Simply put it this way, when ur applications demands a particular Fibonacci number (for eg. the 10th fibonacci number) then GOLDEN RATIO is the way to do it and if u require the whole series of numbers then the incremental method is the way. | |
Re: [quote]can som1 teach me on how to put this into a link and so that u can see how it looks..>? thnx! admins![/quote] Hi hellB0y, welcome to Daniweb. :) Regarding links, Daniweb doesn't support rendering of ad-hoc HTML. If you want to style your text (add hyperlinks, italics, bold etc.), … | |
![]() | Re: What do you mean by "call back"? The simplest and the logical way would be to change the return type of your method to "Vector". Some other approaches would be to pass in a reference to Vector and update the Vector in your "multiply" method or have a static member … ![]() |
Re: AFAIK, you'll get NULL only if you request the value of a form element which is not present in your form. If "name"/"address"/"username"/"password" are valid form fields, their value would be a blank string and not NULL in case you leave those fields blank. | |
Re: The simplest solution would be to use the "startsWith" method of the String class and inspect each and every dictionary entry whether it starts with the user input. But this approach can become unwieldy if the dictionary has a *lot* of entries since it means scanning the entire dictionary for … | |
Re: [quote]Does garbage collection occurs in PERM Area of Java Heap ?[/quote] AFAIK, yes. This aspect doesn't come into play a lot when doing regular development and using already existing libraries but becomes apparent when you implement custom classloaders and manage class loading dynamically. One e.g. would be Tomcat servlet container. … | |
Re: Glad to see that interacting with fellow C#ers on Daniweb has helped you excel in your assignment. If you ever think of giving back to the community, just help out others in need in the C# forum. It would increase your knowledge along with helping out others who are struggling … | |
Re: > my PL told me that someone do hacking if they are able to see the URL Then your PL doesn't know what he is talking about. You don't achieve security by *hiding* URL's but by having a robust security framework in place for your application. Java, of all the … | |
Re: What code are you using to "spawn" the batch file in Java? | |
Re: How are you launching the application? Make sure that the driver JAR is listed in the classpath when you launch the application and you should be good to go. [code]java -cp app.jar:mysql.jar your.pkg.MainClass[/code] Also, never ever mess with your default JDK installation. If your application requires a third-party JAR, supply … | |
Re: [quote]Pick any members you find interesting and describe how you imagine them to look/act in real life. [/quote] OK, I guess I'll just describe a few members here with one liners: [B]Narue-chan[/B]: Someone who bullies everyone everywhere; be it a MMORPG or an interview. I've always imagined you as a … | |
Re: You need to tell us: * The directory structure * The command you are executing on the command line | |
Re: You might find a [URL="http://www.daniweb.com/forums/thread340158.html"]similar thread[/URL] helpful. | |
Re: [quote]i got a such type of error in junit+struts2 +spring[/quote] If you are "testing" your web application as opposed to individual Java components (which is what JUnit does), look into frameworks specifically tailored for those needs. IMO, a proper abstraction here would be to use Cactus or HttpUnit for testing … | |
Re: [quote]i know the method will be the same and both will essentially do the same thing. but why two ways to initializing arraylist?[/quote] The second form is called "programming to an interface". Any further use of "myList" in your code would adhere to the "List" interface and as such would … |
The End.