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

Search:

Type: Posts; User: zizz

Page 1 of 3 1 2 3

Search: Search took 0.02 seconds.

  1. Re: Game of Pick 4 - How to find similar 4 digit numbers in an array of 120 ?

    You're wellcome.

    I served the professional approach to your problem on a silver plate and I hope you have a look at it.
  2. Re: Game of Pick 4 - How to find similar 4 digit numbers in an array of 120 ?

    I hate reading other people's code so I just tell you how I would solve this.

    I would introduce an alternative representation of a number, lets call it a Digit Frequency Table, a DFT.

    A DFT...
  3. Replies
    6
    Views
    5,671

    Re: Which time complexity is true?

    As has been said the question could be clearer.

    But say the posted square-root expression describes F(n) recursively and that the stop criterion is when n reaches 0 that is the function stops at...
  4. Re: Replacing GUI in a Win32 application - best strategy?

    Well what was the insult? By editing my post no one can tell.

    Moderators shouldn't change replies of others at the very least not in discusions where they participate themselves. Censorship is a...
  5. Replies
    7
    Views
    1,793

    Re: Check if a given 8 byte is a valid double

    My comprehension is that any 64-bit bitpattern is a valid double really.

    But the OP wanted to know if a certain bitpattern counted as a valid "number" and in that case the tests I suggested would...
  6. Replies
    7
    Views
    2,308

    Re: reference to const

    How is that? What's dangling? _listRef is initialized to an empty QList or am I mistaken?
  7. Replies
    8
    Views
    2,175

    Re: problems in smart pointers

    Well if you mean that an object preferably shouldn't return stuff (be it by pointer or smart pointer or value or whatever) but instead be asked to do things then I agree.
  8. Replies
    22
    Views
    7,954

    Re: vb.net ... why bother?

    Yours seems to be quite a common problem because Microsoft even has a resource center dedicated to upgrading legacy VB6 code. There are some tools available to ease the pain. Some are free, at least...
  9. Replies
    7
    Views
    1,793

    Re: Check if a given 8 byte is a valid double

    You could check that the 8 bytes (held in a double) is neither std::subnormal, std::infinite nor std::NaN.

    Then it should represent some number in the "numeric" range.
  10. Replies
    7
    Views
    2,308

    Re: reference to const

    You could add a default constructor where _listRef is initialized with an empty QList like,



    class Device {
    public:
    Device() : _listRef(QList<QSharedPointer<Data>>()) {}
    explicit...
  11. Replies
    8
    Views
    2,175

    Re: problems in smart pointers

    On the contrary, at least if you're using the OO paradigm to programming, the best solution is when all polymorphic (OO) objects are handled by smart pointer everywhere and all the time.
  12. Replies
    8
    Views
    2,175

    Re: problems in smart pointers

    To me it looks like your "dilemma" is self-inflicted. You're complicating things.

    Just design like you would in C# or Java with the additional "burden" in C++ that for each introduced OO type you...
  13. Re: Replacing GUI in a Win32 application - best strategy?

    You mean it's a contradiction in terms? One cannot be a die-hard Win32 programmer and a WTL user at the the same time?

    Apart from sounding like a die-hard xxxx I think you're dead wrong. WTL is...
  14. Re: Replacing GUI in a Win32 application - best strategy?

    Although I'm using WTL myself I would describe it as obscure and clandestine. It's mostly for old school die hard Win32 developers who are only comfortable close to the metal. I was about to say that...
  15. Replies
    4
    Views
    1,358

    Re: In Visual C++, how do I define a hash map?

    Googling is fine but there's a very good reference book about the C++ standard library (including the STL containers) available. It's called The C++ Standard Library, 2nd edition, by Josuttis.
  16. Replies
    4
    Views
    1,358

    Re: In Visual C++, how do I define a hash map?

    No, std::map is based on a tree and thus has O(logN) accesses. This is true for all so called associative containers.

    The way to go is std::unordered_map. It's based on a hash table and has O(1)...
  17. Re: Replacing GUI in a Win32 application - best strategy?

    A good strategy could be to switch to a portable GUI.

    Have a look at primarily wxWidgets but also Qt.

    http://www.wxwidgets.org/
  18. Replies
    4
    Views
    4,983

    Re: Creating Matrix/map for Topological sort?

    It seems Boost offers a topological sort algorithm,

    http://www.boost.org/doc/libs/1_55_0/libs/graph/doc/topological_sort.html
  19. Replies
    1
    Views
    7,128

    Re: Algorithm for sorting files on hard disk

    If the file fits in memory you can read it into an array, sort it using the algorithm that comes with your language's standard library, and then write it back again.

    The Java documentation offers...
  20. Re: how to count contiguous and common zeros in various arrays

    You can start by writing a program that can do that for one array. When that works you expand the program to handle several arrays.

    If you can check whether a position is zero in one array it's...
  21. Replies
    3
    Views
    3,060

    Re: Implement an expression parser

    The most famous parsing algorithm specifically for math expression parsing is the Shunting-yard algorithm by Dijkstra,

    http://en.wikipedia.org/wiki/Shunting-yard_algorithm
  22. Replies
    10
    Views
    2,035

    Re: about virtual functions and polymorphism

    What's so horrible about having to specify the signature of the function you override in the derived class?

    If you want to minimize the typing you can even put the implementation directly in the...
  23. Replies
    4
    Views
    8,865

    Re: C++: Convert Jumple Word to Possible Words

    I assume TILL, TRILL and BRILLIANT are in the dictionary and they're selected because they can be composed from the letters of LARBITNLI. Lets call this property composability.

    It's especially...
  24. Replies
    29
    Views
    25,103

    Re: passing an array as a pointer to a function

    I'm no stranger to optimization. This is a good link by the way,

    http://www.agner.org/optimize/optimizing_cpp.pdf

    I agree that optimization is a fine thing and that C++ is especially well...
  25. Replies
    29
    Views
    25,103

    Re: passing an array as a pointer to a function

    That's right.

    When you compare a C-array and an std:vector it doesn't matter where they're (both) allocated be it in static, automatic or free memory.

    You are confusing C++ with the...
Results 1 to 25 of 56
Page 1 of 3 1 2 3





Click Here to Expand Forum to Full Width

Featured