Skip to content

Instantly share code, notes, and snippets.

View oxidist's full-sized avatar
💭
thinking...

Oxide oxidist

💭
thinking...
View GitHub Profile
\usepackage{libertine}
\usepackage{libertinust1math}
@oxidist
oxidist / 78.hs
Last active July 25, 2019 15:46
Project Euler 78
import Data.Array (Array, array, (!), assocs)
import Data.List (transpose, foldl')
interleave :: [a] -> [a] -> [a]
interleave xs ys = concat . transpose $ [xs, ys]
pent :: [Int] -> [Int]
pent = map (\x -> div (3*x^2 - x) 2)
pentagonals :: [Int]
un :: Rational -> Rational
un 1 = -2
un x = (2 * (un (pred x) ^^ 2) + 5 * (un (pred x)) - 7)^^(1 % 3)
main :: IO()
main = do
print $ un $ 10
@oxidist
oxidist / nanopond.c
Created June 12, 2019 20:18
nanopond
/*
* Nanopond is just what it says: a very very small and simple artificial
* life virtual machine.
*
* It is a "small evolving program" based artificial life system of the same
* general class as Tierra, Avida, and Archis. It is written in very tight
* and efficient C code to make it as fast as possible, and is so small that
* it consists of only one .c file.
*
* How Nanopond works:
import math
def prod(arr, index):
tot = 1
for i in range(index):
tot *= arr[i]
return tot
def check_inequality(arr, x):
return math.log(prod(arr, x), 2.4) < arr[x+1] # whether prod primes < (2.4)^n, change the 2.4 in the log to check for different bases
@oxidist
oxidist / fonts.xml
Created August 7, 2017 19:45
fonts.conf
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<fontconfig>
<dir>~/.fonts</dir>
<match>
<test name="family">
<string>sans-serif</string>
</test>
<edit binding="strong" mode="prepend" name="family">
<string>Lucida Grande</string>
</edit>
@oxidist
oxidist / memo.md
Last active August 7, 2017 16:59
Google's Ideological Echo Chamber

Google's Ideological Echo Chamber

I value diversity and inclusion, am not denying that sexism exists, and don’t endorse using stereotypes. When addressing the gap in representation in the population, we need to look at population level differences in distributions. If we can’t have an honest discussion about this, then we can never truly solve the problem. Psychological safety is built on mutual respect and acceptance, but unfortunately our culture of shaming and misrepresentation is disrespectful and unaccepting of anyone outside its echo chamber. Despite what the public response seems to have been, I’ve gotten many personal messages from fellow Googlers expressing their gratitude for bringing up these very important issues which they agree with but would never have the courage to say or defend because of our shaming culture and the possibility of being fired. This needs to change.

TL:DR

Google’s political bias has equated the freedom from offense with psychological safety, but shaming into silence i

import { ActionTypes } from '../createStore';
import isPlainObject from '../utils/isPlainObject';
import mapValues from '../utils/mapValues';
import pick from '../utils/pick';
/* eslint-disable no-console quotes no-unused-vars */
function getErrorMessage(key, action) {
var actionType = action && action.type;
var actionName = actionType && ('"${actionType.toString()}"') || ('an action');