458 Posted Topics

Member Avatar for kiranpvsr

Which operating system are you using? Any service packs installed? Use hard drive diagnostic software to check the drive. See [url]http://www.hitachigst.com/hdd/support/download.htm[/url] Seagate has a program that works with some other vendor's drives. [url]http://www.seagate.com/www/en-us/support/downloads/seatools/[/url] Then click on "Download SeaTools for Windows now".

Member Avatar for mjdodd
-1
193
Member Avatar for cgeier

I am trying to automate a login to a website and then navigate to a webpage and retrieve the html from the page. I found some examples of how to login, but am having difficulty figuring out how to navigate to another page once logged in. I've read some information …

0
95
Member Avatar for NoviceChrilill

javaAddict's method is probably the best. If you are going to want additional numbers/indexes--like the 3rd or 4th smallest--you may just want to sort your array. Then the "smallest" numbers will have index of "n-1". Second smallest will have index of "2-1 = 1". Third smallest will have index of …

Member Avatar for unique72
0
591
Member Avatar for mompoleon

Did you install the Java JDK before installing textpad? I would recommend using NetBeans, it's a free download and can save a lot of programming time.

Member Avatar for dpirtle83
0
1K
Member Avatar for Web_Sailor

Use "RandomAccessFile". [url]http://java.sun.com/j2se/1.4.2/docs/api/java/io/RandomAccessFile.html[/url] [code=Java] private String readFirstLineOfFile(String fn){ String lineData = ""; try{ RandomAccessFile inFile = new RandomAccessFile(fn,"rw"); lineData = inFile.readLine(); inFile.close(); }//try catch(IOException ex){ System.err.println(ex.getMessage()); }//catch return lineData; } [/code]

Member Avatar for rAun007
0
8K
Member Avatar for hedwards09

