Posts
 
Reputation
Joined
Last Seen
Ranked #134
Strength to Increase Rep
+11
Strength to Decrease Rep
-2
94% Quality Score
Upvotes Received
60
Posts with Upvotes
57
Upvoting Members
33
Downvotes Received
3
Posts with Downvotes
3
Downvoting Members
3
29 Commented Posts
0 Endorsements
Ranked #182
~157.53K People Reached
Favorite Tags
c++ x 332
python x 159
c x 105
c# x 16

338 Posted Topics

Member Avatar for dseto200

This program appears to be a merge of the 'have the computer pick a word and have the user guess it' and your 'number guessing' program. As written, the user doesn't have any interface to ask if the word contains a letter. You let them guess at the word and …

Member Avatar for Reverend Jim
0
3K
Member Avatar for Zach1188

I agree with grumpier, if you have to use the system() call, you're stuck with the "black window". But unless you're calling batch files, you can probably avoid the system() call.

Member Avatar for Giver
0
3K
Member Avatar for iuessele

I like using random.shuffle() on the unused cards (or deck) and then you can just pop() a random card off the unused list. If you need to keep a used cards list, you can append the card you just got. When it is time to shuffle again, you can refill …

Member Avatar for alexander.selin.7
0
13K
Member Avatar for Etniespr101
Member Avatar for noamjob

This is the essential parts of the 'source' for the basic search form extracted from the web page you indicated: [code=html] <form action="/search.php#results" method="post"> <strong>Basic Search </strong> <strong>First Name:</strong><br> <input name="fFIRSTNAME" type="text" size="10" maxlength="25" value=""> <strong>Last Name:</strong><br> <input name="fLASTNAME" type="text" size="10" maxlength="25" value=""> </form> [/code] The <form> tells you that …

Member Avatar for rmhapp
0
472
Member Avatar for basukinjal

So what are the 'given' parameters for the tree? Are all values in the tree guaranteed to be single digits? Is there a maximum depth limit? Ok, let me work this out 'on paper' so I understand it: {Note that spaces are preserved inside code tags.} Tree with 3 nodes, …

Member Avatar for steve.lorimer
1
11K
Member Avatar for asameh99

attrib is a program, not an internal command. Either, the program has been removed or renamed or it is not in your path. Though it sounds like you have a more serious problem with the system. The BOOT.INI file is what Windows uses to determine where to find the windows …

Member Avatar for Eng.muslima
0
384
Member Avatar for orwell84

I agree with Comatose, you should probably put the part that prompts for and accepts new input inside the loop somehow. That way as the loop is run again you ask for input again. The psuedo-code looks something like: [LIST] [*]While the user has not guessed the number [*]Prompt for …

Member Avatar for mdawg252
0
839
Member Avatar for yabuki

Putting code in headers is generally bad form....if you include that same header in more than one file in a compilation unit you get duplicate symbols. The original layout of the files should have worked, did you include myfile.obj or myfile.o when you compiled main.c?

Member Avatar for xmelx
0
383
Member Avatar for dennis.d.elston

