Search:

Type: Posts; User: otaconBot

Search: Search took 0.00 seconds.

  1. Replies
    1
    Views
    1,064

    Reciving data from a child program

    Hey guys,

    I'm in need of spawning a separate program from my original (parent) program, which in itself is not a problem (yes, i checked out the FAQ at FAQ > Run a program from within a program -...
  2. Replies
    10
    Views
    2,014

    Hm? I think I am. I might have been using the...

    Hm? I think I am. I might have been using the term list, but actually meaning just a basic array. Unless you mean something else here.

    Oh, and @edit: its just a bit string, not even references....
  3. Replies
    10
    Views
    2,014

    Its relatively small..as in a bits: ...

    Its relatively small..as in a bits: num_vars*(sizeof(char)) , but the length of it is unknown, my test benchmarks are about 100-2000 variables...but industrial testing can easily be 100x that ..so...
  4. Replies
    10
    Views
    2,014

    Smarter List Allocation

    Hey guys,

    I think this question boils down to dynamically allocating memory. Is it more expensive/efficient allocating memory once, if I know the max size I will need (even if I'm likely to use...
  5. Replies
    4
    Views
    1,282

    Parallel execution

    Hey guys,

    I'm still getting used to C, but need to run a really large simulations in it. I have a very n00b question about how C handles memory etc.

    More specifically, is it risky to...
  6. Replies
    2
    Views
    2,209

    /me hugs nonoob Elegant and efficient :)...

    /me hugs nonoob

    Elegant and efficient :) Exactly what I needed! That was quick, thank you :)
  7. Replies
    2
    Views
    2,209

    Random Selection - Tabu List

    Hey guys,

    So my current problem, after great simplifications boils down to this:

    Lets say you have a 100 numbers, and I want to pick a random one. If its not 'right' I need to pick another one...
  8. Replies
    7
    Views
    1,186

    Wow, two things... you're right, after casting it...

    Wow, two things... you're right, after casting it to int I forgot to reformat the print!


    printf("[Clauses] %d - [obj best] %d = [fitness] %d \n", sat_clauses, (int)objective_best,...
  9. Replies
    7
    Views
    1,186

    Yea, I noticed that, but the actual value of both...

    Yea, I noticed that, but the actual value of both "objective_best" is the same, and should be (in this case) 297.0. Not sure why when I cast it to int it suddenly becomes this tiny number in the...
  10. Replies
    7
    Views
    1,186

    I am doing that in the second print attempt: ...

    I am doing that in the second print attempt:

    sat_clauses-(int)objective_best
  11. Replies
    7
    Views
    1,186

    Silly double to int casting

    *sigh* this has to be super simple, but I think my brain if getting fried from coding today.

    I have an int and a double...i know the double is actually an integer value (in this case, but I cannot...
  12. Replies
    4
    Views
    1,253

    Yea, they are of different lengths. I thought...

    Yea, they are of different lengths. I thought there might be a 'cleaner' way to determine the size of it, but it looks like a separate array it is :) Thanks!
  13. Replies
    4
    Views
    1,253

    2D Array length

    So, I'm clearly not understanding something, but I can't seem to be able to determine the length of my array. I have a
    int **sat_data array, which is a set length array (i know that length) of...
  14. Replies
    11
    Views
    3,728

    Thank you guys! Yea, the counting of spaces...

    Thank you guys!

    Yea, the counting of spaces (token separators) is not very expensive, and probably just as efficient as the Java equivalent (StringTokenizer) - i just need to get used to the fact...
  15. Replies
    11
    Views
    3,728

    Thank you Adak, your solution is quite clever,...

    Thank you Adak, your solution is quite clever, but I did oversimplify the problem a bit, and while the space delimiter is always there, I cannot assume the length of the token, so the little math...
  16. Replies
    11
    Views
    3,728

    Lets say I'm reading in a file: a b c d e f...

    Lets say I'm reading in a file:

    a b c d
    e f
    g h i

    I go through it line by line, getting a string line = "a b c d", "e f", "g h i" respectively per every fgets().

    If I know the amount of...
  17. Replies
    11
    Views
    3,728

    Update: Well, I realized I can just count the...

    Update:

    Well, I realized I can just count the spaces and that number+1 is my amount of tokens...better then re-tokenizing it twice, but still seems ugly.
  18. Replies
    11
    Views
    3,728

    strtok() help

    Hey guys,

    I'm trying to convert a big chunk of Java code into C, and ran into a little problem with a part of it (been a while since I touched C).

    I'm trying to tokenize a string, for example...
Results 1 to 18 of 18