Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Nov 16, 2011
  1. add full-height block

Commits on Nov 15, 2011
  1. @gwern
  2. handle special case where min=max

    plus tests
  3. 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.
  4. cache min and max inputs

  5. fix arithmetic errors

    also use division instead of looping with trial multiplication
  6. @patricklucas

    Keep individual numbers separate

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

    Change back to using 'test' for string equality

    patricklucas authored
    Minimizes this branches overall change.
  8. @patricklucas

    Allow spaced input

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

    print sparks incrementally instead of building string

    peff authored
    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).
  10. @peff

    use shell arithmetic expansion

    peff authored
    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)"
  11. @peff

    drop pointless loop

    peff authored
    We just reassign the data to itself in the loop, and then
    break after reading one line.
  12. @JeffAbrahamson @holman

    Don't iteratively build output.

    JeffAbrahamson authored holman committed
    This should be a bit quicker (and portable).
  13. @holman
  14. Missing "

    Tom Bell authored
  15. @holman

    Merge pull request #6 from judofyr/patch-1

    holman authored
    Added U+2584 to get smother ticks.
  16. @holman

    more portable echo

    holman authored
  17. @holman

    Merge pull request #8 from nrr/a_variant_that_works_on_systems_with_n…

    holman authored
    Fix the shebang line even more.
  18. @holman

    reformat help

    holman authored
  19. @rentalcustard
  20. @nrr
  21. @judofyr
  22. @etanol

    Fix the shebang line.

    etanol authored
    POSIX compliant bourne shell implementations do not support array variables.  In
    particular Debian/Ubuntu's /bin/dash (which is linked from /bin/sh) fails to
    parse the script.
    It should also fail in other platforms such as Solaris or BSD.
  23. @holman

    don't hang on tty (closes #1)

    holman authored
  24. @holman


    holman authored
Something went wrong with that request. Please try again.