889 Posted Topics
Re: Q1: The System.exit() method terminates the Java Virtual Machine, not just a single frame. Q2: Not sure what you mean by this Question. | |
Re: Hi rahejapreeti and welcome to DaniWeb :) By a bullet, do you mean an ordered list? Do you know how to do that in XML (without php)? If so, let me point you in the direction of [URL="http://www.php.net/manual/en/book.simplexml.php"]the Simple XML documentation[/URL]. Simple XML provides an easy-to-use XML manipulation for PHP. … | |
Re: [QUOTE=edensigauke;685361]absolutely. i do that most of the time. an example lets say i have created a class Me.java which has the following constructors public Me() {} public Me(String s) {} public Me(int dead) {} public static void main(String[] args) { Me theBasicConstructor = new Me(); Me theStringConstructor = new Me("Hello"); … | |
Re: Why do you want to do this? Are you trying to hack a website for some nefarious purpose? | |
Re: Use modulo arithmetic instead. [code=java] if ( i >= array.size() ) { i = i % array.size(); } [/code] In fact, you don't even need the if-statement, just do the modulo... | |
Re: Just taking a quick look, you have not passed in a parameter to the region::getAllR() call. Note that the signature of the function is function getAllR($Region_id) which contains a single parameter with no default value set. Therefore you must call the function like so: region::getAllR($aRegionId); | |
Re: All I can say is planning your project will reduce the amount of time to code it. Perhaps start by designing the database of players - what details do you require from a new member and how will they go about searching for a partner? Start with the basics of … | |
Re: Are you talking about the IDE or the java.beans package? If you mean the IDE then this link will help [url]http://www.netbeans.org/kb/[/url] | |
Re: Check out the documentation on the date_sub function - I think this will do what you are after. Here is a link: [url]http://au2.php.net/manual/en/function.date-sub.php[/url] | |
Re: With a solid background in C/C++, Java should be relatively straight forward to pick up. I think one of the best free resources for learning java is the java website, [url]http://java.sun.com[/url] , which has the API documentation and lots of great tutorials. In terms of books I would probably recommend … | |
Re: Hmm, the InetAddress.getByName(String) method should work. Are you using the full computer name? That is, including the network? | |
Re: Without more details I can only guess, but I would say that your data type for the amount of money that the player can get is an SQL INT. Am I right? An INT in SQL can only have a maximum value of 2,147,483,647. If that is the case, I … | |
Re: What have you done so far? We are not allowed to just give you the answer, we need to see some effort. Sorry! | |
Re: Hi ocreds, In order to raise a number to a certain power, you need to use the Math.pow(double, double) method. The documentation on it is found [URL="http://java.sun.com/javase/6/docs/api/"]here[/URL] in the Math class. Basically it accepts two numbers as parameters and returns the first number raised to the power of the second … | |
Re: [QUOTE=bdcd;680857] [code=php] $new_file_name=vsquarel; [/code][/QUOTE] I think that this line is incorrect? Possibly it should be: [code=php] $new_file_name="vsquarel"; [/code] or even: [code=php] $new_file_name="vsquarel.htm"; [/code] Unless vsquarel is supposed to be a variable, in which case it should be: [code=php] $new_file_name=$vsquarel; [/code] Try these suggestions and see if that fixes your problem... … | |
Re: Something like this might be simpler if it is possible for your code: [code=php] // $elements is your list of elements that you are adding to your string array $arrayString = array(); foreach($elements as $element) { $arrayString[] = $element; } [/code] Now, in your $arrayString you will need to access … | |
Re: For your previous button, I think you want to do something like [code=java] index--; if (index < 0) { index = numItems - 1; } [/code] This will allow you to cycle through your inventory items by pressing the Previous button when you are at the first item. You can … | |
Re: Sorry what do you mean by "resizer code"? Can you provide an example or show us what you have so far? | |
Re: Take a look at the date() function in the PHP Manual ( found at [url]http://au.php.net/manual/en/function.date.php[/url] ). There is a special format, t, that returns the number of days in a given month. For example, to find the number of days in July, you could write something like: [code=php] $julyDays = … | |
Re: The simple bugs are often the hardest to fix. I personally hate the ones where you have a slight spelling mistake in a variable name and instead of throwing an error it just works but not as you'd expect. They can take ages to find. I would recommend purchasing a … | |
Re: I agree with jbennet but would like to add that perhaps your best bet would be to contact the GIMP community administrators and just double check with them. They may have specific requirements that you need to adhere to. | |
Re: Have you compiled the code? That error usually relates to attempting to run a main method in a file that has not yet been compiled. If that was a compiler error, which line(s) give the error? | |
Re: The error is occurring on line 488 and is a NullPointerException, which means that something is being referenced on line 488 that hasn't been initialised properly. Which line of code is number 488 (in Inventory.java file)? | |
Re: The only thing I can see wrong with your sql statement is that you don't need single quotes around your variables. But I wouldn't think that would cause an error. What happens when you call the storedRecord function? (It should just print the sql statement to the screen, but what … | |
Re: I know that your tutorial probably says to connect to port 7 for an echo, but try connecting to a port > 1024. Chances are your errors are due to trying to connect to a port that is in use. | |
Re: Sure it is. You can do something like: [code=sql] SELECT * FROM <databaseTable> WHERE columnX = 'x' AND columnY = 'Y' AND columnZ = 'Z' [/code] | |
Re: While you are learning java it is probably best if you learn to code your interfaces from scratch rather than using a GUI builder. You will need to use the java.awt and javax.swing packages. There are plenty of tutorials in GUI design - [URL="http://java.sun.com/docs/books/tutorial/ui/index.html"]This one[/URL] is probably a good place … | |
Re: Try sending an email with only addresses in the BCC field (ie none in the To or CC fields) and when it is delivered each address will appear in the To field, but only the recipient's will be displayed. | |
Re: Your DB structure looks ok, except that I would probably just sort by name and remove the sort_name field. Your SQL query will look something like: [code=sql] SELECT * FROM table_ads INNER JOIN table_categories ON table_ads.category_id = table_categories.id WHERE table_ads.active = true ORDER BY name [/code] Might need a bit … | |
Re: Couple of quick points: ID fields should never be a text field. Use Unsigned INT or something similar. This helps efficiency and referential integrity of your tables. Think about maybe consolidating the three columns Dayofweek, Timeslot and AMPM into one column, TimeOfDay, and making it a smalldatetime field, which is … | |
Re: [QUOTE=zyaday;650615] [code] 14: String imageText = null; 15: imageText = getParameter("image"+i); 16: if (imageText != null) { [/code][/QUOTE] The next line will only run if imageText is not null, so your call to getParameter method must return something. I would suggest putting in a println statement to see what the … | |
Re: This is a generic function to return a specific field ($field) from a table ($tble) in a MySQL database. The exact record returned is specified by the parameter $whr. So your call: [code=php] $msgcount = getdata("messages", "count(*)", "status=0"); [/code] will result in the parameter $msgcount being the result of the … | |
Re: The only thing I would say is that since you have a Foreign Key in Amount called Invoice_id, you will need to update the Invoice table before the Amount table. If you try to insert into Amount table for an invoice that you haven't entered into the Invoice table, you … | |
Re: How are you setting up your database connection and queries? | |
Re: [URL="http://www.esus.com/docs/GetQuestionPage.jsp?uid=1326"]This link[/URL] contains an example of how to do what you are trying to do. Basically the author overrides the components paintComponent() method and inserts a numbering system in the left Inset of the area. Hope this helps, darkagn | |
Re: Hi Steve and welcome to Daniweb, Good to see another fellow Australian in the mix. I can offer some advice for numbers 2 and 3... For 2, take a look at the [URL="http://phpgacl.sourceforge.net/"]GACL package[/URL], which is a very powerful tool that deals with security and permission levels for your site. … | |
Re: There may be a better solution out there, but what about if you did a transpose whenever the user rotates their image to make sure the origin is kept above and to the left of the top-most and left-most areas of the drawing? | |
Re: Your algorithm seems to be correct. How are you calling the method? | |
Re: I'm sorry regent_royal, what was the question? If you want to know how to display that HTML that you have posted in a JEditorPane its just a matter of assigning all of that HTML text via a call to the component's setText() method. | |
Re: You need to call Graphics2D.setStroke(Stroke) method before drawing a line. You will need to create a Stroke first - use the BasicStroke class for now. Also, don't forget to reset the stroke after you have drawn your line. | |
Re: [url]www.php.net[/url] is probably a good place to start. This site has some really good documentation and sample code. Of course, if you get stuck there is also DaniWeb :) | |
Re: StringBuffer is certainly better in handling lots of operations than a normal String and can handle the same number of characters as a String. It is also completely thread safe. However if you are using JDK 5 or later, you might want to think about using a StringBuilder if system … | |
Re: Hi hassanalvi1989, welcome to DaniWeb. What language were you thinking of doing this in? Have you done anything so far that we can comment on? What AI principles will you use? Cheers, darkagn EDIT: Sorry, I didn't look at the title. C++ is your language of choice? | |
Re: Use e.getSource() to determine where to copy / paste to / from rather than mPane.field. For example, your PasteActionAdapter.actionPerformed method should be: [code=java] public void actionPerformed(ActionEvent e) { e.getSource().paste(); } [/code] | |
Re: Could you just put a simple if-statement in your mouseExited method? [code=java] public void mouseExited(MouseEvent e) { if (e.getSource() != this.closeButton) { // do your current code here } } [/code] | |
Re: I would convert letter to a char and then compare that char with your charArray word using [code=java] for (int i=0; i<array.size(); i++) { if (letter.charArray[0] == array[i]) { // the letter is at position i } } [/code] | |
Re: Do you have a database on the local server called 'example'? And is there a user called 'root' with a password 'root' that has access to that database? Try testing this by connecting to the example database with that username/password in mysql and see if it works that way. Your … | |
Re: Hi napper_1337 and welcome to DaniWeb, Can you please post your code for index.php for the lines near 142? Say 140-150 so we can see what is going on? |
The End.