This file contains hidden or 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
# I'm experimenting with a GitLab Push Rule to force all commits to follow Arlo's Commit Notation. Here's my latest regex: | |
^([RFB]!!)|([RFBa-z] )|(\*\*\*)[- ].* | |
This file contains hidden or 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 typing import Callable | |
import unittest | |
import typing | |
import abc | |
import typing | |
class Tests(unittest.TestCase): |
This file contains hidden or 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
# Moved! | |
iwr -useb https://raw.githubusercontent.com/refactoring-pipelines/Pipelines/master/machine-setup.ps1 | iex |
This file contains hidden or 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
float Q_rsqrt_original(float number) | |
{ | |
long i; | |
float x2, y; | |
const float threehalfs = 1.5F; | |
x2 = number * 0.5F; | |
y = number; | |
i = *(long*)&y; // evil floating point bit level hacking | |
i = 0x5f3759df - (i >> 1); // what the fuck? |
This file contains hidden or 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
var zipCodePipe = new InputPipe<ZipCode>("zipCode"); | |
var peanutButtersPipe = zipCodePipe.ProcessFunction( PeanutButterShop.GetAvailable); | |
var jelliesPipe = zipCodePipe.ProcessFunction(JellyShop.GetAvailable); | |
var bestPeanutButterPipe = peanutButtersPipe.Process(_ => _.BestPeanutButter); | |
var bestJelliesPipe = jelliesPipe.Process(_ => _.BestJelly); | |
var joinedPipe = bestPeanutButterPipe.JoinTo(bestJelliesPipe); | |
var sandwichPipe = joinedPipe.Process((bestPeanutButter, bestJelly) => | |
Sandwich.Create(bestPeanutButter, bestJelly)); | |
sandwichPipe.Collect(); |
This file contains hidden or 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
#include "okra.h" | |
TEST("addToArray will result in a new copy of the array with the added items") | |
{ | |
const vector<int> numbers = {1, 2, 3}; | |
const vector<int> result = ArrayUtils::addtoArray(numbers, 4, 5, 6); | |
assertArrayEquals(vector<int>{1, 2, 3, 4, 5, 6}, result); | |
} |
This file contains hidden or 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
@Test | |
class YouCanAddToAnArrayTheSameWayYouCanAddToAList | |
{ | |
public void addToArray_WillResultInANewCopyOfTheArrayWithTheAddedItems() throws Exception | |
{ | |
Integer[] numbers = {1, 2, 3}; | |
Integer[] result = ArrayUtils.addtoArray(numbers, 4, 5, 6); | |
assertArrayEquals({1, 2, 3, 4, 5, 6}, result); | |
} | |
} |
This file contains hidden or 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
// | |
// - PipeSource is split. The "take a static input" is one part. The "execute a function and broadcast the result" is another. | |
// | |
// - A FunctionPipe is like PipeMiddle, with the specific purpose of applying an A->B function to each item in the pipeline. Its last ctor parameter is the thing it listens to. (Assume it calls `predecessor.AndNext(this)`) | |
// | |
// - An overloaded FunctionPipe ctor takes a string, to identify it in the ASCII art, when the function is a lambda that doesn't have a friendly name. | |
// var characterFile = CharacterFile.From(fileName); | |
var fileNamePipe = StaticInputPipe.Of(fileName); | |
var characterFile = FunctionPipe.Of(CharacterFile.From, fileNamePipe); |
This file contains hidden or 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
// var characterFile = CharacterFile.From(fileName); | |
var fileName = new StaticInputPipe(fileName); | |
var characterFile = new FunctionPipe(CharacterFile.From, fileName); | |
// var configFile = ConfigFile.Matching(characterFile); | |
var configFile = new FunctionPipe(ConfigFile.Matching, characterFile); | |
// var partialCards = characterFile.ParseCards(); | |
var partialCards = new FunctionPipe("CharacterFile.ParseCards", _ => _.ParseCards(), characterFile); |
This file contains hidden or 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
// var characterFile = CharacterFile.From(fileName); | |
var fileName = new StaticInputPipe(fileName); | |
var characterFile = new FunctionPipe(CharacterFile.From, fileName); | |
// var configFile = ConfigFile.Matching(characterFile); | |
var configFile = new FunctionPipe(ConfigFile.Matching, characterFile); | |
// var partialCards = characterFile.ParseCards(); | |
var partialCards = new FunctionPipe("CharacterFile.ParseCards", _ => _.ParseCards(), characterFile); |