3,892 Posted Topics

Member Avatar for RM@Bowdoin

Make `scan` a private static variable and initialize it in the main() method. In that case, you'd be able to use `scan` in all your static methods. In case you decide to clean up stuff, just remove the static modifier from the scan declaration and all the methods and it …

Member Avatar for ~s.o.s~
0
339
Member Avatar for Ezzaral

To add to the above posts, make sure you quote your keywords if you are looking for an exact match. For e.g. if you are looking for sessions word in PHP code snippets, your query should be: site:daniweb.com/web-development/php/code "sessions". Without quoting session, you'll get code snippets containing both the words, …

Member Avatar for Dani
0
194
Member Avatar for rm_java

What exactly is the problem here? You want to test out your binary tree? Also, is it required that you create one and not use the set data structure present in the Java standard library?

Member Avatar for ~s.o.s~
0
122
Member Avatar for anand01

> can any one tell me how to find unique values in array list? Assuming your items of the `List' implement an appropriate equals/hashCode() method or the Comparable interface, converting it to a `Set' would be the simplest way to get the unique elements.

Member Avatar for anand01
0
3K
Member Avatar for OblibSystems

> Put simply i'm asking "What are the most common and effective languages used in industry?" Try to stick with the ones taught in your curriculum since you would anyways expected to know them once you are done with your degree. AFAIK, C++ and Java are pretty common these days …

Member Avatar for sergent
0
391
Member Avatar for Dani

> I seems Dani and I are the only two active team members left -- what happened to everyone else? Maybe a concept like the one used at Devshed should rope in a few more members. Of course considering that you need really good computers to Fold, only the ones …

Member Avatar for mitrmkar
4
2K
Member Avatar for adarshcu

> My question is whether this has been a new feature added to java 6 or am i missing something ? This compiler enhancement was added in Java 5. The above code compiles fine in Java 1.4. I'd recommend getting the most recent version of the SCJP book if you …

Member Avatar for pavanvusirika
0
153
Member Avatar for alliswim2010

Another solution would be to use the DecimalFormat class. [code] public static void main(String[] args) throws Exception { double[] doubles = {5.300000000000001, 123231.600000000000001, 88.695555555 }; final DecimalFormat fmt = new DecimalFormat(".00"); for (double d : doubles) { System.out.println(fmt.format(d)); } }[/code]

Member Avatar for ~s.o.s~
0
728
Member Avatar for jmelotte

Maybe posting the problem [URL="http://newsreader.mathworks.com/WebX?14@646.XC9QbYZt9L3@/comp.soft-sys.matlab"]here[/URL] would be more productive.

Member Avatar for vijay_smile18
0
389
Member Avatar for NormR1

> Is there an easy to use tool that OPs could use to find variable's whose class level definitions are Shadowed by local definitions of variables with the same name? Not exactly beginner friendly but any serious development house at least has "[URL="http://findbugs.sourceforge.net/"]FindBugs[/URL]" or "[URL="http://pmd.sourceforge.net/"]PMD[/URL]" running on their code bases …

Member Avatar for ~s.o.s~
0
182
Member Avatar for marirs07

[quote]Also, when a member alerts the administrators on a Bad Post, is there a feedback to such member maybe asking for more reasons why the post was flagged as a bad one letting him know the administrators verdict? [/quote] Such facility isn't built in the system but the moderator is …

Member Avatar for Netcode
0
180
Member Avatar for cse.avinash

Notepad is not a compiler, it's a text editor used for typing in Java code. If you are just starting out, I'd recommend grabbing any text editor which highlights the code for you along with smart indentation. There are a lot of options in there: Notepad++, Gedit, Scite etc. I've …

Member Avatar for hszforu
0
110
Member Avatar for G_S

> Adding to that, it might also be worthwhile using System.getProperty("file.separator") to ensure compatibility on as many systems as possible. Or better yet IMO, try not to mess with FS paths thinking of them as strings and use appropriate constructors:[code] final File homeDir = new File(System.getProperty("user.home")); final File defaultFileStore = …

Member Avatar for ~s.o.s~
0
212
Member Avatar for Phaelax

[quote=Ancient Dragon;293460]std::string has a function [B]size()[/B] that will tell the current size. [code] void addNodes(string names[]) { cout << "size of array is " << names.size() << "\n"; } [/code] [/quote] Hmm...you are forgetting that [I]names [/I]is an array of strings and not a std::string or a vector. So you …

Member Avatar for Diego.Corso
0
27K
Member Avatar for MooGeek

If you are *really* creating *that* app, the icon should be the least of your concerns... ;-)

Member Avatar for Netcode
0
204
Member Avatar for keeda

Unfortunately no easy way of doing this. There are two contenders in Java land (assuming you are talking about actually interacting with pages rather than just scraping the web page ignoring the JS part): HtmlUnit and Selenium. HtmlUnit works pretty good for simple and compliant web pages. I have successfully …

