Git Product home page Git Product logo

matrix-multiplication's Introduction

Matrix-Multiplication

This is a Java program we made as an assignment part of the Big Data course I took in university. It uses Socket connection to input two matrices from two clients into a server and multiplies them. You can run the Server and Clients locally on the same device or run them on different devices in the same network.

How to Run

  • If you are running Server and Clients on different devices you need to obtain the IP address of the Server device. Open the terminal on the Server device and execute:

    • On Linux: hostname -I

    • On Mac: ipconfig getifaddr en0 (en0 for wireless,en1 for wired connection)

  • Otherwise, if you are running Server and Clients on the same device, then the Server's IP address will be localhost

Then proceed with the steps:

  1. Open Server.java file and change this line to choose the port you want to open a ServerSocket on (you can also leave it as 1233)
ServerSocket serverSocket = new ServerSocket(1233);
  1. Open Client1.java and Client2.java files and modify this line to use the port you specified in the Server file and the IP address of the server you obtained
Socket socket = new Socket("localhost", 1233);
  1. Run Server.java and your console should print Listening for client 1, then run Client1.java and you should see the first matrix printed on the server's console, then run Client2.java and the second matrix should be printed then the multiplication result.

matrix-multiplication's People

Contributors

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