summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAdam <adam@adambard.com>2015-12-01 20:38:00 +0700
committerAdam <adam@adambard.com>2015-12-01 20:38:00 +0700
commit60b2f9dbdc9b658d2d96d3cb6c146b6e82245d9c (patch)
tree1eaa59eead8c1b764421989010efb66f4a4a7b48
parentccb05ba98a5b411029e8d7c1e7ea2cd7d87bced4 (diff)
parentc2a9369827411c507ed43dee6683dcd60329b677 (diff)
Merge branch 'master' of github.com:adambard/learnxinyminutes-docs
-rw-r--r--latex.html.markdown1
-rwxr-xr-xlatex.pdfbin145946 -> 0 bytes
-rw-r--r--swift.html.markdown2
-rw-r--r--typescript.html.markdown52
4 files changed, 28 insertions, 27 deletions
diff --git a/latex.html.markdown b/latex.html.markdown
index e89d7e3b..2492f226 100644
--- a/latex.html.markdown
+++ b/latex.html.markdown
@@ -4,6 +4,7 @@ contributors:
- ["Chaitanya Krishna Ande", "http://icymist.github.io"]
- ["Colton Kohnke", "http://github.com/voltnor"]
- ["Sricharan Chiruvolu", "http://sricharan.xyz"]
+ - ["Ramanan Balakrishnan", "https://github.com/ramananbalakrishnan"]
filename: learn-latex.tex
---
diff --git a/latex.pdf b/latex.pdf
deleted file mode 100755
index 6cf5f378..00000000
--- a/latex.pdf
+++ /dev/null
Binary files differ
diff --git a/swift.html.markdown b/swift.html.markdown
index 33ff8451..e6bf1621 100644
--- a/swift.html.markdown
+++ b/swift.html.markdown
@@ -46,7 +46,7 @@ let `class` = "keyword" // backticks allow keywords to be used as variable names
let explicitDouble: Double = 70
let intValue = 0007 // 7
let largeIntValue = 77_000 // 77000
-let label = "some text " + String(myVariable) // Casting
+let label = "some text " + String(myVariable) // String construction
let piText = "Pi = \(π), Pi 2 = \(π * 2)" // String interpolation
// Build Specific values
diff --git a/typescript.html.markdown b/typescript.html.markdown
index e9135510..26f1fcd9 100644
--- a/typescript.html.markdown
+++ b/typescript.html.markdown
@@ -83,23 +83,23 @@ mySearch = function(src: string, sub: string) {
// Classes - members are public by default
class Point {
// Properties
- x: number;
+ x: number;
- // Constructor - the public/private keywords in this context will generate
- // the boiler plate code for the property and the initialization in the
- // constructor.
- // In this example, "y" will be defined just like "x" is, but with less code
- // Default values are also supported
+ // Constructor - the public/private keywords in this context will generate
+ // the boiler plate code for the property and the initialization in the
+ // constructor.
+ // In this example, "y" will be defined just like "x" is, but with less code
+ // Default values are also supported
- constructor(x: number, public y: number = 0) {
- this.x = x;
- }
+ constructor(x: number, public y: number = 0) {
+ this.x = x;
+ }
- // Functions
- dist() { return Math.sqrt(this.x * this.x + this.y * this.y); }
+ // Functions
+ dist() { return Math.sqrt(this.x * this.x + this.y * this.y); }
- // Static members
- static origin = new Point(0, 0);
+ // Static members
+ static origin = new Point(0, 0);
}
var p1 = new Point(10 ,20);
@@ -107,15 +107,15 @@ var p2 = new Point(25); //y will be 0
// Inheritance
class Point3D extends Point {
- constructor(x: number, y: number, public z: number = 0) {
- super(x, y); // Explicit call to the super class constructor is mandatory
- }
+ constructor(x: number, y: number, public z: number = 0) {
+ super(x, y); // Explicit call to the super class constructor is mandatory
+ }
- // Overwrite
- dist() {
- var d = super.dist();
- return Math.sqrt(d * d + this.z * this.z);
- }
+ // Overwrite
+ dist() {
+ var d = super.dist();
+ return Math.sqrt(d * d + this.z * this.z);
+ }
}
// Modules, "." can be used as separator for sub modules
@@ -139,19 +139,19 @@ var s2 = new G.Square(10);
// Generics
// Classes
class Tuple<T1, T2> {
- constructor(public item1: T1, public item2: T2) {
- }
+ constructor(public item1: T1, public item2: T2) {
+ }
}
// Interfaces
interface Pair<T> {
- item1: T;
- item2: T;
+ item1: T;
+ item2: T;
}
// And functions
var pairToTuple = function<T>(p: Pair<T>) {
- return new Tuple(p.item1, p.item2);
+ return new Tuple(p.item1, p.item2);
};
var tuple = pairToTuple({ item1:"hello", item2:"world"});