176 Posted Topics
Re: you could also look on the right to your initial post, and you will see 'similar threads.' I know there have been many posts recently on this subject. | |
Re: another way I could think of doing this is building a two dimensional array of 6*2 length. on one column, you could save the indexes, and on the other, save the actual numbers you want to sort. then sort the array in the column where you have your actual values … | |
Re: I would recommend jGRASP. it is very easy to use, and it does not have the auto-complete feature of Eclipse. it does have features that make numbering the lines of code easy, as well as indentation. I have tried Eclipse, but left it for jGRASP. hope this helps. | |
Re: if you wanted to get back to six, you'd need to save somewhere the result of 6/2 first. that way, 6 = (6/2)*2 + 6%2, in general a = (a/b)*b + 1%b. (I'm assuming you work with Java, and declare your variables as int since 7/2 = 3 (not 3.5) … | |
Re: if you just want to avoid using if-else for all 25 cases, you can use switch-case. | |
Re: when you take the sentence in, you can then you StringTokenizer class to tokenize your sentence using as a token the empty space ' '. this will break your sentence into words. next, make a method that removes punctuation from each word, in case there is any, and save your … | |
Re: let's say 24546 is an octal number! what it actually says is that you have: 2*8^4 + 4*8^3 + 5*8^2 + 4*8^1 + 6*8^0, which then equals = 8192 + 2048 + 320 + 32 + 6, which then equals 10598 decimal. notice how the power of eight is being … | |
Re: well, there are ways to see the bit/byte representation of an audio files. in linux, you type "od filename" (od standing for octal dump), and what you get is a hexadecimal representation of an audio file. there are different options you can pass to od to give you various results... … | |
Re: say you want to set the price of the Furniture object held on 4th cell of your furniture array. you invoke the setPrice method of that object, that is: [CODE] furniture[3].setPrice(price)//that's it. note, though, that furniture[3] is 4th cell, since first is furniture[0] [/CODE] is this what you need help … | |
Re: I don't really have a solution, but I am writing because I want to subscribe to the thread and see the solution if someone finds it. however, I do have an idea. If the length of all orders combined is less than the length of the bar, then the waste … | |
Re: yes there is. you can use StringTokenizer class, tokenize your string using an empty space as a token (' ' - this would be your token), and then in a while/for loop, you'd print out a new line every third iteration or so. perhaps there are other ways, but this … | |
Re: could be your escape character... try writing the location of your exec file as follows: d:\\example\\php_exe\\1436.exe I hope that works. | |
Re: try reading each file's name, and classifying your files according to the extensions of the names. you can use strpos() method to find out if a string is a substring of another string, so use that to know if a file's name contains .jpeg, or anything you want. hope that … | |
Re: I guess what you need is a controller class that has a main method inside it. then, in your main method, you instantiate an instance of your IPTPlogin class, and invoke the two methods just as you wrote above. I can't give you the code, but here is a guideline. … | |
hey there, I have the following piece of PHP code to retrieve a list of files on a directory, and then build links to each file: [CODE] <?php $dir=""; // Directory where files are stored if ($dir_list = opendir($dir)){ while(($filename = readdir($dir_list)) !== false){ ?> <li><a href="<?php echo $filename; ?>"><?php … | |
hey there, I have a simple page online, and tried to style it a little. here is my [URL="http://gagi.zxq.net/index.php"]page[/URL]. there are five links. I tried to build a simple, css-styled vertical menu. however, the button-like appearance of the links is not of equal length. would anyone tell me what part … | |
hey there, I havbe the following html and css files: [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"> <head> <link rel=StyleSheet href="style.css" type="text/css"> <title>My site</title> </head> <body> <div id="con"> <div id="navigation"> <ul> <li><a href="http://gagi.zxq.net/star.html">About me</a></li> <li><a href="http://gagi.zxq.net/ekes.html">Blog</a></li> <li><a href="http://gagi.zxq.net/mbretereshat.html">Links</a></li> <li><a href="http://gagi.zxq.net/bouncingball.html">News</a></li> </ul> </div> <hr> <div id="main"> … | |
Re: I am not sure if I understand you, but if I understood you correctly, then my advice is move on to MySQL, and be sure that it's very easy to connect to it with Java. you have a working class ready in a couple of recent threads here in Java … | |
hey there, I am trying to make my first connection to a mysql server with java. I took the following code from another thread: [CODE] import java.sql.Connection; import java.sql.DriverManager; public class Connect { public static Connection ConnectDB() { Connection conn = null; try { String userName = "root"; String password … | |
Re: man, your code really is a mess. try fixing it a little first and then someone will surely help you. this problem is a simple problem that would easily be solved had you provided a complete class, one that includes the imports, a class name, putting pieces of code inside … | |
Re: hsuan, let us assume that the default color of keys on your painted keybord is red, and that when you press a key on your keyboard, the color is changed to blue. say now that you press key D and it turns blue on your screen. do you want it … | |
Re: alright, your application is all right, except for two minor defects. one, you only have your application reading time once, that's why it repaints the same time every time it repaints. you need to put your line 28 somewhere where it is run each time a repaint is needed. that … | |
hey there, I have a simple problem... but it seems overwhelming for me. I have a router, a desktop that runs XP, a laptop that runs Ubuntu 10.10. I want to make a home network with these devices I have. I have already managed to connect two computers, both running … | |
Re: aanders, a couple of weeks ago I was hired to do some data mining, and the mechanism at the core of the task I was assigned was this what you are trying to accomplish. what i did is the following, and I believe this will help you, too. I accessed … | |
Re: I hate to be the bearer of bad news, but nobody is going to do your homework. nobody did mine, either, so no hard feelings, ok :P seriously, you are expected to give the code you wrote and that does not work before anyone will give you any help. show … | |
Re: try k less than 7...it most likely won't work perfectly, but it will give you a hint. tell us what does your int[][] a parameter to the method hold. it's dimensions. besides, you could reach the effect with a one-dimensional array as well... | |
hey there, I downloaded the jxbrowser package that comes in the following folder jxbrowser-2.8-cross-desktop-win_mac_linux . I put it on a directory JavaBrowser on my desktop. I tried writing a java class that makes use of the package but my compiler complains for absence of the package. anyways, after reading the … | |
Re: perhaps you can add some boolean variable and an if statement that check for truth value of the variable and call the repaint method only inside the if statement, which means that repaint will be called only while the boolean variable evaluates to true. hope that helps. | |
Re: I think you only need to pass to the constructor method of JTextArea two in variables, int rows and int cols, and they will appear. try that and see if it works, I haven't tried. and please, post your code | |
hey there. I have the following code. I am trying to build an applet that displays all possible (92) ways of arranging eight queens on a chess board with no two of them on the same column, row, or diagonal. I built this as an application and it ran fine. … | |
I am trying to build an application that finds all possible ways of arranging 8 queens on a chess board in such a way that no two of them are on either the same row, column, or diagonal. I am also trying to do this applying what I think is … | |
Re: this is a Java forum man, I don't know how is this related to java, but anyways: say you have a binary number as follows 1001. that is, you have four digits. what 1001 actually says is that you have 1*2^3 + 0*2^2 + 0*2^1 + 1 *2^0 = 8 … | |
Hello people. I have the following class. [CODE] public class Model{ private Kutia[][] c; public Model(Kutia[][] x){ c = touch(x); } public void touch(Kutia[][] k){ for(int i = 0; i < 8; i++){ for(int j = 0; j < 8; j++){ if(k[i][j].occupied()){ touchHorizontal(k, i, j); touchVertical(k, i, j); } } … | |
Re: for comparing whether a number is between two and five (inclusive) digits in length, you can also do a test on whether it is grater or equal to ten and less than 100.000. another advantage of this is that someone could give your app an input such as 01, and … | |
Re: an idea: say the shape is that of a star. you want more transparent stars to follow behind it. my idea is that you need to specify the number of stars first. say that are five stars, firs (1), second (2), 3, 4 5. when you initialize the app, each … | |
Re: your getScores() method does not contain a line to take input. inside your constructor method, there is a line that takes input through nextInt() method. you need similar code for your getScores() method so that your app can get scores. plus, you need some array variable to store your input … | |
Re: try woking with BigINteger class. there are ways to turn BigINteger to int and vice versa, I think. hope that helps. | |
Re: with a for loop inserted inside your main method I got the following result: Brown James 123456 24/3/85 Marketing Jenkins Susan 234567 11/12/80 Sales Turner Jane 345678 5/7/72 Sales Cavendish Paul 456789 22/9/76 Accounts Williams James 567890 19/1/81 Marketing Ford Karen 678901 15/8/79 Sales Other than the for loop inserted, … | |
Re: hey javanoob101, you have one "monster" class. since you want more than one monster showing on your screen, you instantiate multiple instances of monster class. so, there is one single class, but multiple instances of it. now, when you do the instantiation, you store all instances on an array. and, … | |
Re: you're line 56 is messed up, that's likely why you get a complaint for line 11 as it refers to the method letterSearch(), which contains the line 56. check that line and correct as needed. | |
Re: I tried to compile your code, but as I expected line 17 complains. besides, = is not a comparison operator, I assumed you meant ==. check that first! | |
Re: if you know the standard used for naming methods and attributes, then it's actually easier. you tokenize the entire input file, and as James suggested, everything that's not a key word, is a class, method, or attribute name. now, you know class name follows keyword class. now, perhaps, method names … | |
| |
Re: I think when you instantiate your instance of FileWriter you need to do so in appendable mode. to do that, you write as follows: new FileWriter(PassengerInfo.txt", true); let me know if that works. | |
Re: [QUOTE=;][/QUOTE] pmark, James said you need ANOTHER loop. not ONE loop. and he is right. you are reading one single line of your input file on line 23, and then iterating through that line with your loop, and that's it. if you want to read each line, then do as … | |
Re: String s = "k" and char c = 'k' are different. you either need to tursn String s into a char or char c into a String before comparing. use proper methods for comparing though. hope that helps! | |
Re: well, you are basically all done. except that your formula for calculating hypotenuse is wrong. and, inside your main method you do not need to declare multiple instances of Hypotenuse objects. one would suffice. p.s. what you are basically doing is finding the square root of 3*4 in the first … | |
Re: from what I just read online, there is no scope resolution operator in java. google it, and you'll find your answer. | |
Re: are you trying to have the same method counting both consonants and vowels? this method you provided does not return the number of vowels. it does count the number of vowels, but it does not return it. | |
Re: seems like there is some trim() method calling going on somewhere under the hood. there are ways to insert a new line inside a string like using "\n". there might be similar for inserting space. I know there is for inserting a tab. consider that instead of just adding an … |
The End.