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

Search:

Type: Posts; User: SamstaUK

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    471

    For loop optimization

    I have identified the bottleneck in my code, and I was hoping for some advice on how to get the code running more quickly/efficiently.



    for(s = 0; s < start.size(); s++){
    inc =...
  2. Replies
    5
    Views
    1,096

    Re: Accessing array in a thread (boost)

    Thank you, I didn't realise it was that straight forward! :)

    Here is the code in case anyone else needs to do something similar:



    #include <iostream>
    #include <boost/thread.hpp>

    using...
  3. Replies
    5
    Views
    1,096

    Accessing array in a thread (boost)

    I was wondering if it was possible to access data from an array inside a threaded function after it has finished executing?

    Take this example:



    #include <iostream>
    #include...
  4. Replies
    0
    Views
    711

    Perl Evolving the Mona Lisa

    I'm attempting to recreate the project shown here, using perl and GD: http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/

    Here is a link to my code:...
  5. Re: General Programming Question - Self Enumerating Pangrams

    Thank you for the monte carlo suggestion, I'll have a read about it :)

    I'm using a sort of hybrid technique, I'm getting *really* close now, only 1 number is off, but still no solution.

    What...
  6. General Programming Question - Self Enumerating Pangrams

    I'm trying to create a self enumerating pangram, here is an example of one:




    I've tried two different approaches.

    The first approach was to generate a sentence with random numbers. I would...
  7. Replies
    1
    Views
    546

    Warning: word data exceeds bounds

    I am trying to run this code:
    (NOTE: This code will start a bind shell on port 1337 if you get this working, so don't leave it running!)



    section .text
    global _start
    _start:

    xor eax, eax
  8. Replies
    5
    Views
    580

    Re: Setting function return type

    Sorry, I was trying something else before I posted this and forgot to change it
  9. Replies
    5
    Views
    580

    Setting function return type

    I want my function to return the type mpz_t, but I'm not sure how?

    I've tried:
    mpz_t MyFunction(mpz_t A, mpz_t B){}

    But it didn't work, here is my code so far, I have bolded the parts of the...
  10. Replies
    1
    Views
    419

    Re: mpz_invert() limit?

    Hmm, I've started using even bigger numbers and now it's working again.
    Mods can delete this thread.
  11. Replies
    1
    Views
    419

    mpz_invert() limit?

    I have been writing a program to generate pairs of RSA keys using small prime numbers. I have been using mpz_invert() to get a value for d for the private key. On small prime numbers it calculates...
  12. Replies
    1
    Views
    668

    Simple Image Output

    I'm wanting to create an image, all I need is to be able to set RGB values and X-Y coordinates, I'm not wanting to read or manipulate images.

    I was hoping someone could recommend an easy to use...
  13. Replies
    2
    Views
    543

    Re: Interesting Exercises?

    I was trying to get onto project euler the other night but there was an error on the website, I will check them out, thank you :)
  14. Replies
    2
    Views
    543

    Interesting Exercises?

    There have been some programming exercises I have done which I've found really interesting, and was hoping for some suggestions on some more exercises I could try out.

    The ones which I have...
  15. Replies
    4
    Views
    780

    Re: Changing from BigInteger to GMP

    It wont have values that high unless I'm checking the highest prime numbers which have been discovered, it's nice to be prepared though :)

    Here is the function using GMP, I would estimate it's...
  16. Replies
    4
    Views
    780

    Re: Changing from BigInteger to GMP

    I was wondering if I should post my solution or is it unlikely someone will have the same problem as me?
  17. Replies
    4
    Views
    780

    Changing from BigInteger to GMP

    I have this code which previously used the BigInteger library, however now I have GMP installed and I want to use that instead.

    I have read the manual but I cannot figure out how to use GMP in...
  18. Replies
    4
    Views
    637

    Re: Embedding Python

    How does GMP compare to python in terms of speed? Python can calculate 2 to the power of 100,000 in 1 second, would GMP have the same or better performance?
  19. Replies
    4
    Views
    637

    Embedding Python

    Is there an easy way to embed python in C/C++?

    I'm using visual studio 2010, and the performance of the BigInteger library is really slow compared to how python handles large integers. Is there a...
  20. Replies
    11
    Views
    1,482

    Re: Running on 8 Cores?

    I looked into multithreading but it looked far too complicated for my to tackle right now, I've only been learning C++ for about 1 week.

    Unless there is an easier way of creating threads?
  21. Replies
    7
    Views
    531

    Re: Optimising Code

    I got it down to 8.3 seconds, thank you :) It's still faster on my laptop than a server with 2 quad core processors for some reason though!

    How complicated would making this program use multiple...
  22. Replies
    7
    Views
    531

    Re: Optimising Code

    1 - It was formatted correctly when I pasted it from notepad++, however after posting all the tabs have been removed

    2 - I'm using visual studio 2010

    3/4 - I'll fix those and post back with the...
  23. Replies
    7
    Views
    531

    Re: Optimising Code

    Okay I ran the program 5 times, here is the average time for calculating pi to 10000 decimal places:

    Run 1: 13.744
    Run 2: 13.806
    Run 3: 13.526
    Run 4: 13.838
    Run 5: 13.791
    Avg: 13.741...
  24. Replies
    11
    Views
    1,482

    Running on 8 Cores?

    I made a program which finds the prime numbers from 0 to 100 million, and ran it on my laptop (core 2 duo, 1.83ghz, 2gb ram).

    It takes around 35 seconds for it to sieve all the non-prime numbers...
  25. Replies
    7
    Views
    531

    Optimising Code

    I'm new to C++, and as an exercise I created a program which calculates pi to n decimal places.

    It works, but I want to make it go faster, at the minute it calculates 10,000 digits in around 13...
Results 1 to 25 of 38
Page 1 of 2 1 2


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center