Type: Posts; User: D_Drmmr
Search took 0.07 seconds.
January 21st, 2015, 03:36 PM
Don't know if threads are covered in the book, but a quick way to make the program update approximately each second is to run the loop in a thread.
January 20th, 2015, 09:20 AM
Well, no, because Windows Forms requires .Net and unmanaged C++ doesn't give you that.
What do you miss?
If you mean a nice looking GUI application, then yes that's possible in C++.
January 20th, 2015, 09:15 AM
Calling sleep pretty much puts your program (well, the thread that calls sleep) into a coma. It doesn't do anything until it wakes from its sleep. One important thing your program won't do while it...
January 8th, 2015, 05:04 AM
Why not just send the dialog a custom message to tell it to update the combo box contents? Or just add a member function to the dialog class that you call directly?
November 5th, 2014, 04:02 PM
You call a dictionary application a text predictor and then conclude from that example that a dictionary is a form of text predictor. Seems like circular reasoning to me.
I would assume the...
November 5th, 2014, 03:42 PM
When you say 'hashtable size' do you mean 'number of buckets'?
I think OP meant not knowing the maximum number of data elements to be stored ahead of time.
What makes you say this is a bad idea?...
October 3rd, 2014, 04:21 AM
...and synchronize access to the string data member using a Critical Section.
September 10th, 2014, 04:40 AM
Mandatory reading: http://www.drdobbs.com/parallel/interrupt-politely/207100682
July 28th, 2014, 02:20 PM
Are you benchmarking unoptimized code? That's not very useful.
July 23rd, 2014, 08:31 AM
This might be a (premature) optimization trick to prevent branching due to the short-circuiting behavior of &&.
Look how much easier to read your code becomes with a few local variables. You should really stop copy-pasting source code; it's a very bad habit.
Yes, you could do that. but it sounds to me like a list box is better suited for your user interface. This would also allow the user to select an item by typing multiple characters, which is much...
June 16th, 2014, 08:20 AM
I'm sure you can come up with a test case that fails the second algorithm.
As to why the first one may be too slow: a std::set keeps all its elements sorted. Dijkstra's algorithm only needs to...
That's basically the algorithm for finding a topological order. ;)
That's because there is no specialization for 'implements_load' and 'implements_store'. Don't know if you removed this to get a minimal example or if they are missing in your actual code (maybe the...
Compiles fine in VC9.
What is the complete error message you get?
April 24th, 2014, 06:32 AM
Could you please remove this BULLSHIT? Ever heard of sampling bias?
April 23rd, 2014, 04:06 PM
When we are allocating POD types, probably. But the overhead is constant, i.e. independent of sizeX and sizeY.
However, for non-POD types I think my solution will use less memory for non-tiny...
April 23rd, 2014, 02:59 AM
Assuming you use the code I posted above, you can access the data like this
int x = 1, y = 2; // second row, third column
values[x][y] = 1.23;
const int nRows = int(values.size());...
April 23rd, 2014, 02:48 AM
That's not the same. decltype(pvalue) will be double*, not double**.
I assume you meant "new double[sizeY]" inside the loop. This is also considered bad style. You perform sizeX + 1...
April 22nd, 2014, 10:06 AM
AFAIK, this is invalid in C++11 just as it is in C++03. The call to new returns a double*, which is not convertible to a double**.
April 17th, 2014, 05:37 AM
Could you please fix the compiler errors, such that people can just copy-paste the code if they want to run it?
What about the serialization "does not work"?
April 11th, 2014, 03:26 AM
Please use code tags! Your code is practically unreadable without them.
Did you step through your code with the debugger? What values are you getting for x and y?
April 11th, 2014, 03:25 AM
That's horrible. Why would you advice someone to use a macro for this? A simple text-replace can solve this without obfuscating the code.
@OP Using two different names for the same variable will...
April 9th, 2014, 02:37 AM
What do you mean with "doesn't work"?
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.