Type: Posts; User: D_Drmmr
Search took 0.09 seconds.
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"?
April 9th, 2014, 02:34 AM
That doesn't look like the rotation axis. When rotating about an axis, all point on the axis remain in the same location.
April 9th, 2014, 02:29 AM
Is there an RSS feed to get notifications?
What kind of platform do you want to run on?
April 7th, 2014, 09:55 AM
You could always call the algorithm with a pair of boost::zip_iterators. You'll need to write a custom (or generic reusable) comparator though, which is not so nice without having support for generic...
April 5th, 2014, 01:54 PM
In C++ I would recommend using this instead:
template<typename T, size_t N>
It's much harder to use incorrectly.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.