3,892 Posted Topics
Re: [quote]Im not sure wht does the question want by meaning this “Each thread adds 1 to a variable sum that initially zero”…[/quote] First off; the question explicitly mentions "launching" threads which is bit different from creating a "pool" of threads. No need to extend the `Thread` class, just make your … | |
Re: > Is it "difficult" to do? It depends, but yes, in general I wouldn't shy from using the words "laborious" and "verbose" when it comes to wrapping native code. The process goes something along these lines: [LIST=1] [*]Create a new C or C++ project which would act as a "wrapper" … | |
Re: > It returns true in this case since the character sequence "mat" matches the "onomatopoeia". Really? Have you tried running the example you posted? If yes, post a working code which proves your point. > I want it to return true only and only if the whole word onomatopoeia is … | |
Re: The term you should be looking for is Java RESTful framework. These frameworks basically allow you to create xml/json/XXX enabled HTTP services by mapping your output object to XML/JSON elements. There are a few frameworks which I'm aware of (but never used): * Restlet * Resteasy * Jersey The tutorial … | |
Re: That is because you are pretty much ignoring the exception it throws (line 28 and line 39) which is a bad thing. Never catch exceptions only to replace them with "print" statements or worst, with an empty catch block. Till you incorporate a logger in your application (which IMO every … | |
Hi folks, When browsing technical sub-forums, I noticed that there are a few threads which end with the OP replying "Thanks, it's solved/working now!" or something to that effect and are still not marked solved. Similar is the case with one-shot-posters who post a query which is duly answered but … | |
Re: This is actually a bug/enhancement request which was fixed in JDK 7. Previously, adding a single non-comparable element to the TreeSet didn't cause any problem but as soon as a second one was added, it caused ClassCastException because the existing object was cast to Comparable to determine the location of … | |
Re: [quote]hi am making project..i have entered the record in 8 columns of table using jdbc and 9th column is automatically icremented as primary..so after putting the record and executin query i want to check primary no which i get..i want to show it in text box..what can be the query...??[/quote] … | |
| |
Re: Your quoting seems to be off. Try something like: [code] <script type="text/javascript"> function redirectUser() { var url = '<%= response.encodeURL("http://www.mysite/index.jsp?switch="+ intvariable) %>'; window.location.href = url; } </script> <!-- more code --> <input type="button" value="Copy" onclick="redirectUser();">[/code] | |
Re: IMO [ICODE]Scanner [/ICODE]is much more than just another I/O class with a pretty interface/API; it has advanced parsing capabilities which attempts to remove the utility class most programmers create to process the strings read in by a normal reader. It is pretty much capable of reading and performing complicated processing … | |
Re: Maybe this should be a good starting point: [code=java] // Untested import java.net.*; import java.io.*; public class A { public static void main(String args[]) { try { ServerSocket ss = new ServerSocket(); ss.bind(new InetSocketAddress(100)); System.out.println("Application started"); Thread.sleep(1000000000); } catch (SocketException e) { System.out.println("Application already running"); System.exit(1); } catch(Exception e) { … | |
Re: $ is used as a separation marker for denoting inner classes. For e.g. consider the following class: [code]public class MyWidget { static class Oh { } public void doIt() { final Runnable r1 = new Runnable() { @Override public void run() { } }; final Runnable r2 = new Runnable() … | |
Re: Are you able to ping the given IP address? Can you connect to the database using a SQL explorer like MySQL workbench on the given port? How are you confirming that the database really is alive? | |
Re: [quote=iamthwee;252869] In regards to the how do 'I delete a line from the file problem',you should know that [B]deleting[/B] doesn't actually exist. Rather, you give the illusion of deletion by:- 1. [B]copying the contents of the original file into memory[/B], 2. change the a variable of that file whilst in … | |
Re: [QUOTE=cwarn23;1671706]Hi, I not long ago create a youtube video titled "How to RTFM for Dummies" and so far I have 10 dislikes and 0 likes from 59 views. So does this mean people don't like to read the manual anymore or is it that they don't like being told to … | |
Re: [quote]And... anyone here play any good MMO like Ragnarok etc.?[/quote] I used to play Ragnarok a long time back but botters/harvesters/powerlevellers have ruined the game IMO. Plus the community isn't *that* great (I'm talking about iRO here). I started playing [URL="http://everquest2.com/free_to_play/game_overview"]EQ2 [/URL]a few months back and am finding it pretty … | |
Re: > Thought this was a feedback forum. If moderators/admins don't like > honest feedback, why not have a "Daniweb Community Feedback" for > ****-lickers only. Keep things on topic; there is absolutely no need to throw around verbal filth and make irrelevant generalizations about mods and admins. | |
Re: Indeed; RIP John and thanks a lot for your contributions to the computing world. :( | |
Re: [quote]But /how/ do I encrypt it? In PHP there's a simple md5() function, isn't there some equivalent in Java?[/quote] MD5 is not encryption but just a one-way/irreversible hashing algorithm. You have two different issues here: storing password in secure format and sending across password over the network in a secure … | |
Re: Here the entry level salary is around 8K USD per annum (when converted from INR). Very less I guess compared to other countries. No wonder everyone wants to move out... | |
![]() | Re: Happy Diwali to all the members of Daniweb. Wishing you all a shining and prosperous year ahead. :) Regards, Sanjay. |
Re: Assuming your palindrome logic ignores case, here is one solution: [code=java] String str = "AB , ba"; StringBuffer sb = new StringBuffer(str).reverse(); String strRev = sb.toString(); if(str.equalsIgnoreCase(strRev)) System.out.println("Palindrome"); else System.out.println("Not a Palindrome"); [/code] | |
Re: To me, being the best means much more than being lean and mean, so yeah, it's Firefox for me; can't beat those add-ons. :-) | |
Re: Your Deck class contains a lot of compile time errors. You can't call "add" on an array in Java. Did you mean to use ArrayList class? Also, there is no reason why enums inside the Card class should be non-static since they anyways are not dependent on the instance of … | |
Re: There isn't much background to comment on. Sure, Java + JDBC works pretty good for accessing almost all kinds of RMDSes. Things you might want to keep in mind? To start off (assuming you are new to JDBC): 1) Use Type 4 JDBC thin driver (pure Java driver) instead of … | |
Re: The ideal way would be to use some sort of artifact manager like Maven or Ivy to manage your libraries. If you aren't aware of any of those and want to get started as quickly as you can, visit: [url]http://mvnrepository.com/artifact/jfree[/url] and download the latest versions of "jcommon" and "jfreechart". Put … | |
Re: > Anything that you post in there can only be seen by yourself as well as moderators/staff writers Just FYI, I can't see anything in there. Are you sure it's not "staff-writers-only"? Or is it that nothing has yet been submitted? | |
Re: > but I would like to know that I haven't been abandoned. Maybe because those who visit the feedback section are not too much into fancy graphs and charts? Honest question: given the kind of resource investment (programming/hardware/maintenance) this requires, what does adding this/these features buy to the site as … | |
Re: What JDBC driver version? Are you able to the database using a database explorer software like SQLDeveloper? Also, instead of the connection URL you are using, can you try using the one mentioned in [URL="http://java.dzone.com/articles/hibernatecfgxml-settings-derby"]this article[/URL]? | |
Re: Too long a question and many queries lumped together in a single post. You might want to post the minimum code required for presenting the question and add more code if requested. Plus, posting queries in code snippet as comments in a bad idea and I'm pretty sure those who … | |
Re: The line highlighted in green is your "[URL="http://download.oracle.com/javase/tutorial/java/javaOO/constructors.html"]constructor[/URL]" definition. Constructors are special methods in the sense that they don't have a return type and you are not allowed to provide one. The name of the constructor should be exactly the same as the name of your class or put in … | |
Re: [URL="http://download.eclipse.org/eclipse/downloads/drops/R-3.6.2-201102101200/index.php#SWT"]This page[/URL] seems to provide the 64bit binaries for 3.6.2 version. | |
Re: Before assuming anything just do a [ICODE]System.out.println(Connector.open(url).getClass())[/ICODE] and see which class instance are you actually trying to cast. | |
Re: Are all those classes in separate Java files? How are you running the UseDir class? | |
Re: > I get an error message every so often with this code. > 'document.getElementById(...)' is null or not an object. Because there exists no element with the given ID. It looks as though the ID for your form elements are dynamically generated and hence the intermittent problem. A better way … | |
Re: Changing a system which works for 99% of the people out there doesn't make any sense. | |
Re: You can, though it would require a bit of effort. Look into Webdriver/Selenium libraries for Java. | |
Re: I would strongly recommend you to try to simulate the programs you have written during your C days in C++. That would help you in gaining an OO perspective and make it to approach every problem in the OO way. Jumping head on in complex projects would only cause total … | |
[URL="http://www.youtube.com/watch?v=b-Cr0EWwaTk&feature=player_embedded#!"]An Oracle produced song to promote Java; fun stuff[/URL]. ;-) Lyrics at: [url]http://www.adam-bien.com/roller/abien/entry/code_hard_with_java[/url] | |
Re: Try using forward slashes (//) instead of backward ones (\\) and pass in the [icode]integratedSecurity=true[/icode] property in the connection string if you are using windows credentials. More info on official pages: [url]http://msdn.microsoft.com/en-us/library/ms378988.aspx[/url] | |
Re: RIP Steve. Such is cancer I guess. :-( BTW, for those wondering about the new iPhone 4S, it's iPhone for Steve. Also, I'll just [URL="http://i.imgur.com/dT1Ra.png"]leave this here[/URL]. | |
Re: [quote=jwenting;313013]no, endl should be the standard way to do things. \n is not portable, it's a throwback to C.[/quote] LF or newline is a character which belongs to the ASCII character set. Is priting out characters using streams non portable ? Cit any one situation which showcases its non portability.... | |
Re: > don't forget those code tags! Please consider reporting such posts so that moderators can add tags to posts which can't be modified by the OP after the 30 minute time frame. | |
Re: Also have a look at [URL="https://github.com/kennethreitz/envoy"]Envoy[/URL] by Kenneth. Similar approach with a few more abstractions. | |
Re: A simpler approach would be to parse out an object (let's say for example PropertyInfo object) from each line in the file and then do the processing rather than parsing the file multiple times and searching for selective information. Steps: [LIST=1] [*]For each line in the file [*]Read the line … | |
Re: > please help me in this problem, how to add /r/n in end of every line of a file in java. Are you really required to use Java? If not, the simplest and fastest way would be to use "unix2dos" utility if you are on a Unix box or just … | |
Re: AFAIK, not possible since there is nothing which can be used to infer the type T in there. I'm assuming here that the aim is to ensure a Collection satisfies a given criteria. In that case, the simplest solution would be to create a separate method for the piece of … | |
Re: > I was wondering which language should learn. I do not want to be a programmer for a job(at the moment I am a young teen) in the future, I would like to be a physicist. Python and C++ is a pretty good combination. Python is particularly forgiving to beginners … | |
Re: Typically aimed at mocking newbies (in an offensive sort of way) who try out wrong things and wonder why it doesn't work (read it on some blog): [quote]hey guys I keep shoving cucumbers up my a** but I’m still hungry[/quote] Typical state of an open source project: (some github project) … |
The End.