Forum: Java
Yesterday, 1:59 AM
|
|
Replies: 18
Views: 193
Re: GUI problem.
I would have done it with a variable flag, same as you. There may be a proper way to switch off the PropertyChangeEvent firing altogether, but I don't know of it. I hadn't even heard of a...
|
Forum: Java
Yesterday, 1:12 AM
|
|
Replies: 18
Views: 193
Re: GUI problem.
What about putting another text output next to (or below) the field and put the error message in that? It would be very frustrating to type in a team name, accidently transpose two letters, then have...
|
Forum: Java
Jul 22nd, 2008, 10:22 PM
|
|
Replies: 18
Views: 193
Re: GUI problem.
This page: http://java.sun.com/developer/JDCTechTips/2005/tt0518.html#1 shows how to use an InputVerifier to check the contents of a field before allowing you to move off it. It might do what you...
|
Forum: Java
Jul 22nd, 2008, 5:32 PM
|
|
Replies: 18
Views: 193
Re: GUI problem.
Don't print out the source - you already know that it is teamField1, use the getPropertyName() method on the PropertyChangeEvent to get the property name.
|
Forum: PHP
Jul 22nd, 2008, 8:42 AM
|
|
Replies: 3
Views: 56
Re: Could use some suggestions for improvement
I wouldn't be too concerned with the calculation speed, as most of the time will be spent doing the read. You could move the bcdiv calculation out of the loop, so it is only calculated once.
Having...
|
Forum: Java
Jul 21st, 2008, 7:41 PM
|
|
Replies: 18
Views: 193
Re: GUI problem.
I'd say that the problem is that the property that is changing isn't the value - it is one of the other properties (probably the "focusable Window state", but it could be the font, or the foreground...
|
Forum: Software Design and Algorithms
Jul 1st, 2008, 7:55 PM
|
|
Replies: 1
Views: 121
|
Forum: C
Jun 27th, 2008, 9:30 AM
|
|
Replies: 10
Views: 347
|
Forum: C
Jun 21st, 2008, 9:36 PM
|
|
Replies: 6
Views: 302
Re: Correct use of malloc?
One problem I can see is that the realloc call might change the location of the allocated memory - it does this if it can't grow the memory in-place.
This will mean that your "dest" variable now...
|
Forum: C
Jun 18th, 2008, 9:43 PM
|
|
Replies: 6
Views: 302
Re: Correct use of malloc?
This code
buffer = (char *) realloc(buffer, sizeof(buffer) + sizeof(char));
won't work, because sizeof(buffer) is the size of the buffer pointer, not the size of the memory that is allocated....
|
Forum: Java
Jun 12th, 2008, 7:10 PM
|
|
Replies: 1
Views: 160
Re: Ordered Linked List
If you want OrderedLinkedList class to have the methods from the LinkedList class you would have to inherit from that class.
|
Forum: C#
Jun 12th, 2008, 6:54 PM
|
|
Replies: 4
Views: 202
Re: Thread.AllocateNamedDataSlot
From this link http://msdn.microsoft.com/en-us/library/system.threading.thread.allocatenameddataslot.aspx
it says
So it looks like each thread gets its own data.
|
Forum: C#
Jun 9th, 2008, 1:45 AM
|
|
Replies: 3
Views: 202
|
Forum: C#
Jun 8th, 2008, 5:49 PM
|
|
Replies: 3
Views: 202
Re: Relative File References
You need to use \\ to put a backslash into a hard coded string in c++. Otherwise the \ character is used to escape the next character on.
string ErrorFile = @"..\\Logs\\Error.log";
Also note that...
|
Forum: C
Jun 2nd, 2008, 5:28 PM
|
|
Replies: 2
Views: 176
Re: Need help getting an API app started/working
You should return TRUE in your callback function when you handle a message, this might be causing the problem, as Windows thinks you haven't handled the INITDIALOG message.
You can use GetLastError...
|
Forum: Other Scripting Languages
May 30th, 2008, 8:35 PM
|
|
Replies: 2
Views: 165
|
Forum: Coder's Corner Lounge
May 25th, 2008, 6:51 AM
|
|
Replies: 3
Views: 252
|
Forum: PHP
May 25th, 2008, 6:44 AM
|
|
Replies: 4
Views: 236
Re: Strange fopen Problem
In the first one your are getting the file size before you open the file again, in the second you open the file for reading before you get the file size. I suspect there that the write isn't being...
|
Forum: C
May 7th, 2008, 8:23 AM
|
|
Replies: 6
Views: 271
|
Forum: C
May 5th, 2008, 7:00 PM
|
|
Replies: 11
Views: 478
|
Forum: C
May 5th, 2008, 6:57 PM
|
|
Replies: 6
Views: 271
Re: Setting up
pthread.h is a posix (linux/unix) include file. It is not included in Visual C++. For threading under Visual C++, you would need to use something like the _beginthreadex function, which is in...
|
Forum: Coder's Corner Lounge
Apr 30th, 2008, 12:37 AM
|
|
Replies: 16
Views: 518
|
Forum: C++
Apr 30th, 2008, 12:24 AM
|
|
Replies: 3
Views: 222
Re: array issue
In your Fill_Array function, you don't set the number_used variable to the number of items found.
In your print_array function:
void Print_Array(int Size[], int count)
{
int number_used =...
|
Forum: C
Apr 28th, 2008, 12:24 AM
|
|
Replies: 1
Views: 163
Re: structure with an array in shared memory
I haven't used shmget, but I would imagine you need to allocate the sharearr array using smget as well. This means that your structure would need to contain the sharearr id rather than the pointer....
|
Forum: C++
Apr 17th, 2008, 5:08 PM
|
|
Replies: 3
Views: 238
Re: Feedback On Algorithm With C++
It probably won't help, given the size of the input data. If you were talking millions of names, I think it would be faster though.
Note that vectors have to maintain their data in a contiguous...
|
Forum: C++
Apr 17th, 2008, 9:28 AM
|
|
Replies: 3
Views: 238
Re: Feedback On Algorithm With C++
A few things to consider:
The vector<string> in the tree map may end up with the same name in it several times (e.g. if two authors publish together more than once). It might be better to use a...
|
Forum: Coder's Corner Lounge
Apr 5th, 2008, 2:15 AM
|
|
Replies: 18
Views: 545
|
Forum: Other Scripting Languages
Mar 28th, 2008, 6:13 PM
|
|
Replies: 4
Views: 221
|
Forum: C++
Mar 28th, 2008, 12:50 AM
|
|
Replies: 13
Views: 391
Re: C++ cross-platform Regular Expression Library
Ah I see where I went wrong. After you extract the zip, you have to create the pcre.h (and other files) using the configure and make commands. There are instructions in the INSTALL file (its in upper...
|
Forum: Software Design and Algorithms
Mar 28th, 2008, 12:45 AM
|
|
Replies: 7
Views: 289
Re: Techniques For Overcoming Stack Overflow In DP
You could keep your own stack of items to work on (separate from the program stack) and use a loop to pick the last item on the stack. This depends on being able to keep all your context in your own...
|
Forum: C++
Mar 23rd, 2008, 10:49 AM
|
|
Replies: 13
Views: 391
Re: C++ cross-platform Regular Expression Library
They were in the base of the library. Probably the best thing to do would be to download the zip file from the site and use the source code that comes with it. It should compile OK on OS X (I think a...
|
Forum: C++
Mar 23rd, 2008, 7:29 AM
|
|
Replies: 13
Views: 391
Re: C++ cross-platform Regular Expression Library
Have a look at the pcrecpp.h file - it should be in the pcre directory. It is a wrapper for use with c++. This makes it a lot easier to use the library. There is a lot of instructions and examples in...
|
Forum: C++
Mar 22nd, 2008, 9:17 PM
|
|
Replies: 13
Views: 391
|
Forum: C#
Mar 19th, 2008, 7:20 PM
|
|
Replies: 9
Views: 292
Re: Assigning Values into Random Index's in Array
I can't see anything in that code that puts any values into the array before it starts shuffling. That probably explains the zeros.
Also as lectricpharaoh said, you need "ref" parameters in your swap...
|
Forum: C
Mar 12th, 2008, 5:58 PM
|
|
Replies: 11
Views: 340
Re: Troubleshooting with fread and fopen
Try
wavfile =fopen("cwav1.wav", "rb");
wavfile1 =fopen("cwav2.wav", "rb");
wavfile2 =fopen("cwav3.wav", "rb");
if(wavfile == NULL || wavfile1 == NULL || wavfile2 == NULL)
|
Forum: C
Mar 12th, 2008, 1:12 AM
|
|
Replies: 11
Views: 340
|
Forum: Java
Mar 12th, 2008, 1:10 AM
|
|
Replies: 7
Views: 205
Re: Help why doesnt it work
You have to tell the compiler that 4000000002 is a long, rather than an integer. Sticking an L on the end does that:
k = 4000000002L ; // k to 4,000,000,002
|
Forum: C
Mar 10th, 2008, 9:11 PM
|
|
Replies: 11
Views: 340
Re: Troubleshooting with fread and fopen
Apart from the missing braces and the fact that your code isn't actually inside a function, I think the main problem is that you are reading the data into the data1 variable and then trying to access...
|
Forum: Assembly
Mar 10th, 2008, 3:09 AM
|
|
Replies: 7
Views: 490
Re: [x86]Instruction test setting the zero flag
I wasn't having a go at you because you haven't posted much, if that is what you mean by "argument of repertoire". Extra helpers here are always welcome. Calling people who are asking questions and...
|
Forum: Assembly
Mar 9th, 2008, 4:17 PM
|
|
Replies: 7
Views: 490
Re: [x86]Instruction test setting the zero flag
Dredging up a six month old thread to call people stupid, and having your first two posts in a forum call people stupid, is a sure way to make a name for yourself. Unfortunately, that name isn't a...
|