Ad
  • Custom User Avatar

    I hope, new tests with 'IllegalArgumentException' as error signal will work.

  • Default User Avatar

    Random tests ready.
    While working, accidentally dropped Blind4Basics' solution into the solutions section (however, with comment), sorry.
    I've used it as reference one to adjust tests.

  • Default User Avatar

    Hello, Toderesa97, need a couple of hours more - do correction in random tests; will update them in a minutes and then write random wrong formatting test. Thank you!

  • Default User Avatar

    Will rework random tests a little, and write one for non-correct expression format.

  • Default User Avatar

    I've just published updated version with 'IllegalArgumentException' as error signal, and portions of random tests.
    One's else solution is strong enough to pass them.

  • Default User Avatar

    I'm trying to resolve kata issues and this can break previous solutions, sorry for that.
    Would it be convenient to edit in place?

  • Default User Avatar
  • Default User Avatar
    1. printf now uses "%"PRIu64 macro from <inttypes.h> to print uint64_t
    2. "... all of the smallest 5,000 (Clojure: 2000, NASM: 13282) Hamming numbers ..."
    3. Ok, removed

    Function signature changed to "uint64_t hamming(int n)".

    Published, but not ready yet - will do some testing, about 1 hour else.

  • Default User Avatar

    Thank you; will correct this issues.

  • Default User Avatar

    NASM translation

  • Default User Avatar

    Thank you for reading and answering, it's very helpful for me.

    My questions were mostly about real process, when we have transmitter and receiver:
    i) how can transmitter use coding table (e.g. a:0, b:10, c:11) provided by receiver?
    ii) when transmitter creates one, how can receiver receive that table or re-calculate it self?

    Here, serialization is projection Map<Character,String> -> List (e.g. ["a 0", "b 10", "c 11"]).

    Encode message: aaaabcc -> 0000101111;
    or aaaabcc, ["a 0", "b 10", "c 11"] -> 0000101111
    Decode: the inversion of above.

    Ok, the description is consistent, and so;
    should test system be able to decode result of Huffman.encode("aaaabcc")?
    Guess this is not part of kata problem.
    I agree with this too.

    freq(b+c)=3 is shortly the same as description (Tree construction, "... This node gets reinserted and has the sum of the frequencies of both trees as new frequency.").

  • Custom User Avatar

    Now I work with java translation and try to choose kata api design.
    Well, any solution should be able:

    1. on text sample, calculate symbol frequencies table;
    2. with that frequencies given, build appropriate data structures for encoding with compression, and
      a) serialize coding table calculated,
      b) encode message;
    3. with coding table calculated or provided, decode message just coded.
      So, there are 4 methods in kata api, and 2-a), 3) are not the same as haskell variant.
      I think, it's more clear how to work with code table, then just 'decode a bit sequence using the given frequencies' (haskell kata description).
      For example, a:4, b:1, c:2 (symbol:frequency) "aaaabcc" coding result is 0000101111 - here a:0, b:10, c:11.
      When "usually we choose 0 for the left branch and 1 for the right branch", shouldn't be b:11, c:01 if a:0?
      a=0 and freq(a)=4 > freq(b+c)=3; so last code letter for c should be the same as first for a, because of freq(c)=2 > freq(b)=1 (in accordance with select branch rule.
      Whould it be convenient to work with this 1), 2-a), 2-b), 3) api schema in kata java version?
  • Default User Avatar

    Beta version,
    needed a day or two to inspect tests.

  • Default User Avatar
  • Default User Avatar

    NASM translation

    Not quite sure, am I correct using cr_malloc in Test function (line 145).

  • Loading more items...