Search:

Type: Posts; User: hamster_nz

Page 1 of 10 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    196

    Is Google not working? selection sort in c -...

    Is Google not working?

    selection sort in c - Google Search

    Third hit for me looks OK:

    Selection sort in C | Programming Simplified
  2. GitHub - hamsternz/miniweb: A small, lightweight...

    GitHub - hamsternz/miniweb: A small, lightweight web server - On a Pi 400, 1000 request per second.

    On a laptop 6,000 requests per second on a single core.



    Server Hostname: localhost...
  3. Replies
    35
    Views
    929

    Ah, that makes more sense. If I was...

    Ah, that makes more sense.

    If I was implemented this, I would make a hidden 'checksums' file in each directory, with just the local files in that directory, and not inserting the checksums into...
  4. Replies
    35
    Views
    929

    I'm still left puzzled as why you want to...

    I'm still left puzzled as why you want to checksum/hash the files... are you intending to store them on media has a high bit error rate? do you want some short 'digest' of the file, allowing you to...
  5. Replies
    35
    Views
    929

    If you want to speed things up you want to...

    If you want to speed things up you want to investigate how you can make the most of all the required resources.

    You want to keep many CPU cores busy calculating checksums, while you have a...
  6. Replies
    35
    Views
    929

    Visual studio community edition would be a...

    Visual studio community edition would be a reasonable choice.

    Here is a breadcrumb on reading and writing files using the Windows API:

    Opening a File for Reading or Writing - Win32 apps |...
  7. Replies
    4
    Views
    311

    You are writing the first element of the array...

    You are writing the first element of the array over and over.
  8. Replies
    7
    Views
    482

    Lots of thoughts: Code tends to cycle around...

    Lots of thoughts:

    Code tends to cycle around the 'idea'. Different people have different ideas of what 'ideal' code looks like, and everybody nudges code a little to their idea of the ideal...
  9. Replies
    15
    Views
    507

    Windows now also supports mount points inside...

    Windows now also supports mount points inside file systems.

    It just isn't used very often....
  10. Replies
    4
    Views
    381

    I just compiled it up. What you have been show...

    I just compiled it up.

    What you have been show as the correct answer is 414.00 plus 4% tax, and the answer your program gives is 414.80 plus 4% tax.

    So it seems the assignment setter's code...
  11. Replies
    7
    Views
    523

    So if I was in a room 2.4m Hight x 2.5m Long and...

    So if I was in a room 2.4m Hight x 2.5m Long and 2.0m Wide, are you able to show me how to work out the answers for questions b to g?

    Why?

    What I am trying to get you to do is to learn how...
  12. Thread: FIFO Queue

    by hamster_nz
    Replies
    21
    Views
    956

    Had a good look at this, and it seems you don't...

    Had a good look at this, and it seems you don't really understand what the dequeue operation should be doing.

    It should remove the oldest item in the queue, and reduce the length of the queue by...
  13. Thread: FIFO Queue

    by hamster_nz
    Replies
    21
    Views
    956

    Why does dequeue care if the quque is full or not?

    Why does dequeue care if the quque is full or not?
  14. Thread: DD to DMS

    by hamster_nz
    Replies
    5
    Views
    460

    I've finally got to the point where I no longer...

    I've finally got to the point where I no longer trust floating point - because some things are a little unpredictable, and "float" is only accurate to 25 bits, and just degrees, minutes and seconds...
  15. Thread: DD to DMS

    by hamster_nz
    Replies
    5
    Views
    460

    Do you have some test data and results you can...

    Do you have some test data and results you can share?
  16. Replies
    4
    Views
    426

    It's way easier than that. For 16-bit signed...

    It's way easier than that. For 16-bit signed numbers the most significant bit has a 'place value' of -32768, rather than the 32768 it would have in an unsigned (or longer) value.

    So 0x8011 as a...
  17. Replies
    4
    Views
    426

    Lots of things going on here, but in summary, if...

    Lots of things going on here, but in summary, if 'int' is 16 bits, and you have a overflow the answer will be wrong by 2^16, or 65536.

    So what is 32785-65536? −32,751
  18. Replies
    5
    Views
    450

    It is quite likely that you will still have the...

    It is quite likely that you will still have the same problem. You don't want to speed up the comparison, but reduce the number of comparisons.

    What is the bigger problem you are trying to solve?
  19. It is common to have two-stage locknig... Idle...

    It is common to have two-stage locknig...

    Idle - nobody is accessing the data.

    Shared - everybody cn access, but nobody can change.

    Exclusive - only one thread can access the structure.
    ...
  20. Replies
    16
    Views
    732

    Or just use addition... #include ...

    Or just use addition...



    #include <stdio.h>
    int main(int argc, char *argv[]) {
    float f;
    int x;
    int e = 0;
  21. Replies
    16
    Views
    732

    But.... Why? I mean, it is possible, and I can...

    But.... Why?

    I mean, it is possible, and I can do it, but why do you want to?

    And why the restriction on what elementary operators you can use?
  22. Replies
    5
    Views
    658

    Here is using the "read" and "write" system calls...

    Here is using the "read" and "write" system calls directly.

    Note that this program needs no header files, as it is accessing the Linux system calls directly rather than using any library functions...
  23. Replies
    5
    Views
    658

    To write an integer to a file int i; ...

    To write an integer to a file



    int i;
    fwrite(&i,sizeof(i),1,f);


    To read an integer from a file
  24. Replies
    4
    Views
    444

    Here's a state machine for traffic lights. It...

    Here's a state machine for traffic lights. It might give you ideas:



    #include <stdio.h>
    #include <unistd.h>


    enum State { state_all_stop, state_NS_go, state_NS_stopping, state_WE_go,...
  25. Replies
    4
    Views
    444

    I don't usually support gambling, but in this...

    I don't usually support gambling, but in this case I bet you are asking us to do your homework for you.
Results 1 to 25 of 234
Page 1 of 10 1 2 3 4