Member Avatar for ~s.o.s~
0
188
Member Avatar for nikelin

> Here is latest version of loader: [url]https://github.com/nikelin/Redshape-...cesLoader.java[/url] A few observations: [LIST] [*]Line 20; don't work with raw string paths. As soon as the user passes in a root directory, create a File object out of it or better yet ask the user to pass in a "real" directory in …

Member Avatar for JamesCherrill
0
409
Member Avatar for ankit.pandey3

> I try to connect with mysql (port-3306). Above code works properly in localhost but when i try it with ip of my server (173.255.216.128) it gives following error This seems like a configuration issue. Are you able to ping this host? Are you able to connect to this host …

Member Avatar for ~s.o.s~
0
418
Member Avatar for BuhRock

Not much details to help you out. Please post the shortest possible compilable code which showcases your problem and mention "what exact" errors or problems you are facing (with complete stacktrace or message if any).

Member Avatar for ~s.o.s~
0
381
Member Avatar for simply2smart

This seems like a display issue. Where exactly are you observing this behaviour? If in an IDE console, can you try running the same code from command line and check whether it works or not?

Member Avatar for javaAddict
0
200
Member Avatar for MoZo1

AFAIK, you require "superuser" (also called as "root") privileges for binding to ports below 1024 and `sudo` does exactly that, run the program as a "superuser". From the sudo wikipedia entry: [quote]By default, sudo will prompt for a user password but it may be configured to require the root password, …

Member Avatar for MoZo1
0
425
Member Avatar for chiiqui

A few months back Google had acquired an organization which specialized in created UI builders for Swing / SWT (the toolkit which powers Eclipse) and open sourced it. Not sure how good it is [URL="http://code.google.com/javadevtools/wbpro/index.html"]but worth a try[/URL] if you are into creating drag-n-drop UI's.

Member Avatar for chiiqui
0
399
Member Avatar for stevanity

Depends on how good your preparations are. Kathy Sierra books are pretty good when it comes to certification preparation, for e.g. [URL="http://www.amazon.com/SCJP-Certified-Programmer-Java-310-065/dp/0071591060"]this one for SCJP 6[/URL](called something else now but doesn't matter AFAIK). The secret is to not just "read" the book but also try out the examples "without" blindly …

Member Avatar for peter_budo
0
132
Member Avatar for Reverend Jim

You are by default capable of awarding x and y number of points to the user where x and y is your power to influence a fellow Daniweb member's reputation in a positive and negative manner respectively. For e.g. you can positively influence by +4 and negatively by -1. AFAIK, …

Member Avatar for Dani
0
148
Member Avatar for Chaky

Hehe so why do you think those illegal groups who rip softwares are born..because of the very reason Chaky is stating. I also think that the base or the foundation should be made free or alteast a bit cheap so that each and every person can afford it. The reason …

Member Avatar for crunchie
0
482
Member Avatar for thebigbroski

If you want to modify a `List` while iterating on it, the simplest solution would be to use a list iterator as opposed to a regular iterator. List iterators allow destructive updates on the list while iterating over it. [code]public static void main(String[] args) throws Exception { List<String> lst = …

Member Avatar for JamesCherrill
0
123
Member Avatar for Duki

There is no "pure Java" way of doing that. There are a couple of "curses" bindings floating around for Java but that's it. The mess of outputting a bunch of line feeds is nothing compared to considering using a full fledged JNI-dependent third party library just for a better console …

Member Avatar for ~s.o.s~
0
430
Member Avatar for yapkm01

[quote]I don't see the difference between <?> (Unbounded wildcard) and <? extends Objects> (Since Object is the highest upper bound in Java)[/quote] Interesting; you are indeed correct in quoting that there is absolutely no difference between "?" and "? extends Object" [i]except[/i] for the fact that parameterized types with unbounded …

Member Avatar for ~s.o.s~
0
182
Member Avatar for jingda

I have deleted the groups since they didn't have a lot of members to begin with. I'll probably kick off a discussion in the mod forums related to this since this is pretty close to deleting threads on demand, which we don't allow right now. I'm sure you would exercise …

Member Avatar for peter_budo
0
189
Member Avatar for hybr!d
Member Avatar for David321

> Morning? Its afternoon... Frigging timezones, how do they work? :-)

Member Avatar for ~s.o.s~
0
168
Member Avatar for Duki
Member Avatar for kingsonprisonic
0
1K
Member Avatar for ~s.o.s~

If anyone out there is interested in Indian / Pakistani music but wondered what to search for or where to look for it, I would be posting some links. To start of here is [I]Ek din aayega(a day will come) - by JAL. [/I][url]http://www.youtube.com/watch?v=oz-D1R4nUUo[/url] If you like the song just …

Member Avatar for crunchie
0
185
Member Avatar for JasonHippy

> Last summer, we came up with tshirts with the slogans that a lot of you came up with in the discussion thread that Nick Evan referenced Hey, you could at least post the pics of the shirts for the community if you are using their slogans ya know. :-)

