Skip to content

Instantly share code, notes, and snippets.

Avatar

Valentin Deleplace Deleplace

View GitHub Profile
@Deleplace
Deleplace / main.dart
Created Jul 4, 2022
vagrant-neutron-2212
View main.dart
void main() {
var i = 123;
var s = "$i";
print("String s has value: [" + s + "]");
}
View main.dart
void main() {
var s = "été";
int n = s.length;
print(n);
}
View main.dart
void main() {
print('Hello 2');
}
View main.dart
void main() {
for (var i = 0; i < 10; i++)
print("Hello");
}
View main.dart
void main() {
for (var i = 0; i < 10; i++)
print("Hello");
}
View main.dart
void main() {
for (var i = 0; i < 10; i++)
print("Hello World");
}
View main.dart
void main() {
for (var i = 0; i < 10; i++)
print("Hello World");
}
@Deleplace
Deleplace / lexer_test.go
Created Apr 8, 2022
Benchmark for a 2014 lexer
View lexer_test.go
package main
import (
"io/ioutil"
"testing"
)
func BenchmarkLexer(b *testing.B) {
filebuf, err := ioutil.ReadFile("testdata/tblgen_input.td")
if err != nil {
@Deleplace
Deleplace / main.dart
Created Mar 29, 2022
Pad string on the right
View main.dart
void main() {
var inputs = [
"",
"a",
"ab",
"abc",
"abcd",
"é",
];
@Deleplace
Deleplace / main.dart
Created Mar 28, 2022
Pick uniformly a random integer in [a..b]
View main.dart
import 'dart:math';
void main() {
print(pick(2, 10));
}
int pick(int a, int b) => a + new Random().nextInt(b - a + 1);