CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: wolle

Page 1 of 27 1 2 3 4

Search: Search took 0.08 seconds.

  1. Re: Is there a function intended to split strings by a delimiter in VC++?

    I guess we need to be patient. Rome wasn't built in one day!
  2. Re: Is there a function intended to split strings by a delimiter in VC++?

    The code in my post #4 is directly from cppreference.com so either they or VS 2019 has it wrong.

    Anyway, using your suggestion I got this to work in VS 2019 (latest download),



    #include...
  3. Re: Is there a function intended to split strings by a delimiter in VC++?

    C++ 20 has a new feature called ranges. It has a function for splitting called std::ranges::split_view,

    https://en.cppreference.com/w/cpp/ranges/split_view/split_view

    I tried the last part of...
  4. Replies
    2
    Views
    462

    Re: Intersecting number ranges

    This is my motivation for the reduction of the first set of parentheses in #2:

    Say you have two intervals [dbstart .. dbend] and [paramstart .. paramend] and want to know if they overlap.

    You...
  5. Replies
    8
    Views
    858

    Re: Stopping unnecessary style corrections

    Generally, I find VS 2019 a little too complex and invasive for my taste so I've contemplated switching to VS Code for quite some time.

    But now I see VS 2022 is on the brink of being released and ...
  6. Replies
    2
    Views
    462

    Re: Intersecting number ranges

    If you are allowed to use parentheses () you could "break out" dbend >= 19010101 and dbend = 0 and get the following:


    dbend >= 19010101 and (dbstart >= paramstart and dbend <= paramend or...
  7. Re: Exercises that programmers should do to avoid back and neck pain

    How do you recognize a programmer in a crowd?

    It's the fit-looking individual who's juggling the heavy reference manuals of today as easily as if they were teeny-weeny language descriptions from...
  8. Replies
    17
    Views
    3,352

    Re: Find cartesians for matrix elements

    I find it intriguing that the greedy algorithm I used in #17 works so well. I decided to check out whether it was just luck with the choice of input matrixes. So this time, I generate the input...
  9. Replies
    17
    Views
    3,352

    Re: Find cartesians for matrix elements

    I've had another look at this problem, and it seems to be a variation of the (exact) set cover problem:

    https://en.wikipedia.org/wiki/Set_cover_problem

    Here, the problem has the additional...
  10. Replies
    17
    Views
    3,352

    Re: Find cartesians for matrix elements

    You can always apply exhaustive combinatorics:

    1. Systematically generate all Cartesian matrixes that may occur in any matrix the size of the input matrix. Select those that are present in the...
  11. Re: Rookie query about short and byte arithmetic/bitwise ops

    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...
  12. Thread: C++ Books

    by wolle
    Replies
    3
    Views
    19,521

    Sticky: Re: C++ Books

    Here is an open-access research article called "Thriving in a crowded and changing world: C++ 20062020". The author is no less than Bjarne Stroustrup, the founder of C++. Even if it is not a book,...
  13. Re: What is the counterpart of this C pointer programme in C#?

    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.
  14. Re: What is the counterpart of this C pointer programme in C#?

    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...
  15. Re: Knight's tour, recursion, dynamic programming, optimization

    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...
  16. Replies
    1
    Views
    5,450

    Re: What is GCC High?

    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....
  17. Replies
    1
    Views
    1,577

    Re: N+1 SELECT problem in Hibernate

    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,...
  18. Thread: C++ IDE Query

    by wolle
    Replies
    5
    Views
    975

    Re: C++ IDE Query

    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...
  19. Re: Knight's tour, recursion, dynamic programming, optimization

    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...
  20. Replies
    4
    Views
    2,787

    Re: Stupid Things Developers Do

    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...
  21. Re: Knight's tour, recursion, dynamic programming, optimization

    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...
  22. Thread: C++ IDE Query

    by wolle
    Replies
    5
    Views
    975

    Re: C++ IDE Query

    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.
  23. Replies
    19
    Views
    1,544

    Re: Template class inside a vector

    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...
  24. Replies
    19
    Views
    1,544

    Re: Template class inside a vector

    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...
  25. Replies
    19
    Views
    1,544

    Re: Template class inside a vector

    You must specify the typename T of TableRow. Say you want it to be an int you do,



    std::vector<TableRow<int>> row;
Results 1 to 25 of 669
Page 1 of 27 1 2 3 4





Click Here to Expand Forum to Full Width

Featured