Search:

Type: Posts; User: hamster_nz

Page 1 of 10 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    21
    Views
    559

    I *think* this is what you want in BuildCodes():...

    I *think* this is what you want in BuildCodes():



    void BuildCodes( BUFF *Symbols, uint longest )
    {
    uint uid = 0;
    HUFFMAN_SYMBOL *symbols = Symbols->addr;
    for ( uint...
  2. Replies
    21
    Views
    559

    Here's my code for that, with error checking...

    Here's my code for that, with error checking removed for clarity:



    void codetable_generate(struct Codetable_entry *table, size_t len) {
    uint32_t next_code = 0;
    for(uint32_t pass_len =...
  3. Replies
    21
    Views
    559

    I ran you code against a test file, and got this...

    I ran you code against a test file, and got this output:




    main.c:281: symbols[ 0] (0x5560170045f0): src = 0, use = true, sym = '' ( 0), lit = '' ( 0), get = 0, len = 4, uid = 0010...
  4. In the past I have been using "-Wall -pedantic",...

    In the past I have been using "-Wall -pedantic", but now also recently added "-Wextra", which for me picks up the mixing of mostly signed vs unsigned issues.

    It has shown me a lot of shabby/fuzzy...
  5. Replies
    21
    Views
    559

    Re-reading the spec, now I understand it and I...

    Re-reading the spec, now I understand it and I see I haven't honored that "all code lengths form a single sequence"

    Ah well, better fix it up...
  6. Replies
    21
    Views
    559

    I've got the hard parts of the "deflate"...

    I've got the hard parts of the "deflate" uncompressing written - now seems to inflate the original PNG data just fine (although I've still got to verify the ADLER32 checksum.

    Once again, maybe it...
  7. Replies
    21
    Views
    559

    Here's the decoding of the first part of the...

    Here's the decoding of the first part of the first 'dynamic dictionary' data block in the image in the original post (the first uses a fixed dictionary), in preparation for reading the actual full...
  8. Replies
    21
    Views
    559

    It's true what they say, premature optimization...

    It's true what they say, premature optimization is the source of all evil :D....

    (i.e. I am doing evil using >>3 and &7 )
  9. Replies
    21
    Views
    559

    I dpn't know if it is of any value, but here is...

    I dpn't know if it is of any value, but here is my prototype for getting and consuming bits from the compressed bitstream.



    static uint32_t grab_bits(struct Inflate_data *d) {
    uint32_t...
  10. Replies
    21
    Views
    559

    Are you decoding PNG 'deflate' compression by any...

    Are you decoding PNG 'deflate' compression by any chance?

    Inspired by your earlier posts I decided that I would attempt this too, and am making good progress.

    Shame the RFC is sort of mostly...
  11. Replies
    18
    Views
    567

    Having read throw the thread I have no clear idea...

    Having read throw the thread I have no clear idea of what you are trying to do, and why you want to do it.

    Are you able to give me some context to this?
  12. Have a read of: The Floating-Point Guide - What...

    Have a read of: The Floating-Point Guide - What Every Programmer Should Know About Floating-Point Arithmetic

    The issue is that the library is calculating pow(10,2) as something just slightly under...
  13. Replies
    2
    Views
    358

    1) See if there are any local programming...

    1) See if there are any local programming standards you have to follow. Indentation, style, portability, licensing, compiler options. Maybe there is a template you can use as the basis for your...
  14. Replies
    5
    Views
    406

    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
  15. 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...
  16. Replies
    35
    Views
    1,398

    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...
  17. Replies
    35
    Views
    1,398

    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...
  18. Replies
    35
    Views
    1,398

    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...
  19. Replies
    35
    Views
    1,398

    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 |...
  20. Replies
    4
    Views
    448

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

    You are writing the first element of the array over and over.
  21. Replies
    7
    Views
    658

    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...
  22. Replies
    15
    Views
    663

    Windows now also supports mount points inside...

    Windows now also supports mount points inside file systems.

    It just isn't used very often....
  23. Replies
    4
    Views
    440

    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...
  24. Replies
    7
    Views
    582

    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...
  25. Thread: FIFO Queue

    by hamster_nz
    Replies
    21
    Views
    1,151

    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...
Results 1 to 25 of 248
Page 1 of 10 1 2 3 4