2,040 Posted Topics
Re: Did you get this from database? If so, use database query to group them for you. You could use `COUNT(*)` and `GROUP BY` keyword in the database. ![]() | |
Re: You didn't even finish the first part yet! The requirement said you need **2 arrays**, not one. Then, you need to randomly select a value and put the value into both array at the same time. Your search is looking inside only 1 array. The bin search should be looking … | |
Re: Does the list of flight have to be hard coded? I thought you need to read the data from somewhere instead of hard code them this way??? | |
Re: The code line below is changed because it wouldn't work on FF with original code. [CODE] // need to change to this because previous version doesn't work with FF if (!e || (typeof(e)=="undefined")) { e = window.event; } [/CODE] The code block below, yours was '1', but it is supposed … | |
Re: The check with for file already exists may cause problem later on (i.e. upload corrupted file content the first time). Also, type checking (line 28) is case-insensitive (i.e. a file name a.jpg is equal to a.JPG)? The reason I asked because it usually is case-insensitive on Windows but not on … | |
Re: Errr... This is why copy-and-paste is not teaching one to learn... If you are asking people here to give you the code, then I have to decline. If you ask us to guide you how to do it, I would say you need to read on how to pass variable … | |
Re: It is fine as long as your data is sparse (less than 50% of contacts have a number) and you have small data set. In order to get a contact with number, use JOIN. However, both will have a different field set or you would have many null fields value. … | |
Re: Hmm... I still have doubt that MySQL would be able to do that from query because the `SUM()` function does not select rows for you that way (it does the total of all selected). Even worse, I highly doubt it can actually cut off the value from the field (i.e. … | |
Re: Before you dive into your programming, you need to dissect your program. 1) How do you create a question? I would suggest that you have variables handling 3 separate values - two are for numbers to be multiplied and one answer. Because you separate values, you can use a simple … | |
![]() | Re: A suggestion for your `account.php` (HTML) file for future improvement. You should check whether the new password and confirm password are the same before submitting the form. This could simply be verified using Javascript on `onsubmit` form event. I am guessing your `index.html` has a login form to call `account.php`. … |
Re: Are you returning only 1 object at a time? If so, why not return the found FlightType right inside your `if` (on line 28) instead of return it outside the loop? Because you declare and initiate the object outside the loop, not sure what would happen if you try to … | |
Re: So what is your design so far??? | |
Re: You could do it using inline style, but a fixed CSS may not be exact if the list is dynamic... Javascript would be needed in order to rearrange the display to be exactly what you want. ![]() | |
Re: `$zip_code = sub_str($zip_code, -0, -4);` This is very strange way of teaching people on PHP! Why use `-0` when you can simply use `0`? Also, why would you give an example of negative length (even though it gives the correct result) instead of a positive length when you KNOW what … | |
Re: If you look at your first script you mentioned, the source is from an "on line" link, which means you need an Internet connection to make it work properly. The script file is imported and no physical file on your local server. The second part said that the source is … | |
Re: Both way are inefficent and bad. Even though you are allowed to create many tables, it is a very bad way to use that many to solve a simple problem especially in this case. As rjent said, 2 tables should be enough. However, you do not give enough information for … | |
Re: How do you use `setAlpha()` method? It is a member method, so you can't simply use it without initiate an instance of the class first. Please show the part where you call the method. | |
Re: Either allow the port to be used or change the port number to be the one available? | |
Re: To do decompress, you have to remember that the incoming `String message` needs to be the compressed version which consists of '0' and '1'. Before you can do that, your compress string must have a specific rules applied to the compress (i.e. fixed string of how many bits you are … | |
Re: Hmm... Line 9 in driver... Shouldn't it be `$d` instead of `$driver`? | |
Re: Do you need to tail your `$graphLabels` array element with a comma? Wouldn't it be easier to use `join()` as `echo join(",", $graphLabels);`??? The same way with your `$graphValues` variable... | |
Re: Line 54, are you sure that you can add `double` into `ArrayList<Double>`??? Oh and you could try to use `File.separator` instead of using slash/backslash... PS: How about read in as "String" using `nextLine()` instead? I suggested a long time about about it. This way, you could verify and easily manipulate … | |
Re: You could use cookies but you will need Javascript to achieve it because "cookies" are client side, not the server side. You will have to learn Javascript first. To incorporate with PHP, simply echo the script out to the HTML page. | |
Re: What do you mean by applying to RGB image? Each file has its extension. You also need to follow the "binary" format of the file. What you did so far is simply written ASCII into a file (which means it is simply a .txt). | |
Re: Before I go further, your script is vulnerable to SQL injection... You should ALWAYS sanitize any input from user if you are going to use it inside your query (i.e. `$userid` is the problem in your clientwork.php script). If you don't know what SQL injection is, you should google it. … | |
Re: You would either give each page a rank number that a certain user level can access or include a portion of script to check for permissin in each page. Either way, you must document it well because you could easily forget about it. Personally, I would create a template page … ![]() | |
Re: Output: february 13, 1990 :P Anyway, for what reason would you return `Profile` object from `oldestStudent()`? Is it in your requirement??? | |
Re: > i have my algorithm but i can't get the flowchart to come out. What does that mean? Are you using a program to create a flow chart for you? Anyway, here are my observations... 1) Line 15, shouldn't it be `Set Final_Price = 0.00`? 2) Lines 18, 19, and … | |
Re: Well, you just treat the string with state. You must have 2 dynamic collection variables (possibly `ArrayList`) to handle this task. When something is changed, add to undo. When something is undo, pop the item out from the undo list and add it to redo list (and vice versa). If … | |
Re: First, you may need to think about how to do it by hand. Create a step-by-step of how to do it. Once you completely understand how the puzzle work step-by-step, then we could start talking about programming. :) By the way, DO NOT think about implementing it with Graphic User … | |
Re: The back slash in your `delim` should be escaped because it is supposed to be a regex String. However, a better regex should be `\\s+` instead... | |
Re: If the answer is to print, you do not need another stack but rather a variable to hold the carrier... | |
Re: Shouldn't this post be in Java section? | |
Re: Line 13 & 14, you are building a query without giving a condition for it to search for. You need to look at how to compose a query for SQL (look at Select). Line 20, you are retrieving the row as ARRAY. If you want to retrieve it to use … | |
Re: I highly doubt that you need to access the file again, unless you are given a new file to do so. Anyway, there are 2 possible translation from the requirement. 1) The method simply asks to return the mean value. In this case, the method does not have any argument … | |
Re: There exist at least a way to implement min_element, but it could be slightly different when you deal with more dimension. The worse case is always that you go through all elements in your vector(s). The iteration approach is already mentioned in NathanOliver post. | |
Re: You need to divide the process into 2 parts -- parsing and computing. I think the most difficult part to deal with and would take up the most code line is the parsing. In Shunting yard, it simply converts a string to posix notation. If you want to make it … | |
Re: If you want to do that, you could use [Knuth-Morris-Pratt](http://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm) algorithm. Instead of comparing ASCII, do binary comparison. It takes O(n) time for each file (where n is the file size). | |
Re: In your first part, you have a nested loop. I guess you do not understand what those loops are for. Before working on the second part, I would like to explain how those loops work first. There are 2 loops -- one inside the other. If you graphically think as … | |
Re: > Why don't you create a stored procedure to search for a record based on an ID passed in from the data grid view, instead of doing the query in your VB code? If you look at the OP original post, you could see that the OP quoted a portion … | |
Re: What key??? Why do you need to find the key? If your encryption algorithm takes in a key, it should use the key in the encryption process. If one wants to decrypt and give a wrong key, the content from decryption should be garbage anyway. The decision to encrypt/decrypt should … | |
Re: Are you saying you want to display all categories, list their own collection name, and each collection name is a link? For example... Cartoo Faces: [Gallery1](http://www.daniweb.com) [Gallery2](http://www.daniweb.com) Flags: [Gallery1](http://www.daniweb.com) | |
Re: Some suggestion... 1) If you are searching for a string in a query and expect case-insensitive, use the key word `like` instead of assignment symbol (i.e. `WHERE Status like 'Enabled'`). 2) Line 22, `if(isset($LW) == 'otherlink'){` will never be true because `isset()` doesn't return a string to compare with the … | |
Re: Well, this [join()](http://php.net/manual/en/function.join.php) function should help your life a lot easier if you are dealing with printing out an array to string with delimiter characters ;) ![]() | |
Re: Huh? What does your recursive function do? What are inputs and what output you want? Or you simply want a search for something? The word **recursive** is very broad. | |
Re: When it said `/member/user_action.php`, it means that it is at root domain level. Would you make sure that the environment you are working on is correct (i.e. localhost v. production_domain.com)? Also, the 404 happens when the target landing URL page does not exists. This could be physical file or a … | |
Re: Huh? 2 posts in a row and I don't see that wolfdragon answers actually relate to the question? One post was asking for JavaScript but he gave a Java sample code. In this one, the question is incomplete about what to do next, he gave a sample of `img` tag? … | |
Re: How about looking at this [post](http://stackoverflow.com/questions/2841499/how-do-i-import-include-matlab-functions)? | |
Re: Because you are searching for index of character in a `substring`, not in the main (`name`) string. Simply remove line 16 (`nameTwo`) and utilize the `indexOf()` method (*hint* instead of using `indexOf(int ch)`, use `indexOf(int ch, int fromIndex)`). | |
Re: Not sure you should use the same script for your current purpose. Also, how user ends up to the page that you want to show the notification? How do you construct your registered page (form filling)? The Ajax could be used if you do not want to load the whole … |
The End.