-
Properly used
map
is quite good; -
Badly used
for_i
can be absolutely horrible; -
A custom
map
-like function is on par with barefor_i
; -
Not all
for_i
loops are equally optimized;
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Matrix (2D-array) transpose</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>longest string</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
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
<# | |
.SYNOPSIS | |
Shuffle groups in an AIMP playlist ("*.aimppl4") | |
while preserving the order inside groups. | |
.PARAMETER inputPath | |
Input file to be shuffled ("*.aimppl4"). | |
#> |
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
// #region DIGRAMS =============================================================================== | |
function computeDigramColors( | |
/** @type { Uint8Array } */ uint8Array, | |
paletteKind = 'p5_lerp', | |
blendingMiddlePoint = 0.5 | |
) { | |
const digramStats = Array.from({ length: 65536 }, () => ({ | |
count: 0, // digram occurrences | |
offsetAcc: 0.0 // accumulator to compute average position |
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
import { expectAssignable, expectType } from 'tsd'; | |
type Some<T> = { _some: true, value: T }; | |
type None = { _some: false }; | |
type Option<T> = Some<T> | None; | |
type GetSome<T,R> = (input: T) => Some<R>; | |
type GetOption<T,R> = (input: T) => Option<R>; | |
function isSome<T>(option: Option<T>): option is Some<T> { return option._some; } |
Obsidian forum thread: https://forum.obsidian.md/t/plugin-for-bullet-threading/37317/22
Add these CSS files in Appearance settings.
Changelog:
- 2023-10-02
- highlight snippet
OlderNewer