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
The Tragedy of Hamlet, Prince of Denmark | |
ACT I | |
SCENE I. Elsinore. A platform before the castle. | |
FRANCISCO at his post. Enter to him BERNARDO | |
BERNARDO | |
Who's there? | |
FRANCISCO | |
Nay, answer me: stand, and unfold yourself. | |
BERNARDO |
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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"runtime" | |
) | |
func main() { | |
BoolImplMemoryFootprint() |
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
package insert | |
import ( | |
"fmt" | |
"testing" | |
"golang.org/x/exp/slices" | |
) | |
func BenchmarkGrow(b *testing.B) { |
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
package insert | |
import ( | |
"fmt" | |
"testing" | |
"golang.org/x/exp/slices" | |
) | |
func BenchmarkGrow(b *testing.B) { |
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
package bench | |
import ( | |
"testing" | |
"golang.org/x/exp/slices" | |
) | |
func BenchmarkRemoveFirstByValue(b *testing.B) { | |
items := []string{"a", "b", "c", "d", "e", "f", "g", "h"} |
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
package delete | |
import ( | |
"fmt" | |
"testing" | |
"golang.org/x/exp/slices" | |
) | |
func BenchmarkDeleteLast(b *testing.B) { |
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
main() { | |
final items = ['a', 'b']; | |
items.asMap().forEach((i, x) { | |
print('index=$i, value=$x'); | |
}); | |
} |
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
import 'package:collection/collection.dart'; | |
main() { | |
final items = ['a', 'b']; | |
items.forEachIndexed((i, x) { | |
print('index=$i, value=$x'); | |
}); | |
} |
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
import 'package:collection/collection.dart'; | |
main() { | |
final items = ['a', 'b']; | |
items.forEachIndexed((i, value) { | |
print('index=$i, value=$value'); | |
}); | |
} |
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
package slices | |
import "testing" | |
func delete[S ~[]E, E any](s S, i, j int) S { | |
_ = s[i:j] // bound check | |
return append(s[:i], s[j:]...) | |
} |