Search:

Type: Posts; User: scourge; Keyword(s):

Page 1 of 10 1 2 3 4

Search: Search took 0.04 seconds.

  1. Replies
    15
    Views
    904

    Re: curious use of labels in C++

    You don't have to do that. You can also put "#include "foo.moc" at the end of foo.cpp (the source file containing QObject-based class declarations).
  2. Replies
    4
    Views
    1,943

    [SOLVED] Re: List Iterator Problems C++

    I think you have to replace this:

    typename list<T>::iterator itr;
    with this:

    typename list<stackNode<T> >::iterator itr;

    Also, this is a bit weird:
  3. Thread: Qt programming

    by scourge
    Replies
    4
    Views
    375

    Re: Qt programming

    Did you even try what korvirlol suggested, before deciding that your way was the correct one? Because he's right.
  4. Re: Ever Get irritated with being mistaken for male online?

    When I see that, I think of it as a sarcastic joke that makes fun of the outdated and ignorant conception. Kinda like the quote "640K ought to be enough for anybody" that I see every once in a while...
  5. Replies
    36
    Views
    5,898

    Re: What do you think of google's go language?

    Go's package model uses explicit dependencies for fast build times. This is what the "Go talk" PDF says:





    No, I meant that performance is typically only 10-20% slower than C/C++.
  6. Replies
    36
    Views
    5,898

    Re: What do you think of google's go language?

    I think it's just the OP of this thread, not Google, who's using the term "open source programming language". But I agree with you, it doesn't make any sense.
  7. Replies
    36
    Views
    5,898

    Re: What do you think of google's go language?

    By this logic we should never try anything new, because it's not "commonly used".




    There are way older languages than C++. Ever heard of a language called Java? It's younger than C++, yet...
  8. Replies
    36
    Views
    5,898

    Re: What do you think of google's go language?

    Maybe you could expand those arguments a bit. What exactly are the old, dated, slightly rehashed concepts that make Go suck so much? What are the worst points of other languages that Go combines? Any...
  9. Replies
    3
    Views
    289

    Re: Copying vector by reference

    Using a reference, maybe?
    Like this:


    vector<int> myVector;
    vector<int>& referenceToMyVector = myVector;


    You can also use a pointer:
  10. Replies
    9
    Views
    683

    Re: C++ object construction confusion

    No, Foo doesn't need a default constructor. But you must create a constructor for Bar that initializes the Foo object:


    class Bar
    {
    public:
    Bar() : myfoo(0) {}
    private:
    Foo...
  11. Replies
    2
    Views
    309

    Re: [c] Most efficient way to monitor a file

    It's probably not as trivial as it sounds. Inotify should do the job, although I haven't used it personally:
    http://en.wikipedia.org/wiki/Inotify
    http://www.linuxjournal.com/article/8478
  12. Replies
    10
    Views
    3,288

    Re: [c++] bitwise operators and if statement

    That's not true at all, so maybe you should edit that to not confuse the noobs.


    if (flags & G_PARAM_WRITABLE)
    is the same as

    if ((flags & G_PARAM_WRITABLE) != 0)
    ...and "!= 0" is NOT the...
  13. Replies
    3
    Views
    292

    Re: Looking for critique.

    There's already a balanced binary tree container class in STL - std::set. But if you want to reinvent it for learning purposes, that's fine.

    Writing an iterator can be annoying, but shouldn't be...
  14. Replies
    30
    Views
    1,589

    Re: Program ignoring virtual redefinitions.

    The problem is that your action(), move(), and handler() methods are const in the base class, but non-const in the derived class. So you haven't really reimplemented anything.
  15. Replies
    4
    Views
    6,037

    Re: Offline C/C++ Reference?

    Standard C++ Library Reference: http://www.ucsc.canterbury.ac.nz/UCSC%20userdocs/ForUCSCWebsite/C/AIX/standlib.pdf

    GNU C Library: http://www.gnu.org/software/libc/manual/index.html
  16. Re: Which is the most perspective programming language ?

    I never use Python for anything performance-critical. But I got the impression that Lisp can be pretty fast. Then again, writing high-performance code requires careful design in any language, so...
  17. Re: Which is the most perspective programming language ?

    I've been having interesting times with Common Lisp lately. I had to learn some basics of it on a uni course, and I decided to dive a bit deeper. The first thing I noticed was that it would take...
  18. Re: This line will not compile: typedef Map Datatypes;

    Can you show the declaration of YAML::Node? What's the return type of YAML::Node::operator[](const std::string&)? And are you sure that you have defined operator>> for that type?

    BTW, operators <<...
  19. Replies
    2
    Views
    6,245

    Re: [C/C++] Endian conversion of 64-bit value

    I afraid you'll either have to write it yourself or use a library like Qt or Boost.

    In my chess engine Sloppy I have this macro:



    #define ENDIAN_SWAP_U64(val) ((U64) ( \
    (((U64) (val) &...
  20. Replies
    81
    Views
    5,008

    Re: How Do You Define "Bad Code"?

    +1
    Returning as soon as possible often results in less bugs, and keeps the indentation level down as well. Same goes for breaking out of loops, which is also considered bad by some people.
  21. Replies
    81
    Views
    5,008

    Re: How Do You Define "Bad Code"?

    C does have a bool data type: http://www.opengroup.org/onlinepubs/000095399/basedefs/stdbool.h.html
    But even if it didn't, "x > 10" would still be guaranteed to be either 0 or 1. So if "true" is...
  22. Replies
    81
    Views
    5,008

    Re: How Do You Define "Bad Code"?

    What I consider bad code, partly because I've made these mistakes myself:

    1. Boolean function parameters

    When I see code like "foo(false)" I usually have to find the function declaration of...
  23. Replies
    7
    Views
    415

    Re: My first Gui app

    It's highly unlikely that anyone has trademarked the same name for a similar tool, so you're safe.



    As you said yourself, it's basically just a grid of three buttons. There's not much to...
  24. Replies
    2
    Views
    2,643

    Re: Portable Qt libraries?

    Please read the "Creating the application package" section here: http://doc.trolltech.com/4.5/deployment-x11.html
  25. Replies
    31
    Views
    17,213

    Re: Best GUI programming language

    ...or Python, C#, Ruby, Java, Ada, Pascal, Perl, PHP, or Haskell.
Results 1 to 25 of 250
Page 1 of 10 1 2 3 4