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
#!/usr/bin/env python3 | |
import argparse | |
import random | |
LADDER_PLAYERS = 1000 | |
LADDER_GAMES = 1000000 | |
TOURNAMENTS = 20 | |
def win_probability(race1, race2, imbalance, rematch): |
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
macro_rules! assert_impls {( | |
#[rustc_on_unimplemented(message = $message:expr $(,)?)] | |
$T:ty : $($trait:tt)+ | |
) => (const _: () = { | |
#[allow(unused)] | |
use __poormans_specialization::Fallback as _; | |
mod __poormans_specialization { | |
pub(super) | |
struct Wrapper<T : ?::core::marker::Sized>(T); | |
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
#!/usr/bin/env python3 | |
from Xlib import display | |
from time import sleep | |
from os import system | |
# My screen setup has a vertical display with a large dead zone: | |
# | |
# +----------------+ | |
# | | | |
# DEAD | | |
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
package processor | |
import ( | |
"fmt" | |
"time" | |
"github.com/Jeffail/benthos/v3/lib/log" | |
"github.com/Jeffail/benthos/v3/lib/metrics" | |
"github.com/Jeffail/benthos/v3/lib/processor" | |
"github.com/Jeffail/benthos/v3/lib/types" |
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
package org.sample; | |
import org.openjdk.jmh.annotations.Benchmark; | |
import org.openjdk.jmh.annotations.BenchmarkMode; | |
import org.openjdk.jmh.annotations.Fork; | |
import org.openjdk.jmh.annotations.Measurement; | |
import org.openjdk.jmh.annotations.Mode; | |
import org.openjdk.jmh.annotations.OutputTimeUnit; | |
import org.openjdk.jmh.annotations.Param; |
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
#!/usr/bin/env python3 | |
"""nhl-rank.py: An utility to rank games by a team in a certain year without revealing the results. | |
The data source and its copyright: https://sportsdatabase.com/ | |
""" | |
__author__ = "Lex Vorona" | |
import sys, getopt |
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
package org.sample; | |
/** | |
* Results: | |
* Benchmark Mode Cnt Score Error Units | |
* MyBenchmark.testChain avgt 200 0.019 ± 0.001 us/op | |
* MyBenchmark.testNoChain avgt 200 0.019 ± 0.001 us/op | |
*/ | |
import org.openjdk.jmh.annotations.Benchmark; |
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
package org.eclipse.mat.ui.snapshot.actions; | |
import java.io.BufferedOutputStream; | |
import java.io.BufferedWriter; | |
import java.io.DataOutputStream; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.OutputStreamWriter; | |
import java.io.PrintWriter; | |
import java.util.HashSet; |
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
package com.test; | |
import java.util.Arrays; | |
import java.util.Random; | |
import java.util.concurrent.TimeUnit; | |
import org.openjdk.jmh.annotations.Benchmark; | |
import org.openjdk.jmh.annotations.BenchmarkMode; | |
import org.openjdk.jmh.annotations.Fork; | |
import org.openjdk.jmh.annotations.Measurement; |
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
/** | |
* This is a benchmark to gauge if there is any performance hit into using Option.apply() in Scala. | |
* Use JMH to build it: http://blog.vorona.ca/measuring-scala-performance-with-jmh.html | |
*/ | |
package org.sample | |
import org.openjdk.jmh.annotations._ | |
import java.util.concurrent.TimeUnit |
NewerOlder