889 Posted Topics
Re: Two areas you could talk about is how mathematics is used to determine shadows and movement of the camera. Read up on Projection Matrices and the Phong Model as a starting point. It sounds like a very interesting project. Good luck and enjoy :) | |
Re: Hi there ajayajayajay and welcome to DaniWeb, To the best of my knowledge, the whole point of the md5 function is that it is a one-way encryption of a string so that it cannot be decoded. This way if a hacker gains access to your database, they can't just "reset" … | |
Re: Your problem is in the first if-statement: [code=php] if ($_FILES["userfile"]["size"] = 0) [/code] You are using an assignment here rather than the comparator == as I think you mean. In PHP though, your statement is legal, just that it will always be evaluated to false (and thus will never cause … | |
Re: [URL="http://www.phpro.org/tutorials/Introduction-to-PHP-PDO.html"]Here is a link[/URL] to tutorials for the PDO package which is really easy to use and works really well with MySQL. The manual can be found [URL="http://www.php.net/pdo"]here[/URL]. | |
Re: Hi Ryano24, We're not allowed to just give you the answers but we can try to point you in the right direction. What do you think the answers are? Take an educated guess and we will let you know where you've gone wrong. Cheers, darkagn | |
Re: Further, Java is a popular cross-platform, interpreted object-oriented programming language. | |
Re: What do you mean by "get something in the menu bar?" | |
Re: I have never used a StreamConnection before (is that one of your classes?) but if it's anything like a ServerSocket that waits to accept() in its acceptAndOpen() method then this call needs to be made in a separate Thread. Otherwise, your main thread will sit waiting to accept and this … | |
Re: Hi alpe gulay, It seems from your questions that you are a bit of a beginner at Java. Take a look at the post at the top of this forum. It contains several great links that might be able to help you in your journey. The website java.sun.com is particularly … | |
Re: I haven't actually used SQL with Java before, but there are plenty of tutorials / examples out there in the world wide web. [URL="http://dev.mysql.com/usingmysql/java/"]This link[/URL] might be a good place to start since you are using MySQL. Good luck :) | |
Re: [QUOTE=soup;593303] Now my problem is when I try to access p from func2(), I am getting a NullPointerException error. I am not initializing p anywhere through D()'s or B()'s no argument constructor. Is that the problem? [/QUOTE] Yes, in order to use p it must be initialised somewhere. Try this: … | |
Re: Hi ells912 and welcome to DaniWeb, Both questions are very similar. You need to do the following: 1. Prompt the user for an integer. 2. Store the digits of the integer in an array. 3. Loop over the digits (Q1 in normal order, Q2 in reverse order) and print them … | |
Re: You will want something like: [code=java] Blackjack bj = new Blackjack(); bj.start(); [/code] and have a start() method in your blackjack class that basically runs the game (ie swaps to the Blackjack panel as Ezz suggested earlier). | |
Hi all, I am fairly new to PHP (my experience is mostly in Java) and I have inherited a project that was initially implemented in PHP4. I am updating it to use PHP5 and at the same time I am trying to add Logging to the project. I am using … | |
Re: You can get the time via a call to [code=java] System.currentTimeMillis(); [/code] and parsing the returned long using the Calendar class. I'm not sure if it is possible to set the System time in Java but I'm not sure that you should either. | |
Re: Well I have to admit I usually use swing components rather than awt components for my GUIs. Has your instructor specifically asked you to use awt components? Changing to swing is easy - import javax.swing.* and add a J to the front of each of your GUI components. Other than … | |
Re: Is ImageViewer your own class and is it in the same package as PlotVacDisplay? If not you will have to import it. | |
Re: Do you have any specific questions or would you like us to just write it for you? | |
Re: Hi aim and welcome to DaniWeb, I'm a little unsure about what you mean by "image matching"? Do you mean you have two images in JPEG format and you want a program to work out if they are the same image? Also, I should point out that we are not … | |
Re: What's your definition of the cipher alphabet as opposed to the secret code? I thought that a cipher was a type of code, so I don't really understand what you are asking here... :S | |
Re: Try adding some println statements to your init() method to see where the initialisation fails. Your html code appears correct to me... | |
Re: Most of the log calls allow you to print a message and the caught exception. Try this: [code=java] try { // do something } catch ( Exception e ) { if ( log.isDebugEnabled() ) { log.debug( "Exception throw.", e ); } } [/code] This will log the message and the … | |
Re: Do you have a particular question that the API can't answer for you? | |
Re: Hi Ryano24, That all looks pretty good to me. I guess your next step is to add some drawString methods to display the difference, product and quotient. The only comment I have is what happens if the second number entered by the user is 0? Or if either string entered … | |
Re: Hi jcato77 and welcome to DaniWeb, jamesbien is completely wrong with his advice. But I am not sure about your question. Do you mean that the code inside the loop that jamesbien referenced never executes, or that it executes even when the user inputs the word "STOP"? | |
Re: [URL="http://gcc.gnu.org/"]http://gcc.gnu.org/[/URL] is the official site for the gcc compiler. Latest version was released in March this year and is version 4.3.0. Note that it is actually a standard compiler that is usually included in a standard install of Linux or the Mac OS as well. So you probably only need … | |
Re: Yes, just create an inner class that implements ActionListener. Then in the actionPerformed( ActionEvent e ) method you can call e.getSource() to find the button that was pressed and act accordingly. Then just add a single instance of your inner class to each button. Hope this helps :) | |
Re: I don't think that's possible. You can check the String against each String in your array (which is what you've said you don't want to do?) but how does it make sense to compare a single string with an array of strings? When do you expect them to be equal? | |
Re: if (choice==1) { //HERE CHOICE = 1 for (i=0; i<20; i++) { cout<<"\n"<<num[i]<<endl; } return 0; } // HERE CHOICE STILL EQUALS 1! if (choice==2) { for (i=0; i<n-1; i++) { for (j=0; j<n-1-i; j++) { if (num[j+1] < num[j]) /* compare the two neighbors */ { tmp = num[j]; … | |
Re: What do you need help with? Please try to be specific as we are not allowed to just do your work for you. PS This thread is 18 months dead, please check the dates before performing a resurrection. | |
Re: [QUOTE=Nepenthe8;573396] to determine the length of the boundary of an irregular polygon. The polygon may have between 3 and 9 sides. The user should be prompted to enter the number of sides and the coordinates of each vertex point. The program should then calculate and display the total length of … ![]() | |
Re: I'm sorry sbv but I don't understand your question. Are you asking how to determine the score as a percentage if you have an average mark for someone? | |
Re: I am assuming that your main question is about accepting user input since that is underlined. You will need to use an InuputStream of some form or another for the standard input of System.in to accept input from a console. Something like: [code=java] BufferedReader input = new BufferedReader( new InputStreamReader( … | |
Re: Hi antony_24 and welcome to Daniweb, What's the application doing when the bug occurs? Especially, what are the various threads doing when the bug occurs? | |
Re: I think Vernon's suggestion will fix your problems. This is a common mistake when first learning Java and other C-style programming languages. Saying '=' is an assignment to a value statement, saying '==' is a test for equality. In other words the statement [code=java] housing = 2 [/code] means "set … ![]() | |
Re: I'm not sure if this is what you are after, but I think the java.text.NumberFormat abstract class might help. It provides a static method called getIntegerInstance() that can be used to create a formatter for your floating point numbers to [I]round[/I] them to integer digits. I can't quite tell from … | |
Re: The [URL="http://java.sun.com/javase/6/docs/api/"]Java API[/URL] contains documentation for the java.util.Map interface that might be handy. Have a read of it and repost if you are still unsure what to do. | |
Re: I'm not sure what the "gwordsomething" should be, but my pseudocode for your would go something like this: if list isEmpty - return E item = list.remove list.add( item ) Now, take a look at those methods I have referenced and you will see that this should work. First, we … | |
Re: You just write a new method in each of those classes called void overiden( int access ) Then when an object of type Widget calls the overiden method, it will use the implementation in the Widget class. Similarly, a Spork object uses Spork's implementation and a Grommet will use Grommet's. … | |
Re: Hi naiad08 and welcome to Daniweb, We have some pretty strict rules here in that we can't just do the work for you, we need to see some effort and then we can guide you. What have you done so far? Where are you having problems? Do you know the … | |
Re: The only thing I can think of looking at this code is: do you have an image file called LogoGIF.GIF in a subdirectory called JavaProgram2? Also, you have added the logoLabel to the panel, but you haven't provided the code where you add the logo to the panel or the … | |
Re: You will need to take a look at the java.awt.Graphics and java.awt.Graphics2D classes. They provide methods to draw shapes to what is called a graphics context (eg screen, image, printer etc). So if you want to draw a shape to the screen in say a javax.swing gui, you override the … | |
Re: I would suggest using Java since your main concern seems to be portability. Java is a cross-platform object oriented language and provides several API's for GUI development. The swing package in particular will be most helpful to you if you decide to go with Java. | |
Re: I have never used JScrollPane, but I believe that the "listener" functionality you want is provided in the default functionality of a scroll pane. Do you need to know where the user has clicked for some other reason than to scroll around the pane? If so, I think you should … | |
Re: [QUOTE=technogeek_42;556892]const char *tensWord[] = {"", "ten", "twenty", "thirty", "fourty", "fifty", "sixty", "seventy", "eighty", "ninety"}; can i ask what is *tensWord[]? i think ur wrong in that part i think it's const char *tensWord[][10] = {"", "ten", "twenty", "thirty", "fourty", "fifty", "sixty", "seventy", "eighty", "ninety"}; and it is right to use … | |
Re: You can GET the date and time by using [code=java] System.currentTimeMillis(); [/code] This returns a long type that represents the number of milliseconds since Jan 1, 1970. You can format that long by using the java.util.Calendar and java.text.DateFormat classes. | |
Re: For part one, [URL="http://en.wikipedia.org/wiki/Depth-first_search"]this link[/URL] might help. Part two is a little more involved, so try part one first then have a try at part two and repost if you have any trouble. | |
Hi all, I am wanting to display an image that is aligned so that the centre of a string of text is in line with the centre of the image. I know the image's dimensions and the length of the string, as well as the font I am using to … | |
Re: Instead of [code=java] URL url = new URL( path ); BufferedImage image = ImageIO.read( url ); [/code] try [code=java] File imageFile = new File( path ); BufferedImage image = ImageIO.read( imageFile ); [/code] Generally URLs are only used for the internet, use Files for local stuff... |
The End.