https://cyber.wizard.institute/
press i to get into --INSERT-- mode
press 'escape' to return to command mode
| let pages = [7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2]; | |
| let memorySize = 4; | |
| function lruCache1() { | |
| let memory = new Set(); | |
| let recentUsedPageIndex = new Map(); | |
| let pageFault = 0; | |
| for (let i = 0; i < pages.length; i++) { | |
| const currentPage = pages[i]; |
https://cyber.wizard.institute/
press i to get into --INSERT-- mode
press 'escape' to return to command mode
| const myFunction = async (args) => { | |
| // do something in this function whose memory you want to monitor | |
| return 0; | |
| } | |
| function sleep(ms) { | |
| return new Promise((resolve) => { | |
| console.log(`***\n***\nsleeping for ${ms / 1000} seconds`) | |
| setTimeout(resolve, ms); | |
| }); |
| import { httpGet } from '../util/http'; | |
| import { getAccessToken, expireToken } from './salesforceOAuth'; | |
| import { retryOnce } from '../util/retry'; | |
| import logger from '../logger'; | |
| /** | |
| * API call to get data | |
| * wrapped into retryOnce() util function with fallback unauthorised function | |
| * -- wrapped into getAccessToken() function | |
| */ |