2,040 Posted Topics

Member Avatar for amith_ami

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.

Member Avatar for diafol
0
210
Member Avatar for jonardy

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 …

Member Avatar for jonardy
0
120
Member Avatar for hijran khan

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???

Member Avatar for Taywin
0
226
Member Avatar for ahvic4u

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 …

Member Avatar for Taywin
0
2K
Member Avatar for Reena_1

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 …

Member Avatar for Taywin
0
336
Member Avatar for jovstudios

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 …

Member Avatar for Taywin
0
1K
Member Avatar for Phaelax

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. …

Member Avatar for joshmac
0
135
Member Avatar for J.C. SolvoTerra

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. …

Member Avatar for J.C. SolvoTerra
0
198
Member Avatar for divinity02

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 …

Member Avatar for Taywin
0
201
Member Avatar for KyleScalise

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`. …

Member Avatar for Taywin
0
888
Member Avatar for wilferraciolli

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 …

Member Avatar for Don_4
0
193
Member Avatar for mangel.murti
Member Avatar for ravi142

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.

Member Avatar for diafol
0
2K
Member Avatar for PierJean

`$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 …

Member Avatar for PierJean
0
343
Member Avatar for Kalaivani Nair

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 …

Member Avatar for Taywin
0
240
Member Avatar for Riteman

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 …

Member Avatar for Riteman
0
203
Member Avatar for erictheonly1

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.

Member Avatar for erictheonly1
0
2K
Member Avatar for Jatin_2
Member Avatar for JamesCherrill
0
118
Member Avatar for infiniteloop56

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 …

Member Avatar for Taywin
0
973
Member Avatar for ehpratah
Member Avatar for pzuurveen
0
215
Member Avatar for rtipton

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...

Member Avatar for rtipton
0
181
Member Avatar for GoneGirl

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 …

Member Avatar for GoneGirl
0
622
Member Avatar for soomro_moon

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.

Member Avatar for soomro_moon
0
340
Member Avatar for ritania

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).

Member Avatar for Taywin
0
266
Member Avatar for marifard

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. …

Member Avatar for marifard
0
294
Member Avatar for JasonWung

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 …

Member Avatar for diafol
0
344
Member Avatar for jeram.burbon

Output: february 13, 1990 :P Anyway, for what reason would you return `Profile` object from `oldestStudent()`? Is it in your requirement???

Member Avatar for stultuske
0
534
Member Avatar for david.nicely.393

> 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 …

Member Avatar for patrick.sylvester.90
0
155
Member Avatar for vivekH

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 …

Member Avatar for janissantony
0
139
Member Avatar for polar2323

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 …

Member Avatar for Taywin
0
199
Member Avatar for redtribal23

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...

Member Avatar for Taywin
0
194
Member Avatar for sami saba
Member Avatar for Taywin
0
216
Member Avatar for rayan22
Member Avatar for hallianonline

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 …

Member Avatar for Taywin
0
165
Member Avatar for GoneGirl

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 …

Member Avatar for GoneGirl
0
2K
Member Avatar for Deepesh_1

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.

Member Avatar for Taywin
0
3K
Member Avatar for nataraja833

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 …

Member Avatar for Taywin
0
350
Member Avatar for N S K

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).

Member Avatar for stultuske
0
209
Member Avatar for Atlanta15Braves

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 …

Member Avatar for stultuske
0
3K
Member Avatar for Lethugs

> 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 …

Member Avatar for Lethugs
0
269
Member Avatar for My_1

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 …

Member Avatar for JamesCherrill
0
256
Member Avatar for Simon180

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)

Member Avatar for broj1
0
2K
Member Avatar for rjusman90

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 …

Member Avatar for rjusman90
0
238
Member Avatar for toxicandy

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 ;)

Member Avatar for diafol
0
163
Member Avatar for ravi142

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.

Member Avatar for Taywin
0
222
Member Avatar for Tunnleram

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 …

Member Avatar for Tunnleram
0
230
Member Avatar for khanNivas

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? …

Member Avatar for Taywin
0
84
Member Avatar for Auroch

How about looking at this [post](http://stackoverflow.com/questions/2841499/how-do-i-import-include-matlab-functions)?

Member Avatar for Taywin
0
322
Member Avatar for bmwwbb54

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)`).

Member Avatar for Taywin
0
2K
Member Avatar for Jake.20

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 …

Member Avatar for Taywin
0
497

The End.