... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
var animating = false; | |
// Define an animator consisting of optional incoming and outgoing animations. | |
// alwaysAnimate is false unless specified as true: false means an incoming animation will only trigger if an outgoing animation is also in progress. | |
// forcing dontClone to true means the outward animation will use the original element rather than a clone. This could improve performance by recycling elements, but can lead to trouble: clones have the advantage of being stripped of all event listeners. | |
function animator( incoming, outgoing, alwaysAnimate, dontClone ){ | |
// The resulting animator can be applied to any number of components | |
return function animate( x, y, z ){ | |
var config; | |
var parent; |
#include <math.h> | |
#include <algorithm> | |
#include <string> | |
#include <immintrin.h> | |
using namespace std;typedef float R; | |
#define _W 79 | |
#define _H 39 | |
#define EP 0.01f | |
#define OP operator | |
#define C const |
Calculating ------------------------------------- | |
type-safe users 273.000 i/100ms | |
ar user models 257.000 i/100ms | |
------------------------------------------------- | |
type-safe users 2.813k (± 1.7%) i/s - 14.196k | |
ar user models 2.574k (±10.7%) i/s - 12.850k | |
Comparison: | |
type-safe users: 2812.7 i/s | |
ar user models: 2574.2 i/s - 1.09x slower |
sed -E -f solver.sed input
where input
is a file containing the maze.
For best results, resize your terminal to match the height of the maze. To disable animations, delete the lines containing p
.
The solver assumes the following:
# \nSE
S
) and end (E
)def destructure(method_name) | |
# Intercept the original class | |
meta_klass = class << self; self end | |
# Save the original method as a proc | |
method_proc = method(method_name) | |
# We only want to do this for keyword argument type | |
# methods | |
unless method_proc.parameters.all? { |t, _| t == :key } |