Monthly Archives: July 2021

Swift

max, min

Int.max
Int.min

Float.infinity
Float.infinity

Double.infinity
Double.infinity

label vs no label vs “_”

Below are the ways passing variables

func myFunc(label name: Int, lable name2: Int, age: Int, _ value: String) {

    print(name)

    print(name2)

    print(age)

    print(value)

}

myFunc(label: 4, lable: 3, age: 5, “aa”)

default, no value

var a: String?

In this case, a is a String type with nil as value.

struct vs class

struct is value type. class is reference type like in Java.

Array, String, Dictionary are all value types. class supports inheritance.

struct Resolution {
    var height = 0
}

var s = Resolution()
var ss = s
ss.height = 1

print(s.height) // 0
print(ss.height) // 1
class Resolution {
    var height = 0
}

var s = Resolution()
var ss = s
ss.height = 1

print(s.height) // 1
print(ss.height) // 1

for..loop

var arr = ["a", "b", "c"]
for i in 0...2 {
    print(arr[i])
}
var arr = ["a", "b", "c"]

for (idx, ele) in arr.enumerated() {
    print(String(idx) + ele)
}
var a = 1
while (true) {
    print(1)
}

struct is value type. class is reference type like in Java.

spinnaker

manifest, in kubernetes, it is used to create/modify resources, such as pod. Normally it is .yaml file. For example kubectl apply -f my-file.yaml
artifact, a deployable resource. Could be docker image, git repo, github file, http file, s3 object etc
chart, a combined K8S yaml manifests
helm
, is a tool. Similar to yum, apt in

Category: web