Coder Social home page Coder Social logo

number-processor's Introduction

Number Processor

The application accepts numbers and does multiple computation on the numbers in parallel or in sequential.

Table of Contents

Created by Alok Singh

Computations

  • Addition - add the numbers
  • Multiplication - multiply the numbers
  • Subtraction - subtract the numbers

Examples

  • Example 1:

    Sample Input: 1 1 1 1 1 SEQUENTIAL

    Sample Output: ERROR: "At least 2 numbers must be different"

    Explanation: All five numbers are with the same value "1".

  • Example 2:

    Sample Input: 3 4 1 5 6 SEQUENTIAL

    Sample Output: Add: 19 Multi: 360 Sub: -7 Time: 10s Type: SEQUENTIAL Numbers: [6, 5, 4, 3, 1]

    Explanation: in this case, Add operation executed first and took 2s. Then Mult operation executed and took 5s. Finally Sub operation took 3s, giving a total of 10s.

  • Example 3:

    Sample Input: 5 4 5 5 5 PARALLEL

    Sample Output: Mult: 20 Sub: 1 Add: 9 Time: 5s Type: PARALLEL Numbers: [5, 4]

    Explanation: in this case, Add (5s), Mult (1s) and Sub (4s) operations started at the same time and the longest one defined the final execution time result of 5s.

Run Command

Run the application by executing following command

cd number-processor
java -jar target/number-processor-1.0.0.jar 1 2 6 4 3 PARALLEL 

Or

cd number-processor
java -jar target/number-processor-1.0.0.jar 1 2 6 4 3 SEQUENTIAL

Download Jar Build

Get the latest build from number-processor

Docker Build

Build Docker Image

cd number-processor
docker build -t alokkusingh/number-processor:latest -t alokkusingh/number-processor:1.0.0 --build-arg JAR_FILE=target/number-processor-1.0.0.jar .

Pull/Run Docker Container

docker run --rm --name number-processor alokkusingh/number-processor 1 2 6 4 3 SEQUENTIAL

number-processor's People

Contributors

alokkusingh 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.