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 UIKit | |
class KeyboardAvoidingViewController: UIViewController { | |
private let margin: CGFloat = 20 | |
private var keyboardFrame: CGRect? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
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 python | |
""" | |
A basic adaptive bot. This is part of the third worksheet. | |
""" | |
from api import State, util | |
import random, os | |
from itertools import chain | |
import joblib |
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 joblib | |
import pickle | |
import sklearn.inspection | |
import numpy as np | |
import pandas as pd | |
import os.path | |
rows = ["Pers Clubs A","Pers Clubs 10","Pers Clubs K","Pers Clubs Q","Pers Clubs J", | |
"Pers Diamonds A","Pers Diamonds 10","Pers Diamonds K","Pers Diamonds Q","Pers Diamonds J", |
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 | |
// Model. | |
struct Employee: Codable { | |
let id: Int | |
let name: String | |
} |
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 UIKit | |
final class SheetModalPresentationController: UIPresentationController { | |
// MARK: Private Properties | |
private let isDismissable: Bool | |
private let interactor = UIPercentDrivenInteractiveTransition() | |
private let dimmingView = UIView() | |
private var propertyAnimator: UIViewPropertyAnimator! |
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
func constrainToEdges(of view: UIView) { | |
translatesAutoresizingMaskIntoConstraints = false | |
NSLayoutConstraint.activate([ | |
leftAnchor.constraint(equalTo: view.leftAnchor), | |
topAnchor.constraint(equalTo: view.topAnchor), | |
rightAnchor.constraint(equalTo: view.rightAnchor), | |
bottomAnchor.constraint(equalTo: view.bottomAnchor) | |
]) | |
} |
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
titleLabel?.font = Fonts.font(.quicksand, weight: .bold, size: 14) |
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
struct Fonts { | |
enum Weight: String { | |
case bold = "Bold" | |
case light = "Light" | |
case regular = "Regular" | |
case semiBold = "SemiBold" | |
} | |
enum Font: String { |
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
static func font(_ name: Font, weight: Weight, size: CGFloat) -> UIFont { | |
UIFont(name: "\(name.rawValue)-\(weight.rawValue)", size: size)! | |
} |
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
enum Weight: String { | |
case bold = "Bold" | |
case light = "Light" | |
case regular = "Regular" | |
case semiBold = "SemiBold" | |
} |
NewerOlder