Giter VIP home page Giter VIP logo

transform-implementation's Introduction

Transform Implementation

An implementation of the satellite-stream module. It applies a transform stream to change location data to movement data โ€“ rate of change in latitude and longitude per second.

It launches a simple TCP server. The server implements the satellite-stream module and applies a transform to convert the stream of location data to movement data.

Deployment and Usage

After downloading, install the dependencies from the terminal window:
npm install

In the terminal window, start the server with:
node tcp-start.js

In another terminal window, open a client with:
telnet localhost 65000

The client responds to three commands:

  • start - begins the stream and prints out movement speed as changes in latitude and longitude per second.
  • stop - halts the stream
  • close - terminates the client TCP socket

Any unrecognized commands will echo back to client. Stop the TCP server with Option-C.

Notes

Movement.js is a factory function that produces a subclass of stream.Transform. It transforms the output from a Readable stream that writes JSON objects with a latitude <float> property and a longitude <float> property. The output of the transform is a JSON object with latitude <float> and longitude <float> properties that represent the change in degrees per second.

Known Issues

Currently the server works reliably with one client. The server does not track separate clients so start and stop commands will affect all stream consumers and cause erratic behavior.

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.