Search:

Type: Posts; User: Xpl0ReRChR

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Thank you Nominal Animal, you have been most...

    Thank you Nominal Animal, you have been most helpful! :)
  2. How do I know whether a disk does a READ or a WRITE?

    There's struct request, which represents a request by the hard disk. The question is, how can I get info on whether the disk does a read or a write?

    Your help will be much appreciated! :)
  3. Replies
    0
    Views
    1,816

    How do I test SLOB?

    So I've edited SLOB to use the best-fit algorithm, both when finding a suitable page and a suitable block. But the question is, how do I test it? Should I just write user-level code that continuously...
  4. It makes perfect sense, I should have tried using...

    It makes perfect sense, I should have tried using an example myself. Good point on the integer division!

    Thank you for taking the time!
  5. Thank you Dennis! SLOB_UNIT is defined as...

    Thank you Dennis! SLOB_UNIT is defined as sizeof(slob_t), which is a struct describing a block.

    I should have been more specific. What I meant to ask is, what is it that the formula represents?
  6. Question about something defined in slob.c

    #define SLOB_UNITS(size) (((size) + SLOB_UNIT - 1)/SLOB_UNIT)

    Could someone explain to me what this does? I would be really greatful! :)
  7. I have absolutely no idea what you mean. I...

    I have absolutely no idea what you mean.

    I should have mentioned I'm using MARS, which is a MIPS simulator.
  8. Well I'm getting the following: Runtime exception...

    Well I'm getting the following: Runtime exception at 0x00400080: store address not aligned on word boundary 0x00000001.
  9. Struct node - from C to MIPS assembly language.

    typedef struct node {
    int data;
    struct node *next;
    } nodeL;
    Assuming I want to translate the above declaration in MIPS assembly language, how am I supposed to do it? Apart...
  10. Replies
    18
    Views
    2,369

    I cannot thank you enough! Indeed, my insert...

    I cannot thank you enough! Indeed, my insert function wasn't correctly resetting the head pointer in that case. Insertion and printing of the nodes is now completely functioning. :) :)

    clearList...
  11. Replies
    18
    Views
    2,369

    Thank you guys, I implemented your ideas and...

    Thank you guys, I implemented your ideas and they're working great!
    There's only two problems now.

    1) All titles and prices are read, but
    -when linked according to title, some (eg "BDD" and...
  12. Replies
    18
    Views
    2,369

    Thank you guys! Will try that loop out! And...

    Thank you guys! Will try that loop out!

    And yeah the prices are of type double, that's what's really making this hard. :/
  13. Replies
    18
    Views
    2,369

    @MK27 What the loop is trying to do, is: -...

    @MK27

    What the loop is trying to do, is:
    - each time, check if end of file has been reached
    - if it hasn't been reached, go on and scan the next title and price, then call 'insert' function to...
  14. Replies
    18
    Views
    2,369

    @twomers Yes, but isn't there a more "clever"...

    @twomers
    Yes, but isn't there a more "clever" way of doing that? It would take like 10 switch cases of almost identical code and that would certainly not look good, even though it would work.
    ...
  15. Replies
    18
    Views
    2,369

    #define comparisons and feof.

    How do I make this work?


    #define BOUNDARIES 10 20 30 40 50 60 70 80 90 100

    index = (newnode->price == BOUNDARIES) ? (newnode->price / 10) - 1 : (int)newnode->price / 10;

    Compiler says:...
  16. Replies
    22
    Views
    2,797

    It's WORKING! I used gdb and found out that I'm...

    It's WORKING! I used gdb and found out that I'm getting a segmentation fault at a later-on function!
    Thank you anduril, MK27, stahta, vart, and CommonTater for having putting so much time and effort...
  17. Replies
    22
    Views
    2,797

    I get what you're saying and that's really...

    I get what you're saying and that's really helpful of you, but I don't quite understand your while(curr) and if(prev) statements.

    EDIT: I got it, makes perfect sense! Though it still gets me a...
  18. Replies
    22
    Views
    2,797

    Well if prices[index] == NULL then I do...

    Well if prices[index] == NULL then I do prices[index] = newnode. So if curr is initialized with titles[index], it means titles[index] was not NULL, therefore I think curr can't be NULL.

    And yes I...
  19. Replies
    22
    Views
    2,797

    for (prev = NULL, curr = titles[index];...

    for (prev = NULL, curr = titles[index]; (curr->nxt_title != NULL) && (strcmp(curr->title, curr->nxt_title->title) < 0); prev = curr, curr = curr->nxt_title);

    This causes a segmentation fault....
  20. Replies
    22
    Views
    2,797

    typedef struct books { char...

    typedef struct books {
    char title[TITLE_LEN];
    double price;
    struct books *nxt_price;
    struct books *nxt_title;
    } booksT;


    // Each line is scanned, then 'insert' is...
  21. Replies
    22
    Views
    2,797

    You're definitely right about this. But are you...

    You're definitely right about this.
    But are you sure about the use of '%'? If I'm not mistaken, 100%10=0.
  22. Replies
    22
    Views
    2,797

    Prices are of type double, and range from 0 to...

    Prices are of type double, and range from 0 to 100. So I figured, if a number is eg. 9.12, it corresponds to the index of 0 as it is a value less than 10. And since 9 (as an int) / 10 = 0, it would...
  23. Replies
    22
    Views
    2,797

    Yes, but for each "step" it takes, a comparison...

    Yes, but for each "step" it takes, a comparison will have to be made. Therefore, I'm guessing the runner will have to contain both a temporary title and a temporary price - meaning it will have to be...
  24. Replies
    22
    Views
    2,797

    So what should I do instead? I can't think of a...

    So what should I do instead? I can't think of a different way to find where the new node has to be inserted unless I do that.

    Thanks to both of you by the way; I read both FAQ's and they're very...
  25. Replies
    22
    Views
    2,797

    Segmentation fault!

    Please do have a look at the attachment to get an idea of how it's supposed to look.

    After opening a file, each line (containing <TITLE><space><PRICE><comma>) is read, and then a node is created...
Results 1 to 25 of 70
Page 1 of 3 1 2 3