You are missing a return statement. Also, to make it more effecient, use "else if" statements. [code=Java] public static int[] negativePositive(int[] arr) { int[] ret = new int[3]; int i = 0, e = arr.length; while (i < e) { if (arr[i] < 0) { ret[0]++; i++; } else if …

Member Avatar for hedwards09
0
97
Member Avatar for rfs_silent
Re: help

You have to decide if you want it to be graphical or a console application. If you want to have a console app, use Scanner to allow the user to hit the enter key until they specify that he/she wants to quit (ex: by entering "q"). Use "java.util.Random" to generate …

Member Avatar for cgeier
0
76
Member Avatar for jogc979021
Member Avatar for beholdafrica
Member Avatar for Jamalygirl

To be honest with you, your code gives the appearance that you combined your code with someone else's code. Check your variable names. I would recommend to choose a variable naming standard for yourself. You used "hourlyRate" in one place and "hourly_rate" in other places. This gives the appearance that …

Member Avatar for cgeier
0
129
Member Avatar for knight604

I think that your formulas are not correct. [url]http://math.about.com/od/formulas/ss/surfaceareavol_3.htm[/url] Check the documentation for "Math.pow". You are raising radius to the power of radius. To get data do something like the following: [code=Java] Scanner scan = new Scanner (System.in); //change the delimiter from space to newline in.useDelimiter("\n"); System.out.println ("Enter Radius:"); if …

Member Avatar for BestJewSinceJC
0
1K
Member Avatar for kadji.kahn

It's undersirable (in my opinion) to make the user re-enter all five scores just because ONE of them was wrong. Ask for each score individually using a for (or while) loop. You can also use "switch-case" statements in place of "if/else if" statements. Some considerations when writing a program include: …

Member Avatar for cgeier
0
153
Member Avatar for cgeier

I am trying to write a program to display the unicode character when a user enters a unicode character code. ex: If the user enters: "\u00C3" in the textfield, I want to display a capital "A" with a tilda (~) over the top of it. Here's my code so far: …

Member Avatar for cgeier
0
2K
Member Avatar for freelancelote

The documentation for BufferedReader states the following ..."Returns: A String containing the contents of the line, not including any line-termination characters, or null if the end of the stream has been reached." When you reach the end of the file, the value is "null". [url]http://java.sun.com/j2se/1.5.0/docs/api/java/io/BufferedReader.html#readLine() [/url] As Agni said, tmp …

Member Avatar for Agni
0
2K
Member Avatar for jen140

Here's a possible solution. Not sure what you are trying to accomplish, but this sounds like it should do it. There are probably better options. [code] int i; String myNumberAsString; myNumberAsString = Integer.toString(i); [/code] [url]http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Integer.html#toString(int)[/url] Then you can use the String function "charAt". [code] int indexNumber; char desiredDigit; String myDigitStr; …

Member Avatar for jen140
0
406
Member Avatar for MMD88

Use a for loop in you "vowelCount". Also, you can't print an array like that, use a for loop for that too. Look over the usage of "substring" again.

Member Avatar for MMD88
0
737
Member Avatar for lilbennett

How is your computer connected? Wireless or wired? What brand router are you using (and what version)? Have you tried reseting your router? Not unplugging and plugging it back in, but following the manufacture's instructions for reseting the router (probably pressing and holding the reset button, unplugging the power and …

Member Avatar for khess
1
113
Member Avatar for Hockeyfreak889

Check out "ArrayList", it resizes itself as necessary. If you choose to use it, you would create an "ArrayList" of your class (ex: "Employee").

Member Avatar for javaAddict
0
87
Member Avatar for gferrie

When using scanner if you use "next()", the data is in String format and needs to be converted. If you use, "nextInt" or "nextDouble", it converts the data for you automatically--consider using "hasNextInt()" or "hasNextDouble()" as well. Here's something to get you started. Create a new scanner. [code] Scanner in …

Member Avatar for Grn Xtrm
0
837
Member Avatar for gibson.nathan

When you are reading these integers in from your file, you can either insert them into an array, or just add them together as you read the line. When you read a line in from file, if you read it as text do the following to convert it to an …

Member Avatar for VernonDozier
0
109
Member Avatar for opethcire316

See the post #7 in the following article: [url]http://www.daniweb.com/forums/post999241.html#post999241[/url] . The "isInteger" method, basically does this, but rather than exiting the program, it returns false. You could use it as is (call the "isInteger" method), and then if it returns false, you have encountered a non-integer and can exit your …

Member Avatar for opethcire316
0
3K
Member Avatar for gibson.nathan

Looks like you are making good progress. After you get everything working, maybe rather than hard coding the number of trials, you want to prompt the user for this info. From your "Rolling Dice" post, it looks like you know how to use the scanner. Maybe it's too early yet, …

Member Avatar for VernonDozier
0
634
Member Avatar for Teethous

Change the following line from: [code] Scanner number = new Scanner ( System.in ); [/code] To: [code] static Scanner number = new Scanner ( System.in ); [/code] OR better yet, just move it inside of the main method: [code] public static void main(String[] args) { Scanner number = new Scanner …

Member Avatar for Teethous
0
112
Member Avatar for cbsoldier24

Here's something to get you started. Create a class called HourlyEmployee for the hourly employees: HourlyEmployee: [code=Java] public class HourlyEmployee { protected double payRate; protected double hoursPerWeek; public HourlyEmployee(){ } //constructor public void setPayRate(double newPayRate) { payRate = newPayRate; } public double getPayRate() { return payRate; } public void setHoursPerWeek(double …

Member Avatar for cgeier
0
557
Member Avatar for gibson.nathan

FYI: Indenting for loops does not make them nested. In order to be nested, one for loop must be inside another. If you look at VernonDozier's example you see a nested for loop. Here's another example with 3 for loops that are nested. Notice how one for loop is contained …

Member Avatar for cgeier
0
204
Member Avatar for shroomiin

The problem you faced earlier with: [code] System.out.println("Total Price is $" + distance/mpg*ppg+parking+tolls ); [/code] was because "+" is a String concatenation operator. Do your math operations, store the value in a variable, and then print the variable. To use printf you can do the following: [code] double total; total …

Member Avatar for mrnutty
0
113
Member Avatar for hery

See the following: [url]http://support.microsoft.com/kb/313100[/url] and [url]http://www.daniweb.com/forums/post933374.html#post933374 [/url]

Member Avatar for cgeier
0
197
Member Avatar for daveyb91

It comes from the days of ASP. The "Request.QueryString" command is used to collect values in a form with method="get". SimpleForm_1.asp [code] <form method="get" action="SimpleFormHandler_1.asp"> <TEXTAREA NAME="location" COLS=33 ROWS=4></TEXTAREA> <input type='submit' value='Add Event'> </form> [/code] SimpleFormHandler_1.asp [code] <%@ Language=VBScript %> <% Dim userLocation 'location is the variable name as defined …

Member Avatar for sknake
0
351
Member Avatar for chandiusjp
Member Avatar for samir_ibrahim
0
257
Member Avatar for power_computer

You have some other errors: while(fin.eof() && count<MAX_SONGS) It gets to the end of the file before this is true. Need to change to: while(!fin.eof() && count<MAX_SONGS) To do multiple getline's without checking for EOF each time, you could do something like the following: [code] while(!fin.eof() && count<MAX_SONGS){ if (getline(fin,songs[i].title)) …

Member Avatar for cgeier
0
197
Member Avatar for scias23

Use "DecimalFormat". [code=Java] import java.text.DecimalFormat; private String twoDigitNum(String myNum) { //specifies a 2-digit number DecimalFormat num = new DecimalFormat("00"); //for a 4-digit number use the one below //DecimalFormat num = new DecimalFormat("0000"); return (num.format(Double.parseDouble(myNum))); } [/code]

Member Avatar for amitrail
0
115
Member Avatar for java dummy

You received this error because you used "x", but haven't yet assigned it a value. [code] int x; //x is being used, but hasn't been assigned a value yet selectedJava = x; [/code] . Your code has other issues though. It throws a "ClassCastException" (thrown "if the search key in …

Member Avatar for cgeier
0
103
Member Avatar for pao09

Add some error handling to your code. Also double check the data types in the database. I think that if you use ".AddWithValue" it is assumed that you are passing the correct data types. Ex: if "CheckIn_Date" in the database is of type Date/Time then you probably need to pass …

Member Avatar for pao09
0
132
Member Avatar for rtz2rbbl

**Warning**: This process, if improperly performed, could make your computer unbootable. It is recommended that you back up your files before proceeding. 1. Create a restore point Control Panel -> Backup and Restore Center -> Create a restore point or change settings (on left side) 2. Open cmd window (right …

Member Avatar for cgeier
0
102
Member Avatar for Tyrial

Probably need to install "2007 Office System Driver". See [url]http://www.microsoft.com/downloads/details.aspx?familyid=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en [/url] . That is if you are using the 2007 version. Other things you may want to look at are: [url] http://www.connectionstrings.com[/url] [url] http://support.microsoft.com/kb/247412[/url] MS .NET Framework 3.5 SP1 [url]http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=ab99342f-5d1a-413d-8319-81da479ab0d7 [/url] ODBC .NET Provider [url]http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=6ccd8427-1017-4f33-a062-d165078e32b1[/url] Jet 4.0 SP8 (32-bit) [url] …

Member Avatar for Tyrial
0
161
Member Avatar for nateuni

Here is an implementation of what I think llemes4011 was talking about. See [url] http://java.sun.com/javase/6/docs/api/java/util/Scanner.html[/url] and [url]http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html [/url] [code=Java] public static char typeChar(String message) { boolean validInput = false; char userInputChar = 0; System.out.println(message); //don't use this one because it ignores //possible user input //char userInputChar = keyb.next().trim().charAt(0); do { …

Member Avatar for cgeier
0
344
Member Avatar for nateuni

I haven't used scanner a lot, but I think that error handling is built in. Below is an example of prompting for 10 integers. If invalid data is entered it prompts again. If "quit" is entered, the program exits. [code=Java] Scanner input = new Scanner(System.in); int x=0; while (x<10) { …

Member Avatar for nateuni
0
1K
Member Avatar for stevenaseron
Member Avatar for Madaxe

Use ASP with ADO. If .NET framework is installed, you could also use ASP .NET [url]http://www.w3schools.com/asp/asp_intro.asp[/url] [url]http://www.w3schools.com/asp/asp_ado.asp[/url] [url]http://www.w3schools.com/ado/ado_intro.asp[/url] For connection strings see: [url]http://www.connectionstrings.com/[/url]

Member Avatar for sknake
0
230
Member Avatar for sonah

Download and run the Intel Chipset Identification Utility: [url]http://downloadcenter.intel.com/Product_Filter.aspx?ProductID=861[/url] Download Chipset (SATA) drivers. [code] Go to: [url]http://www.intel.com/support/chipsets/[/url] Find the link for your chipset. -Click on the link. -Under "Drivers and Downloads" look for the column "Intel Chipset Software Installation Utility". -Click on the "Download" link for your chipset. -Select the …

Member Avatar for reganstar
0
290
Member Avatar for masterjiraya

You need to add the following import to use "DecimalFormat": [code] import java.text.*; [/code] Line #9: add "+" between 0.025 and num.format(monthlySales) Line #9: num.format requires a number not a string If monthlySales is declared as String, you need to covert to a number before passing it to format. [code] …

Member Avatar for cgeier
0
85
Member Avatar for endoyaru

Which operating system is currently installed on your computer? What kind of disk are you using to boot with (vendor recovery cd/dvd, Windows installation cd/dvd)? Does your "boot disk" boot on another computer? Is your cd/dvd drive able to read disks (is the drive good)? Some "boot disks" require that …

Member Avatar for stvrich
0
156
Member Avatar for digitalbeat

To get data into the class I know of two methods. 1. Create appropriate constructors and pass the data in that way. See: [url]http://java.sun.com/docs/books/tutorial/java/javaOO/constructors.html[/url] 2. Use set methods. [code] ... private float cost; ... public void setCost(float newCost) { cost = newCost; } // end setCost [/code] To get data …

Member Avatar for TheWhite
0
154
Member Avatar for NewToThis

Don't think you can do this: [code=Java] .... //set variables int [] counter = new int [10]; //number of integers //processing phase while([] counter <= 10);//loop 10 times { ..... [/code] I've never seen anyone try to write a statement like that. Don't think that is valid syntax: while([] counter …

Member Avatar for cgeier
0
124
Member Avatar for robben

Opening with a new buffered reader, opens the file again. You may want to read your file data into an ArrayList and then work with it--depending on how large your file is I suppose. If you really want to work directly with the file and be able to change file …

Member Avatar for sneaker
0
204
Member Avatar for DoEds

You need to follow your code--execute your code on paper. Follow line by line and write down on paper what the values are for the variables. For example: if (i <= day). You set i=1. So unless the user enters a value for day of "0" this will always get …

Member Avatar for DoEds
0
172
Member Avatar for gretty

Store the random number in a variable. Then search the array for the randomly generated number. If it is found, generate another random number. Repeat until random number does not exist in the array.

Member Avatar for wildgoose
0
98
Member Avatar for needhelp199

If you have a floppy drive you can get the XP boot disks here: [url]http://support.microsoft.com/kb/310994[/url]

Member Avatar for steve7132
0
201
Member Avatar for Evil_genius82

Sorry about the code formatting. You have multiple things going on: In "addDefaultData" you give the impression that "studTranArray" is a record. Ok, records/struct don't really exist in Java so you can use a class to try to achieve something similiar. You do the following: String [] defaultNames = {"Alvin …

Member Avatar for Evil_genius82
0
260
Member Avatar for Evil_genius82

[url]http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.18.1[/url] <i>15.18: ...If the type of either operand of a + operator is String, then the operation is string concatenation....If only one operand expression is of type String, then string conversion is performed on the other operand to produce a string at run time. The result is a reference to …

Member Avatar for cgeier
0
223

The End.