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
# a_n = a_1 + (n - 1)d | |
# this function assumes that there is a constant slope! | |
# in the function used, the underscore ('_') defines the 'sub' value of a. | |
def explicitFormula(set, n): | |
print('The set is ' + str(set) + '.') | |
if len(set) > 1: | |
d = set[1] - set[0] # gets the slope. |
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
Empty file |
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
Empty file |
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
// | |
// Combine Strings by Lines | |
// Wilson Gramer | |
// July 10, 2018 | |
// | |
import Foundation | |
/// Combines the input (multiline) strings by line, so that the first line of every | |
/// string in the input is combined into the first line of the output, and so on. |
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
from math import log, ceil, floor | |
digit_refs = list('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-/:;()$&@".,?!\'[]{}#%^*+=_\\|~<>€£¥•') | |
# Inverts the index relative to the length (of an array) provided. | |
# Example: (3, 0) => 2 | |
def rev(len, index): | |
return len - 1 - index | |
class Number: |
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 Foundation | |
public struct IntermediateStrideThrough<Number: Strideable, Amount: Comparable & SignedNumeric> { | |
let from: Number | |
let by: Amount | |
public init(from: Number, by: Amount) { | |
self.from = from | |
self.by = by | |
} |
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
LeftParen = '(' | |
RightParen = ')' | |
LeftBracket = '[' | |
RightBracket = ']' | |
LeftBrace = '{' | |
RightBrace = '}' | |
class Group(object): | |
def __init__(self): | |
self.exprs = [] |
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
set -ex | |
# Add arm64 packages to apt database | |
# WARNING: This overwrites the sources.list entirely! If you have custom sources, | |
# add [arch=amd64] to them instead and just add the [arch=arm64] lines yourself | |
sudo bash -c 'cat <<EOF > /etc/apt/sources.list | |
deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse | |
deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse | |
deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse |
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
-- A work-in-progress recreation of Typing the Technical Interview | |
-- (https://aphyr.com/posts/342-typing-the-technical-interview) in what will | |
-- eventually be Wipple's type system! | |
-- | |
-- 'type' creates marker types. For example, you can define 'Phantom' as either: | |
-- given (some A) in Phantom : type A | |
-- Phantom : type (some _) | |
-- | |
-- 'some' creates invariant type parameters | |
-- |
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
show : external "internal" "show" :: Text -> () |
OlderNewer