3,892 Posted Topics

Member Avatar for mrar85

[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 …

Member Avatar for mrar85
0
2K
Member Avatar for riahc3

> 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" …

Member Avatar for riahc3
0
2K
Member Avatar for asif49

> 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 …

Member Avatar for ~s.o.s~
0
150
Member Avatar for localp

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 …

Member Avatar for ~s.o.s~
0
146
Member Avatar for pro_learner

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 …

Member Avatar for harinath_2007
0
167
Member Avatar for ~s.o.s~

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 …

Member Avatar for Dani
2
358
Member Avatar for anand01

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 …

Member Avatar for ~s.o.s~
0
141
Member Avatar for abhishekarora

[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] …

Member Avatar for ~s.o.s~
0
96
Member Avatar for happygeek
Member Avatar for Dani
0
179
Member Avatar for MrJody

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]

Member Avatar for sarathpetec
0
1K
Member Avatar for javaAddict

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 …

Member Avatar for StephNicolaou
0
551
Member Avatar for vinod_javas

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) { …

Member Avatar for peter_budo
0
6K
Member Avatar for iamcreasy

$ 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() …

Member Avatar for iamcreasy
0
204
Member Avatar for sha11e

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?

Member Avatar for ~s.o.s~
0
210
Member Avatar for im4tion

[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 …

Member Avatar for santakdalai90
1
337
Member Avatar for cwarn23

[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 …

Member Avatar for NicAx64
0
472
Member Avatar for flagstar

[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 …

Member Avatar for jwenting
2
1K
Member Avatar for sknake

> 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.

Member Avatar for pseudorandom21
2
964
Member Avatar for BitBlt

Indeed; RIP John and thanks a lot for your contributions to the computing world. :(

Member Avatar for cwarn23
3
163
Member Avatar for sha11e

[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 …

Member Avatar for ~s.o.s~
0
107
Member Avatar for pyro 214

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...

Member Avatar for Ancient Dragon
0
1K
Member Avatar for thunderstorm98

Happy Diwali to all the members of Daniweb. Wishing you all a shining and prosperous year ahead. :) Regards, Sanjay.

Member Avatar for ~s.o.s~
0
239
Member Avatar for pavani2006

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]

Member Avatar for JamesCherrill
0
225
Member Avatar for adkool

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. :-)

Member Avatar for crunchie
2
896
Member Avatar for nickliutw

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 …

Member Avatar for ~s.o.s~
0
204
Member Avatar for xaelophorus

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 …

Member Avatar for ~s.o.s~
0
190
Member Avatar for rayden150

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 …

Member Avatar for ~s.o.s~
0
246
Member Avatar for cwarn23

> 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?

Member Avatar for cwarn23
0
517
Member Avatar for cwarn23

> 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 …

Member Avatar for Dani
0
179
Member Avatar for Slyvr

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]?

Member Avatar for Slyvr
0
1K
Member Avatar for Syrne

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 …

Member Avatar for ~s.o.s~
0
152
Member Avatar for gahhon

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 …

Member Avatar for ~s.o.s~
0
124
Member Avatar for ynwa

[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.

Member Avatar for ~s.o.s~
0
64
Member Avatar for Acidburn

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.

Member Avatar for Bens
0
165
Member Avatar for gyno

Are all those classes in separate Java files? How are you running the UseDir class?

Member Avatar for gyno
0
110
Member Avatar for Silo45

> 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 …

Member Avatar for Taywin
0
2K
Member Avatar for Dani

Changing a system which works for 99% of the people out there doesn't make any sense.

Member Avatar for happygeek
0
1K
Member Avatar for Priyank19

You can, though it would require a bit of effort. Look into Webdriver/Selenium libraries for Java.

Member Avatar for peter_budo
0
133
Member Avatar for may4life

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 …

Member Avatar for Serapth
0
2K
Member Avatar for ~s.o.s~

[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]

Member Avatar for Netcode
0
132
Member Avatar for bhagawatshinde

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]

Member Avatar for ~s.o.s~
0
88
Member Avatar for sergent

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].

Member Avatar for AliTheChamp
0
330
Member Avatar for fesago90

[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....

Member Avatar for seanwalsh1984
0
573
Member Avatar for hladdha.bhl2009

> 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.

Member Avatar for JoshuaBurleson
0
257
Member Avatar for Gribouillis

Also have a look at [URL="https://github.com/kennethreitz/envoy"]Envoy[/URL] by Kenneth. Similar approach with a few more abstractions.

Member Avatar for deonis
4
3K
Member Avatar for kweigand

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 …

Member Avatar for ~s.o.s~
0
676
Member Avatar for softswing

> 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 …

Member Avatar for softswing
0
124
Member Avatar for JamesCherrill

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 …

Member Avatar for ~s.o.s~
0
187
Member Avatar for yup790

> 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 …

Member Avatar for JamesCherrill
0
257
Member Avatar for WASDted

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) …

Member Avatar for Netcode
0
989

The End.