Well, I personally prefer to help with code that will at least compile... Your original lines 36-39: [code=c] status = fscanf(filep, "%d%d%d%d", measuredp->site_id_num measuredp->wind_speed measuredp->day_of_month measuredp->temperature; [/code] are missing the closing ')' for the function call and the ',' separating the arguments. What dragon was referring to was that with …

Member Avatar for litsluv
0
247
Member Avatar for Krysis

I'm thinking that your problem is actually the format character in the last printf. '%d' is for decimals/integers. Try using a '%f' instead.

Member Avatar for Astro2010
0
219
Member Avatar for stonerain

I googled the function name and came up with this description: [quote] The function cvCalcOpticalFlowBM calculates optical flow for overlapped blocks blockSize.width×blockSize.height pixels each, thus the velocity fields are smaller than the original images. For every block in imgA the functions tries to find a similar block in imgB in …

Member Avatar for bart.scotty
1
703
Member Avatar for dansnyderECE

What part have you written and/or what specific question do you have? - Did you get the binary file open? - Did you fill the vector from the file? - Did you find the start point of the string? - Were you able to append characters to your string from …

Member Avatar for Murtan
0
71
Member Avatar for RingmasterTJ

I'd like to experiment with the code to try it, but in the interest of a quick answer, try [icode]low < mid[/icode] on line 20 and [icode]mid < high[/icode] on line 25. Basic translation: If there are values between low and high that are lower than mid, add them to …

Member Avatar for wieczorek1990
0
252
Member Avatar for salgaby

You're going to have to save the operands that you show the quiz taker so that you can actually perform the math to see if they give you the right answer. Right now, in CheckAnswer, you re-generate two operands and add them together. If the user happens to have entered …

Member Avatar for salgaby
0
199
Member Avatar for Manny7

I found this code example [code=Perl] use Getopt::Long; my $data = "file.dat"; my $length = 24; my $verbose; $result = GetOptions ("length=i" => \$length, # numeric "file=s" => \$data, # string "verbose" => \$verbose); # flag [/code] at [url]http://perldoc.perl.org/Getopt/Long.html[/url] (The first page returned for google "perl getopt long") If you've …

Member Avatar for Murtan
0
187
Member Avatar for prasadk14

It was my understanding (and I did a little searching that didn't disagree) packets sent to 239.255.255.255 should be available to anyone with a 239.x.x.x address. Does your computer have a 239.x.x.x address? Are you listening to the right port?

Member Avatar for prasadk14
0
2K
Member Avatar for Hoss212

So you don't want to append to the file, you want to update its contents? How many files are there? One per team? One per player? One per stat? If the file is in ASCII form (like your sample stat was) and you need to update it, you will likely …

Member Avatar for Murtan
0
148
Member Avatar for kayba

Think about it...how would YOU do it? All you really have to do is additional testing in the year they would turn 18. If they would turn 17 (or younger) this year they fail. If they would turn 19 (or older) this year they pass (they're already 18). If they …

Member Avatar for kayba
0
125
Member Avatar for princecal

If you were given the assignment to do it by hand, how would YOU do it? (The manual process makes a good basis for the pseudo code for the computer.)

Member Avatar for shaiq
0
502
Member Avatar for perly

did you mean to save the key and value pairs you read in so you can search them when you open the second file?

Member Avatar for perly
0
127
Member Avatar for mischikun

I'm not sure what the question is. You declare a pointer to an object of the appropriate type on line 17, in most linked lists I've seen, it is usually named "next" but other than that I don't see a problem. You do appear to be declaring one on line …

Member Avatar for Murtan
0
183
Member Avatar for DrewDodson89

You want to put the date and time in the title of the window that pops up, or do you want the name of the directory to contain the date and/or time? For getting the date/time into a string, you might look at strftime() and you should probably also consider …

Member Avatar for DrewDodson89
0
228
Member Avatar for jimJohnson

It was a link to another thread that explains why not to use eof() in your while loop condition. Click the link, read the thread and implement the change.

Member Avatar for jonsca
0
249
Member Avatar for Aurorian

line 24 is passing the address of a function to scanf? I think you meant [icode]scanf("%f", &inch);[/icode] line 35 you need to pass the address of restart [icode]scanf("%f", &restart);[/icode]

Member Avatar for Murtan
0
98
Member Avatar for jdpjtp910

I wouldn't have written it in the same way, but I think your problem is two-fold: First, you never set an initial value for [ICODE]DivSales::totalSales[/ICODE] so it's initial value is undefined. Second, line 21 of DivSales.h where you think you are adding to the total, [code] totalSales =+ q0+q1+q2+q3; // …

Member Avatar for Murtan
0
1K
Member Avatar for ravenrider

the [ICODE]ifstream fin[/ICODE] on line 48 inside readin() is NOT the same as the stream of the same name that is declared on line 20 and opened on line 24 in main(). You either need to open the file in readin() or pass the stream from main into readin().

Member Avatar for Murtan
0
151
Member Avatar for shyami

You put your variable definitions in a .py file you could name it definevble.py if you wanted to. Then from the other python file (.py) that wanted the variables you add a line: [code=Python] from definevble import * [/code] That imports everything in that file into this file. I think …

Member Avatar for shyami
0
123
Member Avatar for sathya8819

I've never actually done it for a website, so you may want to take this with a grain of salt. The concept is that as a user is added to the 'database' of users, you generate a random 'validation value' that is also stored with the user. You then generate …

Member Avatar for sathya8819
0
274
Member Avatar for BevoX

If you don't intend to use any of the predefined C++ data types in your implementation, what do you propose to use? A 6000 byte long number could be implemented, I would probably use an array with 6000 elements, but that still uses base C++ data types. (Ignoring the fact …

Member Avatar for maf5693
0
4K
Member Avatar for gangster88

So you just want to output the percentage calculation for heads and tails? Wouldn't you just divide the number collected by the total sample size?

Member Avatar for charlottetemp
0
1K
Member Avatar for new programer

I don't want to spend the time to figure out if your program does exactly what the spec calls for, I'd rather help you get your program to do what you expect. What are you seeing it do that is unexpected? (What are the symptoms) You might want to add …

Member Avatar for Agni
0
156
Member Avatar for Nerathas

In C# a function can return only one value. You're passing the fraction into the simply function as a numerator and a denominator and the function is unable to return both. Alternatives would be to 'package' the numerator and denominator into a struct or class which you could pass in …

Member Avatar for ddanbe
0
172
Member Avatar for Karthika_g

You don't want the 'foreach' on line 9, you don't want to add a record to the database for every field on the line. and presuming that the construct [icode]cmd.Parameters.Add("@acc", SqlDbType.NVarChar).Value = part[i];[/icode] makes sense (I've not seen it before so I'll trust you that it will work). You will …

Member Avatar for DanielGreen
0
203
Member Avatar for cam875

There are several options, most of them make the protocol significantly more complex. The goal would be to verify the client and/or the response. You could start each conversation with some kind of challenge and response. Where your code would know how to respond and a fake client would have …

Member Avatar for cam875
0
77
Member Avatar for asm2hex

I'm almost certain you have to make a copy of the data to do what you're trying to do. Depending on the database and the size thereof, attempting to load the entire database into an array might not be your wisest design decision. Here are a few questions to help …

Member Avatar for Murtan
0
128
Member Avatar for Karthika_g

Show us what you've done... [url]http://www.daniweb.com/forums/announcement118-2.html[/url]

Member Avatar for Murtan
0
58
Member Avatar for laelzio.mosca

It would depend on how smart you want the computer to play. The smarter you want the computer to be, the more work it will be. You will likely end up adding a function that will 'make a move' like the player1() and player2() do. A simple implementation for the …

Member Avatar for nerdinator
0
203
Member Avatar for akim_atl

How would you solve the problem manually? I want to withdraw $180, what bills would you give me? How did you decide how many to give me? Ok now make the computer do it... Write some code that asks how much to withdraw. Add a print statement that outputs what …

Member Avatar for virgo_norz
0
1K
Member Avatar for idgeza

200 lines of code is not unreasonable to post, you should just have posted it in code tags. (There are lot of people that won't download code. I don't do it very often.) The "vecA" files would be fairly straight forward to do after the loop that does the calculations, …

Member Avatar for Murtan
0
120
Member Avatar for zachattack05

I apparently wrote this while Ryshad was replying. He covers most of it in a more elegant fashion, but I'll post it anyway. Local variables work like you mentioned your [icode]i[/icode] did in VBA. If you declare it in a function, it goes out of scope when the function ends …

Member Avatar for drifai
1
864
Member Avatar for PDB1982

You're iterating too far. The element indexed by [icode]cnt[/icode] wasn't fully read. On Line 25 the loop limit should be [icode]i < cnt[/icode] not [icode]i <= cnt[/icode]

Member Avatar for Lerner
0
121
Member Avatar for abhaymv

I think your problem is that you don't read the records from the file when you're making changes to them. For example if the first thing I did after starting the program was to check-out or check-in a book, I select menu choice 2 and this is the code: [code=c++] …

Member Avatar for abhaymv
0
266
Member Avatar for qwertymk

Why don't you want the memory set to zero? Are you trying to extract some 'previous' value from the memory?

Member Avatar for qwertymk
0
120
Member Avatar for Egypt Pharaoh

You need to associate a method with the button's "on click" event. The code in the method will need to generate the textbox. (Did you mean a message box?) If you want more detailed help you're going to need to tell us more about your code environment, and preferably show …

Member Avatar for sknake
0
101
Member Avatar for hao90

I don't see anything obvious about the login...maybe you could describe the problem you're having better? As not all of the code required to validate the login is shown, I'm presuming that all of the variable declarations are ok and that the user input for the login and password don't …

Member Avatar for hao90
0
176
Member Avatar for lisedaton

When asking for help, please describe the symptoms you do see (if any). For debugging purposes, you should add some print statements to your code to confirm that you are getting the data you expect, where you expect it and for progress messages so you can tell where you stopped …

Member Avatar for Murtan
0
88
Member Avatar for chester1908

Posting the code (in code tags) would have saved a lot of description of 'how you solved' the problem and given us a chance to actually help you. I think I understand the symptoms of the problem fairly well (and that's a good thing to include when you're asking for …

Member Avatar for Murtan
-2
268
Member Avatar for computerages

I wouldn't use multi-threading in this type of application. You might look at using something from the [ICODE]_spawn[/ICODE] family of functions using the [ICODE]_P_NOWAIT[/ICODE] setting in place of your [ICODE]system()[/ICODE] call. They start child programs, but do not wait for them to complete.

Member Avatar for Murtan
0
94
Member Avatar for PDB1982

His line 12 should have been [icode]++cnt;[/icode] Though I agree with a previous poster that you have 8 grades, and do not have an average or a letter grade in your input file, which makes his sample code flawed as it tries to read the average and grade.

Member Avatar for Dave Sinkula
0
90

The End.