diff --git a/sheets/_cpp/class b/sheets/_cpp/class index 2d5ef49..5f374f0 100644 --- a/sheets/_cpp/class +++ b/sheets/_cpp/class @@ -1,44 +1,44 @@ -// classes are like structs, but everything is by default private. +// classes are like structs, but everything is by default private. -// Declaration -ObjectName className { - // Sets everything below it to be private. +// Declaration +ObjectName className { + // Sets everything below it to be private. private: - // Declaration of variables - int a; + // Declaration of variables + int a; string b; - + // Implement any private / helper functions below // Sets everything below it to be public. public: // Constructor - structName(new_a, new_b) { - a = new_a; - b = new_b; + structName(new_a, new_b) { + a = new_a; + b = new_b; } - // accessors or getters functions - int getA() { - return a; + // accessors or getters functions + int getA() { + return a; } - string getB() { - return b; + string getB() { + return b; } - // mutators or setter functions + // mutators or setter functions void setA(int new_a) { a = new_a; } - void setB(int new_b) { - b = new_b; + void setB(int new_b) { + b = new_b; } // Implement any public functions below }; -// Accessing PUBLIC variables -ObjectName v = structName(5, "Hello"); // Creates a struct via the constructor +// Accessing PUBLIC variables +ObjectName v = structName(5, "Hello"); // Creates a struct via the constructor std::cout << v.a << " " << v.b << std::endl; // Prints to console "5 Hello" diff --git a/sheets/_cpp/struct b/sheets/_cpp/struct index 0a8ea27..f4be997 100644 --- a/sheets/_cpp/struct +++ b/sheets/_cpp/struct @@ -1,21 +1,21 @@ // structs are like classes, but everything is by default public -// Declaration -ObjectName structName { - - // Declaration of variables - int a; +// Declaration +ObjectName structName { + + // Declaration of variables + int a; string b; // Constructor - structName(new_a, new_b) { - a = new_a; - b = new_b; + structName(new_a, new_b) { + a = new_a; + b = new_b; } // Implement any public functions below }; -// Accessing PUBLIC variables -ObjectName v = structName(5, "Hello"); // Creates a struct via the constructor +// Accessing PUBLIC variables +ObjectName v = structName(5, "Hello"); // Creates a struct via the constructor std::cout << v.a << " " << v.b << std::endl; // Prints to console "5 Hello" diff --git a/sheets/_go/if b/sheets/_go/if index 76975c8..ee41993 100644 --- a/sheets/_go/if +++ b/sheets/_go/if @@ -5,14 +5,14 @@ func main() { } else { return -x } - + // You can put one statement before the condition if a := b + c; a < 42 { return a } else { return a - 42 } - + // Type assertion inside if var val interface{} val = "foo" diff --git a/sheets/_mathematica/series b/sheets/_mathematica/series index b93dc3e..9df03b0 100644 --- a/sheets/_mathematica/series +++ b/sheets/_mathematica/series @@ -14,11 +14,11 @@ Series[Cos[x], {x, 0, 6}] * * Here's the same function, but expanded about a different point, x = 3pi/2: *) - + Series[Cos[x], {x, 3 Pi/2, 6}] (x-3pi/2) - 1/6*(x-3pi/2)^3 + 1/120*(x-3pi/2)^5 + O[x-3pi/2]^7 -(* +(* * When plotting series, remember to wrap the function in both a call to Normal AND * a call to Evaluate: this strips the extra term mentioned previously and tells * Mathematica to actually evaluate the function rather than hold it as an expression. diff --git a/sheets/_swift/types b/sheets/_swift/types index e8d4e8a..2d6557b 100644 --- a/sheets/_swift/types +++ b/sheets/_swift/types @@ -8,7 +8,7 @@ // * Character // * Optional − a variable that can hold either a value or no value. // * Tuples -// +// // | -------|-------------------|-----------------------------------------------| // | Type | Typical Bit Width| Typical Range | // | -------|-------------------|-----------------------------------------------| @@ -27,7 +27,7 @@ typealias Feet = Int var distance: Feet = 100 print(distance) - + // Type inference: // // varA is inferred to be of type Int diff --git a/sheets/azure b/sheets/azure index cbc38f4..b80c711 100644 --- a/sheets/azure +++ b/sheets/azure @@ -3,7 +3,7 @@ sudo apt-get install nodejs-legacy sudo apt-get install npm sudo npm install -g azure-cli -# This will output an url and a device code for you to use browser to login +# This will output an url and a device code for you to use browser to login azure login # This will prompt for your password in the console @@ -23,7 +23,7 @@ azure vm disk list # Remove all disks of VMs labeled with LABEL for disk in $(azure vm disk list | grep LABEL | awk '{print $2}') -do +do azure vm disk delete --blob-delete "$disk" done