roll | single dice | advantage | disadvantage | advantage of disadvantage | disadvantage of advantage |
---|---|---|---|---|---|
n = 1 | 1 | 1 | 1 | 1 | 1 |
n = 2 | 0.95 | 0.9975 | 0.9025 | 0.99500626 | 0.9904938 |
n = 3 | 0.9 | 0.99 | 0.81 | 0.9801 | 0.9639 |
n = 4 | 0.85 | 0.9775 | 0.7225 | 0.95550627 | 0.9229938 |
n = 5 | 0.8 | 0.96 | 0.64 | 0.9216 | 0.8704 |
n = 6 | 0.75 | 0.9375 | 0.5625 | 0.87890625 | 0.80859375 |
n = 7 | 0.7 | 0.91 | 0.49 | 0.8281 | 0.7399 |
n = 8 | 0.65 | 0.8775 | 0.422 |
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
// ================================================================= | |
// | High level vs Low level "App stacks" | | |
// ================================================================= | |
// | |
// This works, but it creates too many resources (security groups, ingress/egress rules) and can't | |
// be deployed in the locked down environment I work with. Additionally, I would like to pass in | |
// a log group. | |
class HighLevelStack( | |
parent: Construct, |
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 <stdio.h> | |
#define In_the_Name_of_the_Moon struct | |
#define I_Will_Punish_You int | |
#define Tuxedo_Max char* | |
In_the_Name_of_the_Moon Foo { | |
I_Will_Punish_You X; | |
Tuxedo_Max Y; | |
}; |
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
# User specific aliases and functions | |
COLOR_RED="\033[0;31m" | |
COLOR_YELLOW="\033[0;33m" | |
COLOR_GREEN="\033[0;32m" | |
COLOR_OCHRE="\033[38;5;95m" | |
COLOR_BLUE="\033[0;34m" | |
COLOR_WHITE="\033[0;37m" | |
COLOR_RESET="\033[0m" | |
function git_color { |
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
use std::io::prelude::*; | |
use std::io::{BufReader, BufWriter}; | |
use std::fs::File; | |
fn main() { | |
let args: Vec<String> = std::env::args().collect(); | |
assert_eq!(args.len(), 5, "Usage: ./tool <input.csv> <colum-name> <replacement-string> <output.csv>"); | |
let br = BufReader::new(File::open(&args[1]).expect("No input file")); | |
let mut lines = br.lines().map(|s | s.unwrap().split(',').map(|s| s.to_string()).collect::<Vec<_>>()).peekable(); | |
let col_idx = lines.peek().and_then(|v| v.iter().position(|s| s == &args[2])).expect("Could not find column"); | |
let mut bw = BufWriter::new(File::create(&args[4]).expect("Could not open output file")); |
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
extern crate walkdir; | |
extern crate rayon; | |
use std::fs::File; | |
use std::io::BufReader; | |
use std::io::prelude::*; | |
use std::path::Path; | |
use std::env::args; | |
use walkdir::{WalkDir, DirEntry, Result}; | |
use rayon::prelude::*; |
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 bash | |
# WARNING: sed abuse ahead | |
set -e | |
# First, find out what interface you're using | |
INTERFACE=$(ifconfig | grep -e "RUNNING" | grep -v "LOOPBACK" | sed -e "s/:.*//") | |
# Then, get your current mac address | |
OLDMAC=$(ifconfig | awk "/$INTERFACE/{f=1} f{print; if (/ether/) exit}" | grep -e "ether" | sed -e 's/^.*ether \(.\{17\}\)\(.*\)/\1/') | |
# Get a new mac address | |
END=$(echo $OLDMAC | sed -e "s/.*:\(..$\)/\1/") | |
if [ "$END" == "ff" ] |
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
let mut v = [-5i32, 4, 1, -3, 2]; | |
v.sort_unstable(); | |
assert!(v == [-5, -3, 1, 2, 4]); | |
v.sort_unstable_by(|a, b| b.cmp(a)); | |
assert!(v == [4, 2, 1, -3, -5]); | |
v.sort_unstable_by_key(|k| k.abs()); | |
assert!(v == [1, 2, -3, 4, -5]); |
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
00400000: 20020004 ; <input:0> li $v0, 4 | |
00400004: 240400c0 ; <input:1> la $a0, hello | |
00400008: 00042400 ; <input:1> la $a0, hello | |
0040000c: 24840000 ; <input:1> la $a0, hello | |
00400010: 0000000c ; <input:2> syscall | |
00400014: 2002000a ; <input:3> li $v0, 10 | |
00400018: 0000000c ; <input:4> syscall | |
; | |
; DATA IN MEMORY | |
; hello |
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
if __name__ == '__main__': | |
print("Hello, World") |
NewerOlder