Giter VIP home page Giter VIP logo

the-prices-are-wrong's Introduction

Usage Instructions

Dependencies

To run the script Babashka is preferred, you can find installation instructions here

To run the tests I opted for clojure/kaocha as Babshka was fiddly to get working with the tests, installation instructions are here

The data is required to be in the data directory otherwise the script will just fail

Usage

To run the script, from the project root run:

bb src/calculate_price_differential.clj

To run the tests, from the project roo run:

./bin/kaocha

For a REPL, I used vim-iced and to start that up (with kaocha) I used:

iced repl --dependency=kaocha-nrepl:0.1.1 --middleware=kaocha-nrepl.core/wrap-kaocha

Notes

  • I spent far too long trying to get the data into a format that was easy to output, resulting in many iterations through the entire data set
  • I avoided using regexes for no real reason, which led to parsing being pretty easy to break
  • With a larger data set this script would not scale well, however in a real setting you are most likely to only improve the script when required, so I felt this more adequately reflected real world situations
  • Lack of confiurability of location of the data, this would be useful, but again would likely be added later
  • Wasted far too much time trying to get tests working in Babashka
  • It would have been good to have kept track of the receipt in which the line item was, as it became hard to manually test the script
  • The tests should really test edge cases and invalid data, but as I was using them as a design tool I found it hard to add that on later

the-prices-are-wrong's People

Contributors

lamp avatar

Watchers

 avatar

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.