Search Results

Showing results 1 to 40 of 538
Search took 0.03 seconds.
Search: Posts Made By: Murtan
Forum: C++ Sep 30th, 2009
Replies: 1
Views: 273
Posted By Murtan
Your problem is inside the while loop.


while (whileIter != tmpCsvFile.end())
{
whileIter++;
if (fileName == (whileIter->fileName).c_str())
break;

}
Forum: C Sep 30th, 2009
Replies: 3
Views: 323
Posted By Murtan
If the parent process doesn't have to wait, why does it care who finishes first.

If at least one child process needs to finish, then you have to wait.
Forum: Python Sep 30th, 2009
Replies: 3
Views: 415
Posted By Murtan
Please use code tags when posting code

You will need to re-input the health inside the loop so that it will ask the user for the health again. I suspect the current version outputs the 'health...
Forum: C++ Sep 30th, 2009
Replies: 4
Views: 323
Posted By Murtan
I'm not sure what your problem is, when I compile and run it:

start
Caught One! Ex. #: 1
Caught One! Ex. #: 2
Caught a string: Value is zero
Caught One! Ex. #: 3
end
Forum: C Sep 29th, 2009
Replies: 5
Views: 552
Posted By Murtan
That looks like it ought to work.

The program is counting the characters in the word say "daniweb" and also counting the enter as it is also a character before the EOF.

if you entered "daniweb"...
Forum: C++ Sep 29th, 2009
Replies: 2
Views: 396
Posted By Murtan
For the most part in c++, a class is almost the same as a struct. The key difference is that members in a struct default to public, in a class they default to private. You made all of the members of...
Forum: C++ Sep 29th, 2009
Replies: 1
Views: 162
Posted By Murtan
Why not just 'add' the records you want in main, after you construct the list?


