This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
URL: 127.0.0.1:3000/1 | |
[ | |
{ | |
"id": 1, | |
"url": "https://mykea-main-title-pictures.s3.us-east-2.amazonaws.com/27.jpg", | |
"description_id": 1, | |
"description": "Fuga est quibusdam molestias adipisci tenetur pariatur quis voluptas vitae maxime adipisci et voluptatem odit autem placeat id iste velit quam quibusdam cumque ipsam rerum iste fugit est molestias aut." | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 | |
redirect: https://observablehq.com/@d3/selection-join |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reviews=# select * from "Reviews" join "Guitars" on "Reviews"."guitarId"= "Guitars"."id" where "Guitars".id = 21; | |
id | guitarId | rating | author | date | description | id | name | productId | |
----------+----------+--------+---------------------+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change port for service/proxy | |
target: "http://localhost:3000" | |
phases: | |
- duration: 60 | |
arrivalRate: 5 | |
name: Warm up | |
- duration: 120 | |
arrivalRate: 5 | |
rampTo: 1000 | |
name: Ramp up load |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loader.io test: | |
Endpoint: http://<proxy>/reviews/api/item/%{*:1-10000000}/reviews | |
Specifications: 400 clients per second over 1 minute | |
New Relic results: | |
Peak throughput: 292 rps | |
Peak latency: 650ms. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const removeCoveredIntervals = (intervals) => { | |
let coveredIntervalsCount = 0; | |
const compareSet = new Set(); | |
for (let i = 0; i < intervals.length; i += 1) { | |
const current = intervals[i]; | |
for (let j = 0; j < intervals.length; j += 1) { | |
if (j === i || compareSet.has((intervals[j].toString()))) { | |
continue; | |
} | |
const compare = intervals[j]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const summaryRanges = (nums, [beginning, end] = [nums[0]]) => { | |
return nums.reduce((result, curr, i) => { | |
const next = nums[i + 1]; | |
if (curr + 1 !== (next)) { | |
result.push(end === beginning ? `${end}` : `${beginning}->${end}`); | |
beginning = next; | |
} | |
end = next; | |
return result; | |
}, []); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const maxDistToClosest = (seats, | |
[maxDist, i, j] = [0, 0, 1], | |
{ length } = seats) => { | |
const leftSeatOccupied = () => seats[i] === 1; | |
const rightSeatOccupied = () => seats[j] === 1; | |
const isEndOfRow = () => (j + 1) === length; | |
const distanceToEndOfRow = () => j - i; | |
const distanceBetweenSeats = () => Math.ceil(((j - 1) - i) / 2); | |
const seatsLeftInRow = () => j < length; | |
const checkNextRightSeat = () => j += 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getDecimalValue = (head, [currentNode, string] = [head, '']) => { | |
do { | |
string += currentNode.val; | |
currentNode = currentNode.next; | |
} while (currentNode) | |
return parseInt(string, 2); | |
} | |
const getDecimalValue = (h, [c, a] = [h, []]) => { | |
do { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.galvanize.demo; | |
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RequestParam; | |
import org.springframework.web.bind.annotation.RestController; | |
import java.util.Map; | |
import static java.lang.Integer.parseInt; |
OlderNewer