Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Nov 16, 2011

  1. Mark Jason Dominus (陶敏修)

    add full-height block


Nov 15, 2011

  1. gwern

    generalize to translating all whitespace, not one character (the space)

    gwern authored committed
  2. Mark Jason Dominus (陶敏修)

    comment tests

  3. Mark Jason Dominus (陶敏修)

    handle special case where min=max

    plus tests
  4. Mark Jason Dominus (陶敏修)

    -z option puts spark baseline at 0 instead of at min

  5. Mark Jason Dominus (陶敏修)

    Use rational arithmetic instead of bc

    Use rational arithmetic throughout to avoid shelling out to bc, which
    is slow and apparently nonportable.  Instead of dealing with decimal
    numbers like 4.35, we convert 4.35 to 435 / 100 and deal with the
    integers 435 and 100.
    It is ridiculous, but it is a lot faster.
    All the tests pass now.
  6. Mark Jason Dominus (陶敏修)

    a couple more fractional-number tests

  7. Mark Jason Dominus (陶敏修)

    fix expected test result for decimal test

    Since 5.5 is the minimal input value, it should be at the baseline,
    and should have the shortest possible tick, not the second-shortest.
  8. Mark Jason Dominus (陶敏修)

    adjust expected test result

    The input data were 1,5,22,13,5
    Say 1 maps to a bar of height 0 and 22 to a bar of height 6.
    Then the linear mapping has that x :-> (x-1) * 2/7.
    So 13 :-> 24/7 = 3.43.  The test data had it displayed as a bar of
    height 4, and I changed it to a bar of height 3.
  9. Mark Jason Dominus (陶敏修)

    fix trivial spacing error in test

  10. Mark Jason Dominus (陶敏修)

    do not repeatedly compute number_of_ticks or tier_size

  11. Mark Jason Dominus (陶敏修)

    cache min and max inputs

  12. Mark Jason Dominus (陶敏修)

    -d flag to enable debugging mode

  13. Mark Jason Dominus (陶敏修)

    fix arithmetic errors

    also use division instead of looping with trial multiplication
  14. Zach Holman

    update README

    holman authored
  15. Zach Holman

    add space tests

    holman authored
  16. Zach Holman

    Merge branch 'allow_spaced_input' of…

    …spark into patricklucas-allow_spaced_input
    holman authored
  17. Zach Holman

    (failing) test for decimals

    holman authored
  18. Patrick Lucas

    Keep individual numbers separate

    Instead of interpreting input "1 3 2 6 8" as "13268", treat spaces
    as commas then condense.
    patricklucas authored
  19. Patrick Lucas

    Change back to using 'test' for string equality

    Minimizes this branches overall change.
    patricklucas authored
  20. Patrick Lucas

    Allow spaced input

    This allows input like "1, 2, 4, 7, 9" which is sometimes useful
    with longer lists.
    patricklucas authored
  21. Zach Holman

    Merge pull request #25 from peff/22439644fb39de086482d71d36a9251966af…

    obvious shell cleanups
    holman authored
  22. Jeff King

    print sparks incrementally instead of building string

    This shaves a few lines from the print_ticks function. We
    use "printf" instead of "echo -n" as the former is more
    portable (although we are hopelessly tied to bash due to the
    use of arrays, anyway, so either would be fine).
    peff authored
  23. Jeff King

    use shell arithmetic expansion

    This is way faster than invoking bc repeatedly.
      $ DATA=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20
      $ time spark.old $DATA >/dev/null
      real    0m1.018s
      user    0m0.020s
      sys     0m0.060s
      $ time spark $DATA >/dev/null
      real    0m0.089s
      user    0m0.000s
      sys     0m0.008s
    Or to make it more clear:
      $ elapsed_ms() {
          /usr/bin/time -f %e "$@" 2>&1 >/dev/null |
            perl -lpe '$_ *= 1000'
      $ spark "$(elapsed_ms spark.old $DATA),$(elapsed_ms spark $DATA)"
    peff authored
  24. Jeff King

    drop pointless loop

    We just reassign the data to itself in the loop, and then
    break after reading one line.
    peff authored
  25. Zach Holman

    that was easy

    holman authored
  26. Zach Holman

    Merge pull request #22 from benburkert/master

    Add simple roundup tests.
    holman authored
  27. Ben Burkert

    Add simple roundup tests.

    benburkert authored
  28. Jeff Abrahamson

    Don't iteratively build output.

    This should be a bit quicker (and portable).
    JeffAbrahamson authored holman committed
  29. Zach Holman


    holman authored
  30. Zach Holman


    holman authored
  31. Zach Holman

    Merge pull request #18 from tombell/patch-1

    Missing "
    holman authored
  32. Tom Bell

    Missing "

    tombell authored
  33. Zach Holman


    holman authored
  34. Zach Holman

    Merge pull request #6 from judofyr/patch-1

    Added U+2584 to get smother ticks.
    holman authored
Something went wrong with that request. Please try again.