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
Pod::Spec.new do |s| | |
s.name = "NameOfYourProject" | |
s.version = "0.1.0" | |
s.summary = "Description of your project" | |
s.description = "Mandatorily longer description of your project" | |
s.homepage = "https://github.com/YourUserName/NameOfYourProject" | |
s.license = "Description of your licence, name or otherwise" | |
s.author = { "Your name occupation" => "[email protected]" } | |
s.platform = :ios, "9.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
import UIKit | |
class ShimmerView: UIView { | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
setupViews() | |
} | |
required init?(coder aDecoder: NSCoder) { |
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
first = float(input("first number")) | |
operand = input("Your operand (accepting addition, multiplication, division, subtraction)") | |
second = float(input("second number")) | |
if operand == "x" or operand == "multiplication" or operand == "multiply" or operand == "*": | |
print(first * second) | |
elif operand == "+" or operand == "addition" or operand == "add": | |
print(first + second) | |
elif operand == "-" or operand == "subtraction" or operand == "subtract": | |
print(first - second) |
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 dependent column must have continuous data. If it is continuous you should use a linear regression model. | |
# we create a dictionary | |
eruptions = { | |
"eruptions": [3.6, 1.8, 3.333, 2.283, 4.533, 2.883], | |
"waiting": [79, 54, 74, 62, 85, 55] | |
} | |
# we convert the dictionary into a dataframe | |
edf = pd.DataFrame(eruptions) |
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 test() { | |
print(1) | |
DispatchQueue.main.async { | |
print(2) | |
DispatchQueue.main.async { | |
print(3) | |
} | |
print(4) | |
} | |
print(5) |
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 an array of prices | |
func emas(for range: Int, smoothing: Int = 2) -> [Double?] { | |
var ema: Double? | |
let multiplier: Double = Double(smoothing) / (Double(range) + 1) | |
return (0..<count).map { | |
if let last = ema { | |
//Sean? | |
//ema = last * multiplier + self[$0] * (1 - multiplier) | |
//THEbalance | |
//ema = (self[$0] - last) * multiplier + last |
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 an array of prices | |
func emas(for range: Int, smoothing: Int = 2) -> [Double?] { | |
var ema: Double? | |
let multiplier: Double = Double(smoothing) / (Double(range) + 1) | |
return (0..<count).map { | |
if let last = ema { | |
//Sean? | |
//ema = last * multiplier + self[$0] * (1 - multiplier) | |
//THEbalance | |
//ema = (self[$0] - last) * multiplier + last |
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
fileprivate struct EmaInOuts { | |
var prices: [Double] | |
var range: Int | |
var smoothing: Int | |
var resultingEMA: [Double?] | |
} | |
// Takes an array of tick values (price, close, high, open) | |
// price: CLOSE | |
// length: 180 |
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
// swift-tools-version:5.3 | |
import PackageDescription | |
let package = Package( | |
name: "MyLibrary", | |
platforms: [ | |
.macOS(.v10_14), .iOS(.v13), .tvOS(.v13) | |
], | |
products: [ | |
// Products define the executables and libraries a package produces, and make them visible to other packages. |
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
dependencies: [ | |
// Dependencies declare other packages that this package depends on. | |
.package(url: "https://url/of/another/package.git", from: "1.0.0"), | |
.package(path: "path/to/a/local/package/", "1.0.0"..<"2.0.0")], |