338 Posted Topics

Member Avatar for Darkmystery

or, you at least need another index for the characters you put into packets. When you switch to a new x index, you need to reset the output index to 0. [code=c] void split(char *original) { int x = 0; int i = 0; int jj = 0; while (original[i] …

Member Avatar for Darkmystery
0
156
Member Avatar for tutti

Ok this first comment is pretty minor, but I'll mention it anyway. The code for setup randomly selects the players card and the dealers card, then removes both cards from the deck. It does this twice to for the initial two cards. There is a chance (pretty small, but it …

Member Avatar for Murtan
0
179
Member Avatar for Stefano Mtangoo

This didn't make any sense? [code=python] self.rtc.BeginTextColour((255, 0, 0)) self.rtc.WriteText("colour, like this red bit.") self.rtc.EndTextColour() [/code] It looks like you have to 'build' the contents of the Rich Text Control as you go. When you get to text you want in another (non-default) color, you call BeginTextColour with a tuple …

Member Avatar for Stefano Mtangoo
0
109
Member Avatar for StarZ

Can you TRY to use some of what you got? If its not quite right, change it a little. Try starting the loop like this: [code=python] while house[5] == "Empty": print "Pick an item to fill in the empty space: \n1 - Lamp\n2 - bed\n3 - NDS\n\n" [/code] You will …

Member Avatar for StarZ
0
119
Member Avatar for PC_Nerd

The first point was a link to an article that describes why the concept of 'security through obscurity' was false. (The concept that just because you aren't telling anyone about how you do something that it is therefore secure.) The second half about the 'big enough target' refers to the …

Member Avatar for PC_Nerd
0
1K
Member Avatar for Rejinacm

Python does string or number pretty well. If you need variables that are a specific size in bytes, look at ctypes

Member Avatar for sneekula
0
140
Member Avatar for god_43

the test [ICODE]if ((cMenu == 'A' && cMenu == 'a') || (cMenu == 'B' && cMenu == 'b') || (cMenu == 'C' && cMenu == 'c'))[/ICODE] can never be true because the character can not be both the uppercase and lowercase letter at the same time. With input where the …

Member Avatar for dbmoyes
0
135
Member Avatar for vandenzergen

It may not be very efficient, but this creates an output file with the one string in it: [code=c#] using System; using System.IO; using System.Collections.Generic; using System.Linq; using System.Text; namespace FileCreationTesting { class Program { static void Main(string[] args) { String test = "This is some sample data\n"; FileStream fh …

Member Avatar for vandenzergen
0
133
Member Avatar for akm3
Member Avatar for Murtan
0
126
Member Avatar for codedhands

In all of the code here, I don't really see the point for the threading. Unless you've simplified the code to demonstrate your question, reading from a file doesn't usually take very long (unless its really big) and in any case, there is nothing else going on so we end …

Member Avatar for codedhands
0
2K
Member Avatar for aodpreacher

What's your objective? What kind of interface do you need? Should the game play fully automated, or does the user interact with the game? If fully automated, where/how do you define the 'rules' for the player? Do you need to shuffle the deck? What keeps 'choice' from re-picking the same …

Member Avatar for tutti
0
1K
Member Avatar for rogergrippo
Member Avatar for naim khan

I don't think I understand your request. Are you saying that your program creates a folder and then puts some files in it? Then later, your program creates another folder and you want to move the files from the first directory to the second?

Member Avatar for Murtan
0
37
Member Avatar for dseto200

Python lists support several methods for example: append, count, extend, index, insert, pop, remove, reverse, sort [url]http://www.letmegooglethatforyou.com/?q=Python+List[/url]

Member Avatar for mn_kthompson
0
332
Member Avatar for mini programmer

If the string only contains a date (month/day/year) then you're right the third '/' isn't strictly necessary, but you do need to call it a third time to get the year and the '/' works about as well as anything else that would not be in the 'year' part. If …

Member Avatar for mini programmer
0
151
Member Avatar for cointosser

you're not supposed to take part of the discussion out of the thread...now if someone were to search and find this thread, they can't see what you learned. For random number generation, I like the python random module: [code=Python] import random op1 = random.randint(1,10) op2 = random.randint(1,10) sum = op1 …

Member Avatar for Murtan
0
120
Member Avatar for randr

The current implementation only looks at the first record returned and builds an output string with the question and answer options. If there was more than one question matched, how would it work? Should this return all of the questions delimited in some fashion? Should it always return a list …

Member Avatar for randr
0
190
Member Avatar for dseto200

try something like: [code=python] import random wl = ["abacus", "biology", "chemistry", "dog", "elf", "ghost"] random.shuffle(wl) for word in wl: print word [/code]

Member Avatar for dseto200
0
88
Member Avatar for serkan sendur

That's not a library reference, that's an include file reference. The compiler (ok, maybe the preprocessor) will search for a file of the specified name through each of the directories in the include path. It will use the first file it finds. The contents of the file it finds are …

Member Avatar for Narue
0
109
Member Avatar for Takeian

I'm suspecting you mean alignment of your output, but I'm not sure. It will be very difficult to guide you to a better solution without knowing what you're doing for the alignment presently. Could you post the following: The source code for your output function (use code=c++ tags for the …

Member Avatar for Murtan
0
80
Member Avatar for karang

If the include line looks like: [code]#include "Test/Testnamespaces.h"[/code] it should look for the Test directory in the same directory the source file was located in, or in the include path. If you used: [code]#include <Test/Testnamespaces.h>[/code] the compiler will not look in the source file's directory first. Which style of include …

Member Avatar for serkan sendur
0
145
Member Avatar for anbuninja
Member Avatar for Titanius

We love to help people with their problems, why don't you post what you tried and what you think needs fixed (or why it didn't work) and we will help you fix it.

Member Avatar for Titanius
0
175
Member Avatar for Filipe11

Maybe you should look for a method to disable a control. (second big hint)

Member Avatar for Filipe11
0
108
Member Avatar for MaxManus

where do figure() and show() come from? They don't exist in python without imports. What context are you using them in?

Member Avatar for MaxManus
0
85
Member Avatar for ejohns85

But if the unit need to notify the army that it has died (a little strange in real-life, but not so bad in computers), the unit will need to know which army to notify. The other option might be for all operations which might 'kill' a unit to come through …

Member Avatar for LizR
0
103
Member Avatar for CoolAtt

Under windows, getting the file open by two programs is a matter of using file sharing modes. The 'reader' would commonly "deny none" the 'updater' would commonly 'deny write'. The only real concern I have is whether or not the two programs need to interact at all. How does the …

Member Avatar for Murtan
0
153
Member Avatar for Stefano Mtangoo

don't use a list when assigning restype: [ICODE]res = bass_dll.BASS_SampleLoad.restype = ct.c_int[/ICODE] But I suspect you're in for a spot of trouble. a FILE * is NOT a char * fname;

Member Avatar for Murtan
0
343
Member Avatar for callprem26

Would array initialization be legal? [code=c++] class Foo { Foo() { cout << "Hello, World\n"; } }; int main() { Foo myarray[100]; } [/code]

Member Avatar for Narue
0
179
Member Avatar for micky692002

As a note, I love using functions to help break things up. You have several things which would support that well. 1) The 'assignment' asks you to fill the board with pairs of numbers from 1-8. On line 15, you fill with a random number from 1 to 8. Where …

Member Avatar for Murtan
0
3K
Member Avatar for mikewalsh89

don't you need to empty the factors array before you start factoring the next number? Try [ICODE]factors=[][/ICODE] just before the [icode]for k in range(1):[/icode]

Member Avatar for Murtan
0
119
Member Avatar for elitedragoon

Well, you could look at the values in the debugger if you have one, or you could add additional print statements to better confirm the values. If you come to the conclusion that the values are correct then you have to chase back to where they came from to see …

Member Avatar for Luckychap
0
147
Member Avatar for shadowrun

If I remember right, the JIT debugger from visual studio is enabled (or disabled) as an option from within studio. I think it was under the debugger section.

Member Avatar for ddanbe
0
86
Member Avatar for serkan sendur

Generally, you want to avoid the above. I think if you tried hard enough, you might be able to hack something together, but I don't think it would be worth the ongoing effort. I know in visual studio that once you tell it that one dll (or lib) depends on …

Member Avatar for Murtan
0
104
Member Avatar for Passiongamer25

Is this a problem: [code=c++] cout << "Enter field to be sorted(0-7): "; cin >> sortWhat; switch (sortThis){ case '1': [/code] You're getting the input into sortWhat and then switching on sortThis.

Member Avatar for ddanbe
0
651
Member Avatar for gunsmith2112

If you can give me (us) an idea of what you want to use the arrays for, it will help us direct the focus.

Member Avatar for mrboolf
0
143
Member Avatar for elitedragoon

You probably can put it into 2 different functions. You could probably make it work if you tried hard enough. But was the point to make the two 20 argument functions work or to make the code work? I don't know if you saw the suggestion, but the creation of …

Member Avatar for elitedragoon
0
174
Member Avatar for SHWOO

So you want the loop to keep running while the xPos is different or the yPos is different. You wrote while the xPos is different AND the yPos is different. The loop needs to run while either doesn't match. [CODE=c++] while((board.getgXPos() != board.getXPos()) || (board.getgYPos() != board.getYPos())) [/CODE]

Member Avatar for Murtan
0
115
Member Avatar for q8y_4u

Please use code tags when posting code, preferably the language-specific version so we get syntax highlighting. It makes the code MUCH easier to read. If you want the linked list to be ordered by last name, the convention is to put the record in the list where it belongs. If …

Member Avatar for AHUazhu
0
205
Member Avatar for robgeek

I agree with ninwa, the function you have doesn't make much sense. [code=c++] void addressType::print_add(string str, string Cit, string St, int Z) { cout<<"Address: "<<str<<endl; cout<< Cit <<","<<St<<endl; cout<<"Zip: "<<Z<<endl; return ; } [/code] The function asks you pass in all of the address data when the address data is …

Member Avatar for AHUazhu
0
178
Member Avatar for daviddoria

It's the programmers responsibility to ensure the target buffer is sufficiently large enough to hold the maximum possible output size. I think lint (or something like it) might catch it, but I'm not sure.

Member Avatar for grumpier
0
224
Member Avatar for Prahaai

I did some initial review, and I was able to load the library and call hgeCreate using ctypes: Run this from a directory with the hge.dll in it, I was in the hge181 directory. [code=python] from ctypes import * hge = windll.hge hgeCreate = hge.hgeCreate hgeCreate.restype = c_void_p hge = …

Member Avatar for Prahaai
0
303
Member Avatar for VBNick

note that POINTS actually contains 3 full instances of the POINT (whatever that happens to be) while EDGE only contains 2 pointers to POINT. This code isn't quite right: [code=c++] POINTS some_points; EDGE an_edge; an_edge.p1 = some_points.pts[0]; [/code] This will work: [code=c++] POINTS some_points; EDGE an_edge; an_edge.p1 = &some_points.pts[0]; // …

Member Avatar for Murtan
0
152
Member Avatar for mmeyer49

I had to massage it a little to get it to compile under VCPP Express. I think your key problem is that you have 2 copies of the array [icode]arrayGrid[/icode] one declared globally that never gets initialized and one declared in main that is never used. gamePlay() calls displayGrid() passing …

Member Avatar for Murtan
0
115
Member Avatar for Ameerah

You didn't post your whole source file, so the line numbers don't line up... [code] student.cpp: In member function `Student Student::operator+(const Course&)': student.cpp:67: error: no matching function for call to `Student::Student()' student.h:21: note: candidates are: Student::Student(const Student&) student.cpp:15: note: Student::Student(std::string, Date) [/code] The above error indicates that your operator+ implementation …

Member Avatar for Salem
0
124
Member Avatar for happymadman

[code=python] def isWhole(num): return num == int(num) [/code] Works pretty well, but can fail for numbers that are really close to whole: Test code and output [code] for ii in xrange(1,20): f = float('3.'+'9'*ii) print ii, f, isWhole(f) 1 3.9 False 2 3.99 False 3 3.999 False 4 3.9999 False …

Member Avatar for sneekula
0
101
Member Avatar for nikola.rosic

So if I understand it correcly, your application has 4 windows. The main window and 3 other forms. The 3 forms are updated by backgroud worker threads. Does the program always create all 3 forms, even if they are not visible? Does the program always start the 3 background threads, …

Member Avatar for LizR
0
257
Member Avatar for TriceD

LPT1 is a device, you are unable to open it to read what someone else has written (or will write) to it, it just doesn't work that way. To do what you are proposing, you would need to somehow 'get between' the other application and the output device. You could …

Member Avatar for TriceD
0
503
Member Avatar for srikanth.sonu

you're getting stuck on the while loop: [code=c] while(strstr(arr,"RECORD DEFINITIONS")==NULL) { fgets(arr,120,fp); printf("\n%s",arr); } [/code] Nothing in the main [icode]while(!feof(fp))[/icode] ever resets the value in arr. So when you get to the second record's data you print 'INTO THE RECORDS NOW' but don't ever actually read any data because arr …

Member Avatar for Murtan
0
79
Member Avatar for gamer12223

From what I'm reading of the posts and assignment, you should remove the for loop from inputData() and add a for loop to main to call inputData for all three TMoney members of the array money. [code=c++] TMoney money[3]; for (int jj = 0; jj < 3; jj++) money[jj].inputData(); [/code] …

Member Avatar for Murtan
0
162

The End.