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
| // | |
| // AppUtility.swift | |
| // AHS | |
| // | |
| // Created by Richard Wei. | |
| // | |
| import Foundation | |
| import UIKit | |
| struct AppUtility { |
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
| // | |
| // multipartPacketProtocol.swift | |
| // Omegacam-ios | |
| // | |
| // Created by Richard Wei on 2/23/21. | |
| // | |
| import Foundation | |
| class multipartPacketManager{ | |
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
| // | |
| // imageDeltaFinder.swift | |
| // Omegacam-ios | |
| // | |
| // Created by Richard Wei on 2/24/21. | |
| // | |
| import Foundation | |
| import AVFoundation |
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 <iostream> | |
| using namespace std; | |
| double dydx(double x, double y){ | |
| return x+y; | |
| } | |
| int main(){ | |
| double x, y, h, endX; |
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
| extension String { | |
| func getHeight(withConstrainedWidth width: CGFloat, font: UIFont) -> CGFloat { | |
| let constraintRect = CGSize(width: width, height: .greatestFiniteMagnitude) | |
| let boundingBox = self.boundingRect(with: constraintRect, options: .usesLineFragmentOrigin, attributes: [NSAttributedString.Key.font: font], context: nil) | |
| return ceil(boundingBox.height) | |
| } | |
| func getWidth(withConstrainedHeight height: CGFloat, font: UIFont) -> CGFloat { | |
| let constraintRect = CGSize(width: .greatestFiniteMagnitude, height: height) |
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
| func resetAllSettingsDefaults() { | |
| let defaults = UserDefaults.standard | |
| let dictionary = defaults.dictionaryRepresentation() | |
| dictionary.keys.forEach { key in | |
| defaults.removeObject(forKey: key) | |
| } | |
| } |
NewerOlder