Member Avatar for Kerry W
2
644
Member Avatar for Shanti C

[QUOTE=Shanti Chepuru;714479]validation of an url.. got from google search.. [code] var theurl=document.formaddad.url.value; var tomatch= /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/ if (!tomatch.test(theurl)) { window.alert("URL invalid..See the example giving beside the textbox."); a.url.focus(); return false; } [/code][/QUOTE] Today I learned that 'http://...zzz' is a valid URL.... [QUOTE=Ene Uran;717671]I learned to eat lobster.[/QUOTE] So is it that …

Member Avatar for Netcode
0
924
Member Avatar for ankit_the_hawk

[quote=apurv;304610]try using... fflush(stdin); after every gets();[/quote] Bad, bad really bad. [URL="http://www.gidnetwork.com/b-57.html"]Read this[/URL].

Member Avatar for thisun
0
13K
Member Avatar for Dani
Member Avatar for The Dude
0
395
Member Avatar for ~s.o.s~

Hello to all Gamedevelopers out there. Many of your have already wanted to get into game development but came to a stand still due to the lack of resources. [B]Please don't post Spam or Thank you posts in this thread since this is meant to be used as a guide …

Member Avatar for Serapth
4
3K
Member Avatar for wonder_laptop

I think you should post your solution or what you did to solve the issue to help out those who stumble upon this thread in the future. :)

Member Avatar for ahmed0725
0
224
Member Avatar for Netcode

> But when you need quick answers you always want to get in touch with someone who is online. This more or less amounts to " paid consulting" (if you want to get things done your way) and there are quite a few sites which engage in this sort of …

Member Avatar for Netcode
-1
193
Member Avatar for shasta90

I did something similar a long back when I was playing around with Python. You can find my scribblings [URL="https://gist.github.com/1057999"]here[/URL]; just adjust the method calls and you should be able to understand how it works. The trick here is to think in terms of co-ordinate, try to plot stuff on …

Member Avatar for ~s.o.s~
0
1K
Member Avatar for jaepi

[URL="http://www.daniweb.com/techtalkforums/post191438-3.html"]Why atoi is bad...[/URL] [inlinecode]strtol[/inlinecode] is what you should be looking for.

Member Avatar for WaltP
0
1K
Member Avatar for 2Dcube

[INLINECODE]system[/INLINECODE] function calls in C / C++ invoke the operating system functionality (here [INLINECODE]cls[/INLINECODE]) so the context has to be changed and control be handed from the currently running program to the Operating System to invoke the clear screen function. Using the method posted by Joey won't invoke OS functions …

Member Avatar for WaltP
0
2K
Member Avatar for pseudorandom21

There are a lot of websites out there which provide source code hosting. Few of them are Google Code (supports svn, hg, git), Github (git) and Bitbucket (hg + private repositories). Github is pretty famous (in terms of activity) and Bitbucket is the only one AFAIK which provides unlimited private …

Member Avatar for pseudorandom21
0
204
Member Avatar for blackcathacker

You can create a [URL="http://www.daniweb.com/forums/group.php"]group here[/URL]. Just make sure that you search the existing groups out there to see if there already exists one (or pretty close to)suiting your needs. Also, any self-promotional groups would be immediately deleted. EDIT: Drats; this is what you get for working against an old …

Member Avatar for Nick Evan
0
237
Member Avatar for arindam31

This seems like a direct-copy paste of [url]http://letshare.it/blog/regular-expression-beginner.html[/url] Do you own that content?

Member Avatar for arindam31
-1
239
Member Avatar for harinath_2007

Looking forward to the new G1 collector which claims to be better than the CMS collector used by JDK 6. Also, it seems that they fixed the `TreeSet' to throw an exception when a non-comparable item is added to it (previously the the exception was thrown when you tried adding …

Member Avatar for jwenting
0
138
Member Avatar for wingwarp

[quote=wingwarp]if you have read or use [U]Learn C++ in 24hours [/U]is it a good book to learn form or is it a [B]pile of paper to burn?[/B]... or object oriented Programming in c++ is that a good (graphics) bbok?[/quote] [I]You should be really ashamed of yourself saying such a stmt.[/I] …

Member Avatar for tiredoy
0
451
Member Avatar for WaltP

[quote]I'm sorry, but that's BS! A button that is clearly labeled multi-quote as it is on numerous other forums is not confusing & frustrating.[/quote] Sorry, I don't agree with this. If I press a button and it just "glows" up without doing anything, it is confusing. Sure, it's useful when …

Member Avatar for Ezzaral
1
188
Member Avatar for Carmenchi

Moved the thread. BTW, consider the possibility of your account being compromised and some third party entity already knowing your current user name and password. You should ASAP get your password changed and then think of finding out *how* exactly this happened.

Member Avatar for jholland1964
0
148

The End.