Build or install nghttp2 (optionally with support for the --interval DURATION
flag).
Either:
brew install nghttp2
Or:
# Max Subset Sum No Adjacent | |
# https://www.algoexpert.io/questions/Max%20Subset%20Sum%20No%20Adjacent | |
# | |
# Write a function that takes in an array of positive integers | |
# and returns the maximum sum of non-adjacent elements in the array. | |
# | |
# If a sum can't be generated, the function should return `0`. | |
# | |
# Input: | |
# A = [75, 105, 120, 75, 90, 135] |
# Store 3 hashes: | |
# When `row == 0`, we do not yet know the maximum length of `col`: | |
# 1. H[0] = 0 or previous H[1] (hash of all values excluding the final one for the column) | |
# 2. H[1] = hash((H[1], value)) (hash of all values including the final one for the column) | |
# 3. self.end = col | |
# When `row > 0` and `col < self.end`: | |
# 1. H[1] = hash((H[1], value)) (hash of left-hand values, excluding last) | |
# 2. H[2] = 0 or hash((H[2], value)) (hash of right-hand values, excluding first) | |
# When `col == self.end`: | |
# - Compare H[0] with H[2], if they don't match return False |
export interface CancellablePromise<T> extends Promise<T> { | |
cancel(reason: any): void | |
} | |
export class Cancellable { | |
public promise: Promise<never> | |
private cancelled: boolean | |
private reason?: any | |
constructor() { |
[package] | |
name = "nth-prime" | |
version = "0.1.0" | |
edition = "2018" | |
[dependencies] | |
futures-preview = "0.3.0-alpha.16" |
n = 1_000_000 | |
bmap = FooBench.start(FooMap, n) | |
btup = FooBench.start(FooTuple, n) | |
Benchee.run(%{ | |
"bmap.read" => fn -> FooBench.readall(bmap) end, | |
"btup.read" => fn -> FooBench.readall(btup) end | |
}, memory_time: 5) | |
Benchee.run(%{ |
defmodule MyCache do | |
@behaviour :gen_statem | |
@table :my_cache | |
@expire_after :timer.seconds(45) | |
@vacuum_idle_timeout :timer.minutes(5) | |
@vacuum_dead_timeout :timer.seconds(60) | |
# Public API functions |
Build or install nghttp2 (optionally with support for the --interval DURATION
flag).
Either:
brew install nghttp2
Or:
defmodule :lamport_clock do | |
@moduledoc ~S""" | |
# Example | |
iex> lc0 = :lamport_clock.new() | |
%:lamport_clock{value: 1} | |
iex> # Node: A | |
iex> lc1a = :lamport_clock.increment(lc0) | |
%:lamport_clock{value: 2} |
%% -*- mode: erlang; tab-width: 4; indent-tabs-mode: 1; st-rulers: [70] -*- | |
%% vim: ts=4 sw=4 ft=erlang noet | |
-module(quickbench). | |
%% API | |
-export([bench/2]). | |
-export([bench/3]). | |
-export([compare/3]). | |
%% Records |
Concuerror (version 0.20.0+build.2149.refc040b0d
):
./concuerror --pa "$(exenv prefix)/lib/elixir/ebin" -m registry_example -t test --treat_as_normal=killed --treat_as_normal=shutdown --show_races=true --graph=registry_example.dot
Example failure:
* Stop testing on first error. (Check '-h keep_going').