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

Search:

Type: Posts; User: wolle

Page 1 of 29 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    6
    Views
    354

    Re: programming question

    Your best option probably is to team up with a good programmer. That is how many successful companies started - one with the vision and one with the know-how.
  2. Thread: stl find

    by wolle
    Replies
    12
    Views
    502

    Re: stl find

    Well, I should have tested my code but it was intended more as an illustration for a suggestion. Anyway, the GetValue function can be declared constexpr and noexcept to make it even better.
  3. Thread: stl find

    by wolle
    Replies
    12
    Views
    502

    Re: stl find

    It is possible to use 2kaud's approach (in #8) but in a way that reduces the size of B. That can be useful if A grows in the future but still holds numbers that are all powers of 2. The idea is to...
  4. Replies
    3
    Views
    375

    Re: Built in Data Types Support in C and C++

    If it is a general programming project, it is better to use C++, even if it is a small project. With C++, you have C at the baseline but gain the benefits of a modern language. You get a substantial...
  5. Replies
    15
    Views
    2,000

    Re: needs to convert C++ code to JAVA

    There are C++ to Java conversion tools available on the internet. Some are for free.
  6. Replies
    2
    Views
    281

    Re: Running an application on multiple CPUs

    It is decided by the OS. In the case of Windows, Microsoft says this,

    https://docs.microsoft.com/en-us/windows/win32/procthread/multiple-processors
  7. Replies
    3
    Views
    677

    Re: Palindrome Problem in C++

    Are you sure? I could not spot a bug, so I ran your code with jverd's test set in #3 and the results are identical. It suggests your code is working. Still, it will not work with negative integers....
  8. Replies
    2
    Views
    3,690

    Re: Solving SameGame aka Clickomania

    Are you looking for an algorithm to develop or to play the game? It is an important distinction. I think the OP wanted an optimal playing strategy.
  9. Replies
    14
    Views
    6,456

    Re: Store all pixel from a circle in an array?

    Are you looking for a solution to the Gauss circle problem?

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

    https://mathworld.wolfram.com/GausssCircleProblem.html
  10. Replies
    5
    Views
    1,174

    Re: Which programming language can handle this

    I would consider Python,

    https://www.python.org/

    It is the preferred language among people with no idea :), and there are many, as you can see here,

    https://www.tiobe.com/tiobe-index/
    ...
  11. Replies
    2
    Views
    1,333

    Re: Is it ok to use null checks?

    The inventor of the null reference, Tony Hoare, has publicly apologized for it. He calls it his billion-dollar mistake. See this Wikipedia entry (the first paragraph in the Apologies and retractions...
  12. Replies
    2
    Views
    710

    Re: "Embedding a method" refactoring method

    Embedding usually means that something is made part of some larger structure. And since the term "method" is predominantly used in object orientation, the larger structures in question could be the...
  13. Thread: complex signal

    by wolle
    Replies
    1
    Views
    1,037

    Re: complex signal

    C++ has a standard library to handle complex numbers,

    https://en.cppreference.com/w/cpp/numeric/complex

    Say you have,

    f(t) = exp^(j*omega*t)

    Note that the imaginary unit j plays a role in...
  14. Replies
    3
    Views
    650

    Re: Set to coordinates to centre of grid

    My code is logically the same as yours. If your code is wrong, so is mine. Your problem description indicates you have a working solution and now want help making your code become "neater".
  15. Replies
    3
    Views
    650

    Re: Set to coordinates to centre of grid

    I do not know what you mean by neater, but this is another way of assigning values to devy and devx,



    if (_num <= 3) {
    devy = 1;
    devx = _num - 2;
    } else if (_num <= 6) {
    devy = 0;...
  16. Replies
    1
    Views
    450

    Re: I'm new in Golang

    What is wrong with VS Code? It is considered one of the best. Maybe you did not download the Go extension. Why not give it another Go :)

    https://code.visualstudio.com/docs/languages/go

    Anyway,...
  17. Replies
    1
    Views
    1,083

    Re: Tournament Round robin to bracket

    Could you please explain what is wrong with the order of the matches in the examples you have presented?

    I cannot see anything strange in particular. Or is it maybe, that those who play their...
  18. Replies
    6
    Views
    2,487

    Re: Sudden problem with std::vector

    But, it only works if the function itself is executable at compile-time. If not, you still need to use an std::vector.
  19. Replies
    6
    Views
    2,487

    Re: Sudden problem with std::vector

    It will work (in this case) if the function is declared constexpr.
  20. Replies
    4
    Views
    1,495

    Re: Float point number simple arithmetic.

    In addition to my post #4.

    Not all decimal numbers have a finite digital representation. This includes 0.1, which requires an infinite number of bits. So when you assign 0.1 to a single-precision...
  21. Replies
    4
    Views
    1,495

    Re: Float point number simple arithmetic.

    A single-precision FP has 6-7 significant decimal digits, and a double-precision FP has 15-18. A good rule is to consider the significant digits only. The range of significant digits in an FP starts...
  22. Re: Why is my single thread code is faster than my multhread code?

    That may speed things up on the CPU side, but you probably should do something to that effect on the GPU side too. Maybe by pooling the command buffers,
    ...
  23. Re: Is it safe to locally use arrays, vectors and calloc when multi-threading

    I understand there may be company restrictions. But if you are free to choose, I recommend you update to the latest Visual Studio version and the latest C++ standard. With a reasonable delay, of...
  24. Re: Is it safe to locally use arrays, vectors and calloc when multi-threading

    I agree with the previous posters, at least if you use C++ version 11 or later.

    C++ 11 was a game-changer. Especially concurrency got a much-needed overhaul. Why should you not be able to use...
  25. Thread: Finding Doubles

    by wolle
    Replies
    12
    Views
    1,543

    Re: Finding Doubles

    I posted a solution strategy to this problem quite some time ago now,

    https://forums.codeguru.com/showthread.php?562663-Birthday-is-no-problem&highlight=birthday+problem

    Today, I can just...
Results 1 to 25 of 705
Page 1 of 29 1 2 3 4





Click Here to Expand Forum to Full Width

Featured