I hereby claim:
- I am scooter-dangle on github.
- I am scottlsteele (https://keybase.io/scottlsteele) on keybase.
- I have a public key whose fingerprint is D0B8 B301 5EA6 B2BA B2E8 C064 AEC3 67AF C5DA D548
To claim this, I am signing this object:
use std::sync::Arc; | |
// #[derive(Debug)] | |
// struct Database(Vec<User>); | |
// #[derive(Debug, Default)] | |
// struct User { | |
// id: usize, | |
// login: UserLogin, | |
// password: String, |
# AWS_ENV var is meant to be combined with the following | |
# function in the shell prompt | |
function __fish_aws_creds_prompt | |
if set --query AWS_ENV | |
if string match --ignore-case --quiet --regex 'pro?d' "$AWS_ENV" | |
set aws_name_color brred | |
else | |
set aws_name_color bryellow | |
end |
// Winner! The others are about 45% slower on the contrived example | |
fn is_substring(needle: &[u8], haystack: &[u8]) -> bool { | |
if needle.is_empty() { return true } | |
// if haystack.len() < needle.len() { return false } | |
// if haystack.is_empty() { return false } | |
haystack.windows(needle.len()).any(|subvec| subvec == needle) | |
} |
extern crate num; | |
use num::rational::{Ratio,Rational,BigRational}; | |
use num::traits::ToPrimitive; | |
fn to_rational(number: BigRational) -> Option<Rational> { | |
let denom = number.denom().to_isize(); | |
if denom == None { | |
return None | |
} |
(->> (data) | |
(filter even?) | |
(map #(* 3 %)) | |
(reduce +)) |
require 'erb' | |
require 'active_support/concern' | |
module Expressable | |
def with_tmp_buffer(&block) | |
tmp_buffer, @output_buffer = @output_buffer, "" | |
block.yield | |
@output_buffer | |
ensure | |
tmp_buffer, @output_buffer = @output_buffer, tmp_buffer |
#!/usr/bin/env ruby | |
# | |
# To be run from inside the AliasTables directory | |
# | |
require './lib/alias' | |
normalize = -> ary do | |
sum = ary.inject(0.0, :+) | |
ary.map { |elmt| elmt.to_f / sum } |
I hereby claim:
To claim this, I am signing this object:
Federal agencies are required to perform detailed economic analyses when a proposed course of action exceeds a particular dollar threshold (historically set at $100M). Part of quantifying anticipated consequences requires that they put a monetary value on everything, including human life.
One way they accomplish that is by looking at how much more employers have to pay employees in risky work environments. For instance, if workers generally demand $10,000 more to drive machinery that increases the probability of death by 1 in 500, then you have an example of a market where life is valued at $5.0M.
It's not a cheery topic, but it's important to reach an acceptable dollar value: If we just say that a human life is priceless, we'd logically have to expend all of our resources (if necessary) the first chance we get to save a life. But then we won't have anything at our disposal the next day when, perhaps, we might have been able to save multiple lives with the same a