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

Search:

Type: Posts; User: nuzzle

Page 1 of 5 1 2 3 4

Search: Search took 0.08 seconds.

  1. Replies
    20
    Views
    463

    Re: A Predator-Prey Simulation

    Well, you're bullshitting, plain and simple.

    It doesn't work here. At least not with me. Anyway, good luck :).
  2. Replies
    5
    Views
    159

    Re: Searching a vector of objects for pairs

    Well, if you search the vector from begin to end you'll have O(N) complexity.

    But if you introduce an extra unordered_map you can get O(1) accesses into the vector.
  3. Replies
    20
    Views
    463

    Re: A Predator-Prey Simulation

    Since you've used float variables throughout and if the code compiles there's nothing wrong with your C++ "coding". Any problems must lay with the algorithm you're using.

    The algorithm can be...
  4. Replies
    20
    Views
    463

    Re: A Predator-Prey Simulation

    I must comment on this because it looks like the worst besserwisser approach I've seen in a long time.

    So you've come up with your own oddball definition of what constitutes a simulation. And...
  5. Replies
    6
    Views
    214

    Re: Creating a Property (Get/Set) Class

    Neither C++ nor Java has any language features in support of the concept of Properties.

    Unfortunately, since Properties has associated getter/setter methods they've become collaterally damaged by...
  6. Replies
    20
    Views
    463

    Re: A Predator-Prey Simulation

    You're wrong.

    To model a system (any system, not just biological) using a set of differential (or difference) equations and then follow how it evolves and behaves over time on a computer is...
  7. Replies
    20
    Views
    463

    Re: A Predator-Prey Simulation

    In fact predator-prey simulation is one of the cornerstones of mathematical biology. It gives rise to a system of two differential equations and to study how models like this evolve over time is...
  8. Thread: Prime Numbers

    by nuzzle
    Replies
    28
    Views
    479

    Re: Prime Numbers

    Just a few suggestions.

    Speed; Concurrency has become very straightforward as of C++ 11 so it pays off to make use of all available CPU cores when the primes are calculated.

    Big files; Instead...
  9. Replies
    4
    Views
    238

    Re: C++ easy school project, I need help

    I have some sympathy for your predicament but handing in work of others as your own is cheating plain and simple.

    If graduates from your IT school are expected to have basic programming skills I...
  10. Replies
    6
    Views
    242

    Re: copy constructor issues with vector class

    As C++ is often taught it's easy to get the impression that writing copy constructors, copy assignment operators and even destructors is very central to C++ programming. It's not. One can in fact...
  11. Replies
    2
    Views
    164

    Re: Search technique on DNA sequence

    There's another valid sequence that also has 8 letters: ACAGTTGC.

    I found it using a simple heuristic strategy. I cannot guarantee it's optimal thought, but maybe it doesn't matter because it...
  12. Replies
    7
    Views
    213

    Re: Operator overloading and friend functions

    That doesn't compile in VS2012. It compiles only if class B makes the whole class A a friend (and not only the individual f function). But I think it should work actually so it seems like a bug.
    ...
  13. Replies
    7
    Views
    213

    Re: Operator overloading and friend functions

    A member function cannot be a friend function, it's either or. And a friend function is a free function (with special access priviliges in the class where it's declared).

    If you declare a member...
  14. Replies
    7
    Views
    213

    Re: Operator overloading and friend functions

    If the operator can be a free function it can also be a friend.
  15. Replies
    1
    Views
    177

    Re: When to use static classes

    The general consensus is as little as possible. The idea is that global shared data is bad because it induces dependencies in designs.

    Nevertheless, there's a design pattern to handle the one...
  16. Replies
    1
    Views
    371

    Re: Disjoint pairs problem

    To me it looks like a set cover problem,

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

    There it says the optimal approximate strategy is to greedily select the largest set in each stage.
    ...
  17. Replies
    42
    Views
    1,336

    Re: When to use pointers?

    It didn't take any mind reading to see the obvious. What I find curious is why you didn't reveal your "source of inspiration" up front. After all Mr. Stepanov is an authority figure of STL fame. His...
  18. Replies
    7
    Views
    224

    Re: Memory Leak in Constructor?

    There's nothing in the code that can cause a leak. Either you're using the leak detection mechanism wrongly or the leak is elsewhere.

    Are you using new on CColorTable somewhere. Maybe you're...
  19. Replies
    7
    Views
    287

    Re: Towers of Hanoi help

    Personally I've given up on the recursive solution to this problem but try this video from MIT, it may work for you,
    ...
  20. Replies
    12
    Views
    403

    Re: Area and volume of cylinder

    There are at least four different kinds of polymorphisms available in the C++ type system. Only one is associated with inheritenace and overriding.

    In your case the most likely kind of...
  21. Replies
    7
    Views
    287

    Re: Towers of Hanoi help

    I've never had any problems with recursive formulations but I've always found this particular problem especially difficult so I can't help you with a deeper understanding. Still the net is full of...
  22. Replies
    16
    Views
    372

    Re: Calculation Problems

    It's a general problem. How do you represent money in a computer?

    The usual reply is to use a money package.

    Well, which one?

    I can't say I know.
  23. Replies
    42
    Views
    1,336

    Re: When to use pointers?

    According to C++ an object may only be deleted once and that's the responsibility of the programmer, not the memory allocator.

    So "undefined behaviour" may take a whole new meaning with a memory...
  24. Replies
    42
    Views
    1,336

    Re: When to use pointers?

    No, I've never really heard programmer interfaces to libraries being discussed in those terms. But I'm positive they can because after all they're designs too.

    I think superbonzo threw STL into...
  25. Replies
    42
    Views
    1,336

    Re: When to use pointers?

    You introduced STL as an example of good template based design. I say fine but since STL is a standard it's at most an example of a well designed programmer's interface. It doesn't tell much about...
Results 1 to 25 of 120
Page 1 of 5 1 2 3 4



HTML5 Development Center

Click Here to Expand Forum to Full Width