338 Posted Topics
Re: We generally don't do 'instant' solutions or links to them here. We like to help those who help themselves. If you've put some effort into a solution, but don't understand why you get the results you do, or the errors you're getting, post the errors or results (preferably with code … | |
Re: is state() supposed to detect winners? First of all, it does not always return a value. Secondly the expression [icode]game[1]&&game[2]&&game[3]==play[/icode] does not test positions 1, 2 and 3 for the value play. I think you wanted [icode]game[1] == play && game[2] == play && game[3] == play[/icode] Third, when you … | |
Re: Will the grid really contain 'x' where it doesn't have a word? Is it defined that all words will start at the left and go right, or start at the top and go down? If there are going to be other letters in the grid, it would help to have … | |
Re: At least part of the problem is in your last set of code... The tempptr was null, so you allocated and initialized it, but tempptr was just a copy of the pointer from [icode]current[target[i]][/icode] you made no effort to set the original array entry to the newly allocated item. Also … | |
Re: Please be more specific with your question..."When I run the program, I'm seeing ____. I tried ____ but it didn't solve it." or something along that line. Does the code compile? Does the program run? Does it do what it is supposed to do? | |
Re: If I ever wrote methods like writefile(...) and readfile(...) for a class that was to be streamed to/from files, I would pass the file handle (or stream) as an argument to the method so that it didn't have to worry about opening the file or closing the file. It would … | |
Re: Another common option is to leave the board in a single dimensional array. Depending on how you interface to the board, it has advantages and disadvantages. For example, a 3 x 3 board would use 9 elements in an array. The first 3 would be the first row (or first … | |
Re: Then modify the sample code he gave you. Programming is an adventure, TRY something and see what it does (especially on simple things like this). If you try something and it doesn't do what you want, either modify it and try again, or post it here with a 'it does … | |
Re: Please use code tags to wrap your code. Your code as posted: [code=python] house = ["TV", "computer", "phone", "playstation", "Wii", "EMPTY"] print "items in my house are: " print house house = ["TV", "computer", "phone", "playstation", "Wii", "EMPTY"] print "Pick an item to fill in the empty space: \n1 =TV\n2 … | |
Re: The [icode]if[/icode] is the proper construct. You couldn't replace them with while or do/while without significant restructuring of the methods. I will note however that the remove method could be improved. It presently will 'leak' the newitem that it created. (The creation of which was entirely un-necessary.) The method will … | |
Re: I would agree that it does not look like it is quite linked up right. Where is the Applicant class defined? (I see [icode]Applicant app[/icode] but not the class, does this compile?) I'm not sure, but it appears that you are repeating some (or all) of the data from the … | |
Re: Quoting from the link: After the installation, the following files should be present on the target system in the indicated folders: <windows system>\Msdbrptr.dll <program files>\Common Files\Designers\Msderun.dll <windows system>\Msstdfmt.dll The inclusion of Msdbrptr.dll (and its dependent files) typically corrects this problem. If you are still experiencing problems, make sure that the … | |
Re: If the array entered was: [code] 40 20 10 30[/code] I think the output should be:[code] 2 1 3 0[/code] Does it look like I understood the what the program is supposed to do? I will not just solve your problem. I will help YOU solve your problem. If you're … | |
Re: Short answer: Move the [icode]do {[/icode] from line 23/24 in front of the random stuff starting on line 15. Longer answer: If you were to break each problem type out into a function, you could call it from the [icode]if (choice ==[/icode] stuff. The function could then generate the random … | |
Re: That looks like a mass-mailing application...not sure I WANT to help, but does it just not work or are you getting an exception? If you're getting an exception, what is it? If it just "doesn't work", what debugging (to ensure you are getting the right parameters set) have you done? | |
Re: ALWAYS use CODE tags when posting code. Also all of the leading whitespace is missing from your posted code. In python, leading whitespace is an essential part of your code, you can't compile without it. (I was going to re-post your code here with the code tags, but I don't … | |
Re: Your loop starting on line 129 is only one line long (130) You should probably also indent lines 131 to 147 to the same level as 130 to make them part of the loop. | |
Re: Please use the CODE tags around anything that is a block of code, it makes it easier to read. [code=c++] #define API_DLLEXPORT extern "C" __declspec(dllexport) HINSTANCE hIQ_Measure; // handle for IQ_Measure DLL hIQ_Measure = LoadLibrary("IQ_Fact.dll"); // you only need to do this once typedef IQ_RESULT_TYPE *(*DLL_PROC)( LPTSTR); typedef IQ_RESULT_SWEEP_TYPE *(*DLL_SWEEP_PROC)(LPTSTR); … | |
Re: Not to be too terribly picky, but the code in the above post where it uses [icode]if int(num) not in [0,1]:[/icode] will fail if the user enters non-digit characters. If the test were performed with strings it would not fail: [icode]if num not in ['0','1']:[/icode] | |
Re: If you want help (with what obviously appears to be homework) show us what you have so far. We will usually help you with homework, but we won't do it for you. | |
Re: I'm not certain I understand your question or what you need help with. (Specific questions usually get faster and better answers.) Are you saying that you need to write an application that will be run weekly to extract data from an Excel worksheet and insert it into an SQL database? … | |
Re: This sounds like an assignment, but you will probably have to re-create what strtod() does. You will end up validating the string (or characters) and building the number by recognizing the digit characters. | |
Re: I believe your algorithm is the source of your problem...you are running 3 nested loops, when I think your intent is to iterate at least some of the arrays simultaneously. Your algorithm (as written) does the following: For each row of the first array, compare it with each of the … | |
Re: I think the problem is where you're building your select [code]SqlDataAdapter da = new SqlDataAdapter("select * from mudiamINC where fname like" + TextBox1.Text + " %", con);[/code] I'm think you need a space after the like, but not before the % [code]SqlDataAdapter da = new SqlDataAdapter("select * from mudiamINC where … | |
Re: I think the problem that you are running into is the fact that it is VERY unlikely to just randomly select digits to fill into the grid and have a grid that meets all of the criteria. There are improvements you can make to your algorithm to make better choices, … | |
Re: You have a basic misunderstanding related to pointers. Pointers must be made to point to a valid storage location before they can be used to reference anything. [code=c++] class Foo { private: int mX; int my; public: Foo(); int getX(); int getY(); void setX(int x); void setY(int y); }; Foo … | |
Re: LOWORD is a macro, used to extract the 'low word' from a long. HIWORD extracts the 'high word' There is another macro that can be used to put them back together: [code] LPARAM MAKELPARAM( WORD wLow, WORD wHigh ); [/code] So a call like: [icode]MAKELPARAM(somenum, HIWORD(lParam))[/icode] would be pretty close … | |
Re: If you want the program to ask for multiple inputs, you need to re-prompt and re-accept input inside the while loop. Try putting it right after you display an answer. | |
Re: Is this game supposed to be like the card game memory? Where you turn over two cards and if they match you count the pair (usually removing the cards) and if not flip them back over? So for each user turn: the user should pick a first card you 'turn … | |
Re: I see a few things that could be done to clean the code up. The largest of which is that you have one HUGE method that seems to want to do all of the work. This is almost always a sign of a poor design. The pseudo code for the … | |
Re: A little more data might be useful. Do you have a more concrete example of the relationship? Does your form have all of the data necessary to add one row to each table? Is there enough data to add more rows to either table? | |
Re: Are you asking to programmatically detect when another program opens a particular file? Is the other program known? Would it be sufficient to know if the specific program opens the file, or do you need to detect if the file is opened by ANY program? Are there any real-time constraints … | |
Re: Not stopping your service is a bit unfriendly, do you properly handle getting stopped if windows is shutting down? I suspect the reason you don't get called a second time is because something you're doing in the first event causes you to be removed from the handler chain. Confirm that … | |
Re: where's the code to support the rest of the algorithm? It looks like it might be useful to write a function to calculate the distance between two cities (or two coordinates). | |
Re: As a side note to the discussion, although it is convenient in this context to have the default Car constructor generate a random car, the constructor seems to be doing an awful lot, including adding delays? I try to promote the simple constructor theory where the constructor is as simple … | |
Re: Is the problem that your application has the input focus and is getting all of the keystrokes instead of the game? Can your application run while minimized? This would remove the input focus from your application and return it to the game. Alternatively, could your application just send the keys … | |
Re: It doesn't make much sense for a location (specified as latitude and longitude) to support an increment (or decrement) operator at all. The current implementation causes the location to move in a diagonal direction, what is the benefit? How would it be used? | |
Re: It's been a while since I played in VB, but doesn't the [icode]x = 1[/icode] run every time the timer is called? The sub as displayed reads from [icode]Me.ProgressBar1[/icode], but does not appear to set it, so the value doesn't change here. So if neither [icode]Me.ProgressBar >= 10[/icode] or [icode]x … |
The End.