Giter Club home page Giter Club logo

rinseweb's People

Contributors

unix1 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

wahello jgarte

rinseweb's Issues

Upgrade to erlang 25

To update from Erlang/OTP 24 to 25

  • Add CircleCI tests against erlang 25
  • Update github workflow to build a release with erlang 25

DRY web test suites

It seems the web CT suites repeat the same or similar steps after each request - they assert the response status, headers, returned response, and parse the answer. It seems these repetitive steps can be moved to the rinseweb_test or similar shared module to avoid lots of duplication.

Upgrade erlang to 25.3

Currently in use is erlang 25.0.4 which can be upgraded to 25.3, which is currently the latest version published by Erlang Solutions.

Update erlang to 26.0

Current release is using Erlang/OTP 25.3. As of this writing the latest version of Erlang/OTP is 26.0.2.

Add a feature to display request user agent

The command could be

what is my user agent

and the response would display the user agent header values given in the request. Optionally, the response could also contain other interesting HTTP headers.

Consider removing CircleCI tests

Now that #43 uses GitHub workflows to test on Ubuntu 22.04, do CircleCI tests have any value? If not remove them. Also, remove CircleCI access/setup, if any.

Convert command error when numeric value is large

To reproduce

Type in this command

convert 10GB to bytes

Expected result: "10 GB = 10000000000 bytes"

Actual result: 500 error response from server.

Details

Error log

  crasher:
    initial call: cowboy_stream_h:request_process/3
    pid: <0.382.0>
    registered_name: []
    exception error: bad argument
      in function  list_to_integer/1
         called as list_to_integer("1e+10")
         *** argument 1: not a textual representation of an integer
      in call from rinseweb_util:string_to_number/1 (src/rinseweb_util.erl, line 45)
      in call from rinseweb_wiz_convert:answer_using_canonical_units/3 (src/rinseweb_wiz_convert.erl, line 38)
      in call from rinseweb_wiz:handler_answer/3 (src/rinseweb_wiz.erl, line 117)
      in call from rinseweb_wiz:answer/1 (src/rinseweb_wiz.erl, line 44)
      in call from rinseweb_h_answer:answer_to_json/2 (src/rinseweb_h_answer.erl, line 61)
      in call from cowboy_rest:call/3 (_build/default/lib/cowboy/src/cowboy_rest.erl, line 1583)
      in call from cowboy_rest:set_resp_body/2 (_build/default/lib/cowboy/src/cowboy_rest.erl, line 1472)

Why

Per units man page

The default format for 'units' is '%.8g'; for greater precision, you could specify '-o %.15g'. The 'g' and 'G' format types use exponential format whenever the exponent would be less than -4, so the value 0.000013 displays as '1.3e-005'. These types also use exponential notation when the exponent is greater than or equal to the precision, so with the default format, the value 5e7 displays as '50000000' and the value 5e8 displays as '5e+008'. If you prefer fixed-point display, you might specify '-o %.8f'; however, small numbers will display very few significant digits, and values less than 0.5e-8 will show nothing but zeros.

So the units command output in the above case is 1e+10 which erlang doesn't recognize as valid. Incidentally, if it was represented as 1.0e+10, then it would have been recognized as numeric. This can also be reproduced using the units command directly

> units --terse '10GB' 'bytes'
1e+10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.