Search:
Type: Posts; User: wolle
Search:
Search took 0.07 seconds.
-
April 4th, 2021, 01:46 AM
They know, and they call it the C# type promotion rules. It can give "somewhat unexpected results" mentioned here,
https://prasadiapsara.wordpress.com/2013/07/21/csharp-type-promotion-rules/
To...
-
March 24th, 2021, 01:28 PM
Here is an open-access research article called "Thriving in a crowded and changing world: C++ 2006–2020". The author is no less than Bjarne Stroustrup, the founder of C++. Even if it is not a book,...
-
March 23rd, 2021, 02:03 PM
In exceptional situations, there is yet another option. You can mix C# and native C++ using C++/CLI as a bridge. At least in theory. I haven't done it, so I cannot vouch for it.
-
March 19th, 2021, 01:56 PM
One of the main goals of both Java and its follow-up C# is to be resilient to programmer errors. For this reason, you cannot do things like &i and *p. Explicit references and pointers were deemed...
-
March 12th, 2021, 04:43 AM
But the Knight's tour can be formulated as an optimization problem, so I guess my claim is wrong.
One can define the distance between two squares as the fewest moves it takes for the knight to go...
-
March 12th, 2021, 12:24 AM
What you write can be found verbatim here,
https://www.boardworld.com.au/forums/viewthread/28006/
So either you are also Paul Wilson, or you are plagiarizing someone else, which is fraudulent....
-
March 7th, 2021, 11:01 AM
Here's someone who claims to have a solution,
https://www.sipios.com/blog-tech/eliminate-hibernate-n-plus-1-queries
I haven't heard about this problem before. But if it's a common inefficiency,...
-
March 5th, 2021, 03:20 PM
In my view, it can be a good thing to first go through the process of learning how to use the different individual tools involved in program development. Then when you start using an IDE you are in a...
-
March 3rd, 2021, 06:49 AM
Dynamic programming is an optimization method and as such is used when you are looking for what is best in some sense. It could be to find the shortest or the cheapest of something. But that does not...
-
March 3rd, 2021, 04:53 AM
The easiest way to be stupid as a programmer is trying too hard to be smart. Spending lots of time reducing a straightforward algorithm into something only Einstein could understand, to be able to...
-
March 3rd, 2021, 04:32 AM
The Wikipedia entry to Knight's tour,
https://en.wikipedia.org/wiki/Knight%27s_tour
reveals that there are 26,534,728,821,064 (directed closed) tours on an 8x8 board. It will take a lot of time...
-
March 3rd, 2021, 02:25 AM
It's even so that some IDE:s allow you to use more than one C++ compiler. For example, VS 2019 supports the use of both the Microsoft and the Clang C++ compilers.
-
March 1st, 2021, 02:58 PM
You can create a union of these 3 types using std::variant. If you declare a variable of that union type, you can check which of the types is stored in the variable using std::visit. You will need...
-
March 1st, 2021, 06:06 AM
An alternative to what 2kaud suggests is to go for an object-oriented design. In that case, you would replace T with a base class type. Then you would store objects of classes derived from the base...
-
March 1st, 2021, 02:13 AM
You must specify the typename T of TableRow. Say you want it to be an int you do,
std::vector<TableRow<int>> row;
-
February 18th, 2021, 09:41 PM
It is best to use the logical XOR operator != whereby
bool c = !(a^b);
becomes
-
January 28th, 2021, 03:59 AM
I would use one of these, probably the first,
void checkTheState() {
const bool hasChanged =
(boolOne != boolOneCurrentState()) ||
(boolTwo != boolTwoCurrentState()) ||
......
-
January 27th, 2021, 05:19 AM
Instead of excavating the past, you could go for something current,
https://www.sqlite.org/index.html
-
January 14th, 2021, 11:30 AM
In this case, you have a total of 52 balls in the urn. The chance of picking a blue is 50/52, and a red is 2/52. The total probability is 50/52 + 2/52 = 52/52 = 1 (the ball will always be either blue...
-
January 14th, 2021, 03:08 AM
The link in my previous reply suddenly doesn't seem to work so I supply an example. It is based on the recipe: "Generating pseudo-random numbers" in Modern C++ Programming Cookbook, 2nd ed. by Marius...
-
January 14th, 2021, 01:37 AM
If you have the possibilities 0.8, 0.1, and 0.1 you think of them as three intervals,
1: 0.0 <= x < 0.8
2: 0.8 <= x < 0.9
3: 0.9 <= x < 1.0
Then you draw a random float x between 0 and 1, for...
-
January 13th, 2021, 01:19 AM
Well, according to the link in my previous post, according to the C++ standard, a reinterpret_cast should work,
"3) A value of any integral or enumeration type can be converted to a pointer type."...
-
January 11th, 2021, 12:43 PM
As a last resort, there's always the reinterpret_cast,
wpAddress = reinterpret_cast<WORD*>(nAddress);
https://en.cppreference.com/w/cpp/language/reinterpret_cast
-
January 3rd, 2021, 12:40 PM
This problem is quite common and there are several ways to solve it,
https://web.stanford.edu/class/cs9/sample_probs/TwoSum.pdf
The video uses the hashtable approach. A hashtable is a data...
-
December 31st, 2020, 12:02 PM
And you are not the only one :). I recognize the problem because I replied to this thread,
https://forums.codeguru.com/showthread.php?563893-Program-to-decompress-a-compressed-string
|
Click Here to Expand Forum to Full Width
On-Demand Webinars (sponsored)
|