Design a generic caching system for vehicle data that minimizes the number of requests that SC must make to a given vehicle.
{
"odometer": {
"distance": 104400.50
const Fs = require('fs'); | |
const Os = require('os'); | |
const Path = require('path'); | |
const FILTERED_WORDS_FILE = 'filtered.txt'; | |
const STARTS_WITH = 'h'; | |
const TOTAL_LENGTH = 12; | |
const WORDS_FILE = '20k.txt'; // https://github.com/first20hours/google-10000-english/blob/master/20k.txt | |
const addendPairs = []; |
/** | |
* Resolve an arithmetic equation. | |
* | |
* Ex. '1+3*4/22^4-11' | |
* | |
* @param {String} equation - string representation of arithmetic equation | |
* @return {Number} - resolved number | |
*/ | |
/** |
function getInput() { | |
return [ | |
['name', 'tags'], | |
['john',' hungry,likes_pizza'], | |
['maggie', 'thirsty, productmanager,likes_pizza'], | |
['sally', 'hungry,thirsty, somethingelse'], | |
['tim', 'productmanager'] | |
]; | |
} |
var TinyColor = require('tinycolor2'); | |
var NEUTRALS = [ | |
['BLACK', 'black', -0.01, .11], | |
['NEARBLACK', 'near black', .11, .2], | |
['GREY', 'grey', 0.2, 0.95], | |
['NEARWHITE', 'near white', 0.95, .99], | |
['WHITE', 'white', .99, 1] | |
]; |
// Francesca | |
// REVERSE A STRING | |
const assert = require('assert'); | |
function reverse(str) { | |
let output = ''; | |
//reverseVowels | |
//"whiteboard" | |
//"whatobeird" | |
const VOWELS = ['a','e','i','o','u']; | |
function isVowel(char) { | |
return VOWELS.indexOf(char) >= 0; | |
} |
function swap (array, a, b) { | |
var temp = array[a] | |
array[b] = (array[a] = array[b], temp) | |
} | |
function makeSortedArray(x, y) { | |
var sorted = [] | |
for (var i = x; i < y; ++i) sorted.push(i) | |
return sorted | |
} |
<!doctype html> | |
<html> | |
<head> | |
<style> | |
.colors, #preview { | |
height: 50px; | |
width: 50px; | |
} | |
.colors:hover { | |
cursor: pointer; |
<!doctype html> | |
<html> | |
<head> | |
<style> | |
.red { | |
background-color: #FF0000; | |
} | |
.yellow { | |
background-color: #FFFF00; |