Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/traviskaufman/socrata_programming_challenge
My Implementation of Socrata's Front-End Engineer Programming Challenge using NodeJS
https://github.com/traviskaufman/socrata_programming_challenge
Last synced: 7 days ago
JSON representation
My Implementation of Socrata's Front-End Engineer Programming Challenge using NodeJS
- Host: GitHub
- URL: https://github.com/traviskaufman/socrata_programming_challenge
- Owner: traviskaufman
- Created: 2012-12-05T09:08:19.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2012-12-05T09:25:15.000Z (about 12 years ago)
- Last Synced: 2025-01-08T15:53:58.592Z (16 days ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Socrata Front-End Engineer Programming Challenge
================================================Overview
--------
This node module represents my answer to Socrata's [Front-End Engineer
Programming
Challenge](http://www.socrata.com/career/front-end-software-engineer/),
described here:
"Allow the user to enter two times of the format “[H]H:MM AM”. Mentally picture
these times on two analog clocks, each having an hour hand and a minute hand.
Without using any built-in date or time routines, calculate the number of
degrees the minute hand on the first clock must travel in order to have the
second clock show the exact same time as the first clock. Assume that when you
move the minute hand, the hour hand moves automatically. The minute hand may
only move in the clockwise direction. You may assume that the minute hand
always ends up on a perfect minute boundary."Installation
------------
```sh
$ git clone https://github.com/traviskaufman/socrata_programming_challenge.git
$ cd socrata_programming_challenge
$ npm install .
```Run the Tests
-------------
```sh
$ npm test
```Verify that it works
--------------------
```sh
$ ./bin/rotation-amt [-h, --help] START_TIME END_TIME
```Examples
--------
###Running the command line script
```sh
$ ./bin/rotation-amt "10:15 AM" "12:45 PM"
900 degrees (2.5 rotations)
```###Using it as a nodeJS Module
```javascript
var degRotnAmtCalc = require('./index');
degRotnAmtCalc.getDegreeRotationAmt('10:15 AM', '12:45 PM'); // 900
```