This file contains hidden or 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
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains hidden or 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
| // Save common tests in a global variable | |
| postman.setGlobalVariable("commonTests", () => { | |
| // The Content-Type must be JSON | |
| tests["Content-Type header is set"] = postman.getResponseHeader("Content-Type") === "application/json"; | |
| // The response time must be less than 500 milliseconds | |
| tests["Response time is acceptable"] = responseTime < 500; | |
| // The response body must include an "id" property | |
| var data = JSON.parse(responseBody); |
This file contains hidden or 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 buffer = require('buffer'); | |
| const crypto = require('crypto'); | |
| // Demo implementation of using `aes-256-gcm` with node.js's `crypto` lib. | |
| const aes256gcm = (key) => { | |
| const ALGO = 'aes-256-gcm'; | |
| // encrypt returns base64-encoded ciphertext | |
| const encrypt = (str) => { | |
| // Hint: the `iv` should be unique (but not necessarily random). |
This file contains hidden or 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
| /** | |
| * This class takes an Excel spreadsheet and converts it into a Guava Table format. | |
| * When other formats of the file are to be supported (like CSV, TSV etc.,) implement the apply method with that format. | |
| */ | |
| @Component | |
| public class ExcelToTableLoader implements TableGenerator<File> { | |
| private static final Logger logger = org.slf4j.LoggerFactory.getLogger(ExcelToTableLoader.class); |
OlderNewer