int main()
{
List test;

test.InsertEmployee("Michael bay",1234,"Design");
...
Forum: Python Sep 29th, 2009
Replies: 2
Views: 409
Posted By Murtan
I can't find the examples right now, but I recall modifying the setup.py to perform a search for some DLLs and using the path I found in the data section.

so instead of the constant string...
Forum: C++ Sep 29th, 2009
Replies: 2
Views: 439
Posted By Murtan
I don't see where your enqueue function sets the next and prev members of the node.

When the queue is empty, front and rear should both be NULL.

When you add the first node, front and rear...
Forum: C Sep 29th, 2009
Replies: 5
Views: 552
Posted By Murtan
We like to help those that show some effort, especially when it appears to be an assignment.

Show us what you've tried. Tell us what it does and what you expected it to do and we can help you make...
Forum: C# Jul 30th, 2009
Replies: 10
Views: 574
Posted By Murtan
I think the forcibly stopped comes from the reader application reading one line and exiting.

Can you put the read into a loop of some form?

If you're going to write to the stream more than...
Forum: Python Jul 29th, 2009
Replies: 1
Views: 163
Posted By Murtan
The code you posted wouldn't even compile, let alone run.

Please be specific in the problem you are having.

I think the following is close to what you wanted, but it uses global variables which...
Forum: C++ Jul 29th, 2009
Replies: 2
Views: 149
Posted By Murtan
It looks like it compiled, so the symbol was defined enough for the compiler to recognize them.

The link process is where the actual executable is built. The linker needs to match up the symbol...
Forum: C Apr 21st, 2009
Replies: 6
Views: 622
Posted By Murtan
Not surprisingly, but your program is doing what you told it to:


// Wait here for the user to enter a message
gets (msg);

while (msg != "q")
{
/* Write out message. */
...
Forum: C# Apr 9th, 2009
Replies: 5
Solved: ConnecionString
Views: 383
Posted By Murtan
So what you really want is a verification that a specific record (license) exists and you would never want anyone to be able to list or add records.

I'm not sure what resources you have available,...
Forum: Python Apr 9th, 2009
Replies: 3
Views: 295
Posted By Murtan
If the coordinates were tuple (instead of lists) python would compare the values correctly:


a = [(1,2),(2,0)]
b = (2,0)
aa = a[1]
# now aa == b returns True

#alternatively, though probably...
Forum: Python Apr 9th, 2009
Replies: 3
Views: 295
Posted By Murtan
You're having an entity vs value comparison issue:


a = [[1,2],[2,0]]
b = [2,0]
aa = a[1]
# at this point, b = [2,0] and aa = [2,0]
# but aa == b returns False

# aa[0] == b[0] returns True
Forum: C# Apr 9th, 2009
Replies: 5
Solved: ConnecionString
Views: 383
Posted By Murtan
Will the users of your application be connecting to your SQL server or is the intent for them to connect to their own server?

The following presumes they will be connecting to your server:

Hard...
Forum: Python Mar 31st, 2009
Replies: 12
Views: 656
Posted By Murtan
Maybe you should look at the python bit-wise operators in the Python Docs (http://docs.python.org/reference/expressions.html#binary-bitwise-operations)
Forum: Python Mar 16th, 2009
Replies: 5
Views: 513
Posted By Murtan
Were you using the formula from page 8 of the pdf?

Shouldn't it be more like this?

return (0.0 + c - min(a, b)) / max(a, b)


I could be wrong, it wouldn't be the first time (grin).
Forum: Python Mar 13th, 2009
Replies: 3
Views: 463
Posted By Murtan
Your posted code did have tags, but if you use the language specific tags for example, you get line numbers and syntax highlighting as well. The syntax highlighting makes the code easier to read...
Forum: C++ Mar 12th, 2009
Replies: 12
Views: 462
Posted By Murtan
Line 26 should be:


if ((convert=fopen("convert.txt","r"))==NULL)


I have a couple of points and several questions about the encryption loop:

while(c!=EOF)
{
Forum: C++ Mar 12th, 2009
Replies: 12
Views: 462
Posted By Murtan
you showed us the content of the file...


So I'm presuming that you're will need to read each line of the file, parse it to find what's on the left and the right of the '=' and setup the...
Forum: Python Mar 12th, 2009
Replies: 3
Views: 463
Posted By Murtan
First, the directory structure shown by walk doesn't quite appear to match what you said the structure would be.

For example, the directories under Library appear to be prefixed with a number (as...
Forum: C++ Mar 12th, 2009
Replies: 12
Views: 462
Posted By Murtan
So the first file defines the 'encryption'
The second file contains the 'message' to be encrypted.
The third file you are supposed to generate as the encrypted message?

If so, you will need to...
Forum: Python Mar 9th, 2009
Replies: 62
Views: 394,594
Posted By Murtan
I was working on revamping the code...most of it would need changes to work with the classes.
Forum: Python Mar 8th, 2009
Replies: 62
Views: 394,594
Posted By Murtan
Ok, I'm going to post this...I've started it several times and then you post a significant rewrite of your code and to help you I have to toss this stuff out.

You can use the idea and expand on...
Forum: Python Mar 8th, 2009
Replies: 62
Views: 394,594
Posted By Murtan
The lines:


self.weapons[1:"Steel Knuckles",2:"Knife",3:"Sword",4:"Gun",5:"Rocket Launcher"]
self.armors[1:"Leather Jacket",2:"Padded Sweater",3:"Iron Arm-shield",4:"Bullet-Proof...
Forum: Python Mar 7th, 2009
Replies: 62
Views: 394,594
Posted By Murtan
Line 242 (line 2 in the fragment):


elif self.deposit <= self.money:
self.bankbalance = self.money - self.deposit
self.money = self.money - self.deposit
print"Your new bank Balance...
Forum: Python Mar 7th, 2009
Replies: 62
Views: 394,594
Posted By Murtan
If you're having a problem with part of the code, please be specific as to what the problem is. What did you see? What did you expect to see?

If it is a compile problem, include the full text of...
Forum: C++ Mar 6th, 2009
Replies: 4
Views: 1,007
Posted By Murtan
const is a 'promise' not to change.

If you have member-functions that do not change your class (and never should) you can declare them const.

const member-functions are declared like this:
...
Forum: C++ Mar 6th, 2009
Replies: 10
Solved: tic-tac-toe
Views: 564
Posted By Murtan
@VernonDozier
You're right (again), I missed the fact that they would all be 3's to start.

Not that it is an excuse, but my convention for TTT win checks is to check for matches against the last...
Forum: C++ Mar 6th, 2009
Replies: 10
Solved: tic-tac-toe
Views: 564
Posted By Murtan
It would appear that inside move, placement is actually getting set to true when the game is 'won' but nothing is looking at placement to stop the game. The only stop case is when the board is full.
Forum: C++ Mar 6th, 2009
Replies: 10
Solved: tic-tac-toe
Views: 564
Posted By Murtan
Oh, and please:

When posting c++ code, please use c++ code tags

// Your code here
Forum: C++ Mar 6th, 2009
Replies: 10
Solved: tic-tac-toe
Views: 564
Posted By Murtan
Actually, it should never get to that print line...it returns from inside all over the function. (Though I'm not sure that the returns in all of the test are required.)

Is the board required to be...
Forum: Python Mar 6th, 2009
Replies: 2
Views: 264
Posted By Murtan
Ok, just to make sure I understand, you're running on computer A and can telnet to computer B. You want computer B to telnet to computer C?

Why not telnet from computer A to computer C directly?
...
Forum: Python Mar 6th, 2009
Replies: 62
Views: 394,594
Posted By Murtan
The saved games should not change the code, but if you posted the file with the saved game in it, we should be able to save it and have the game load it like it was our saved game.
Forum: Python Mar 5th, 2009
Replies: 62
Views: 394,594
Posted By Murtan
I meant the second code fragment in post 32 (http://www.daniweb.com/forums/post819042-32.html) where I posted you an entire file full of working code. The code isn't a fully complete version, but it...
Forum: Python Mar 5th, 2009
Replies: 25
Views: 1,303
Posted By Murtan
What if we changed decode?

def decode(loc):
## Funktion för att översätta user input från A4 till listindex.
## den skall returnera -1 om platsen inte är giltig.
letter = loc[0].upper()
...
Forum: Python Mar 5th, 2009
Replies: 62
Views: 394,594
Posted By Murtan
Line 96 should be:

self.e = self.eAttack()


The self.tnls on line 114 does not belong. It was moved to line 14.


(Why did you only copy part of the source when I went to the trouble to fix...
Showing results 1 to 40 of 538

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC