Skip to content

Instantly share code, notes, and snippets.

View Deleplace's full-sized avatar

Valentin Deleplace Deleplace

View GitHub Profile
@Deleplace
Deleplace / shrink.go
Created November 7, 2026 10:17
sync.Map shrinks
package main
import (
"fmt"
"runtime"
"sync"
)
func main() {
n := 1_000_000
a b a => b
false false true
false true true
true false false
true true true
a b a <= b
false false true
false true true
true false false
true true true
@Deleplace
Deleplace / oom_test.go
Last active March 12, 2026 08:16
Reproduce OOM in stats.MannWhitneyUTest with NaN
package oom
import (
"math"
"testing"
"github.com/aclements/go-moremath/stats"
)
func TestMannWhitneyUTest_NaN_OOM(t *testing.T) {
use std::io::prelude::*;
use std::str::FromStr;
fn main() {
// solve_a();
solve_b();
}
fn solve_a() {
let lines = std::io::stdin().lock().lines().map(|x| x.unwrap()).collect::<Vec<String>>();
@Deleplace
Deleplace / main.dart
Created December 5, 2023 17:51
fluttering-midnight-6937
void main() {
final s = "L'été";
final c = s[s.length - 1];
print("The last character of \"$s\" is '$c'");
}
@Deleplace
Deleplace / main.dart
Created December 5, 2023 17:35
fluttering-midnight-6937
void main() {
final s = "Cat";
final c = s[s.length - 1];
print("The last character of \"$s\" is '$c'");
}
@Deleplace
Deleplace / main.dart
Created October 30, 2023 22:34
oval-arc-0625
void main() {
print('Test permalink');
}
@Deleplace
Deleplace / main.dart
Created September 14, 2023 09:32
fluttering-midnight-6937
class Person {
String id;
String firstName, lastName;
Person(this.id, this.firstName, this.lastName);
@override
String toString() {
return "$firstName $lastName";
}
}
@Deleplace
Deleplace / main.dart
Created September 12, 2023 15:31
fluttering-midnight-6937
import 'dart:convert';
void main() {
const x = {'text': 'foo', 'value': '2'};
var encoded = const JsonEncoder.withIndent(' ').convert(x);
print(encoded);
}