This file contains 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
import random | |
from enum import Enum, auto, unique | |
@unique | |
class Prize(Enum): | |
CAR = auto() | |
GOAT = auto() | |
results = { | |
Prize.CAR: 0, |
This file contains 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 | |
# -*- coding: utf-8 -*- | |
# Copyright © 2019 Taylor C. Richberger <taywee@gmx.com> | |
# This code is released under the MIT license | |
import argparse | |
import shutil | |
from io import BytesIO | |
def convertchunk(chunk, byteswapped, wordswapped): |
This file contains 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::env; | |
#[derive(Debug, Clone, Copy)] | |
struct Pair(u32, u32); | |
impl Pair { | |
fn contains(&self, item: u32) -> bool { | |
self.0 == item || self.1 == item | |
} | |
// Get the item that isn't the one passed in |
This file contains 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
# FOR TESTING, REMOVE FOR ACTUAL USE | |
Object.send(:remove_const, :Enumerator) | |
Object.send(:remove_const, :Enumerable) | |
module Enumerable | |
# Used for undefined arguments, because "nil" can be significant. | |
UNDEFINED = BasicObject.new | |
def all? | |
return all? {|obj| obj} unless block_given? |
This file contains 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 | |
# -*- coding: utf-8 -*- | |
# Copyright © 2018 Taylor C. Richberger <taywee@gmx.com> | |
# This code is released under the MIT license | |
import locale | |
import argparse | |
from collections import namedtuple | |
Threshold = namedtuple('Threshold', ['easy', 'medium', 'hard', 'deadly']) |
This file contains 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
/* Copyright © 2018 Taylor C. Richberger <taywee@gmx.com> | |
* This code is released under the MIT license | |
*/ | |
#include <memory> | |
#include <iostream> | |
#include <iterator> | |
#include <sstream> | |
#include <fstream> | |
#include <vector> |
This file contains 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
// Given a slice of upc digits, return the checksum | |
fn upc_raw(input: &[u8]) -> u8 { | |
let mut code = Vec::from(input); | |
while code.len() < 11 { | |
code.insert(0, 0); | |
} | |
if code.len() > 11 { | |
code.resize(11, 0); | |
} |
This file contains 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 | |
# -*- coding: utf-8 -*- | |
# Copyright © 2019 Taylor C. Richberger | |
# This code is released under the MIT license | |
import argparse | |
base = { | |
'0': 'zero', | |
'1': 'one', |
This file contains 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 | |
# -*- coding: utf-8 -*- | |
# Copyright © 2016 Taylor C. Richberger <taywee@gmx.com> | |
# This code is released under MIT license | |
import locale | |
import argparse | |
import string | |
def hanoi(day, tapes): |
This file contains 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
/* | |
Copyright Alex Leone, David Nufer, David Truong, 2011-03-11. kathack.com | |
javascript:var i,s,ss=['http://kathack.com/js/kh.js','http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js'];for(i=0;i!=ss.length;i++){s=document.createElement('script');s.src=ss[i];document.body.appendChild(s);}void(0); | |
*/ | |
var BORDER_STYLE = "1px solid #bbb", | |
CSS_TRANSFORM = null, | |
CSS_TRANSFORM_ORIGIN = null, | |
POSSIBLE_TRANSFORM_PREFIXES = ['-webkit-', '-moz-', '-o-', '-ms-', ''], |
NewerOlder