184 Posted Topics
Re: in java , if you dont provide a constructor , java provides one for you , but if you do give one , then java will follow that constructor only. you have a constructor for objectView , but you dont put anything inside it. plus , i dont think i … | |
my host is XP sp2 , and virtual box guest is XP SP3. i want to access the guest from the host. I read and felt that a host-only network is what i want.( ill be using it to use database loaded on guest from the host). i googled it … | |
Re: though not related to the problem (which IIM solves above) , but , you should update your java version. A lot of nasty things are roaming all over cyberspace , each new update helps in making the holes a bit smaller for them to enter your system through. | |
Re: inheritance is really handy in eliminating duplicate code, and making the overall code more compact, since doctor and patient have things in common, its handy to put the common stuff in a superclass. as regards > Can't we use only the children, since they will also have the setter method … | |
i basically need mySQL for learning JDBC connections. will be thankful to any information regarding this matter. didnt find anything concrete on the net... | |
recently , iv started using both Visual Studio 2010 (to learn C#) and i came across eclipse WindowsBuilder ( and i'm loving it.. ). so i was wondering how do these two compare against each other ... strengths and weaknesses ? iv only begun using VS , but i do … | |
Re: C , about 4 years ago. but then i didnt have my own pc , and shared work on our college lab's turbo C running machines never seemed fun , especially as we got only 40 mins per week. it was in early 2010 after getting my own pc , … ![]() | |
hi everyone :) im trying to open this project , but when i double click it , vs2010 opens with error on the forms. double clicking the forms shows that the file doesnt exist at the particular directory , even when its visibly there. its probably a trivial thing , … | |
i grew up with cartoon network and animax... cartoon network has gone bogus , but i dont feel the same for animax. i saw that SOS , the admin from the java forum has baen nido (from Get Backers ) in his display pic, a character who used to be … | |
Re: i ran your code , seems to work... perhaps i didnt get your problem. by the way , > The largest row index : 2 > The largest column index : 2,3 i know i didnt understand that part... | |
Re: this.dollars = dollars; this.cents = cents; the "this" parts above will give you errors. the compiler is asking for a class instance whose dollar and cents variables will be updated , but this is being called from inside a static method. static methods/blocks are compiled first, everything else comes afterwards. … | |
i was thinking of downloading some database software that would help me learn sql. so far i have only *read* sql , ie havent done any practical sort of thing. i made a post earlier in this forum , where i was told that sql server express will be a … | |
hi everyone :) im hoping to learn a healthy amount of vb10/12 by the end of the month. mainly to improve my cv and get a better shot at jobs. originally wanted to learn vb6 for a college project , but after a post in daniweb , my ideas are … | |
hi everyone :) i want to learn vb6 , but i dont know where to start. I have a college project related to creating banking software where vb6 is being used as the frontend. i have around 1 month to get my vb6 skills up , as the project has … | |
Re: i only looked at it for a moment , but : Scanner keyboard = new Scanner(System.in); . . input = keyboard.nextInt(); Scanner scanner = new Scanner(System.in); if(input == 1){ System.out.println("Enter a new string: "); item = scanner.nextLine(); i quite dont get use of having two different scanners, also having a … | |
Re: what do you want the delimiters to be? how do you want to parse it? these are important factors when u decide to parse something, and im unable to get much information regarding these from your code. personally, iv always used bufferedReader and string split methods for parsing with good … | |
Re: you can pass the level of the shooter to the enemy class , then do a switch case statement like : shooting = true; switch(level){ // the shooters level case 1: counter = 20;// reset break; case 2: counter = 10; break; case 3: counter = 5; break; default: break; … | |
Re: by "client" what iv come to understand is the main method that runs classes and its methods in a particular fashion , to get a particular job done. u might hear terms like "test client" as such as well... they are basically a tester class with just the main method … | |
Re: welcome to daniweb :) maybe you could post for the other classes as well , that way members could run it and check out the nuances themselves.. not only that , but it would be more fun too .. :) good to play hangman :) however , at a first … | |
Re: System.out.println("How many positions do you want?"); int userInput = play.nextInt(); // this will lead to problems Clown[] circusClowns = new Clown[userInput]; for (int i = 0; i < circusClowns.length; i++) { System.out.print("Enter the name of the clown: "); name = play.nextLine(); this part of the posted code will lead to … | |
i was wondering if there could be some notification system like facebook which pops up a number as soon as something in your daniweb world has changed. currently , i have to refresh to get the info if im already watching the opened page , and if im opening daniweb … | |
Re: > Can someone explain what the Fibonacci series is? IIM n <M/> have already added java related information to fibonacci stuff... this post , isnt much about about java , but more about the numbers themselves . if you have seen/read the da vinci code , u might have heard … | |
Re: first of all , welcome to daniweb :) all the membesrs would love to help you out , but you should to show that you gave an effort to solving the problem too .. c'mon thats only fair :) if things didnt work out like that .. daniweb , or … | |
Re: 1st of all , i think your complicating your edge class too much... i havent looked at it in detail ,its a lot easier to just keep it as an innerclass of your linked list , and make a constructor as such head = new Node(); // in this case … | |
Re: add() can always work without main method.. this is a simple code showing that happening. import java.util.ArrayList; public class tester { ArrayList<String> arr = new ArrayList<String>(); public tester(){ arr.add("sure "); arr.add("it "); arr.add("does"); arr.add("... see :) "); for(String s : arr) System.out.print(s); } public static void main(String[] args){ tester t … | |
from today morning , my keyboard just cant keep up. i type a few words , and then it starts displaying the first letters! quite a trouble this ! i tried google-ing about keyboard becoming slow , but the few forum threads i found suggested a format, but thats not … | |
Re: not sure if "more" or "less" random really make much sense mathematically ... but maybe you could try a switch - case block , and run different code for different cases for different output of the random method.. that way , you can easily write up an increasing number of … | |
Re: you do not want your enemies to collide , but you havent mentioned what you do want them to do when a collision happens or aboout to happen... maybe if you fix that , its will be easier to comeup with algorithms. one possible way is the particle collision model … | |
Re: instead of while(current_node != null) { System.out.println(current_node.name+"\t"+current_node.age); current_node = current_node.next; } do this : while(current_node.next != null) // as the head (which the current node has been assinged ) is a sentinel , and actual data starts from the next node { System.out.println(current_node.name+"\t"+current_node.age); current_node = current_node.next; } also , in … | |
can anyone help me understand this code part ? this is about binary minimum heap , ie root has the lowest key.. the part of the code im trying to understand checks whether the subtree ( of a certain minHeap pq[1..N] ), rooted at k is also a min heap … | |
Re: can you give the customer code? at first glance , bits of your code seems redundant... like public void addCustomer(Customer c) { database.add(c); } your already doing this inside the try catch block.. so why keep this? public void readCustomerData(String CustomerNames) { try { File f = new File("CustomerNames.txt"); are … | |
Re: first of all , welcome to daniweb. :) now, regarding your code, when you say linked list as an array , im supposing this to be an implementation of a singly linked list. in which case , as you said , one array will hold the data , and another … | |
Re: both are good , and usually it depends on the particular code your working in. but if the 1st method can be done , ie if the values to set are known at the time the new instance is created , i cant see why not to use it... makes … | |
![]() | Re: your code will be slow for large "end" parameter, as it has to check for every number because of the for() loops. a faster method will be this : from the [wiki page for perfect numbers](http://en.wikipedia.org/wiki/Perfect_number) , ull get a formula with a variable p that all perfect numbers (48 … |
i wrote a code to implement some basics of priority queue , but apparantly its not giving desired output. the code is implemented using binary heap as its data structure. i tried tinkering here and there , nut no luck... i want to display a given number of max or … | |
Re: is there any particular reason ur keeping your readlines method static? edit : didnt see that james already posted there.... | |
Re: dont have much of a sweet tooth , i like hot spicy stuff ... but thats generally reserved for luch or dinner. as a snack , i might like some fresh peas , chilled mangoes , and some grated fresh coconut topped with some sugar. simple and light. :) | |
Re: james and radhakrishna already pointed out the things you should be doing.. i just saw that in ur isSolvable() method , ur doing this : if(((a*d) - (b*c)) == 0) return 0; else return 1; you dont need to have a if else structure for return.. once return is called … | |
Re: welcome to daniweb. :) > how can i make my 10 different program as one program would be good if you could explain a bit more about these "programs" . if you have written some code , post them here , that would speed up the problem solving procedure. :) | |
i want to sort a list of two dimensional points based on their polar angles with respect to a particular point. this will a part of a bigger code to find collinear objects from a set of points. the method i thought of for doing this is is: 1. create … | |
Re: perhaps this isnt a good place to post this query , but im doing so as my doubt relates to the if-else structure that has been talked about here... in this code // compare by y-coordinate, breaking ties by x-coordinate public int compareTo(Point2D that) { if (this.y < that.y) return … | |
Re: > import java.io.BufferedReader; > import java.io.IOException; > import java.io.InputStreamReader; it seems you didnt import java.util.ArrayList. without doing so , it arraylist wont work. > System.out.println("Last entry is "+users.get(initialCapacity)); this should be `System.out.println("Last entry is "+users.get(initialCapacity - 1));` as arraylists an arrays have the same convention regarding indices. else { if(users.size() … | |
Re: i agree with james , but then again , school/college teachers rarely follow the best practises... keep a circle class , it will have ONE variable only : radius. the methods will be setRadius() , getArea() , and if you need it, keep a getRadius() too. all these methods should … | |
Re: > is there a standard best/worst case for sorting algorithms? there are hundreds of sorting algorithms out there... some of them have different variations of themselves as well. they all have their own standard best/worst case complexity. example : considering two classic algorithms : quicksort and mergesort, quicksort has time … | |
Re: does this code do atleast some part of what you hoped it would? since your reading from a file , bufferedReader is a faster way of doing things. a part of a code i wrote for parsing purposes : try { is = new BufferedReader(new FileReader(fileName)); while ((line = is.readLine()) … | |
Re: > In other words, in each iteration, the odds of choosing the current value are: > (number of values still needed) / (number of values left to choose from) so if i have to find 'k' non reapeating numbers from a certain 'range' , and if i do this: ((obtained … | |
Re: @thetechie , welcome to daniweb :) regarding the problem above , have you tried writing some code? or do you want some algorithm of sorts? if you have some code, you can post it here , it would help the members to help you... to answer your question , try … | |
i have to create a queue where the dequeue operations will be random. that is , a random location will be chosen, and deleted after returning the data stored at that location. i was going through the two underlying datastructures that im allowed to use **:** linked list , and … | |
in an assingment, i have to implement a deque ( double ended queue ). the underlying datastructure is allowed to be arrays or linkedlist. only that im not allowed to use any prebuilt java api that does the above. (like the java.util.LinkedList api) implementing the above using doubly linked list … | |
forgive my ignorance, there must be a really simple answer to this, but im unaware of it, also, tried google-ing for it, but didnt know what to look for exactly, and didnt get much good answers either. my question is, since 2^32 is around 4Gb, so max usable RAM on … |
The End.