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
/*------------------------------------------------------------------------------ | |
|| Shortened functions for generating arrays of single character strings from || | |
|| codepoints (e.g. ['a', 'b', 'c', ...]). Codepoints 97-122 (a-z) are used || | |
|| to emulate a simple use case, allowing the canonical solution `vRef` to be || | |
|| used for testing. Character counts in the left column are calculated as is || | |
|| without adjustment for the variable names or frequency of their usage. || | |
|| Extremely brief explanations of the methods used for each solution are || | |
|| provided in the right column. || | |
/*----------------------------------------------------------------------------*/ | |
var v = [], // ---------- |
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
ffmpeg \ | |
-loop 1 \ | |
-i input.png \ | |
-i input.mp3 \ | |
-pix_fmt yuv420p \ | |
-vcodec libx264 \ | |
-tune stillimage \ | |
-acodec aac \ | |
-vb 1024k \ | |
-minrate 1024k \ |
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
Buildings: | |
# You can remove items by clicking with the mouse. | |
L1 1x1 Detached | |
L1 2x2 Detached01 | |
L1 2x2 Detached03 |
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, | |
code, | |
h2, | |
h3, | |
summary, | |
.author, | |
.badge, | |
.content, | |
.count, | |
.description, |
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 digitCount = n => { | |
var i = 0; | |
for(; 10**i <= n; i++); | |
return i; | |
} |
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
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | |
<episodedetails> | |
<title>The End of the Beginning and the Beginning of the End</title> | |
<originaltitle>始まりの終わりと終わりの始まり</originaltitle> | |
<showtitle>Re:ZERO Director's Cut</showtitle> | |
<season>1</season> | |
<episode>1</episode> | |
<displayseason>-1</displayseason> | |
<displayepisode>-1</displayepisode> | |
<outline></outline> |
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
// Fill integer array 1...n | |
var a = n => [...Array(n).keys()].map(x => ++x), | |
// Lazy shortcut | |
c = x => new Array(x.length).fill(0), | |
// Matrix multiplication | |
m4m = (A, B) => c(A) | |
.map((r, i) => c(B[0]) | |
.map((v, j) => A[i] | |
.reduce((s, e, k) => s+(e*B[k][j]), 0) | |
) |
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
let fib = n=>( | |
f = { | |
*f(){ | |
var [a,b]=[0,1]; | |
while(1){ | |
yield a; | |
[a,b]=[b,a+b]; | |
} | |
} | |
} |
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
clamp=(val,min,max)=>{let j=(a,b,h)=>{if(a==b)return a;let c,d;[c,d]=[a,b].map((v)=>v>>31==-1);if(c!=d)return h?b:a;for(let i=30,e,f,g;i>=0;i--){if((e=a>>i&1)==(f=b>>i&1))continue;return e!=f&&e?h?a:b:h?b:a;}};return j(j(val,max,0),min,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
// Math | |
const | |
ℏ = 1, // 1.05e-34 m2kg/s | |
π = Math.PI; | |
/** Schrodinger Equation Solver */ | |
class Ψ { | |
/** | |
* Create a Schrodinger solver | |
* @param {array} x - Points to solve at (must be evenly spaced) | |
* @param {array} ψ_0 - ψ at time t_0 at each point x |
NewerOlder