255 Posted Topics
Re: You are declaring insertseek1 as a normal function but then calling it from an object ($db) that doesn't exist in this context. Just do this: [CODE=PHP]$res=insertseek1($user,$pss);[/CODE] | |
Re: clock() will get the number of "ticks" since your program started. If this statement is executed at the same point in the program several times (likely), you will see repetition. time() is the better choice, if not for randomness, then just for commonality. | |
Re: A waveform is made up of digital samples or frames. You don't need to do this operation in real time, rather you can calculate the length of each sample and set how ever many you need to "low". | |
Re: What exactly do you mean by "online practice"? But check out this thread: [URL="http://www.daniweb.com/forums/thread67837.html"]C / C++ FAQ's and Practice problems[/URL]. Yes, thats the C++ forum, but most of the problems can be done just as well in java. | |
Re: You have posted quite a bit already, so you should know how to use code tags. Do it. | |
Re: Pdf files aren't encoded in plain text; if they were there would be no point to having another file type. | |
Re: I don't think AJAX would be the best choice, instead use javascript to change the button's style.display value. If you don't know how to do this, I suggest this [URL="http://www.informit.com/library/library.aspx?b=STY_JavaScript_24_hours"]javascript tutorial[/URL] (it covers this topic directly). It is always better to actually learn something about a language instead of just … | |
Re: So, what code have you done already, and what are your problems? (In case you haven't heard, we won't do your homework) | |
Re: Google "php image gallery" or something along those lines. Plenty of results come up. | |
Re: Use a database to store car info (names, image files, etc.) as well as the number of votes that car has gotten. When a car gets a vote, just increase this number by 1. | |
Re: Create a counter of how many "levels" of braces you are in. What do you mean by reposition? To see if they are part of a block, look at the statement before the opening brace. If it is a for loop, if statement, etc. then it is valid. | |
Re: Why use getche? As well as being compiler-specific, it is not very c++-like to use such functions. [URL="http://cplusplus.com/doc/tutorial/basic_io.html"]Here[/URL] is some info on how C++ does i/o. | |
Re: Specifically for this purpose, you would likely use [URL="http://us2.php.net/serialize"]serialize[/URL] and its opposite, unserialize, to store an object as text. | |
Re: Using <?= is shorthand for printing whatever is between the tags. I don't understand your problem, however. Do you have PHP code stored in a database that you would want to execute? | |
Re: mktime likely uses a more complex algorithm for computing the timestamp, it would have to include leapyears for example. If you want to let PHP handle dates, use it for creating the timestamp and for decoding it. If you want to use your own algorithm, you must use that at … | |
Re: Put this: [CODE=PHP]if (!$user_check) { die('Invalid query: ' . mysql_error()); } [/CODE] in between this: [CODE=PHP]$user_check = mysql_query("SELECT userdb_user_name FROM default_userdb WHERE userdb_user_name='$reciever'"); [/CODE] and this: [CODE=PHP] $user_check = mysql_num_rows($user_check); [/CODE] and tell us what is displayed. | |
![]() | Re: Use "%e" in printf. And what do you even think "%1f" is doing for your code? |
Re: Using .inc files is a bad idea in terms of security. If a user tries to view that file directly and the server doesn't interpret it through PHP, the user will be able to see your code! ![]() | |
Re: Returning 1 (or some value > 0) is a common way of reporting that the program did not execute correctly. | |
Re: Try reading about bitwise operators, that will clear things up for you. | |
Re: You could probably pull it off with some clever javascript. That solution would be more inline and portable than a mandatory plugin anyway. | |
Re: Do not use goto: in C applications. It is very bad coding practice (see [URL="http://en.wikipedia.org/wiki/Spaghetti_code"]spaghetti code[/URL]). Instead, use control structures like conditional statements, loops, etc. | |
Re: [URL="http://us2.php.net/mysql_fetch_array"]mysql_fetch_array[/URL] returns an array, just a the name implies, so this statement: [CODE=PHP]$new_Number_value = $query_results_Number++;[/CODE] is trying to increment an array? You want some thing like this: [CODE=PHP]$new_Number_value = $query_results_Number["Number"]++;[/CODE] | |
Re: Learn [URL="http://www.winprog.org/tutorial/"]WinAPI[/URL] or MFC. | |
Re: There are a few ways to do this. For one, let us define i as any index of the 1D array. The corresponding row of this element is [CODE=C]r = i / 25;[/CODE] The column is [CODE=C]c = i % 25;[/CODE] Alternatively (would likely be faster too), have three counters: … | |
Re: A bubble sort but with the comparison flipped. | |
Re: You can use a tm structure for the date of birth, convert it with mktime(), and subtract that from time(). Then convert your answer back into a tm struct. | |
Re: 1. Get a more recent compiler 2. [URL="http://openil.sourceforge.net/download.php"]DevIL[/URL] works well (you may need to learn some WinAPI stuff depending on how much control you really want) | |
Re: Why don't you explain why you need to do this? It is likely there are much better ways of doing whatever it is, unless you are trying to provide a very low level service. | |
Re: Your post describes each step perfectly. Computer generates a number, user makes a guess, computer tells what range the number it is in, and so on. If you're problem is writing the code, learn some c++ first. | |
Re: Have an array for each possible number, have each element be a flag as to whether the number at that index has been generated. | |
Re: That looks like a good implementation to me, and without the comments its really quite short and sweet. | |
Re: If you can't find it, make it yourself. It's not too difficult. Use an existing image library (DevIL works well, covers almost any format). Then get the image data and apply a rotation. Google/Wikipedia will have the math you need for rotation. | |
Re: A simple solution (but will give more flexibility): define two arrays, one with source characters and the other with destination characters to replace those with. Arrays are matched by indices. Just make sure there are no repeats or decryption may not work correctly. | |
Re: Sounds like [URL="http://www.pages.drexel.edu/~weg22/can_tut.html"]edge detection[/URL] would help. | |
Re: Open your php.ini file, look for the values of SMTP and smtp_port. Change these to the appropriate server and port. If you can't access php.ini (hosted site) use ini_set() like the error suggested. | |
Visual C (2008) is acting as if I never included a header file (wave.h) that I am using, but the #include statement is definitely there. Here's my main (BPM analyze.c): [CODE=C]#include "stdafx.h" #include "common.h" #include "sound.h" #include "wave.h" int main(int argc, char* argv[]) { SAMPLE samples[2]; unsigned int i, j; … | |
Re: Even if you could use scanf for your purposes, it is better to use fgets anyway. | |
Re: And your origional question seemed to be about whether or not you could include <string> multiples: well all the standard headers use #ifndef too! Cool, right? | |
Re: What is the problem with using || ? It is a completely valid part of the C language. There might be some obscure way of doing the same comparison without it, but it would be useless to even try it. | |
Re: The first article you posted has a very concise description of this layout. It describes the class architecture you will use (study object oriented programming in PHP), including the use of abstract, super, and sub classes. It also defines the most common and most helpful methods to define for each … | |
Re: Use code tags, tell which line is producing that error. | |
Re: Use fgets to read one line, strtok to split each line between spaces, sscanf to break apart each value. Do this all in a loop to read multiple lines. | |
Re: Good point. With both under your belt, not only will it strengthen your overall programming knowledge, the flexibility it would give you would be more impressive on a resume. | |
Re: Use [URL="http://cplusplus.com/reference/clibrary/cstdio/fgets.html"]fgets[/URL] to read one line, [URL="http://cplusplus.com/reference/clibrary/cstring/strtok.html"]strtok[/URL] to split it on spaces, '=', etc. | |
Re: That would be the correct way to call it. The function would still not work as planned, as you set hours to zero inside calctotal. The function itself should be something like: [CODE=C]float calctotal(float hours) { // got rid of: int hours=0; if (hours < 3 && hours > 0) … | |
Re: If you have to use array notation, also consider using a static variable instead of a parameter: [CODE]void enter(int *p_arr) { static int insert = 0; printf("\nplease enter the number:"); scanf("%d", &insert); p_arr[i++]=insert; }[/CODE] | |
Re: If you don't know how to open the file, read about fopen, fclose, etc. If you don't know how to read the information, read about fgets, fread, sscanf, etc. | |
Re: What is the program you are using? What type of SQL server are you using? Have you learned programming in PHP? |
The End.