Skip to content

Instantly share code, notes, and snippets.

View Deleplace's full-sized avatar

Valentin Deleplace Deleplace

View GitHub Profile
@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) {
@Deleplace
Deleplace / signdance.go
Last active April 18, 2025 05:00
A web server that generates dancing gopher GIFs
# Copyright 2019 Google LLC
# SPDX-License-Identifier: Apache-2.0
package main
import (
"fmt"
"image"
"image/color"
"image/draw"
"image/gif"
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 / insert_test.go
Created September 8, 2022 12:51
Benchmark heavy use of slices.Insert vs. heavy use of a dynamic-array-like insert func
package insert
import (
"fmt"
"testing"
"golang.org/x/exp/slices"
)
func BenchmarkGrow(b *testing.B) {
@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);
}
@Deleplace
Deleplace / foo_test.go
Created July 26, 2023 16:19
Which of these 2 functions is fastest?
package bench
import "testing"
var fooMap = map[string]int{"a": 1, "b": 2}
func Foo1(s string) int {
return fooMap[s]
}