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

Search:

Type: Posts; User: Codeplug

Page 1 of 5 1 2 3 4

Search: Search took 0.06 seconds.

  1. Replies
    7
    Views
    160

    Re: Boost library thread callbacks

    >> We call a method in the C++ DLL (from javascript) to do a long procedure.
    >> ... and the method returns to firefox as a non-blocking function call.
    It sounds like you'll have to make a 2nd,...
  2. Replies
    7
    Views
    160

    Re: Boost library thread callbacks

    What is the main thread doing while the compute thread is computing? Does it "return" to the caller? Is it blocked? Is it in a message loop (that your wrote)?

    Why did you create a thread in the...
  3. Re: Slightly OT, Visual Studio 2012, and virtual desktops...

    Could download the source, debug it, fix it :)

    They have a forum too, but that's not as fun.

    gg
  4. Replies
    14
    Views
    305

    Re: Member function pointer assignment

    You supply to instance to use when calling the function pointer.
    http://www.newty.de/fpt/fpt.html#call

    gg
  5. Replies
    7
    Views
    275

    Re: Question fstream logistics

    TCHAR's solve a very specific problem and aren't needed in new development. You can read about it in this thread:...
  6. Replies
    7
    Views
    275

    Re: Question fstream logistics

    Also, you shouldn't be using _T(). Formatted output methods of std::fstream always works on narrow strings/characters.

    gg
  7. Re: accessing symbols in appllication from within dynamic library MinGW

    If you can't get an EXE-import-lib to work (I'm not sure if it is possible), then you're down to two options:
    1) Manually link the EXE's symbols with GetProcAddress() (or through dlfcn-win32)
    2)...
  8. Re: accessing symbols in appllication from within dynamic library MinGW

    You can omit the "dllexport" by linking the main EXE with "-Wl,--export-all-symbols", which which will export all global symbols.

    I'm not sure if you can bypass having to call GetProcAddress() in...
  9. Re: accessing symbols in appllication from within dynamic library MinGW

    Windows does not support "automatic reverse dynamic linking" - or in other words, what you get on Linux when the app is compiled with "-rdynamic" (or "--export-dynamic").

    You should be able to...
  10. Replies
    30
    Views
    1,322

    Re: Generating big random numbers in C

    According to the author of nrand -
    gg
  11. Replies
    30
    Views
    1,322

    Re: Generating big random numbers in C

    Full disclosure - nrand() is from "Accelerated C++".
    http://www.amazon.com/Accelerated-C-Practical-Programming-Example/dp/020170353X...
  12. Replies
    30
    Views
    1,322

    Re: Generating big random numbers in C

    >> non-technically speaking ...
    Thanks for the English version. The thought experiment of reducing [1,3] to [1,2] (or [0,5] to [0,3]) is what I'm used to seeing when explaining why a mathematically...
  13. Replies
    30
    Views
    1,322

    Re: Generating big random numbers in C

    >> ... if and only if ...
    That's Greek to me. Does it have a name? Or where can I read about it more?
    Proof jargon aside, isn't "uniformity" just a subjective measurement in this case, including...
  14. Replies
    30
    Views
    1,322

    Re: Generating big random numbers in C

    >> What I meant is if you have a random distribution from 0-R exclusive, then neither your method of multiplying and clipping nor modulo will give a uniform distribution over 0-M if M is not a factor...
  15. Replies
    30
    Views
    1,322

    Re: Generating big random numbers in C

    >> Because of the +0.5 correction ...
    You are correct. Simply multiplying by 256 is the right thing to do and will give a true uniform distribution over [0, 255]. It was easy to confirm as well:

    ...
  16. Replies
    7
    Views
    284

    Re: Can't Stop Thread

    When two or more threads access the same memory location where at least one thread is modifying the memory, then all accesses must be synchronized using primitives from your threading library.

    In...
  17. Replies
    30
    Views
    1,322

    Re: Generating big random numbers in C

    http://www.cse.unr.edu/robotics/bekris/cs482_f09/sites/cse.unr.edu.robotics.bekris.cs482_f09/files/uniform_random.pdf

    gg
  18. Replies
    30
    Views
    1,322

    Re: Generating big random numbers in C

    >> The potential modulo bias is still there.
    *sigh* I can't explain things any better than the links I've already posted. If you don't believe the experts from the Usenet posts I linked to, then...
  19. Replies
    30
    Views
    1,322

    Re: Generating big random numbers in C

    >> If those bytes are concatenated, are the resulting bits in that bit string also uniformly distributed?
    Got an answer from sci.stat.math -...
  20. Replies
    30
    Views
    1,322

    Re: Generating big random numbers in C

    >> So even if the random number you get from rand() is uniformly distributed the individual bits may not be for certain.
    I'm no mathematician, and I couldn't find an authoritative answer online. My...
  21. Replies
    30
    Views
    1,322

    Re: Generating big random numbers in C

    >> If you use modulo N to "cap" it, a small non-uniformity will sneak in.
    This statement is only true under the following assumptions:
    - the PRNG returns uniformly distributed numbers within some...
  22. Re: How to reduce high CPU usage caused by receiver thread of CAN messages?

    I wish I could help more, but this thread and the other represent my only exposure to CAN bus programming. In other words, I'm just pulling what I can from the manuals.

    You say the old code runs...
  23. Replies
    3
    Views
    339

    Re: boost::condition_variable problem

    http://www.boost.org/users/history/

    This was the only fix that jumped out at me: https://svn.boost.org/trac/boost/ticket/6200

    The smallest complete app that reproduces the issue is always nice....
  24. Replies
    30
    Views
    1,322

    Re: Generating big random numbers in C

    >> I don't quite understand the nature of your objection.
    >> ... uniformly distributed number withing the full range of a positive 32 bit int.
    My objection is that it's not a uniform distribution -...
  25. Replies
    30
    Views
    1,322

    Re: Generating big random numbers in C

    >> That will give you a random uniformly distributed number withing the full range of a positive 32 bit int.
    That doesn't seem correct to me. For example, to get a number between 0 and 127, rand()...
Results 1 to 25 of 119
Page 1 of 5 1 2 3 4



HTML5 Development Center

Click Here to Expand Forum to Full Width