summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--csharp.html.markdown130
-rw-r--r--de-de/LOLCODE-de.html.markdown188
-rw-r--r--de-de/edn-de.html.markdown112
-rw-r--r--de-de/nix-de.html.markdown358
-rw-r--r--de-de/pyqt-de.html.markdown89
-rw-r--r--de-de/qt-de.html.markdown175
-rw-r--r--edn.html.markdown20
-rw-r--r--pt-br/amd-pt.html.markdown2
-rw-r--r--pt-br/asciidoc-pt.html.markdown2
-rw-r--r--pt-br/asymptotic-notation-pt.html.markdown2
-rw-r--r--pt-br/awk-pt.html.markdown376
-rw-r--r--pt-br/c++-pt.html.markdown12
-rw-r--r--pt-br/c-pt.html.markdown4
-rw-r--r--pt-br/csharp-pt.html.markdown26
-rw-r--r--pt-br/css-pt.html.markdown2
-rw-r--r--pt-br/java-pt.html.markdown2
-rw-r--r--pt-br/javascript-pt.html.markdown2
-rw-r--r--pt-br/json-pt.html.markdown2
-rw-r--r--pt-br/perl-pt.html.markdown6
-rw-r--r--pt-br/visualbasic-pt.html.markdown12
-rw-r--r--pt-br/whip-pt.html.markdown247
-rw-r--r--python3.html.markdown136
-rw-r--r--typescript.html.markdown2
-rw-r--r--vi-vn/less-vi.html.markdown395
-rw-r--r--vi-vn/typescript-vi.html.markdown193
-rw-r--r--whip.html.markdown2
-rw-r--r--zh-cn/go-cn.html.markdown1
27 files changed, 2410 insertions, 88 deletions
diff --git a/csharp.html.markdown b/csharp.html.markdown
index 963f38f4..3790747c 100644
--- a/csharp.html.markdown
+++ b/csharp.html.markdown
@@ -132,6 +132,12 @@ namespace Learning.CSharp
DateTime fooDate = DateTime.Now;
Console.WriteLine(fooDate.ToString("hh:mm, dd MMM yyyy"));
+ // Verbatim String
+ // You can use the @ symbol before a string literal to escape all characters in the string
+ string path = "C:\\Users\\User\\Desktop";
+ string verbatimPath = @"C:\Users\User\Desktop";
+ Console.WriteLine(path == verbatimPath); // => true
+
// You can split a string over two lines with the @ symbol. To escape " use ""
string bazString = @"Here's some stuff
on a new line! ""Wow!"", the masses cried";
@@ -634,6 +640,54 @@ on a new line! ""Wow!"", the masses cried";
}
}
+
+ // DELEGATES AND EVENTS
+ public class DelegateTest
+ {
+ public static int count = 0;
+ public static int Increment()
+ {
+ // increment count then return it
+ return ++count;
+ }
+
+ // A delegate is a reference to a method
+ // To reference the Increment method,
+ // first declare a delegate with the same signature
+ // ie. takes no arguments and returns an int
+ public delegate int IncrementDelegate();
+
+ // An event can also be used to trigger delegates
+ // Create an event with the delegate type
+ public static event IncrementDelegate MyEvent;
+
+ static void Main(string[] args)
+ {
+ // Refer to the Increment method by instantiating the delegate
+ // and passing the method itself in as an argument
+ IncrementDelegate inc = new IncrementDelegate(Increment);
+ Console.WriteLine(inc()); // => 1
+
+ // Delegates can be composed with the + operator
+ IncrementDelegate composedInc = inc;
+ composedInc += inc;
+ composedInc += inc;
+
+ // composedInc will run Increment 3 times
+ Console.WriteLine(composedInc()); // => 4
+
+
+ // Subscribe to the event with the delegate
+ MyEvent += new IncrementDelegate(Increment);
+ MyEvent += new IncrementDelegate(Increment);
+
+ // Trigger the event
+ // ie. run all delegates subscribed to this event
+ Console.WriteLine(MyEvent()); // => 6
+ }
+ }
+
+
// Class Declaration Syntax:
// <public/private/protected/internal> class <class name>{
// //data fields, constructors, functions all inside.
@@ -949,6 +1003,7 @@ on a new line! ""Wow!"", the masses cried";
// String interpolation by prefixing the string with $
// and wrapping the expression you want to interpolate with { braces }
+ // You can also combine both interpolated and verbatim strings with $@
public class Rectangle
{
public int Length { get; set; }
@@ -961,6 +1016,9 @@ on a new line! ""Wow!"", the masses cried";
{
Rectangle rect = new Rectangle { Length = 5, Width = 3 };
Console.WriteLine($"The length is {rect.Length} and the width is {rect.Width}");
+
+ string username = "User";
+ Console.WriteLine($@"C:\Users\{username}\Desktop");
}
}
@@ -1096,25 +1154,65 @@ namespace Learning.More.CSharp
}
}
+//New C# 7 Feature
+//Install Microsoft.Net.Compilers Latest from Nuget
+//Install System.ValueTuple Latest from Nuget
using System;
namespace Csharp7
{
- //New C# 7 Feature
- //Install Microsoft.Net.Compilers Latest from Nuget
- //Install System.ValueTuple Latest from Nuget
- class Program
- {
- static void Main(string[] args)
- {
- //Type 1 Declaration
- (string FirstName, string LastName) names1 = ("Peter", "Parker");
- Console.WriteLine(names1.FirstName);
-
- //Type 2 Declaration
- var names2 = (First:"Peter", Last:"Parker");
- Console.WriteLine(names2.Last);
- }
- }
+ // TUPLES, DECONSTRUCTION AND DISCARDS
+ class TuplesTest
+ {
+ public (string, string) GetName()
+ {
+ // Fields in tuples are by default named Item1, Item2...
+ var names1 = ("Peter", "Parker");
+ Console.WriteLine(names1.Item2); // => Parker
+
+ // Fields can instead be explicitly named
+ // Type 1 Declaration
+ (string FirstName, string LastName) names2 = ("Peter", "Parker");
+
+ // Type 2 Declaration
+ var names3 = (First:"Peter", Last:"Parker");
+
+ Console.WriteLine(names2.FirstName); // => Peter
+ Console.WriteLine(names3.Last); // => Parker
+
+ return names3;
+ }
+
+ public string GetLastName() {
+ var fullName = GetName();
+
+ // Tuples can be deconstructed
+ (string firstName, string lastName) = fullName;
+
+ // Fields in a deconstructed tuple can be discarded by using _
+ var (_, last) = fullName;
+ return last;
+ }
+
+ // Any type can be deconstructed in the same way by
+ // specifying a Deconstruct method
+ public int randomNumber = 4;
+ public int anotherRandomNumber = 10;
+
+ public void Deconstruct(out int randomNumber, out int anotherRandomNumber)
+ {
+ randomNumber = this.randomNumber;
+ anotherRandomNumber = this.anotherRandomNumber;
+ }
+
+ static void Main(string[] args)
+ {
+ var tt = new TuplesTest();
+ (int num1, int num2) = tt;
+ Console.WriteLine($"num1: {num1}, num2: {num2}"); // => num1: 4, num2: 10
+
+ Console.WriteLine(tt.GetLastName());
+ }
+ }
}
```
diff --git a/de-de/LOLCODE-de.html.markdown b/de-de/LOLCODE-de.html.markdown
new file mode 100644
index 00000000..155c5657
--- /dev/null
+++ b/de-de/LOLCODE-de.html.markdown
@@ -0,0 +1,188 @@
+---
+language: LOLCODE
+filename: learnLOLCODE.lol
+contributors:
+ - ["abactel", "https://github.com/abactel"]
+translators:
+ - ["Henrik Jürges", "http://github.com/santifa"]
+lang: de-de
+---
+
+LOLCODE ist eine esoterische Programmiersprache die die Sprache der [lolcats](https://upload.wikimedia.org/wikipedia/commons/a/ab/Lolcat_in_folder.jpg?1493656347257) nachahmt.
+
+```
+BTW Das ist ein Kommentar
+BTW Das Programm muss mit `HAI <language version>` beginnen und mit `KTHXBYE` enden.
+
+HAI 1.3
+CAN HAS STDIO? BTW Standard Header importieren
+
+OBTW
+ ==========================================================================
+ ============================== Grundlegendes =============================
+ ==========================================================================
+TLDR
+
+BTW Texte anzeigen:
+VISIBLE "HELLO WORLD"
+
+BTW Variablen deklarieren:
+I HAS A MESSAGE ITZ "CATZ ARE GOOD"
+VISIBLE MESSAGE
+
+OBTW
+ Variablen sind dynamisch typisiert und der Typ muss nicht explizit
+ angegeben werden. Die möglichen Typen sind:
+TLDR
+
+I HAS A STRING ITZ "DOGZ ARE GOOOD" BTW Typ ist YARN
+I HAS A INTEGER ITZ 42 BTW Typ ist NUMBR
+I HAS A FLOAT ITZ 3.1415 BTW Typ ist NUMBAR
+I HAS A BOOLEAN ITZ WIN BTW Typ ist TROOF
+I HAS A UNTYPED BTW Typ ist NOOB
+
+BTW Eingaben von Nutzern:
+I HAS A AGE
+GIMMEH AGE
+BTW Die Variable wird als YARN gespeichert und kann in eine
+BTW NUMBR konvertiert werden:
+AGE IS NOW A NUMBR
+
+OBTW
+ ==========================================================================
+ ================================== MATHE =================================
+ ==========================================================================
+TLDR
+
+BTW LOLCODE benutzt polnische Notation für Mathe.
+
+BTW grundlegende mathematische Notationen:
+
+SUM OF 21 AN 33 BTW 21 + 33
+DIFF OF 90 AN 10 BTW 90 - 10
+PRODUKT OF 12 AN 13 BTW 12 * 13
+QUOSHUNT OF 32 AN 43 BTW 32 / 43
+MOD OF 43 AN 64 BTW 43 modulo 64
+BIGGR OF 23 AN 53 BTW max(23, 53)
+SMALLR OF 53 AN 45 BTW min(53, 45)
+
+BTW binäre Notation:
+
+BOTH OF WIN AN WIN BTW und: WIN if x=WIN, y=WIN
+EITHER OF FAIL AN WIN BTW oder: FAIL if x=FAIL, y=FAIL
+WON OF WIN AN FAIL BTW exklusives oder: FAIL if x=y
+NOT FAIL BTW unäre Negation: WIN if x=FAIL
+ALL OF WIN AN WIN MKAY BTW beliebige Stelligkeit bei AND
+ANY OF WIN AN FAIL MKAY BTW beliebige Stelligkeit bei OR
+
+BTW Vergleiche:
+
+BOTH SAEM "CAT" AN "DOG" BTW WIN wenn x == y
+DIFFRINT 732 AN 184 BTW WIN wenn x != y
+BOTH SAEM 12 AN BIGGR OF 12 AN 4 BTW x >= y
+BOTH SAEM 43 AN SMALLR OF 43 AN 56 BTW x <= y
+DIFFRINT 64 AN SMALLR OF 64 AN 2 BTW x > y
+DIFFRINT 75 AN BIGGR OF 75 AN 643 BTW x < y
+
+OBTW
+ ==========================================================================
+ ============================= Flusskontrolle =============================
+ ==========================================================================
+TLDR
+
+BTW If/then Statement:
+I HAS A ANIMAL
+GIMMEH ANIMAL
+BOTH SAEM ANIMAL AN "CAT", O RLY?
+ YA RLY
+ VISIBLE "YOU HAV A CAT"
+ MEBBE BOTH SAEM ANIMAL AN "MAUS"
+ VISIBLE "NOM NOM NOM. I EATED IT."
+ NO WAI
+ VISIBLE "AHHH IS A WOOF WOOF"
+OIC
+
+BTW Case Statement:
+I HAS A COLOR
+GIMMEH COLOR
+COLOR, WTF?
+ OMG "R"
+ VISIBLE "RED FISH"
+ GTFO
+ OMG "Y"
+ VISIBLE "YELLOW FISH"
+ BTW Weil hier kein `GTFO` ist wird auch das nächste Statement überprüft
+ OMG "G"
+ OMG "B"
+ VISIBLE "FISH HAS A FLAVOR"
+ GTFO
+ OMGWTF
+ VISIBLE "FISH IS TRANSPARENT OHNO WAT"
+OIC
+
+BTW For Schleife:
+I HAS A TEMPERATURE
+GIMMEH TEMPERATURE
+TEMPERATURE IS NOW A NUMBR
+IM IN YR LOOP UPPIN YR ITERATOR TIL BOTH SAEM ITERATOR AN TEMPERATURE
+ VISIBLE ITERATOR
+IM OUTTA YR LOOP
+
+BTW While Schleife:
+IM IN YR LOOP NERFIN YR ITERATOR WILE DIFFRINT ITERATOR AN -10
+ VISIBLE ITERATOR
+IM OUTTA YR LOOP
+
+OBTW
+ =========================================================================
+ ================================ Strings ================================
+ =========================================================================
+TLDR
+
+BTW Zeilenumbrüche:
+VISIBLE "FIRST LINE :) SECOND LINE"
+
+BTW Tabulatoren:
+VISIBLE ":>SPACES ARE SUPERIOR"
+
+BTW Bell (macht beep):
+VISIBLE "NXT CUSTOMER PLS :o"
+
+BTW Anführungszeichen in Strings:
+VISIBLE "HE SAID :"I LIKE CAKE:""
+
+BTW Doppelpunkte in Strings :
+VISIBLE "WHERE I LIVE:: CYBERSPACE"
+
+OBTW
+ =========================================================================
+ =============================== Funktionen ==============================
+ =========================================================================
+TLDR
+
+BTW Definieren einer neuen Funktion:
+HOW IZ I SELECTMOVE YR MOVE BTW `MOVE` ist ein Argument
+ BOTH SAEM MOVE AN "ROCK", O RLY?
+ YA RLY
+ VISIBLE "YOU HAV A ROCK"
+ NO WAI
+ VISIBLE "OH NO IS A SNIP-SNIP"
+ OIC
+ GTFO BTW Gibt NOOB zurück
+IF U SAY SO
+
+BTW Eine Funktion deklarieren und einen Wert zurückgeben:
+HOW IZ I IZYELLOW
+ FOUND YR "YELLOW"
+IF U SAY SO
+
+BTW Eine Funktion aufrufen:
+I IZ IZYELLOW MKAY
+
+KTHXBYE
+```
+
+## Weiterführende Informationen:
+
+- [LCI compiler](https://github.com/justinmeza/lci)
+- [Official spec](https://github.com/justinmeza/lolcode-spec/blob/master/v1.2/lolcode-spec-v1.2.md)
diff --git a/de-de/edn-de.html.markdown b/de-de/edn-de.html.markdown
new file mode 100644
index 00000000..2434d1bd
--- /dev/null
+++ b/de-de/edn-de.html.markdown
@@ -0,0 +1,112 @@
+---
+language: edn
+filename: learnedn-de.edn
+contributors:
+ - ["Jason Yeo", "https://github.com/jsyeo"]
+ - ["Jonathan D Johnston", "https://github.com/jdjohnston"]
+translators:
+ - ["Dennis Keller", "https://github.com/denniskeller"]
+lang: de-de
+---
+
+Extensible Data Notation (EDN) ist ein Format für serialisierte Daten.
+
+EDN ist ein Subset der von Clojure verwendeten Syntax. Das Lesen von Daten, die durch EDN definiert werden, ist
+sicherer als das, was durch die vollständige Clojure-Syntax definiert wird, insbesondere von nicht
+vertrauenswürdigen Quellen. EDN ist beschränkt auf Daten, kein Code. Es ist ähnlich in seinen Zielen zu JSON.
+Obwohl es mehr in Clojure verwendet wird, gibt es verschiedene Implementationen von EDN in vielen
+verschiedenen anderen Sprachen.
+
+Der Hauptvorteil von EDN im Gegensatz zu JSON und YAML ist, dass es erweiterbar ist.
+Wir werden später sehen wie es erweitert werden kann.
+
+```clojure
+; Kommentare starten mit einem Semikolon.
+; Alles nach dem Semikolon wird ignoriert.
+
+;;;;;;;;;;;;;;;;;;;
+;;; Basistypen ;;;
+;;;;;;;;;;;;;;;;;;;
+
+nil ; auch bekannt in anderen Sprachen als null
+
+; Booleans
+true
+false
+
+; Strings werden in Gänsefüßchen eingeschlossen.
+"hungarian breakfast"
+"farmer's cheesy omelette"
+
+; Charaktere werden einem Backslash vorangestellt
+\g \r \a \c \e
+
+; Schlüsselwörter beginnen mit einem Doppelpunkt. Sie verhalten sich wie Enums.
+; Ähnlich, wie Symbole in Ruby.
+:eggs
+:cheese
+:olives
+
+; Symbole werden verwendet um Identifier zu repräsentieren. Sie beginnen mit einem #.
+; Du kannst einen Namespace für Symbole nutzen, wenn du / verwendest. Egal was / vorangestellt wird
+; ist der Namespace dieses Namens.
+#spoon
+#kitchen/spoon ; nicht das selbe, wie #spoon
+#kitchen/fork
+#github/fork ; damit kannst du nicht essen
+
+; Integers und Floats
+42
+3.14159
+
+; Listen sind Sequenzen von Werten
+(:bun :beef-patty 9 "yum!")
+
+; Vektoren erlauben zufälligen Zugriff
+[:gelato 1 2 -2]
+
+; Maps sind assoziative Datenstrukturen, die einen Schlüssel mit einem Wert verbinden.
+{:eggs 2
+ :lemon-juice 3.5
+ :butter 1}
+
+; Du bist nicht beschränkt ausschließlich Schlüsselwörter als Schlüssel zu verwenden.
+{[1 2 3 4] "tell the people what she wore",
+ [5 6 7 8] "the more you see the more you hate"}
+
+; Du kannst Kommas für eine bessere Lesbarkeit verwenden. Sie werden wie Leerraum behandelt.
+; Sets sind Sammlungen, die eindeutige Elemente enthalten.
+#{:a :b 88 "huat"}
+
+;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; markierte Elemente ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; EDN kann erweitert werden, indem Elemente mit # Symbolen makiert werden.
+
+#MyYelpClone/MenuItem {:name "eggs-benedict" :rating 10}
+
+; Lass mich das mit einem Clojure Beispiel erklären.
+; Angenommen ich möchte dieses Stück EDM in einen MenuItem record umwandeln.
+(defrecord MenuItem [name rating])
+
+; Um EDN in clojure Werte umzuwandeln, muss ich den eingebauten EDN Leser
+; edn/read-string verwenden
+
+(edn/read-string "{:eggs 2 :butter 1 :flour 5}")
+; -> {:eggs 2 :butter 1 :flour 5}
+
+; Definiere die Leserfunktion, um markierte Elemente zu transformieren
+; und übergebe eine Map, die Tags den Lesefunktionen als edn / read-string zuweisen
+
+(edn/read-string {:readers {'MyYelpClone/MenuItem map->menu-item}}
+ "#MyYelpClone/MenuItem {:name \"eggs-benedict\" :rating 10}")
+; -> #user.MenuItem{:name "eggs-benedict", :rating 10}
+
+```
+
+# Referenzen
+
+- [EDN spec](https://github.com/edn-format/edn)
+- [Implementationen](https://github.com/edn-format/edn/wiki/Implementations)
+- [makierte Elemente](http://www.compoundtheory.com/clojure-edn-walkthrough/)
diff --git a/de-de/nix-de.html.markdown b/de-de/nix-de.html.markdown
new file mode 100644
index 00000000..8c78ffbc
--- /dev/null
+++ b/de-de/nix-de.html.markdown
@@ -0,0 +1,358 @@
+---
+language: nix
+filename: learnnix-de.nix
+contributors:
+ - ["Chris Martin", "http://chris-martin.org/"]
+translators:
+ - ["Dennis Keller", "https://github.com/denniskeller"]
+lang: de-de
+---
+
+Nix ist eine simple funktionale Programmiersprache, die für den
+[Nix package manager](https://nixos.org/nix/) und
+[NixOS](https://nixos.org/) entwickelt wurde.
+
+Du kannst Nix Ausdrücke evaluieren mithilfe von
+[nix-instantiate](https://nixos.org/nix/manual/#sec-nix-instantiate)
+oder [`nix-repl`](https://github.com/edolstra/nix-repl).
+
+```
+with builtins; [
+
+ # Kommentare
+ #=========================================
+
+ # Inline Kommentare sehen so aus.
+
+ /* Multizeilen Kommentare
+ sehen so aus. */
+
+
+ # Booleans
+ #=========================================
+
+ (true && false) # Und
+ #=> false
+
+ (true || false) # Oder
+ #=> true
+
+ (if 3 < 4 then "a" else "b") # Bedingungen
+ #=> "a"
+
+
+ # Integers
+ #=========================================
+
+ # Integers sind die einzigen numerischen Typen.
+
+ 1 0 42 (-3) # Einige integers
+
+ (4 + 6 + 12 - 2) # Addition
+ #=> 20
+
+ (7 / 2) # Division
+ #=> 3
+
+
+ # Strings
+ #=========================================
+
+ "String Literale sind in Gänsefüßchen."
+
+ "
+ String Literale können mehrere
+ Zeilen umspannen.
+ "
+
+ ''
+ Dies wird als Literal mit eingerückten String bezeichnet.
+ Es entfernt intelligent führende Leerzeichen.
+ ''
+
+ ''
+ a
+ b
+ ''
+ #=> "a\n b"
+
+ ("ab" + "cd") # String Konkatenation
+ #=> "abcd"
+
+ # Mit Antiquotation kannst du Werte in Strings einbetten.
+ ("Dein Homeverzeichnis ist ${getEnv "HOME"}")
+ #=> "Dein Homeverzeichnis ist /home/alice"
+
+
+ # Paths
+ #=========================================
+
+ # Nix besitzt einen primitven Datentyp für Pfade
+ /tmp/tutorials/learn.nix
+
+ # Ein relativer Pfad wird beim Parsing zu einem absoluten Pfad aufgelöst,
+ # relativ zu der Datei in der es auftritt.
+ tutorials/learn.nix
+ #=> /the-base-path/tutorials/learn.nix
+
+ # Ein Pfad muss mindestens einen Schrägstrich enthalten. Ein Pfad für eine
+ # Datei im selben Verzeichnis benötigt ein ./ Präfix.
+ ./learn.nix
+ #=> /the-base-path/learn.nix
+
+ # Der / Operator muss von Leerraum umgeben sein wenn du dividieren möchtest.
+ 7/2 # Das ist ein Pfadliteral
+ (7 / 2) # Das ist ein Integerliteral
+
+
+ # Importe
+ #=========================================
+
+ # Eine nix Datei besitzt einen einzelnen top-level Ausdruck mit keinen freien Variablen.
+ # Ein Import-Ausdruck wird zum Wert der Datei, die importiert wird, ausgewertet.
+ (import /tmp/foo.nix)
+
+ # Importe können ebenso mit Strings spezifiziert werden.
+ (import "/tmp/foo.nix")
+
+ # Import Pfade müssen absolut sein. Pfadliterale
+ # sind automatisch aufgelöst, das ist ein Ordnung.
+ (import ./foo.nix)
+
+ # Jedoch passiert dies nicht mit Strings.
+ (import "./foo.nix")
+ #=> error: string ‘foo.nix’ doesn't represent an absolute path
+
+
+ # Let
+ #=========================================
+
+ # `let` Blöcke erlauben es uns Werte zu Variablen zu binden.
+ (let x = "a"; in
+ x + x + x)
+ #=> "aaa"
+
+ # Bindungen können auf sich gegenseitig verweisen. Die Reihenfolge spielt
+ # keine Rolle.
+ (let y = x + "b";
+ x = "a"; in
+ y + "c")
+ #=> "abc"
+
+ # Innere Bindungen überschatten Äußere.
+ (let a = 1; in
+ let a = 2; in
+ a)
+ #=> 2
+
+
+ # Funktionen
+ #=========================================
+
+ (n: n + 1) # Funktion, die 1 addiert
+
+ ((n: n + 1) 5) # Dieselbe Funktion angewendet auf 5.
+ #=> 6
+
+ # Es gibt keine spezielle Syntax für benannte Funktionen, aber sie
+ # können mit `let` Blöcken, wie jeder andere Wert auch, gebunden werden.
+ (let succ = (n: n + 1); in succ 5)
+ #=> 6
+
+ # Eine Funktion hat genau ein Argument.
+ # Mehrere Argumente können erreicht werden mithilfe von Currying.
+ ((x: y: x + "-" + y) "a" "b")
+ #=> "a-b"
+
+ # Benannte Funktionsargumente gibt es auch. Diese werden wir einführen, nachdem wir uns Sets
+ # angeschaut haben.
+
+ # Listen
+ #=========================================
+
+ # Listen werden durck eckige Klammern gekennzeichnet.
+
+ (length [1 2 3 "x"])
+ #=> 4
+
+ ([1 2 3] ++ [4 5])
+ #=> [1 2 3 4 5]
+
+ (concatLists [[1 2] [3 4] [5]])
+ #=> [1 2 3 4 5]
+
+ (head [1 2 3])
+ #=> 1
+ (tail [1 2 3])
+ #=> [2 3]
+
+ (elemAt ["a" "b" "c" "d"] 2)
+ #=> "c"
+
+ (elem 2 [1 2 3])
+ #=> true
+ (elem 5 [1 2 3])
+ #=> false
+
+ (filter (n: n < 3) [1 2 3 4])
+ #=> [ 1 2 ]
+
+
+ # Sets
+ #=========================================
+
+ # Ein "Set" ist eine ungeordnete Zuordnung mit Stringschlüsseln.
+ { foo = [1 2]; bar = "x"; }
+
+ # Der . Operator nimmt einen Wert aus dem Set.
+ { a = 1; b = 2; }.a
+ #=> 1
+
+ # Der ? Operator testet, ob der Schlüssel in dem Set vorhanden ist.
+ ({ a = 1; b = 2; } ? a)
+ #=> true
+ ({ a = 1; b = 2; } ? c)
+ #=> false
+
+ # Der // Operator mergt zwei Sets.
+ ({ a = 1; } // { b = 2; })
+ #=> { a = 1; b = 2; }
+
+ # Werte auf der rechten Seite überschrieben die Werte auf der linken Seite.
+ ({ a = 1; b = 2; } // { a = 3; c = 4; })
+ #=> { a = 3; b = 2; c = 4; }
+
+ # Das Schlüsselwort rec bezeichenet ein "rekursives Set", in der sich Attribute
+ # aufeinander beziehen können.
+ (let a = 1; in { a = 2; b = a; }.b)
+ #=> 1
+ (let a = 1; in rec { a = 2; b = a; }.b)
+ #=> 2
+
+ # Verschachetelte Sets können stückweise definiert werden.
+ {
+ a.b = 1;
+ a.c.d = 2;
+ a.c.e = 3;
+ }.a.c
+ #=> { d = 2; e = 3; }
+
+ # Die Nachkommen eines Attributs können in diesem Feld nicht zugeordnet werden, wenn
+ # das Attribut selbst nicht zugeweisen wurde.
+ {
+ a = { b = 1; };
+ a.c = 2;
+ }
+ #=> error: attribute ‘a’ already defined
+
+
+ # With
+ #=========================================
+
+ # Der Körper eines Sets Blocks wird mit der Zurodnung eines Satzes an die Variablen gebunden.
+ (with { a = 1; b = 2; };
+ a + b)
+ # => 3
+
+ # Innere Bindungen überschatten äußere Bindungen.
+ (with { a = 1; b = 2; };
+ (with { a = 5; };
+ a + b))
+ #=> 7
+
+ # Die erste Linie diese Tutorials startet mit "with builtins;",
+ # weil builtins ein Set mit allen eingebauten
+ # Funktionen (length, head, tail, filter, etc.) umfasst.
+ # Das erspart uns beispielseweise "builtins.length" zu schreiben,
+ # anstatt nur "length".
+
+
+ # Set patterns
+ #=========================================
+
+ # Sets sind nützlich, wenn du mehrere Werte einer Funktion
+ # übergeben musst.
+ (args: args.x + "-" + args.y) { x = "a"; y = "b"; }
+ #=> "a-b"
+
+ # Dies kann mit Hilfe von Set patterns deutlicher geschrieben werden.
+ ({x, y}: x + "-" + y) { x = "a"; y = "b"; }
+ #=> "a-b"
+
+ # Standardmäßig schlägt das Muster bei Sets mit zusätzlichen Schlüsseln fehl.
+ ({x, y}: x + "-" + y) { x = "a"; y = "b"; z = "c"; }
+ #=> error: anonymous function called with unexpected argument ‘z’
+
+ # Durch Hinzufügen von ", ..." können zusätzliche Schlüssel ignoriert werden.
+ ({x, y, ...}: x + "-" + y) { x = "a"; y = "b"; z = "c"; }
+ #=> "a-b"
+
+
+ # Errors
+ #=========================================
+
+ # `throw` bewirkt, dass die Auswertung mit einer Fehlermeldung abgebrochen wird.
+ (2 + (throw "foo"))
+ #=> error: foo
+
+ # `tryEval` fängt geworfene Fehler.
+ (tryEval 42)
+ #=> { success = true; value = 42; }
+ (tryEval (2 + (throw "foo")))
+ #=> { success = false; value = false; }
+
+ # `abort` ist ähnlich wie throw, aber es ist fatal. Es kann nicht gefangen werden.
+ (tryEval (abort "foo"))
+ #=> error: evaluation aborted with the following error message: ‘foo’
+
+ # `assert` evaluiert zu dem gegebenen Wert, wenn die Bedingung wahr ist, sonst
+ # löst es eine abfangbare Exception aus.
+ (assert 1 < 2; 42)
+ #=> 42
+ (assert 1 > 2; 42)
+ #=> error: assertion failed at (string):1:1
+ (tryEval (assert 1 > 2; 42))
+ #=> { success = false; value = false; }
+
+
+ # Impurity
+ #=========================================
+
+ # Da die Wiederholbarkeit von Builds für den Nix Packetmangager entscheidend ist,
+ # werden in der Nix Sprache reine funktionale Elemente betont. Es gibt aber ein paar
+ # unreine Elemente.
+ # Du kannst auf Umgebungsvarialben verweisen.
+ (getEnv "HOME")
+ #=> "/home/alice"
+
+ # Die trace Funktion wird zum Debugging verwendet. Sie gibt das erste Argument zu stderr aus
+ # und evaluiert das zweite Argument.
+ (trace 1 2)
+ #=> trace: 1
+ #=> 2
+
+ # Du kannst Dateien in den Nix store schreiben. Obwohl unrein, kannst du dir relativ sicher sein,
+ # dass es sicher ist, da der Dateiname aus dem Hash des Inhalts abgeleitet wird.
+ # Du kannst Dateien von überall lesen. In diesem Beispiel schreiben wir Dateien in den Store
+ # und lesen wieder davon.
+ (let filename = toFile "foo.txt" "hello!"; in
+ [filename (builtins.readFile filename)])
+ #=> [ "/nix/store/ayh05aay2anx135prqp0cy34h891247x-foo.txt" "hello!" ]
+
+ # Außerdem können wir Dateien in den Nix Store downloaden.
+ (fetchurl "https://example.com/package-1.2.3.tgz")
+ #=> "/nix/store/2drvlh8r57f19s9il42zg89rdr33m2rm-package-1.2.3.tgz"
+
+]
+```
+
+### Weitere Resourcen
+
+* [Nix Manual - Nix expression language]
+ (https://nixos.org/nix/manual/#ch-expression-language)
+
+* [James Fisher - Nix by example - Part 1: The Nix expression language]
+ (https://medium.com/@MrJamesFisher/nix-by-example-a0063a1a4c55)
+
+* [Susan Potter - Nix Cookbook - Nix By Example]
+ (http://funops.co/nix-cookbook/nix-by-example/)
diff --git a/de-de/pyqt-de.html.markdown b/de-de/pyqt-de.html.markdown
new file mode 100644
index 00000000..93ee20d4
--- /dev/null
+++ b/de-de/pyqt-de.html.markdown
@@ -0,0 +1,89 @@
+---
+category: tool
+tool: PyQT
+filename: learnpyqt-de.py
+contributors:
+ - ["Nathan Hughes", "https://github.com/sirsharpest"]
+translators:
+ - ["Dennis Keller", "https://github.com/denniskeller"]
+lang: de-de
+---
+
+**Qt** ist eine weit bekanntes Framework mit den man plattformunabhängige Programme schreiben kann,
+die auf verschiedenen Sotfware und Hardware Plattformen laufen mit kleinen oder keinen Änderungen im Code.
+Dabei besitzen sie trozdem die Power und Geschwindigkeit von nativen Anwendungen.
+**Qt** wurde ursprünglich in *C++** geschrieben.
+
+Das ist eine Adaption von dem C++ Intro für QT von [Aleksey Kholovchuk](https://github.com/vortexxx192),
+manche der Codebeispiele sollte in der selben Funktionalität resultieren.
+Diese Version wurde in pyqt erstellt.
+
+```python
+import sys
+from PyQt4 import QtGui
+
+def window():
+ # Erschafft ein Anwendungsobjekt.
+ app = QtGui.QApplication(sys.argv)
+ # Erschafft ein Widget, auf dem unser Label platziert wird.
+ w = QtGui.QWidget()
+ # Fügt ein Label zu dem Widget hinzu.
+ b = QtGui.QLabel(w)
+ # Setzt einen Text für das Label.
+ b.setText("Hello World!")
+ # Setzt die Größe und die Platzierungsinfomationen.
+ w.setGeometry(100, 100, 200, 50)
+ b.move(50, 20)
+ # Setzt unserem Fenster einen schönen Titel.
+ w.setWindowTitle("PyQt")
+ # Lässt alles anzeigen.
+ w.show()
+ # Führe alles aus, nachdem wir alles aufgebaut haben.
+ sys.exit(app.exec_())
+
+if __name__ == '__main__':
+ window()
+
+```
+
+Damit wir weitere fortgeschrittene Funktionen in **pyqt** verwenden können,
+müssen wir anfangen zusätzliche Elemente zu bauen.
+Hier zeigen wir wie man eine Dialog Popup Box einführt.
+Diese ist nützlich, um den Benutzer eine Entscheidung zu bestätigen oder um Informationen anzuzeigen.
+
+```Python
+import sys
+from PyQt4.QtGui import *
+from PyQt4.QtCore import *
+
+
+def window():
+ app = QApplication(sys.argv)
+ w = QWidget()
+ # Erschafft einen Knopf und fügt das Widget w hinzu
+ b = QPushButton(w)
+ b.setText("drücke mich")
+ b.move(50, 50)
+ # Wenn b gedrückt wird, wird diese Funktion aufgerufen.
+ # Bemerke das Fehlen von () bei dem Funktionsaufruf.
+ b.clicked.connect(showdialog)
+ w.setWindowTitle("PyQt Dialog")
+ w.show()
+ sys.exit(app.exec_())
+
+# Diese Funktion soll ein Dialogfenster mit einem Knopf erschaffen.
+# Der Knopf wartet bis er geklickt wird und beendet das Programm
+def showdialog():
+ d = QDialog()
+ b1 = QPushButton("ok", d)
+ b1.move(50, 50)
+ d.setWindowTitle("Dialog")
+ # Diese Modalität sagt dem Popup, dass es den Parent blocken soll, solange es aktiv ist.
+ d.setWindowModality(Qt.ApplicationModal)
+ # Beim klicken möchte ich, dass der gesamte Prozess beendet wird.
+ b1.clicked.connect(sys.exit)
+ d.exec_()
+
+if __name__ == '__main__':
+ window()
+```
diff --git a/de-de/qt-de.html.markdown b/de-de/qt-de.html.markdown
new file mode 100644
index 00000000..480030fe
--- /dev/null
+++ b/de-de/qt-de.html.markdown
@@ -0,0 +1,175 @@
+---
+category: tool
+tool: Qt Framework
+language: c++
+filename: learnqt-de.cpp
+contributors:
+ - ["Aleksey Kholovchuk", "https://github.com/vortexxx192"]
+translators:
+ - ["Dennis Keller", "https://github.com/denniskeller"]
+lang: de-de
+---
+
+**Qt** ist ein weithin bekanntes Framework zum Entwickeln von cross-platform Software,
+die auf verschiedenen Hard- und Softwareplatformen mit wenig oder keinen Veränderungen im Code läuft.
+Dabei besitzt man die Power und Geschiwindigkeit von nativen Anwendungen.
+Obwohl **Qt** ursprünglich in *C++* geschrieben wurde,
+gibt es verschiedene Ports für andere Sprachen: *[PyQt](https://learnxinyminutes.com/docs/pyqt/)*, *QtRuby*, *PHP-Qt*, etc.
+
+**Qt** eignet sich hervorragend zum Erstellen von Anwendungen mit grafischer Benutzeroberfläche (GUI).
+Dieses Tutorial zeigt, wie man das in *C++* macht.
+
+```c++
+/*
+ * Lass uns klassisch starten
+ */
+
+// Alle Header vom Qt Framework starten mit dem Großbuchstaben 'Q'.
+#include <QApplication>
+#include <QLineEdit>
+
+int main(int argc, char *argv[]) {
+ // Erstellt ein Objekt um applikationsweit die Resourcen zu managen.
+ QApplication app(argc, argv);
+
+ // Erstellt ein Line edit Widget und zeigt es auf dem Bildschirm
+ QLineEdit lineEdit("Hello world!");
+ lineEdit.show();
+
+ // Startet die Event Loop der Anwendung.
+ return app.exec();
+}
+```
+
+Die GUI bezogene Teile von **Qt** bestehen aus *Widgets* und den *Verbindungen*
+dazwischen.
+
+[Lies mehr über Widgets](http://doc.qt.io/qt-5/qtwidgets-index.html)
+
+```c++
+/*
+ * Lass uns Label und einen Button machen.
+ * Ein Label soll auftauchen, wenn der Button gedrückt wird.
+ *
+ * Der Qt Code spricht für sich selbst.
+ */
+
+#include <QApplication>
+#include <QDialog>
+#include <QVBoxLayout>
+#include <QPushButton>
+#include <QLabel>
+
+int main(int argc, char *argv[]) {
+ QApplication app(argc, argv);
+
+ QDialog dialogWindow;
+ dialogWindow.show();
+
+ // Füge ein vertikales Layout hinzu
+ QVBoxLayout layout;
+ dialogWindow.setLayout(&layout);
+
+ QLabel textLabel("Danke für das Knopf drücken");
+ layout.addWidget(&textLabel);
+ textLabel.hide();
+
+ QPushButton button("Drück mich");
+ layout.addWidget(&button);
+
+ // Zeigt verstecktes Label, wenn der Button gedrückt wird.
+ QObject::connect(&button, &QPushButton::pressed,
+ &textLabel, &QLabel::show);
+
+ return app.exec();
+}
+```
+
+Beachte den *QObject::connect* Teil. Diese Methode wird verwendet,
+um *Signale* eines Objekts mit den *Slots* eines Objektes zu verbinden.
+
+**Signale** werden ausgegeben, wenn bestimmte Dinge mit Objekten passieren.
+Beispielsweise wird das *pressed* Signal ausgegeben,
+wenn der Benutzer auf das QPushButton Objekt drückt.
+
+**Slots** sind Aktionen, die als Reaktion auf empfangene Signale ausgeführt werden können.
+
+[Lies mehr über Slots und Signale](http://doc.qt.io/qt-5/signalsandslots.html)
+
+
+Als Nächstes lernen wir, dass wir nicht nur Standard Widgets verwenden können,
+sondern auch ihr Verhalten mithilfe von Vererbung verändern können.
+Lass uns einen Button erschaffen, der zählt, wie häufig er gedrückt wird.
+Dafür definieren wir unsere eigene Klasse *CounterLabel*.
+Diese muss wegen der speziellen Qt Architektur in einer seperaten Datei deklariert werden.
+
+```c++
+// counterlabel.hpp
+
+#ifndef COUNTERLABEL
+#define COUNTERLABEL
+
+#include <QLabel>
+
+class CounterLabel : public QLabel {
+ Q_OBJECT // Qt definiertes Makro, welches in jedem modifizierten Widget vorhanden sein muss.
+
+public:
+ CounterLabel() : counter(0) {
+ setText("Zähler wurde noch nicht erhöht."); // Methode von QLabel
+ }
+
+public slots:
+ // Aktion, die ausgeführt wird, wenn der Button gedrückt wird.
+ void increaseCounter() {
+ setText(QString("Zähler Wert: %1").arg(QString::number(++counter)));
+ }
+
+private:
+ int counter;
+};
+
+#endif // Zähllabel
+```
+
+```c++
+// main.cpp
+// Fast das Gleiche, wie das vorherige Beispiel
+
+#include <QApplication>
+#include <QDialog>
+#include <QVBoxLayout>
+#include <QPushButton>
+#include <QString>
+#include "counterlabel.hpp"
+
+int main(int argc, char *argv[]) {
+ QApplication app(argc, argv);
+
+ QDialog dialogWindow;
+ dialogWindow.show();
+
+ QVBoxLayout layout;
+ dialogWindow.setLayout(&layout);
+
+ CounterLabel counterLabel;
+ layout.addWidget(&counterLabel);
+
+ QPushButton button("Drück mich nochmal.");
+ layout.addWidget(&button);
+ QObject::connect(&button, &QPushButton::pressed,
+ &counterLabel, &CounterLabel::increaseCounter);
+
+ return app.exec();
+}
+```
+
+Das wars! Natürlich ist das Qt Framework erheblich größer, als der der Teil der in diesem Tutorial behandelt wurde.
+Das heißt, es gibt viel zu lesen und zu üben.
+
+## Further reading
+
+- [Qt 4.8 tutorials](http://doc.qt.io/qt-4.8/tutorials.html)
+- [Qt 5 tutorials](http://doc.qt.io/qt-5/qtexamplesandtutorials.html)
+
+Viel Erfolg und viel Spaß!
diff --git a/edn.html.markdown b/edn.html.markdown
index 9ecfb24f..f47853f0 100644
--- a/edn.html.markdown
+++ b/edn.html.markdown
@@ -84,22 +84,26 @@ github/fork ; you can't eat with this
#MyYelpClone/MenuItem {:name "eggs-benedict" :rating 10}
-; Let me explain this with a clojure example. Suppose I want to transform that
+; Let me explain this with a Clojure example. Suppose I want to transform that
; piece of EDN into a MenuItem record.
(defrecord MenuItem [name rating])
-; To transform EDN to clojure values, I will need to use the built in EDN
-; reader, edn/read-string
+; defrecord defined, among other things, map->MenuItem which will take a map
+; of field names (as keywords) to values and generate a user.MenuItem record
-(edn/read-string "{:eggs 2 :butter 1 :flour 5}")
+; To transform EDN to Clojure values, I will need to use the built-in EDN
+; reader, clojure.edn/read-string
+
+(clojure.edn/read-string "{:eggs 2 :butter 1 :flour 5}")
; -> {:eggs 2 :butter 1 :flour 5}
-; To transform tagged elements, define the reader function and pass a map
-; that maps tags to reader functions to edn/read-string like so
+; To transform tagged elements, pass to clojure.edn/read-string an option map
+; with a :readers map that maps tag symbols to data-reader functions, like so
-(edn/read-string {:readers {'MyYelpClone/MenuItem map->menu-item}}
- "#MyYelpClone/MenuItem {:name \"eggs-benedict\" :rating 10}")
+(clojure.edn/read-string
+ {:readers {'MyYelpClone/MenuItem map->MenuItem}}
+ "#MyYelpClone/MenuItem {:name \"eggs-benedict\" :rating 10}")
; -> #user.MenuItem{:name "eggs-benedict", :rating 10}
```
diff --git a/pt-br/amd-pt.html.markdown b/pt-br/amd-pt.html.markdown
index 38c1f70f..40c7cd09 100644
--- a/pt-br/amd-pt.html.markdown
+++ b/pt-br/amd-pt.html.markdown
@@ -141,7 +141,7 @@ require(['jquery', 'coolLibFromBower', 'modules/algunsHelpers'], function($, coo
coolLib.facaAlgoDoidoCom(helpers.transform($('#foo')));
});
```
-Apps baseados em `require.js` geralmente terão u´m único ponto de acesso (`main.js`) que é passado à tag script do `require.js` como um data-attribute. Ele vai ser automaticamente carregado e executado com o carregamento da página:
+Apps baseados em `require.js` geralmente terão um único ponto de acesso (`main.js`) que é passado à tag script do `require.js` como um data-attribute. Ele vai ser automaticamente carregado e executado com o carregamento da página:
```html
<!DOCTYPE html>
diff --git a/pt-br/asciidoc-pt.html.markdown b/pt-br/asciidoc-pt.html.markdown
index 1dee31db..b12c0693 100644
--- a/pt-br/asciidoc-pt.html.markdown
+++ b/pt-br/asciidoc-pt.html.markdown
@@ -99,7 +99,7 @@ Para criar uma lista com marcadores use asteriscos.
* baz
```
-Para criar uma lista númerada use pontos.
+Para criar uma lista numerada use pontos.
```
. item 1
diff --git a/pt-br/asymptotic-notation-pt.html.markdown b/pt-br/asymptotic-notation-pt.html.markdown
index 2e299d09..aecc2194 100644
--- a/pt-br/asymptotic-notation-pt.html.markdown
+++ b/pt-br/asymptotic-notation-pt.html.markdown
@@ -38,7 +38,7 @@ Na primeira seção desse documento, descrevemos como Notação Assintótica ide
*f*, *n* como o tamanho da entrada e *f(n)* sendo o tempo de execução. Então,
para dado algoritmo *f*, com entrada de tamanho *n*, você terá tempo de execução
*f(n)*. Isto resulta em um gráfico onde a coordernada Y é o tempo de execução
-, a coordernada X representa o tamanho da entrada e os pontos representao o tempo
+, a coordernada X representa o tamanho da entrada e os pontos representam o tempo
de execução para dado tamanho de entrada.
Você pode representar a função, ou o algoritmo, com Notação Assintótica de várias
diff --git a/pt-br/awk-pt.html.markdown b/pt-br/awk-pt.html.markdown
new file mode 100644
index 00000000..75b73abe
--- /dev/null
+++ b/pt-br/awk-pt.html.markdown
@@ -0,0 +1,376 @@
+---
+language: awk
+filename: learnawk-pt.awk
+contributors:
+ - ["Marshall Mason", "http://github.com/marshallmason"]
+translators:
+ - ["Paulo Henrique Rodrigues Pinheiro", "https://github.com/paulohrpinheiro"]
+lang: pt-br
+
+---
+
+AWK é uma ferramenta padrão em todos os sistemas UNIX compatíveis com POSIX. É
+como um Perl despojado, perfeito para tarefas de processamento de texto e
+outras tarefas de script. Possui uma sintaxe C-like, mas sem ponto e vírgula,
+gerenciamento manual de memória, ou tipagem estática. Destaca-se no
+processamento de texto. Você pode chamá-lo a partir de um shell-script, ou você
+pode usá-lo como uma linguagem de script autônomo.
+
+Por que usar AWK ao invés de Perl? Principalmente porque AWK faz parte do UNIX.
+Você pode sempre contar com ele, enquanto o futuro do Perl é indefinido. AWK é
+também mais fácil de ler que Perl. Para scripts simples de processamento de
+texto, particularmente aqueles que leem arquivos linha por linha e fatiam texto
+por delimitadores, AWK é provavelmente a ferramenta certa para a tarefa.
+
+```awk
+#!/usr/bin/awk -f
+
+# Comentários são assim
+
+# Programas AWK consistem de uma coleção de padrões e ações. O mais
+# importante padrão é chamado BEGIN. Ações estão dentro de blocos
+# entre chaves.
+
+BEGIN {
+
+ # O bloco BEGIN será executado no começo do programa. É onde você coloca
+ # todo código que prepara a execução, antes que você processe qualquer
+ # arquivo de texto. Se você não tem arquivos de texto, então pense no
+ # BEGIN como o ponto principal de entrada.
+
+ # Variáveis são globais. Simplesmente atribua valores ou as use, sem
+ # necessidade de declarar.
+
+ # Operadores são como em C e similares
+ a = count + 1
+ b = count - 1
+ c = count * 1
+ d = count / 1 # divisão inteira
+ e = count % 1 # módulo
+ f = count ^ 1 # exponenciação
+
+ a += 1
+ b -= 1
+ c *= 1
+ d /= 1
+ e %= 1
+ f ^= 1
+
+ # Incrementando e decrementando por um
+ a++
+ b--
+
+ # Como um operador pré-fixado, retorna o valor incrementado
+ ++a
+ --b
+
+ # Perceba, não há pontuação, como ponto-e-vírgula, ao final das declarações
+
+ # Declarações de controle
+ if (count == 0)
+ print "Começando com count em 0"
+ else
+ print "Como é que é?"
+
+ # Ou você pode usar o operador ternário
+ print (count == 0) ? "Começando com count em 0" : "Como é que é?"
+
+ # Blocos multilinhas devem usar chaves
+ while (a < 10) {
+ print "Concatenação de texto é feita" " com uma série" " de"
+ " textos separados por espaço"
+ print a
+
+ a++
+ }
+
+ for (i = 0; i < 10; i++)
+ print "Uma boa opção para um loop de uma linha"
+
+ # Quanto a comparações, eis os padrões:
+ a < b # Menor que
+ a <= b # Menor ou igual a
+ a != b # Não igual
+ a == b # Igual
+ a > b # Maior que
+ a >= b # Maior ou igual a
+
+ # Bem como operadores lógicos
+ a && b # E
+ a || b # OU (inclusivo)
+
+ # Em adição, há o utilíssimo operador para expressões regulares
+ if ("foo" ~ "^fo+$")
+ print "Fooey!"
+ if ("boo" !~ "^fo+$")
+ print "Boo!"
+
+ # Matrizes
+ arr[0] = "foo"
+ arr[1] = "bar"
+ # Infelizmente, não há outra forma para inicializar uma matriz. Apenas
+ # coloque cada valor em uma linha, como mostrado acima.
+
+ # Você também pode ter matrizes associativas
+ assoc["foo"] = "bar"
+ assoc["bar"] = "baz"
+
+ # E matrizes multidimensionais, com algumas limitações que não mencionarei
+ multidim[0,0] = "foo"
+ multidim[0,1] = "bar"
+ multidim[1,0] = "baz"
+ multidim[1,1] = "boo"
+
+ # Você pode testar a pertinência de um elemento em uma matriz
+ if ("foo" in assoc)
+ print "Fooey!"
+
+ # Você pode também usar o operador 'in' para percorrer as chaves de uma
+ # matriz associativa
+ for (key in assoc)
+ print assoc[key]
+
+ # Os argumentos da linha de comando estão em uma matriz especial ARGV
+ for (argnum in ARGV)
+ print ARGV[argnum]
+
+ # Você pode remover elementos de uma matriz
+ # Isso é muito útil para prevenir que o AWK assuma que os argumentos são
+ # arquivo para ele processar
+ delete ARGV[1]
+
+ # A quantidade de argumentos passados está na variável ARGC
+ print ARGC
+
+ # O AWK tem várias funções nativas. Elas estão separadas em três categorias.
+ # Demonstrarei cada uma delas logo mais abaixo.
+
+ return_value = arithmetic_functions(a, b, c)
+ string_functions()
+ io_functions()
+}
+
+# Eis como você deve definir uma função
+function arithmetic_functions(a, b, c, d) {
+
+ # Provavelmente a parte mais irritante do AWK é ele não possuir variáveis
+ # locais. Tudo é global. Para pequenos scripts, isso não é problema, e
+ # pode até mesmo ser considerado útil, mas para grandes scripts, isso pode
+ # ser um problema.
+
+ # Mas há como contornar isso (um hack). Os argumentos de função são locais
+ # para a função e o AWK permite que você defina mais argumentos de função
+ # do que ele precise. Então, coloque a variável local na declaração de
+ # função, como eu fiz acima. Como uma convenção, adicione alguns espaços
+ # extras para distinguir entre parâmetros de função reais e variáveis
+ # locais. Neste exemplo, a, b e c são parâmetros reais, enquanto d é
+ # meramente uma variável local.
+
+ # Agora, serão demonstradas as funções aritméticas
+
+ # Muitas implementações AWK possuem algumas funções trigonométricas padrão
+ localvar = sin(a)
+ localvar = cos(a)
+ localvar = atan2(a, b) # arco-tangente de b / a
+
+ # E conteúdo logarítmico
+ localvar = exp(a)
+ localvar = log(a)
+
+ # Raiz quadrada
+ localvar = sqrt(a)
+
+ # Descartando a parte não inteira de um número em ponto flutuante.
+ localvar = int(5.34) # localvar => 5
+
+ # Números aleatórios
+ srand() # Forneça uma semente como argumento. Por padrão, ele usa a hora atual
+ localvar = rand() # Número aleatório entre 0 e 1.
+
+ # Aqui mostramos como retornar um valor
+ return localvar
+}
+
+function string_functions( localvar, arr) {
+
+ # Sendo o AWK uma linguagem para processamento de texto, ele possui
+ # várias funções para manipulação de texto, muitas das quais
+ # fortemente dependentes de expressões regulares.
+
+ # Procurar e substituir, primeira instância (sub), ou todas (gsub)
+ # Ambas retornam o número de instâncias substituídas
+ localvar = "fooooobar"
+ sub("fo+", "Meet me at the ", localvar) # localvar => "Meet me at the bar"
+ gsub("e+", ".", localvar) # localvar => "m..t m. at th. bar"
+
+ # Localiza um texto que casa com uma expressão regular
+ # index() faz a mesma coisa, mas não permite uma expressão regular
+ match(localvar, "t") # => 4, pois 't' é o quarto carácter
+
+ # Separa por delimitador
+ split("foo-bar-baz", arr, "-") # a => ["foo", "bar", "baz"]
+
+ # Outras coisas úteis
+ sprintf("%s %d %d %d", "Testing", 1, 2, 3) # => "Testing 1 2 3"
+ substr("foobar", 2, 3) # => "oob"
+ substr("foobar", 4) # => "bar"
+ length("foo") # => 3
+ tolower("FOO") # => "foo"
+ toupper("foo") # => "FOO"
+}
+
+function io_functions( localvar) {
+
+ # Você já viu como imprimir
+ print "Hello world"
+
+ # Também há o printf
+ printf("%s %d %d %d\n", "Testing", 1, 2, 3)
+
+ # O AWK não disponibiliza manipuladores de arquivo. Ele irá automaticamente
+ # manipular um arquivo quando você fizer algo que precise disso. O texto
+ # que você usou para isso pode ser usado como um manipulador de arquivo,
+ # para propósitos de E/S. Isso faz ele parecer com um shell script:
+
+ print "foobar" >"/tmp/foobar.txt"
+
+ # Agora a string "/tmp/foobar.txt" é um manipulador de arquivos. Você pode
+ # fechá-lo:
+ close("/tmp/foobar.txt")
+
+ # Aqui está como você pode executar alguma coisa no shell
+ system("echo foobar") # => prints foobar
+
+ # Lê uma linha da entrada padrão e armazena em localvar
+ getline localvar
+
+ # Lê uma linha de um pipe
+ "echo foobar" | getline localvar # localvar => "foobar"
+ close("echo foobar")
+
+ # Lê uma linha de um arquivo e armazena em localvar
+ getline localvar <"/tmp/foobar.txt"
+ close("/tmp/foobar.txt")
+}
+
+# Como dito no início, os programas AWK consistem de uma coleção de padrões
+# e ações. Você já viu o padrão BEGIN, o mais importante. Outros padrões são
+# usados apenas se você estiver processando linhas de arquivos ou a entrada
+# padrão.
+
+# Quando você passa argumentos para o AWK, eles são tratados como nomes de
+# arquivos para processar. Todos serão processados, em ordem. Pense nisso como
+# um implícito para loop, iterando sobre as linhas nesses arquivos. Esses
+# padrões e ações são como instruções de mudança dentro do loop.
+
+/^fo+bar$/ {
+
+ # Esta ação será executada para cada linha que corresponda à expressão
+ # regular, / ^ fo + bar $ /, e será ignorada para qualquer linha que não
+ # corresponda. Vamos apenas imprimir a linha:
+
+ print
+
+ # Opa, sem argumento! Isso ocorre pois print tem um argumento padrão: $0.
+ # $0 é o nome da linha atual que está sendo processada. Essa variável é
+ # criada automaticamente para você.
+
+ # Você provavelmente pode adivinhar que existem outras variáveis $. Toda
+ # linha é implicitamente dividida antes de cada ação ser chamada, como
+ # o shell faz. E, como o shell, cada campo pode ser acessado com um sinal
+ # de cifrão
+
+ # Isso irá imprimir o segundo e quarto campos da linha
+ print $2, $4
+
+ # O AWK automaticamente define muitas outras variáveis para ajudar você
+ # a inspecionar processar cada linha. A mais importante delas é NF.
+
+ # Imprime o número de campos da linha atual
+ print NF
+
+ # Imprime o último campo da linha atual
+ print $NF
+}
+
+# Todo padrão é na verdade um teste verdadeiro/falso. A expressão regular no
+# último padrão também é um teste verdadeiro/falso, mas parte dele estava
+# escondido. Se você não informar um texto para testar, AWK assumirá $0,
+# a linha que está atualmente sendo processada. Assim, a versão completa
+# é a seguinte:
+
+$0 ~ /^fo+bar$/ {
+ print "Equivalente ao último padrão"
+}
+
+a > 0 {
+ # Isso será executado uma vez para cada linha, quando a for positivo
+}
+
+# Você entendeu. Processar arquivos de texto, ler uma linha de cada vez, e
+# fazer algo com ela, particularmente dividir com base em um delimitador, é
+# tão comum no UNIX que AWK é uma linguagem de script que faz tudo por você,
+# sem você precisa perguntar. Tudo o que você precisa fazer é escrever os
+# padrões e ações com base no que você espera da entrada, e o que você quer
+# fazer com isso.
+
+# Aqui está um exemplo rápido de um script simples, o tipo de coisa que o AWK
+# é perfeito para fazer. Ele irá ler um nome da entrada padrão e depois
+imprimirá a média de idade de todos com esse primeiro nome. Digamos que você
+forneça como argumento o nome de um arquivo com esses dados:
+
+# Bob Jones 32
+# Jane Doe 22
+# Steve Stevens 83
+# Bob Smith 29
+# Bob Barker 72
+#
+# Eis o script:
+
+BEGIN {
+
+ # Primeiro, pergunte o nome do usuário
+ print "Para qual nome você quer calcular a média de idade?"
+
+ # Pega uma linha da entrada padrão, não dos arquivos indicados na
+ # linha de comando
+ getline name <"/dev/stdin"
+}
+
+# Agora, processa cada linha em que o primeiro nome é o nome informado
+$1 == name {
+
+ # Dentro desse bloco, nós temos acesso a algumas variáveis uteis, que
+ # foram pré-carregadas para nós:
+ # $0 é a linha corrente completa
+ # $3 é o terceiro campo, que é o que nos interessa aqui
+ # NF é a quantidade de campos, que deve ser 3
+ # NR é o número de registros (linhas) lidas até agora
+ # FILENAME é o nome do arquivo sendo processado
+ # FS é o delimitador em uso, que é " " aqui
+ # ...etc. Há muito mais, documentadas no manual.
+
+ # Mantenha um registro do total e da quantidade de linhas encontradas
+ sum += $3
+ nlines++
+}
+
+# Outro padrão especial é chamado END. Ele será executado após o processamento
+# de todos os arquivos de texto. Ao contrário de BEGIN, ele só será executado
+# se você tiver dado a ele dados para processar. Ele será executado depois de
+# todos os arquivos terem sido lidos e processados de acordo com as regras e
+# ações que você forneceu. O objetivo disso em geral é produzir algum tipo de
+# relatório final, ou fazer algo com o agregado dos dados acumulados ao longo
+# do script.
+
+END {
+ if (nlines)
+ print "A média da idade para " name " é " sum / nlines
+}
+
+```
+Leituras adicionais (em inglês):
+
+* [Awk tutorial](http://www.grymoire.com/Unix/Awk.html)
+* [Awk man page](https://linux.die.net/man/1/awk)
+* [The GNU Awk User's Guide](https://www.gnu.org/software/gawk/manual/gawk.html) GNU AWK é encontrado na maioria dos sistemas GNU/Linux.
diff --git a/pt-br/c++-pt.html.markdown b/pt-br/c++-pt.html.markdown
index c1cfbbb1..cd4adde7 100644
--- a/pt-br/c++-pt.html.markdown
+++ b/pt-br/c++-pt.html.markdown
@@ -18,9 +18,9 @@ foi concebida para
- suportar programação orientada a objetos
- suportar programação genérica
-Embora sua sintaxe pode ser mais difícil ou complexa do que as linguagens mais
-recentes, C++ é amplamente utilizado porque compila para instruções nativas que
-podem ser executadas diretamente pelo processador e oferece um controlo rígido sobre hardware (como C), enquanto oferece recursos de alto nível, como os
+Embora sua sintaxe possa ser mais difícil ou complexa do que as linguagens mais
+recentes, C++ é amplamente utilizada porque compila para instruções nativas que
+podem ser executadas diretamente pelo processador e oferece um controle rígido sobre o hardware (como C), enquanto oferece recursos de alto nível, como os
genéricos, exceções e classes. Esta combinação de velocidade e funcionalidade
faz C++ uma das linguagens de programação mais utilizadas.
@@ -40,10 +40,10 @@ faz C++ uma das linguagens de programação mais utilizadas.
int main(int argc, char** argv)
{
- // Argumentos de linha de comando são passados em pelo argc e argv da mesma
+ // Argumentos de linha de comando são passados para argc e argv da mesma
// forma que eles estão em C.
// argc indica o número de argumentos,
- // e argv é um array de strings, feito C (char*) representado os argumentos
+ // e argv é um array de strings, feito C (char*) representando os argumentos
// O primeiro argumento é o nome pelo qual o programa foi chamado.
// argc e argv pode ser omitido se você não se importa com argumentos,
// dando a assinatura da função de int main()
@@ -274,7 +274,7 @@ public:
void setWeight(int dogsWeight);
- // Funções que não modificam o estado do objecto devem ser marcadas como
+ // Funções que não modificam o estado do objeto devem ser marcadas como
// const. Isso permite que você chamá-los se for dada uma referência const
// para o objeto. Além disso, observe as funções devem ser explicitamente
// declarados como _virtual_, a fim de ser substituídas em classes
diff --git a/pt-br/c-pt.html.markdown b/pt-br/c-pt.html.markdown
index 6e7aa8c2..0dca7ab0 100644
--- a/pt-br/c-pt.html.markdown
+++ b/pt-br/c-pt.html.markdown
@@ -182,7 +182,7 @@ int main() {
int a, b, c;
a = b = c = 0;
- // Aritimética é óbvia
+ // Aritmética é óbvia
i1 + i2; // => 3
i2 - i1; // => 1
i2 * i1; // => 2
@@ -191,7 +191,7 @@ int main() {
f1 / f2; // => 0.5, mais ou menos epsilon
// Números e cálculos de ponto flutuante não são exatos
- // Modulo também existe
+ // Módulo também existe
11 % 3; // => 2
// Operadores de comparação provavelmente são familiares,
diff --git a/pt-br/csharp-pt.html.markdown b/pt-br/csharp-pt.html.markdown
index 547f4817..16321c82 100644
--- a/pt-br/csharp-pt.html.markdown
+++ b/pt-br/csharp-pt.html.markdown
@@ -6,23 +6,23 @@ contributors:
lang: pt-br
---
-C# é uma linguagem elegante e altamente tipado orientada a objetos que permite aos desenvolvedores criarem uma variedade de aplicações seguras e robustas que são executadas no .NET Framework.
+C# é uma linguagem elegante, altamente tipada e orientada a objetos que permite aos desenvolvedores criar uma variedade de aplicações seguras e robustas que são executadas no .NET Framework.
-[Read more here.](http://msdn.microsoft.com/pt-br/library/vstudio/z1zx9t92.aspx)
+[Leia mais aqui.](http://msdn.microsoft.com/pt-br/library/vstudio/z1zx9t92.aspx)
```c#
-// Comentário de linha única começa com //
+// Comentários de linha única começam com //
/*
-Múltipas linhas é desta forma
+Comentários de múltiplas linhas são desta forma
*/
/// <summary>
-/// Esta é uma documentação comentário XML que pode ser usado para gerar externo
-/// documentação ou fornecer ajuda de contexto dentro de um IDE
+/// Este é um comentário de documentação XML que pode ser usado para gerar documentação
+/// externa ou para fornecer ajuda de contexto dentro de uma IDE
/// </summary>
//public void MethodOrClassOrOtherWithParsableHelp() {}
-// Especificar qual namespace seu código irá usar
-// Os namespaces a seguir são padrões do .NET Framework Class Library
+// Especifica os namespaces que o código irá usar
+// Os namespaces a seguir são padrões da biblioteca de classes do .NET Framework
using System;
using System.Collections.Generic;
using System.Dynamic;
@@ -33,11 +33,11 @@ using System.IO;
// Mas este aqui não é :
using System.Data.Entity;
-// Para que consiga utiliza-lo, você precisa adicionar novas referências
+// Para que consiga utilizá-lo, você precisa adicionar novas referências
// Isso pode ser feito com o gerenciador de pacotes NuGet : `Install-Package EntityFramework`
-// Namespaces são escopos definidos para organizar o códgo em "pacotes" or "módulos"
-// Usando este código a partir de outra arquivo de origem: using Learning.CSharp;
+// Namespaces são escopos definidos para organizar o código em "pacotes" ou "módulos"
+// Usando este código a partir de outro arquivo de origem: using Learning.CSharp;
namespace Learning.CSharp
{
// Cada .cs deve conter uma classe com o mesmo nome do arquivo
@@ -762,7 +762,7 @@ on a new line! ""Wow!"", the masses cried";
}
}
- //Method to display the attribute values of this Object.
+ //Método para exibir os valores dos atributos deste objeto.
public virtual string Info()
{
return "Gear: " + Gear +
@@ -790,7 +790,7 @@ on a new line! ""Wow!"", the masses cried";
// (Penny Farthings are those bicycles with the big front wheel.
// They have no gears.)
- // calling parent constructor
+ // chamando construtor pai
public PennyFarthing(int startCadence, int startSpeed) :
base(startCadence, startSpeed, 0, "PennyFarthing", true, BikeBrand.Electra)
{
diff --git a/pt-br/css-pt.html.markdown b/pt-br/css-pt.html.markdown
index b1fbd961..956b3614 100644
--- a/pt-br/css-pt.html.markdown
+++ b/pt-br/css-pt.html.markdown
@@ -25,7 +25,7 @@ O foco principal deste artigo é sobre a sintaxe e algumas dicas gerais.
```css
/* Comentários aparecem dentro do slash-asterisk, tal como esta linha!
- não há "comentários de uma linha"; este é o único estilo de comentário * /
+ Não há "comentários de uma linha"; este é o único estilo de comentário * /
/* ####################
## SELETORES
diff --git a/pt-br/java-pt.html.markdown b/pt-br/java-pt.html.markdown
index 82989502..1b9d7fc6 100644
--- a/pt-br/java-pt.html.markdown
+++ b/pt-br/java-pt.html.markdown
@@ -42,7 +42,7 @@ public class LearnJava {
" Double: " + 3.14 +
" Boolean: " + true);
- // Para imprimir sem inserir uma nova lina, use o System.out.print
+ // Para imprimir sem inserir uma nova linha, use o System.out.print
System.out.print("Olá ");
System.out.print("Mundo");
diff --git a/pt-br/javascript-pt.html.markdown b/pt-br/javascript-pt.html.markdown
index 7b6729ef..ed4a6ff3 100644
--- a/pt-br/javascript-pt.html.markdown
+++ b/pt-br/javascript-pt.html.markdown
@@ -25,7 +25,7 @@ Feedback são muito apreciados! Você me encontrar em
```js
// Comentários são como em C. Comentários de uma linha começam com duas barras,
-/* e comentários de múltplas linhas começam com barra-asterisco
+/* e comentários de múltiplas linhas começam com barra-asterisco
e fecham com asterisco-barra */
// comandos podem ser terminados com ;
diff --git a/pt-br/json-pt.html.markdown b/pt-br/json-pt.html.markdown
index fd822c03..62d9ccad 100644
--- a/pt-br/json-pt.html.markdown
+++ b/pt-br/json-pt.html.markdown
@@ -16,7 +16,7 @@ Como JSON é um formato de intercâmbio de dados, este será, muito provavelment
JSON na sua forma mais pura não tem comentários, mas a maioria dos analisadores
aceitarão comentários no estilo C (//, /\* \*/). No entanto estes devem ser evitados para otimizar a compatibilidade.
-Um valor JSON pode ser um numero, uma string, um array, um objeto, um booleano (true, false) ou null.
+Um valor JSON pode ser um número, uma string, um array, um objeto, um booleano (true, false) ou null.
Os browsers suportados são: Firefox 3.5+, Internet Explorer 8.0+, Chrome 1.0+, Opera 10.0+, e Safari 4.0+.
diff --git a/pt-br/perl-pt.html.markdown b/pt-br/perl-pt.html.markdown
index cc07a2ec..217861f9 100644
--- a/pt-br/perl-pt.html.markdown
+++ b/pt-br/perl-pt.html.markdown
@@ -21,7 +21,7 @@ Perl 5 roda em mais de 100 plataformas, de portáteis a mainframes e é adequada
# Variáveis iniciam com um sigilo, que é um símbolo que mostra o tipo.
# Um nome de variável válido começa com uma letra ou sublinhado,
-# seguido por qualquer número de letras, números ou sublinhados.
+# seguido por qualquer quantidade de letras, números ou sublinhados.
### Perl has three main variable types: $scalar, @array, e %hash.
@@ -52,10 +52,10 @@ my %fruta_cor = (
banana => "amarelo",
);
-# Scalars, arrays and hashes são documentados mais profundamentes em perldata.
+# Scalars, arrays and hashes são documentados mais profundamente em perldata.
# (perldoc perldata).
-# Mais tipos de dados complexos podem ser construídas utilizando referências,
+# Mais tipos de dados complexos podem ser construídos utilizando referências,
# o que permite que você crie listas e hashes dentro de listas e hashes.
#### Condicionais e construtores de iteração
diff --git a/pt-br/visualbasic-pt.html.markdown b/pt-br/visualbasic-pt.html.markdown
index 76cca567..b94ab609 100644
--- a/pt-br/visualbasic-pt.html.markdown
+++ b/pt-br/visualbasic-pt.html.markdown
@@ -15,9 +15,9 @@ module Module1
Sub Main ()
' Uma visão geral de console de aplicativos do Visual Basic antes de
- ' mergulharmos mais profundamente na linguagem
+ ' mergulharmos mais profundamente na linguagem.
' Aspas simples começam comentários.
- ' Para Navegar este tutorial dentro do compilador do Visual Basic,
+ ' Para navegar neste tutorial dentro do compilador do Visual Basic,
' eu criei um sistema de navegação.
' Este sistema de navegação vai ser explicado conforme avançarmos no
' tutorial, e você vai entender o que isso significa.
@@ -93,16 +93,16 @@ module Module1
Private Sub HelloWorldInput ()
Console.Title = " Olá Mundo YourName | Saiba X em Y Minutes"
' Variáveis
- 'Os dados inseridos por um usuário precisa ser armazenada .
+ 'Os dados inseridos por um usuário precisam ser armazenados.
' As variáveis ​​também começar com um Dim e terminar com um Como VariableType .
- ' Neste tutorial, nós queremos saber o que o seu nome, e faça o programa
+ ' Neste tutorial, nós queremos saber qual é o seu nome, e faça o programa
' Responder ao que é dito.
Nome de usuário Dim As String
" Nós usamos string como string é uma variável de texto baseado .
Console.WriteLine (" Olá, Qual é o seu nome? ") ' Peça ao usuário seu nome.
- username = Console.ReadLine () ' armazena o nome usuários.
- Console.WriteLine (" Olá " + nome do usuário) " A saída é Olá ' Seu nome '
+ username = Console.ReadLine () ' armazena o nome do usuário.
+ Console.WriteLine (" Olá " + username) ' A saída é "Olá < seu nome >".
Console.ReadLine () ' Outsputs acima.
' O código acima irá lhe fazer uma pergunta seguiu imprimindo sua resposta.
" Outras variáveis ​​incluem Integer e usamos inteiro para números inteiros.
diff --git a/pt-br/whip-pt.html.markdown b/pt-br/whip-pt.html.markdown
new file mode 100644
index 00000000..989bae05
--- /dev/null
+++ b/pt-br/whip-pt.html.markdown
@@ -0,0 +1,247 @@
+---
+language: whip
+contributors:
+ - ["Tenor Biel", "http://github.com/L8D"]
+ - ["Saurabh Sandav", "http://github.com/SaurabhSandav"]
+author: Tenor Biel
+author_url: http://github.com/L8D
+translators:
+ - ["Paulo Henrique Rodrigues Pinheiro", "https://github.com/paulohrpinheiro"]
+lang: pt-br
+filename: whip-pt.lisp
+---
+
+Whip é um dialeto de Lisp feito para construir scripts e trabalhar com
+conceitos mais simples.
+Ele também copia muitas funções e sintaxe de Haskell (uma linguagem não correlata)
+
+Esse documento foi escrito pelo próprio autor da linguagem. Então é isso.
+
+```scheme
+; Comentário são como em Lisp. Pontos-e-vírgulas...
+
+; A maioria das declarações de primeiro nível estão dentro de "listas"
+; que nada mais são que coisas entre parêntesis separadas por espaços em branco
+nao_é_uma_lista
+(uma lista)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; 1. Números, texto e operadores
+
+; Whip tem um tipo numérico (que é um double de 64 bits IEE 754, do JavaScript)
+3 ; => 3
+1.5 ; => 1.5
+
+; Funções são chamadas se elas são o primeiro elemento em uma lista
+(funcao_chamada argumentos)
+
+; A maioria das operações são feitas com funções
+; Todas as funções aritméticas básicas são bem diretas
+(+ 1 1) ; => 2
+(- 2 1) ; => 1
+(* 1 2) ; => 2
+(/ 2 1) ; => 2
+; até mesmo o módulo
+(% 9 4) ; => 1
+; Divisão não inteira ao estilo JavaScript.
+(/ 5 2) ; => 2.5
+
+; Aninhamento de listas funciona como esperado.
+(* 2 (+ 1 3)) ; => 8
+
+; Há um tipo boleano.
+true
+false
+
+; Textos são criados com ".
+"Hello, world"
+
+; Caracteres são criados com '.
+'a'
+
+; Para negação usa-se a função 'not'.
+(not true) ; => false
+(not false) ; => true
+
+; Mas a maioria das funções não-haskell tem atalhos
+; o não atalho é um '!'.
+(! (! true)) ; => true
+
+; Igualdade é `equal` ou `=`.
+(= 1 1) ; => true
+(equal 2 1) ; => false
+
+; Por exemplo, inigualdade pode ser verificada combinando as funções
+;`not` e `equal`.
+(! (= 2 1)) ; => true
+
+; Mais comparações
+(< 1 10) ; => true
+(> 1 10) ; => false
+; e suas contra partes para texto.
+(lesser 1 10) ; => true
+(greater 1 10) ; => false
+
+; Texto pode ser concatenado com +.
+(+ "Hello " "world!") ; => "Hello world!"
+
+; Você pode usar as características comparativas do JavaScript.
+(< 'a' 'b') ; => true
+; ... e coerção de tipos
+(= '5' 5)
+
+; As funções `at` ou `@` acessarão caracteres de um texto, começando em 0.
+(at 0 'a') ; => 'a'
+(@ 3 "foobar") ; => 'b'
+
+; Também existem as variáveis `null` e `undefined`.
+null ; usada para indicar a ausência de algum valor
+undefined ; usada para indicar que um valor não foi informado
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; 2. Variáveis, matrizes e dicionários
+
+; Variáveis são declaradas com as funções `def` ou `let`.
+; Variáveis que não tiveram valor atribuído serão `undefined`.
+(def some_var 5)
+; `def` deixará a variável no contexto global.
+; `let` deixará a variável no contexto local, e tem uma sintaxe estranha.
+(let ((a_var 5)) (+ a_var 5)) ; => 10
+(+ a_var 5) ; = undefined + 5 => undefined
+
+; Matrizes são listas de valores de qualquer tipo.
+; Elas basicamente são listas sem funções no início
+(1 2 3) ; => [1, 2, 3] (sintaxe JavaScript)
+
+; Dicionários em Whip são o equivalente a 'object' em JavaScript ou
+; 'dict' em python ou 'hash' em Ruby: eles s]ão uma coleção desordenada
+de pares chave-valor.
+{"key1" "value1" "key2" 2 3 3}
+
+; Chaves podem ser apenas identificadores, números ou texto.
+(def my_dict {my_key "my_value" "my other key" 4})
+; Mas em Whip, dicionários são parceados como: valor, espaço, valor;
+; com mais espaço entre cada. Então isso significa que
+{"key" "value"
+"another key"
+1234
+}
+é avaliado da mesma forma que
+{"key" "value" "another key" 1234}
+
+; Dicionários podem ser acessados usando a função `at`
+; (como em texto e listas)
+(@ "my other key" my_dict) ; => 4
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; 3. Lógica e controle de fluxo
+
+; A função `if` é muito simples, ainda que muito diferente do que em muitas
+linguagens imperativas.
+(if true "returned if first arg is true" "returned if first arg is false")
+; => "returned if first arg is true"
+
+; E por conta do legado operador ternário
+; `?` é o atalho não utilizado para `if`.
+(? false true false) ; => false
+
+; `both` é uma declaração lógica `and`, e `either` é o `or` lógico.
+(both true true) ; => true
+(both true false) ; => false
+(either true false) ; => true
+(either false false) ; => false
+; E seus atalhos são
+; & => both
+; ^ => either
+(& true true) ; => true
+(^ false true) ; => true
+
+;;;;;;;;;
+; Lambdas
+
+; Lambdas em Whip são declaradas com as funções `lambda` ou `->`.
+; E funções são na verdade lambdas com nomes.
+(def my_function (-> (x y) (+ (+ x y) 10)))
+; | | | |
+; | | | valor retornado (com escopo contento argumentos)
+; | | argumentos
+; | declaração de funções lambda
+; |
+; nome do lambda a ser declarado
+
+(my_function 10 10) ; = (+ (+ 10 10) 10) => 30
+
+; Obviamente, todos os lambdas por definição são anônimos e
+; tecnicamente sempre usados anonimamente. Redundância.
+((lambda (x) x) 10) ; => 10
+
+;;;;;;;;;;;;;;;;
+; Comprehensions
+
+; `range` or `..` geram uma lista dos números para
+; cada número entre seus dois argumentos.
+(range 1 5) ; => (1 2 3 4 5)
+(.. 0 2) ; => (0 1 2)
+
+; `map` aplica seu primeiro argumento (que deve ser um lambda/função)
+; a cada item dos argumentos seguintes (que precisa ser uma lista)
+(map (-> (x) (+ x 1)) (1 2 3)) ; => (2 3 4)
+
+; Reduce
+(reduce + (.. 1 5))
+; equivalente a
+((+ (+ (+ 1 2) 3) 4) 5)
+
+; Nota: map e reduce não possuem atalhos
+
+; `slice` ou `\` é similar ao .slice() do JavaScript
+; mas veja que ele pega uma lista como primeiro argumento, não o último.
+(slice (.. 1 5) 2) ; => (3 4 5)
+(\ (.. 0 100) -5) ; => (96 97 98 99 100)
+
+; `append` ou `<<` são auto explicativos
+(append 4 (1 2 3)) ; => (1 2 3 4)
+(<< "bar" ("foo")) ; => ("foo" "bar")
+
+; Length é auto explicativo.
+(length (1 2 3)) ; => 3
+(_ "foobar") ; => 6
+
+;;;;;;;;;;;;;;;
+; Delicadezas Haskell
+
+; Primeiro item de uma lista
+(head (1 2 3)) ; => 1
+; Pega do segundo ao último elemento de uma lista
+(tail (1 2 3)) ; => (2 3)
+; Último item de uma lista
+(last (1 2 3)) ; => 3
+; Contrário de `tail`
+(init (1 2 3)) ; => (1 2)
+; Pega do primeiro até o elemento especificado da lista
+(take 1 (1 2 3 4)) ; (1 2)
+; Contrário de `take`
+(drop 1 (1 2 3 4)) ; (3 4)
+; Menos valor em uma lista
+(min (1 2 3 4)) ; 1
+; Maior valor em uma lista
+(max (1 2 3 4)) ; 4
+; Verifica se o valor está em uma lista ou objeto
+(elem 1 (1 2 3)) ; true
+(elem "foo" {"foo" "bar"}) ; true
+(elem "bar" {"foo" "bar"}) ; false
+; Inverte a ordem de uma lista
+(reverse (1 2 3 4)) ; => (4 3 2 1)
+; Verifica se o valor é par ou ímpar
+(even 1) ; => false
+(odd 1) ; => true
+; Separa um texto cortando por espaço em branco
+(words "foobar nachos cheese") ; => ("foobar" "nachos" "cheese")
+; Junta lista de textos
+(unwords ("foo" "bar")) ; => "foobar"
+; Sucessor e predecessor
+(pred 21) ; => 20
+(succ 20) ; => 21
+```
+
+Para mais informação, verifique o [repositório](http://github.com/L8D/whip)
diff --git a/python3.html.markdown b/python3.html.markdown
index 5aa61b65..37987582 100644
--- a/python3.html.markdown
+++ b/python3.html.markdown
@@ -669,7 +669,7 @@ class Human:
# An instance method. All methods take "self" as the first argument
def say(self, msg):
- print ("{name}: {message}".format(name=self.name, message=msg))
+ print("{name}: {message}".format(name=self.name, message=msg))
# Another instance method
def sing(self):
@@ -740,10 +740,105 @@ if __name__ == '__main__':
####################################################
-## 6.1 Multiple Inheritance
+## 6.1 Inheritance
+####################################################
+
+# Inheritance allows new child classes to be defined that inherit methods and
+# variables from their parent class.
+
+# Using the Human class defined above as the base or parent class, we can
+# define a child class, Superhero, which inherits the class variables like
+# "species", "name", and "age", as well as methods, like "sing" and "grunt"
+# from the Human class, but can also have its own unique properties.
+
+# To take advantage of modularization by file you could place the classes above in their own files,
+# say, human.py
+
+# To import functions from other files use the following format
+# from "filename-without-extension" import "function-or-class"
+
+from human import Human
+
+
+# Specify the parent class(es) as parameters to the class definition
+class Superhero(Human):
+
+ # If the child class should inherit all of the parent's definitions without
+ # any modifications, you can just use the "pass" keyword (and nothing else)
+ # but in this case it is commented out to allow for a unique child class:
+ # pass
+
+ # Child classes can override their parents' attributes
+ species = 'Superhuman'
+
+ # Children automatically inherit their parent class's constructor including
+ # its arguments, but can also define additional arguments or definitions
+ # and override its methods such as the class constructor.
+ # This constructor inherits the "name" argument from the "Human" class and
+ # adds the "superpower" and "movie" arguments:
+ def __init__(self, name, movie=False,
+ superpowers=["super strength", "bulletproofing"]):
+
+ # add additional class attributes:
+ self.fictional = True
+ self.movie = movie
+ self.superpowers = superpowers
+
+ # The "super" function lets you access the parent class's methods
+ # that are overridden by the child, in this case, the __init__ method.
+ # This calls the parent class constructor:
+ super().__init__(name)
+
+ # overload the sing method
+ def sing(self):
+ return 'Dun, dun, DUN!'
+
+ # add an additional class method
+ def boast(self):
+ for power in self.superpowers:
+ print("I wield the power of {pow}!".format(pow=power))
+
+
+if __name__ == '__main__':
+ sup = Superhero(name="Tick")
+
+ # Instance type checks
+ if isinstance(sup, Human):
+ print('I am human')
+ if type(sup) is Superhero:
+ print('I am a superhero')
+
+ # Get the Method Resolution search Order used by both getattr() and super()
+ # This attribute is dynamic and can be updated
+ print(Superhero.__mro__) # => (<class '__main__.Superhero'>,
+ # => <class 'human.Human'>, <class 'object'>)
+
+ # Calls parent method but uses its own class attribute
+ print(sup.get_species()) # => Superhuman
+
+ # Calls overloaded method
+ print(sup.sing()) # => Dun, dun, DUN!
+
+ # Calls method from Human
+ sup.say('Spoon') # => Tick: Spoon
+
+ # Call method that exists only in Superhero
+ sup.boast() # => I wield the power of super strength!
+ # => I wield the power of bulletproofing!
+
+ # Inherited class attribute
+ sup.age = 31
+ print(sup.age) # => 31
+
+ # Attribute that only exists within Superhero
+ print('Am I Oscar eligible? ' + str(sup.movie))
+
+####################################################
+## 6.2 Multiple Inheritance
####################################################
# Another class definition
+# bat.py
class Bat:
species = 'Baty'
@@ -765,21 +860,14 @@ if __name__ == '__main__':
print(b.say('hello'))
print(b.fly)
-# To take advantage of modularization by file you could place the classes above in their own files,
-# say, human.py and bat.py
-
-# To import functions from other files use the following format
-# from "filename-without-extension" import "function-or-class"
+# And yet another class definition that inherits from Superhero and Bat
# superhero.py
-from human import Human
+from superhero import Superhero
from bat import Bat
-# Batman inherits from both Human and Bat
-class Batman(Human, Bat):
-
- # Batman has its own value for the species class attribute
- species = 'Superhero'
+# Define Batman as a child that inherits from both Superhero and Bat
+class Batman(Superhero, Bat):
def __init__(self, *args, **kwargs):
# Typically to inherit attributes you have to call super:
@@ -789,7 +877,8 @@ class Batman(Human, Bat):
# So instead we explicitly call __init__ for all ancestors.
# The use of *args and **kwargs allows for a clean way to pass arguments,
# with each parent "peeling a layer of the onion".
- Human.__init__(self, 'anonymous', *args, **kwargs)
+ Superhero.__init__(self, 'anonymous', movie=True,
+ superpowers=['Wealthy'], *args, **kwargs)
Bat.__init__(self, *args, can_fly=False, **kwargs)
# override the value for the name attribute
self.name = 'Sad Affleck'
@@ -801,20 +890,15 @@ class Batman(Human, Bat):
if __name__ == '__main__':
sup = Batman()
- # Instance type checks
- if isinstance(sup, Human):
- print('I am human')
- if isinstance(sup, Bat):
- print('I am bat')
- if type(sup) is Batman:
- print('I am Batman')
-
# Get the Method Resolution search Order used by both getattr() and super().
# This attribute is dynamic and can be updated
- print(Batman.__mro__) # => (<class '__main__.Batman'>, <class 'human.Human'>, <class 'bat.Bat'>, <class 'object'>)
+ print(Batman.__mro__) # => (<class '__main__.Batman'>,
+ # => <class 'superhero.Superhero'>,
+ # => <class 'human.Human'>,
+ # => <class 'bat.Bat'>, <class 'object'>)
# Calls parent method but uses its own class attribute
- print(sup.get_species()) # => Superhero
+ print(sup.get_species()) # => Superhuman
# Calls overloaded method
print(sup.sing()) # => nan nan nan nan nan batman!
@@ -827,10 +911,10 @@ if __name__ == '__main__':
# Inherited class attribute
sup.age = 100
- print(sup.age)
+ print(sup.age) # => 100
# Inherited attribute from 2nd ancestor whose default value was overridden.
- print('Can I fly? ' + str(sup.fly))
+ print('Can I fly? ' + str(sup.fly)) # => Can I fly? False
diff --git a/typescript.html.markdown b/typescript.html.markdown
index 44fd791a..10f01ebc 100644
--- a/typescript.html.markdown
+++ b/typescript.html.markdown
@@ -9,7 +9,7 @@ TypeScript is a language that aims at easing development of large scale applicat
TypeScript adds common concepts such as classes, modules, interfaces, generics and (optional) static typing to JavaScript.
It is a superset of JavaScript: all JavaScript code is valid TypeScript code so it can be added seamlessly to any project. The TypeScript compiler emits JavaScript.
-This article will focus only on TypeScript extra syntax, as opposed to [JavaScript](javascript.html.markdown).
+This article will focus only on TypeScript extra syntax, as opposed to [JavaScript](/docs/javascript).
To test TypeScript's compiler, head to the [Playground] (http://www.typescriptlang.org/Playground) where you will be able to type code, have auto completion and directly see the emitted JavaScript.
diff --git a/vi-vn/less-vi.html.markdown b/vi-vn/less-vi.html.markdown
new file mode 100644
index 00000000..594ccc31
--- /dev/null
+++ b/vi-vn/less-vi.html.markdown
@@ -0,0 +1,395 @@
+---
+language: less
+contributors:
+ - ["Saravanan Ganesh", "http://srrvnn.me"]
+translators:
+ - ["Thanh Duy Phan", "https://github.com/thanhpd"]
+filename: learnless-vi.less
+lang: vi-vn
+---
+
+Less là một CSS pre-processor (bộ tiền xử lí CSS), nó thêm các tính năng như biến (variable), lồng (nesting), mixin và nhiều thứ khác. Less cùng với các CSS pre-processor khác như [Sass](http://sass-lang.com/) giúp lập trình viên viết được các đoạn CSS bảo trì được và không bị lặp lại (DRY - Don't Repeat Yourself).
+
+```css
+
+
+// Comment (chú thích) một dòng sẽ bị xóa khi Less được biên dịch thành CSS
+
+/* Comment trên nhiều dòng sẽ được giữ lại */
+
+
+
+/* Biến
+==============================*/
+
+
+/* Ta có thể lưu giá trị CSS (ví dụ như color) vào một biến.
+ Sử dụng ký hiệu '@' để khai báo một biến. */
+
+@primary-color: #a3a4ff;
+@secondary-color: #51527f;
+@body-font: 'Roboto', sans-serif;
+
+/* Sau khi khai báo biến, ta có thể sử dụng nó ở trong tệp stylesheet.
+ Nhờ sử dụng biến ta chỉ cần thay đổi một lần
+ tại 1 nơi để thay đổi tất cả những đoạn sử dụng biến */
+
+body {
+ background-color: @primary-color;
+ color: @secondary-color;
+ font-family: @body-font;
+}
+
+/* Đoạn code trên sẽ được biên dịch thành: */
+
+body {
+ background-color: #a3a4ff;
+ color: #51527F;
+ font-family: 'Roboto', sans-serif;
+}
+
+
+/* Cách sử dụng này giúp ta dễ dàng bảo trì hơn
+ việc phải đổi giá trị mỗi lần nó xuất hiện
+ trong tệp stylesheet. */
+
+
+
+/* Mixins
+==============================*/
+
+
+/* Nếu đang viết một đoạn code cho nhiều hơn một
+ element, ta có thể sử dụng lại nó dễ dàng. */
+
+.center {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ left: 0;
+ right: 0;
+}
+
+/* Ta có thể dùng mixin chỉ bằng việc thêm selector
+ vào trong nội dung style của element khác */
+
+div {
+ .center;
+ background-color: @primary-color;
+}
+
+/* Đoạn code trên sẽ được biên dịch thành: */
+
+.center {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ left: 0;
+ right: 0;
+}
+div {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ left: 0;
+ right: 0;
+ background-color: #a3a4ff;
+}
+
+/* Ta có thể ngăn không cho code mixin được biên dịch
+ bằng cách thêm cặp ngoặc tròn đằng sau selector */
+
+.center() {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ left: 0;
+ right: 0;
+}
+
+div {
+ .center;
+ background-color: @primary-color;
+}
+
+/* Đoạn code trên sẽ được biên dịch thành: */
+div {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ left: 0;
+ right: 0;
+ background-color: #a3a4ff;
+}
+
+
+
+/* Nesting - Lồng
+==============================*/
+
+
+/* Less cho phép ta có thể lồng selector bên trong selector */
+
+ul {
+ list-style-type: none;
+ margin-top: 2em;
+
+ li {
+ background-color: #f00;
+ }
+}
+
+/* Selector bắt đầu bằng ký tự '&' sẽ thay thế ký tự '&'
+ với selector cha. */
+/* Ta cũng có thể lồng các pseudo-class với nhau */
+/* Nên lưu ý không nên lồng quá nhiều lần sẽ làm code kém tính bảo trì.
+ Kinh nghiệm cho thấy không nên lồng quá 3 lần.
+ Ví dụ: */
+
+ul {
+ list-style-type: none;
+ margin-top: 2em;
+
+ li {
+ background-color: red;
+
+ &:hover {
+ background-color: blue;
+ }
+
+ a {
+ color: white;
+ }
+ }
+}
+
+/* Biên dịch thành: */
+
+ul {
+ list-style-type: none;
+ margin-top: 2em;
+}
+
+ul li {
+ background-color: red;
+}
+
+ul li:hover {
+ background-color: blue;
+}
+
+ul li a {
+ color: white;
+}
+
+
+
+/* Function
+==============================*/
+
+
+/* Less cung cấp các function có thể được dùng để hoàn thành
+ các công việc khác nhau. */
+
+/* Function được gọi sử dụng tên của nó và truyền vào
+ các tham số được yêu cầu. */
+
+body {
+ width: round(10.25px);
+}
+
+.header {
+ background-color: lighten(#000, 0.5);
+}
+
+.footer {
+ background-color: fadeout(#000, 0.25)
+}
+
+/* Biên dịch thành: */
+
+body {
+ width: 10px;
+}
+
+.header {
+ background-color: #010101;
+}
+
+.footer {
+ background-color: rgba(0, 0, 0, 0.75);
+}
+
+/* Ta có thể định nghĩa function mới.
+ Function khá tương tự với mixin bởi chúng đều có thể được tái
+ sử dụng. Khi lựa chọn giữa việc sử dụng function hay mixin,
+ hãy nhớ mixin được tối ưu cho việc tạo ra CSS trong khi
+ function sẽ được sử dụng tốt hơn cho logic sẽ được sử dụng
+ xuyên suốt Less code. Các ví dụ trong phần 'Toán tử' là ứng cử viên
+ sáng giá cho việc dùng function có thể tái sử dụng được.
+*/
+
+/* Function này tính giá trị trung bình của hai số: */
+.average(@x, @y) {
+ @average-result: ((@x + @y) / 2);
+}
+
+div {
+ .average(16px, 50px); // gọi mixin
+ padding: @average-result; // sử dụng giá trị trả về của mixin
+}
+
+/* Biên dịch thành: */
+
+div {
+ padding: 33px;
+}
+
+
+
+/* Mở rộng (Thừa kế)
+==============================*/
+
+
+/* Mở rộng là cách để chia sẻ thuộc tính của một selector cho selector khác */
+
+.display {
+ height: 50px;
+}
+
+.display-success {
+ &:extend(.display);
+ border-color: #22df56;
+}
+
+/* Biên dịch thành: */
+.display,
+.display-success {
+ height: 50px;
+}
+.display-success {
+ border-color: #22df56;
+}
+
+/* Nên mở rộng một khai báo CSS có trước thay vì tạo một mixin mới
+ bởi cách nó nhóm các lớp có chung một style gốc.
+ Nếu thực hiện với mixin, các thuộc tính sẽ bị trùng lặp
+ cho mỗi khai báo có sử dụng mixin. Mặc dù không ảnh hưởng đến luồng công việc nhưng nó
+ tạo ra các đoạn code CSS thừa sau khi được biên dịch.
+*/
+
+
+/* Partials and Imports - Chia nhỏ và nhập vào
+==============================*/
+
+
+/* Less cho phép ta tạo các partial file (tệp con).
+ Sử dụng nó giúp ta có thể tổ chức code Less theo mô-đun có hệ thống.
+ Các tệp con thường bắt đầu với ký tự gạch dưới '_', vd: _reset.less
+ và được nhập vào file Less chính để được biên dịch thành CSS */
+
+/* Quan sát ví dụ sau, ta sẽ đặt đoạn code dưới đây vào tệp tên là _reset.less */
+
+html,
+body,
+ul,
+ol {
+ margin: 0;
+ padding: 0;
+}
+
+/* Less cung cấp cú pháp @import cho phép nhập các partial vào một file.
+ Cú pháp này trong Less sẽ nhập các file và kết hợp chúng lại với
+ code CSS được sinh ra. Nó khác với cú pháp @import của CSS,
+ bản chất là tạo một HTTP request mới để tải về tệp tin được yêu cầu. */
+
+@import 'reset';
+
+body {
+ font-size: 16px;
+ font-family: Helvetica, Arial, Sans-serif;
+}
+
+/* Biên dịch thành: */
+
+html, body, ul, ol {
+ margin: 0;
+ padding: 0;
+}
+
+body {
+ font-size: 16px;
+ font-family: Helvetica, Arial, Sans-serif;
+}
+
+
+
+/* Toán học
+==============================*/
+
+
+/* Less cung cấp các toán tử sau: +, -, *, / và %.
+ Điều này rất có ích cho việc tính toán giá trị trực tiếp
+ trong tệp Less thay vì phải tính toán thủ công.
+ Dưới đây là ví dụ về việc tạo một khung thiết kế đơn giản có hai cột. */
+
+@content-area: 960px;
+@main-content: 600px;
+@sidebar-content: 300px;
+
+@main-size: @main-content / @content-area * 100%;
+@sidebar-size: @sidebar-content / @content-area * 100%;
+@gutter: 100% - (@main-size + @sidebar-size);
+
+body {
+ width: 100%;
+}
+
+.main-content {
+ width: @main-size;
+}
+
+.sidebar {
+ width: @sidebar-size;
+}
+
+.gutter {
+ width: @gutter;
+}
+
+/* Biên dịch thành: */
+
+body {
+ width: 100%;
+}
+
+.main-content {
+ width: 62.5%;
+}
+
+.sidebar {
+ width: 31.25%;
+}
+
+.gutter {
+ width: 6.25%;
+}
+
+
+```
+
+## Tập sử dụng Less
+
+Nếu bạn cần xài thử Less trên trình duyệt, hãy ghé qua:
+* [Codepen](http://codepen.io/)
+* [LESS2CSS](http://lesscss.org/less-preview/)
+
+## Tính tương thích
+
+Less có thể được dùng trong bất kì dự án nào miễn là ta có chương trình để biên dịch nó thành CSS. Ta cần chắc chắn rằng đoạn CSS đang dùng tương thích với các phiên bản trình duyệt mong muốn.
+
+[QuirksMode CSS](http://www.quirksmode.org/css/) và [CanIUse](http://caniuse.com) là nguồn thông tin tin cậy để kiểm tra tính tương thích của mã CSS.
+
+## Tìm hiểu thêm
+* [Tài liệu chính thức](http://lesscss.org/features/)
+* [Less CSS - Hướng dẫn cho người mới bắt đầu](http://www.hongkiat.com/blog/less-basic/) \ No newline at end of file
diff --git a/vi-vn/typescript-vi.html.markdown b/vi-vn/typescript-vi.html.markdown
new file mode 100644
index 00000000..ba459c11
--- /dev/null
+++ b/vi-vn/typescript-vi.html.markdown
@@ -0,0 +1,193 @@
+---
+language: TypeScript
+contributors:
+ - ["Philippe Vlérick", "https://github.com/pvlerick"]
+translators:
+ - ["Thanh Duy Phan", "https://github.com/thanhpd"]
+filename: learntypescript-vi.ts
+lang: vi-vn
+---
+
+TypeScript là ngôn ngữ được viết nhằm tinh giản quá trình phát triển ứng dụng quy mô lớn được viết bằng JavaScript.
+TypeScript bổ sung thêm các khái niệm phổ biến như Class, Module, Interface, Generic và Static typing (tùy chọn) vào JavaScript.
+Ngôn ngữ này là tập lớn hơn của JavaScript: tất cả code JavaScript đều là code TypeScript đúng nên nó có thể được thêm vào các dự án một cách nhanh chóng. Trình biên dịch TypeScript sẽ sinh ra JavaScript.
+
+Bài viết này sẽ chỉ tập trung tới các cú pháp bổ sung mà TypeScript thêm vào thay vì nói đến cả các cú pháp [JavaScript](javascript-vi.html.markdown).
+
+Để thử dùng TypeScript với trình biên dịch, đi đến [Sân chơi TypeScript](http://www.typescriptlang.org/play) nơi mà bạn có thể nhập code, sử dụng chức năng hỗ trợ tự hoàn thành code - autocompletion và trực tiếp quan sát mã JavaScript được sinh ra.
+
+```ts
+// Đây là 3 khai báo kiểu biến cơ bản trong TypeScript
+// (JavaScript chỉ có kiểu của giá trị, không có kiểu của biến)
+let isDone: boolean = false;
+let lines: number = 42;
+let name: string = "Anders";
+
+// Bạn có thể bỏ khai báo kiểu của biến nếu như nó đã được suy ra từ kiểu giá trị cơ bản
+let isDone = false;
+let lines = 42;
+let name = "Anders";
+
+// Có kiểu biến "any" tương thích với mọi kiểu của biến,
+// được dùng khi ta không chắc chắn về kiểu của biến khi được khai báo
+let notSure: any = 4;
+notSure = "có thể là một biến kiểu string";
+notSure = false; // cũng có thể là biến kiểu boolean
+
+// Dùng từ khóa const cho khái báo biến không thay đổi (constant variable)
+const numLivesForCat = 9;
+numLivesForCat = 1; // Có lỗi!
+
+// Khi khai báo tập hợp ta có thể dùng mảng có kiểu được khai báo trước - typed array
+let list: number[] = [1, 2, 3];
+// Ta cũng có thể sử dụng mảng kiểu chung - generic array
+let list: Array<number> = [1, 2, 3];
+
+// Để dùng enumeration - danh sách của một tập hợp:
+enum Color { Red, Green, Blue };
+let c: Color = Color.Green;
+
+// Nếu function không trả về kết quả, sử dụng "void" cho kết quả trả về
+function bigHorribleAlert(): void {
+ alert("I'm a little annoying box!");
+}
+
+// Function trong TypeScript là first-class citizen (tạm dịch: phần tử hạng nhất), hỗ trợ thao tác tới các thực thể khác
+// (vd: truyền vào như tham số, được trả về từ function, chỉnh sửa, gán vào một biến)
+// TypeScript hỗ trợ sử dụng function với cú pháp lambda (mũi tên) và suy luận kiểu trả về
+
+// Các cú pháp dưới đây tương đương với nhau,
+// trình biên dịch sẽ tự nhận biết và sinh ra mã JavaScript giống nhau
+let f1 = function (i: number): number { return i * i; }
+// Kiểu trả về nếu không khai báo được tự suy diễn
+let f2 = function (i: number) { return i * i; }
+// Cú pháp mũi tên (arrow syntax)
+let f3 = (i: number): number => { return i * i; }
+// Cú pháp mũi tên với kiểu trả về được suy diễn
+let f4 = (i: number) => { return i * i; }
+// Cú pháp mũi tên với kiểu trả về được suy diễn
+// khi không sử dụng dấu ngoặc nhọn {} thì không cần sử dụng return
+let f5 = (i: number) => i * i;
+
+// Interface mang tính cấu trúc, mọi thứ có các đặc điểm (property) đều tương thích
+interface IPerson {
+ name: string;
+ // Đặc điểm có thể tùy chọn bằng sử dụng dấu "?"
+ age?: number;
+ // Có thể sử dụng function
+ move(): void;
+}
+
+// Object sử dụng interface IPerson nói trên
+// có thể được coi là 1 thực thể Person vì nó có đặc điểm name và chức năng move
+let p: Person = { name: "Bobby", move: () => { } };
+// Object sử dụng property tùy chọn
+let validPerson: Person = { name: "Bobby", age: 42, move: () => { } };
+// Khai báo dưới đây gây lỗi vì giá trị đặc điểm age không mang kiểu number
+let invalidPerson: Person = { name: "Bobby", age: true };
+
+// Interface cũng có thể mô tả đặc tả của function
+interface SearchFunc {
+ (source: string, subString: string): boolean;
+}
+// Chỉ có kiểu của tham số là quan trọng còn tên không quan trọng
+let mySearch: SearchFunc;
+mySearch = function (src: string, sub: string) {
+ return src.search(sub) != -1;
+}
+
+// Class - các khai báo mặc định là public
+class Point {
+ // Property
+ x: number;
+
+ // Constructor - sử dụng tham số với từ khóa public/private
+ // sẽ tạo ra property tương ứng (ví dụ với property y)
+ // Có thể khai báo giá trị mặc định
+
+ constructor(x: number, public y: number = 0) {
+ this.x = x;
+ }
+
+ // Function
+ dist() { return Math.sqrt(this.x * this.x + this.y * this.y); }
+
+ // Biến Static
+ static origin = new Point(0, 0);
+}
+
+let p1 = new Point(10, 20);
+let p2 = new Point(25); // y sử dụng giá trị mặc định là 0
+
+// Thừa kế - Inheritance
+class Point3D extends Point {
+ constructor(x: number, y: number, public z: number = 0) {
+ super(x, y); // Bắt buộc phải gọi constructor của class cha
+ }
+
+ // Overwrite/Polymorphism - Ghi đè/Đa hình
+ dist() {
+ let d = super.dist();
+ return Math.sqrt(d * d + this.z * this.z);
+ }
+}
+
+// module, "." có thể được dùng như những module con
+module Geometry {
+ export class Square {
+ constructor(public sideLength: number = 0) {
+ }
+ area() {
+ return Math.pow(this.sideLength, 2);
+ }
+ }
+}
+
+let s1 = new Geometry.Square(5);
+
+// Bí danh (alias) có thể được sử dụng để tham vấn module khác
+import G = Geometry;
+
+let s2 = new G.Square(10);
+
+// Generic
+// Class
+class Tuple<T1, T2> {
+ constructor(public item1: T1, public item2: T2) {
+ }
+}
+
+// Interface
+interface Pair<T> {
+ item1: T;
+ item2: T;
+}
+
+// Function
+let pairToTuple = function <T>(p: Pair<T>) {
+ return new Tuple(p.item1, p.item2);
+};
+
+let tuple = pairToTuple({ item1: "hello", item2: "world" });
+
+// Các thư viện viết bằng JavaScript thường đi kèm file định nghĩa kiểu để có thể sử dụng cho TypeScript
+// Thêm vào tham vấn tới file định nghĩa:
+/// <reference path="jquery.d.ts" />
+
+// Template Strings - Chuỗi dạng mẫu (string sử dụng dấu `)
+// String Interpolation - Nội suy chuỗi with với template string
+let name = 'Tyrone';
+let greeting = `Chào ${name}, bạn khỏe không?`
+// Chuỗi nhiều dòng với template string
+let multiline = `Đây là ví dụ
+cho chuỗi nhiều dòng`;
+
+```
+
+## Tìm hiểu thêm
+
+* [Website TypeScript chính thức](http://www.typescriptlang.org/)
+* [Đặc tả ngôn ngữ TypeScript] (https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md)
+* [Anders Hejlsberg - Introducing TypeScript on Channel 9] (http://channel9.msdn.com/posts/Anders-Hejlsberg-Introducing-TypeScript)
+* [Mã nguồn trên GitHub] (https://github.com/Microsoft/TypeScript)
+* [Definitely Typed - repository for type definitions] (http://definitelytyped.org/)
diff --git a/whip.html.markdown b/whip.html.markdown
index e7e5e427..c692714a 100644
--- a/whip.html.markdown
+++ b/whip.html.markdown
@@ -3,6 +3,7 @@ language: whip
contributors:
- ["Tenor Biel", "http://github.com/L8D"]
- ["Saurabh Sandav", "http://github.com/SaurabhSandav"]
+ - ["Paulo Henrique Rodrigues Pinheiro", "https://github.com/paulohrpinheiro"]
author: Tenor Biel
author_url: http://github.com/L8D
filename: whip.lisp
@@ -232,6 +233,7 @@ undefined ; user to indicate a value that hasn't been set
(words "foobar nachos cheese") ; => ("foobar" "nachos" "cheese")
; Join list of strings together.
(unwords ("foo" "bar")) ; => "foobar"
+; Successor and Predecessor
(pred 21) ; => 20
(succ 20) ; => 21
```
diff --git a/zh-cn/go-cn.html.markdown b/zh-cn/go-cn.html.markdown
index 75498367..37b4b137 100644
--- a/zh-cn/go-cn.html.markdown
+++ b/zh-cn/go-cn.html.markdown
@@ -142,6 +142,7 @@ func learnTypes() {
func learnNamedReturns(x, y int) (z int) {
z = x * y
return // z is implicit here, because we named it earlier.
+}
// Go全面支持垃圾回收。Go有指针,但是不支持指针运算。
// 你会因为空指针而犯错,但是不会因为增加指针而犯错。