Search:

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

Page 1 of 3 1 2 3

Search: Search took 0.12 seconds.

  1. Replies
    3
    Views
    287

    Re: Need help in a small problem in c

    Read this: Sieve of Eratosthenes

    Check to see if it is prime; if not, use the list of primes and modulo arithmetic.
  2. [SOLVED] Re: error: expected ‘;’ before ‘(’ token

    According to the compilers (clang++ and g++) that is a valid function definition. I'm assuming string is a std::string.



    g++ -v
    Using built-in specs.
    COLLECT_GCC=g++...
  3. Replies
    19
    Views
    3,899

    Re: Beginners programming challenge #26

    My solution is below (this challenge is similar to, Project Euler #17). It relies upon a few boost libraries program_options and lexical_cast;

    The logic required to convert a integral type (in...
  4. Replies
    19
    Views
    3,899

    Re: Beginners programming challenge #26

    Couple of quick questions:
    (1) Should we also handle separators that correspond to different localizations (i.e. comma separators (en_CA.utf8), period separators (de_DE.utf8 for example), ... is...
  5. Replies
    4
    Views
    1,554

    Re: Is STL sort() Function Thread Safe?

    The original post made no promise of anything more than threads would call std::sort on different containers (I felt that situations like the following could occur: thread 'a' might call std::sort on...
  6. Replies
    3
    Views
    809

    Re: C++ bit shifting question

    (1) I'm confused. Based upon the method name, it looks like you are trying to convert a binary representation of a number to an unsigned int. If you want to do this, you have to guarantee that the...
  7. Replies
    4
    Views
    1,554

    Re: Is STL sort() Function Thread Safe?

    STL sort is not thread safe (unless you lock the container). In case you are wondering why it is not thread safe:
    (1) if iterators become invalidated (std::vector<>, std::deque<>, and other...
  8. Re: Problem with IOstream reference in C++ in Ubuntu

    Do you mean the header file for iostream?
    Are you including the iostream header before you make calls to std::cout?
    Please remember to include std:: (the header iostream is contained within the...
  9. Replies
    23
    Views
    7,301

    Re: C++ lowercase function

    Within the C standard library there is a function called:


    tolower


    Its probably best if you investigate these options and come up with a solution for yourself.

    Cheers
  10. [SOLVED] Re: C++ Data structure question: map vs. ?

    Bit shifting and masking can be incredible quick (it depends on the platform). For example, a bit shift on some platforms can take less time than an addition. Further, you can remove the |= for +=...
  11. Replies
    20
    Views
    4,337

    Re: C++ switch statement with letters

    (1) Don't use cout; (it looks too similar to std::cout)
    (2) I assume that you have a typos at lines marked with * (and are meaning to use count);
    (3) What is the type of exampleString? (assuming...
  12. [SOLVED] Re: C++ Data structure question: map vs. ?

    Honestly: there is probably a better way to design this; but without more details of the problem domain I can't give you any better solutions. It sounds like you are wanting to use the flyweight...
  13. Replies
    3
    Views
    1,805

    Re: Problem compiling ioDOOM 3

    So I investigated further. You'll have to edit (from within the doom root folder):


    neo/sys/scons/SConscript.core

    and change the following:


    if ( local_dedicated == 0 ):...
  14. Replies
    3
    Views
    1,805

    Re: Problem compiling ioDOOM 3

    The problem that you are getting is one most likely the libraries libX11, libXext, and libXxf86vm are not installed. However the other possibility is that the libraries are in a location that is not...
  15. Replies
    5
    Views
    4,598

    [SOLVED] Re: compiling c++ code with clang++

    Clang 3.0 is in the 12.04 LTS repositories (along with libclang).

    Cheers,
  16. Replies
    5
    Views
    4,598

    [SOLVED] Re: compiling c++ code with clang++

    I quickly tried to compile your code with the same command;


    clang++ --std=c++0x test.cpp


    It worked properly (however, when asking a question like this, it is usually best to give the...
  17. Replies
    1
    Views
    661

    Re: Geany compilation w/ make

    Your makefile appears to be correct (but add an all target -> all : asteroid). To get make to compile the program fully, (it appears that geany_run_script.sh is looking for the executable ship,...
  18. Replies
    2
    Views
    877

    Re: [C++] STL map and iterator

    A few points:
    (1) careful with double maps (because mmap["a"]["b"] is not equivalent to mmap["b"]["a"]); it might be better to use


    std::map<std::pair<std::string, std::string> >, int>
    ...
  19. Replies
    28
    Views
    4,086

    Re: Advanced programming exercise: Power set

    Solution using templates in C++
    (1) it relies upon the fact that elements are unique in std::set<type>



    #include <iostream>
    #include <set>

    using namespace std;
  20. [SOLVED] Re: an error occurred during signature verification...

    It looks like the mit keyserver is being swapped with requests. Try using the ubuntu keyserver instead.

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A040830F7FAC5991
  21. [SOLVED] Re: an error occurred during signature verification...

    Thanks for the information. I'm just curious why it reports BADSIG as the error.
  22. [SOLVED] Re: an error occurred during signature verification...

    I'm getting the same error. I think google has updated their signing key, but forgot to put the public key online (i.e. we are still using the old public key).
  23. Replies
    13
    Views
    2,443

    [SOLVED] Re: ubuntu 9.04 manual fsck help!!!

    Sorry, I misspoke, I should have said partition or device (instead of disk). But it doesn't just check the filesystem. It checks the underlying physical device (only the CHS of the associated...
  24. Replies
    13
    Views
    2,443

    [SOLVED] Re: ubuntu 9.04 manual fsck help!!!

    Umm ... according to the man pages of badblocks (which is used by fsck.ext3):
    Non-destructive read-write -


    Use non-destructive read-write mode. By default only a nondestructive ...
  25. Replies
    13
    Views
    2,443

    [SOLVED] Re: ubuntu 9.04 manual fsck help!!!

    <snip>
Results 1 to 25 of 60
Page 1 of 3 1 2 3