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
a=[];i=1;handle=setInterval(_=>{$.get(`/search?q=xkcd.com&Room=240&page=${i++}&pagesize=100&sort=newest`,data=>data.match(/xkcd.com\/\d+/g).map(s=>a.push(+/\d+$/.exec(s)[0])));if(i===12){clearInterval(handle);b=[];for(j=1;j<1726;j++)if(!a.includes(j))b.push(j);}},3000) |
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
function encodeInput(encoding) { | |
var input = document.getElementById("input"); | |
return input ? "&input=" + encoding(input.value) : ""; | |
} |
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
Enter numeric array: [1,2,[],[3,4,5]] | |
Array | |
├1 | |
├2 | |
├Array | |
└Array | |
├3 | |
├4 | |
└5 |
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
#!/usr/bin/python3 | |
import http.server | |
N=25001 | |
numbers = ["()" * i for i in range(N)] | |
def tryi(n, s): | |
if n < N and len(numbers[n]) > len(s): | |
numbers[n] = s |
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
//note: requires minimist (npm i minimist) | |
'use strict'; | |
const {accessSync, mkdirSync, unlinkSync, readFileSync, writeFileSync, F_OK} = require('fs'), | |
name = 'hpm', | |
{join} = require('path'), | |
homeDir = require('os').homedir(), | |
dir = join(homeDir, '.' + name), | |
path = join(homeDir, '.hyper.js'), |
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
2 1 | |
3 2 | |
4 4 | |
5 6 | |
6 8 | |
7 14 | |
8 18 | |
9 27 | |
10 36 | |
11 52 |
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
(1, 1, 1, 1, 1) | |
(1, 1, 1, 1, 32) | |
(1, 1, 1, 1, 31) | |
(1, 1, 1, 1, 30) | |
(1, 1, 1, 1, 29) | |
(1, 1, 1, 1, 28) | |
(1, 1, 1, 1, 27) | |
(1, 1, 1, 1, 26) | |
(1, 1, 1, 1, 25) | |
(1, 1, 1, 1, 24) |
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
(1, 1, 1, 1, 1) | |
(1, 1, 1, 1, 32) | |
(1, 1, 1, 1, 31) | |
(1, 1, 1, 1, 30) | |
(1, 1, 1, 1, 29) | |
(1, 1, 1, 1, 28) | |
(1, 1, 1, 1, 27) | |
(1, 1, 1, 1, 26) | |
(1, 1, 1, 1, 25) | |
(1, 1, 1, 1, 24) |
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
bin(): n leading 1s trailing 0s | |
1 1 0 | |
10 1 1 | |
11 1 0 | |
100 10 1 | |
101 1 10 | |
110 11 1 | |
111 1 0 | |
1000 11 1 | |
1001 10 10 |
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
{ | |
"type":"methods", | |
"title":"Array Methods", | |
"object":"A", | |
"intro":[], | |
"methods":{ | |
"a(s/n)":{ | |
"description":"Returns the last index of `x`s/n`` in `A`, or `-1` if not found.", | |
"returns":"N", | |
"version":"1.4.5", |
OlderNewer