In the name of God
This gist contains steps to setup Ubuntu 22.04 for deep learning.
| import Combine | |
| import SwiftUI | |
| import CoreData | |
| class CoreDataViewModel: NSObject, ObservableObject, NSFetchedResultsControllerDelegate { | |
| let container: NSPersistentContainer | |
| private var controllerUpdates = [NSObject: CurrentValueSubject<[NSFetchRequestResult], Never>]() | |
| init(container: NSPersistentContainer) { | |
| self.container = container |
| secrets/ |
A common task when developing iOS apps is to register custom cell subclasses for both UITableView and UICollectionView. Well, that is if you don’t use Storyboards, of course.
Both UITableView and UICollectionView offer a similar API to register custom cell classes:
public func registerClass(cellClass: AnyClass?, forCellWithReuseIdentifier identifier: String)
public func registerNib(nib: UINib?, forCellWithReuseIdentifier identifier: String)| class SubdomainValidator < ActiveModel::EachValidator | |
| # http://matthewhutchinson.net/2010/10/27/rails-3-subdomain-validation-activemodeleachvalidator | |
| def validate_each(object, attribute, value) | |
| return unless value.present? | |
| reserved_names = %w(www ftp mail pop smtp admin ssl sftp) | |
| reserved_names = options[:reserved] if options[:reserved] | |
| if reserved_names.include?(value) | |
| object.errors[attribute] << 'cannot be a reserved name' | |
| end |