Search:

Type: Posts; User: salquestfl

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. SMP full memory barrier means reads and writes...

    SMP full memory barrier means reads and writes before the barrier are visible to all processors. (both software and hardware (cache symchronization) ensures this - refer Memory Barriers)
    I don't...
  2. Most libraries have two components - actual...

    Most libraries have two components - actual library object files, and their headers. You copied the headers to /usr/include. You need to copy the library files, which are generated when you build....
  3. libssh library

    Did you install libssh and libssh-dev? You are getting linker error which means you have not installed the ssh library.
  4. Do you have to sort the vector in-place? You...

    Do you have to sort the vector in-place? You anyway need to convert the original vector to an unordered set, for performance reasons. So, you might as well empty the original vector and use it.
  5. Replies
    1
    Views
    1,310

    You need to disambiguate the declaration of m_vol...

    You need to disambiguate the declaration of m_vol using typename inside the OctVolume class because ItkVolume::Pointer is a template.

    I am using slightly different names that made sense to me...
  6. Replies
    18
    Views
    2,485

    Good points mhaaawaaa.

    Good points mhaaawaaa.
  7. Replies
    2
    Views
    725

    As far as find algorithm is concerned, I think as...

    As far as find algorithm is concerned, I think as long as the user-defined type defines equality operator (operator ==), it will work.
  8. Replies
    2
    Views
    1,267

    Apart from the spawning a thread, another way is...

    Apart from the spawning a thread, another way is to use asynchronous read/write APIs.
  9. [QUOTE=chenayang;964509] /* Accept a...

    [QUOTE=chenayang;964509]


    /* Accept a connection. */
    client_socket_fd = accept (socket_fd, &client_name, &client_name_len);


    I think the client_name_len should be initialized with...
  10. Replies
    4
    Views
    1,899

    The Bad news is what you are asking is...

    The Bad news is what you are asking is impossible. The Good news you do not need it. :)
    You can't name variables stored in an array. But just the name of the array is sufficient to access these...
  11. Replies
    4
    Views
    1,000

    You cannot dynamically assign names to new...

    You cannot dynamically assign names to new instances because the names of identifiers is a compile-time mechanism.
    I think you are confusing the unique identifier of an object and uniqueness of the...
  12. Replies
    1
    Views
    2,717

    I suspect the reconnection is unsuccessful...

    I suspect the reconnection is unsuccessful because you are not properly closing the connection. Instead of terminating the client threads abruptly, you should do that.
  13. Replies
    1
    Views
    3,761

    You can use ifstream for an input file stream. ...

    You can use ifstream for an input file stream.

    1. To read an integer from a file stream, you can use extraction operator '>>'
    2. To push an element into a vector, you can use vector::push_back...
  14. Replies
    3
    Views
    917

    It is not two copies actually. The runtime makes...

    It is not two copies actually. The runtime makes it appear so, but it's just one copy mapped into two respective address spaces of these processes.
  15. Replies
    2
    Views
    3,914

    You can use strlen to count the string length....

    You can use strlen to count the string length. So, you can get rid of the for loop.
    Also, when you call strtok in the while loop, you are overwriting the first substring pointer gotten using the...
  16. Replies
    2
    Views
    6,511

    I think in the sixad process, you may be using...

    I think in the sixad process, you may be using file stream API which do not write the output till they are explicitly flushed or till newline is written. So, just add fflush for explicit flushing of...
  17. Thread: optimizaton

    by salquestfl
    Replies
    10
    Views
    1,119

    If this is C++, you can use functors. Functors...

    If this is C++, you can use functors. Functors are basically objects with operator() overloaded. And the variable number of arguments to functions can be used to initialize these functor objects.
  18. Why not use a vector?

    Why not use a vector?
  19. Yes, you cannot create an array of objects for...

    Yes, you cannot create an array of objects for which you don't have the default constructor.
    I am curious about how you create the array of classB objects in the first place without having the...
  20. Replies
    6
    Views
    2,057

    If class 1 and class 2 share some attributes, it...

    If class 1 and class 2 share some attributes, it may be that your design needs to be modified. You can have a class 3 containing shared attributes referenced by class 1 and class 2 objects.
  21. Replies
    8
    Views
    1,562

    Great. I had missed that one. And brilliant...

    Great. I had missed that one. And brilliant solution, btw.
    boost::regex_replace is also an alternative. But it may be an overkill.
  22. Replies
    8
    Views
    1,562

    Still, why to do replace_if, unique and erase...

    Still, why to do replace_if, unique and erase when remove_if is what is needed?



    Then what is the need of unique and erase?
    You either define the problem as
    1. Replace unwanted characters by...
  23. 1. Libraries can only take you up to a certain...

    1. Libraries can only take you up to a certain level. Design decisions of a particular language limit its inherent capabilities. In short, all languages are not equal.
    2. He said he has been...
  24. Replies
    8
    Views
    1,562

    Hi Laserlight, I know you said 'something like...

    Hi Laserlight,

    I know you said 'something like this' about your solution, but couldn't help nitpicking.
    Your solution will remove all duplicate characters in the string (with unique and erase)....
  25. Actually, you are better off using a higher-level...

    Actually, you are better off using a higher-level language like Ruby or Python.
    C++ shines when performance is critical, not when something needs to be get done quickly.
Results 1 to 25 of 30
Page 1 of 2 1 2