summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJulien M'Poy <julien.mpoy@gmail.com>2017-11-08 13:29:24 +0100
committerJulien M'Poy <julien.mpoy@gmail.com>2017-11-08 13:29:24 +0100
commit5e81853768c0f3cc55c05e0dfec18773045df952 (patch)
treeb62c3fb0bfc6de3318e962b330e163f3d65cdfa6
parent20893f5d83b4f7a1585bac9e7656d6af46183262 (diff)
parent6ce71c56d6affb57a3537a2732485a4918306d4b (diff)
Merge remote-tracking branch 'upstream/master'
-rw-r--r--CHICKEN.html.markdown4
-rw-r--r--awk.html.markdown4
-rw-r--r--bash.html.markdown2
-rw-r--r--c.html.markdown2
-rw-r--r--ca-es/groovy-ca.html.markdown4
-rw-r--r--chapel.html.markdown30
-rw-r--r--clojure-macros.html.markdown2
-rw-r--r--csharp.html.markdown209
-rw-r--r--de-de/LOLCODE-de.html.markdown188
-rw-r--r--de-de/edn-de.html.markdown112
-rw-r--r--de-de/git-de.html.markdown6
-rw-r--r--de-de/html-de.html.markdown4
-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--de-de/swift-de.html.markdown32
-rw-r--r--dynamic-programming.html.markdown2
-rw-r--r--edn.html.markdown32
-rw-r--r--es-es/groovy-es.html.markdown4
-rw-r--r--es-es/learnsmallbasic-es.html.markdown132
-rw-r--r--es-es/swift-es.html.markdown30
-rw-r--r--forth.html.markdown2
-rw-r--r--fr-fr/d-fr.html.markdown (renamed from fr-fr/d.html.markdown)0
-rw-r--r--fr-fr/haskell-fr.html.markdown (renamed from fr-fr/haskell.html.markdown)0
-rw-r--r--fr-fr/java-fr.html.markdown939
-rw-r--r--fr-fr/markdown-fr.html.markdown (renamed from fr-fr/markdown.html.markdown)0
-rw-r--r--fr-fr/scala-fr.html.markdown (renamed from fr-fr/scala.html.markdown)0
-rw-r--r--fr-fr/vim-fr.html.markdown (renamed from fr-fr/vim.html.markdown)0
-rw-r--r--git.html.markdown4
-rw-r--r--groovy.html.markdown4
-rw-r--r--haxe.html.markdown4
-rw-r--r--html.html.markdown2
-rw-r--r--id-id/bf-id.html.markdown86
-rw-r--r--id-id/rst-id.html.markdown122
-rw-r--r--it-it/go-it.html.markdown44
-rw-r--r--it-it/html-it.html.markdown121
-rw-r--r--it-it/markdown.html.markdown194
-rw-r--r--it-it/rst-it.html.markdown111
-rw-r--r--java.html.markdown53
-rw-r--r--javascript.html.markdown24
-rw-r--r--nim.html.markdown23
-rw-r--r--nix.html.markdown6
-rw-r--r--pt-br/amd-pt.html.markdown (renamed from pt-br/amd.html.markdown)2
-rw-r--r--pt-br/asciidoc-pt.html.markdown2
-rw-r--r--pt-br/asymptotic-notation-pt.html.markdown2
-rw-r--r--pt-br/asymptoticnotation-pt.html.markdown161
-rw-r--r--pt-br/awk-pt.html.markdown376
-rw-r--r--pt-br/bf-pt.html.markdown (renamed from pt-br/bf.html.markdown)0
-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.markdown (renamed from pt-br/csharp.html.markdown)36
-rw-r--r--pt-br/css-pt.html.markdown2
-rw-r--r--pt-br/dynamic-programming-pt.html.markdown10
-rw-r--r--pt-br/elixir-pt.html.markdown (renamed from pt-br/elixir.html.markdown)0
-rw-r--r--pt-br/groovy-pt.html.markdown4
-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/pyqt-pt.html.markdown92
-rw-r--r--pt-br/qt-pt.html.markdown174
-rw-r--r--pt-br/rust-pt.html.markdown (renamed from rust-pt.html.markdown)0
-rw-r--r--pt-br/swift-pt.html.markdown10
-rw-r--r--pt-br/visualbasic-pt.html.markdown12
-rw-r--r--pt-br/whip-pt.html.markdown247
-rw-r--r--pt-pt/bf-pt.html.markdown (renamed from pt-pt/bf.html.markdown)0
-rw-r--r--pt-pt/swift-pt.html.markdown (renamed from pt-pt/swift.html.markdown)32
-rw-r--r--python.html.markdown6
-rw-r--r--python3.html.markdown136
-rw-r--r--r.html.markdown3
-rw-r--r--ru-ru/haml-ru.html.markdown233
-rw-r--r--ru-ru/php-ru.html.markdown2
-rw-r--r--ru-ru/ruby-ru.html.markdown5
-rw-r--r--ru-ru/swift-ru.html.markdown38
-rw-r--r--sk-sk/bash-sk.html.markdown (renamed from sk-sk/bash.html.markdown)0
-rw-r--r--sk-sk/coffeescript-sk.html.markdown (renamed from sk-sk/coffeescript.html.markdown)0
-rw-r--r--sk-sk/elixir-sk.html.markdown (renamed from sk-sk/elixir.html.markdown)0
-rw-r--r--sk-sk/git-sk.html.markdown (renamed from sk-sk/git.html.markdown)0
-rw-r--r--sk-sk/json-sk.html.markdown (renamed from sk-sk/json.html.markdown)0
-rw-r--r--sk-sk/latex-sk.html.markdown.tex (renamed from sk-sk/latex.html.markdown.tex)0
-rw-r--r--sk-sk/ruby-sk.html.markdown (renamed from sk-sk/ruby.html.markdown)0
-rw-r--r--smalltalk.html.markdown4
-rw-r--r--swift.html.markdown38
-rw-r--r--tr-tr/swift-tr.html.markdown32
-rw-r--r--typescript.html.markdown2
-rw-r--r--uk-ua/javascript-ua.html.markdown2
-rw-r--r--vi-vn/less-vi.html.markdown395
-rw-r--r--vi-vn/markdown-vi.html.markdown325
-rw-r--r--vi-vn/sass-vi.html.markdown590
-rw-r--r--vi-vn/typescript-vi.html.markdown193
-rw-r--r--vim.html.markdown42
-rw-r--r--whip.html.markdown2
-rw-r--r--zh-cn/go-cn.html.markdown1
-rw-r--r--zh-cn/groovy-cn.html.markdown4
-rw-r--r--zh-cn/swift-cn.html.markdown30
95 files changed, 5868 insertions, 565 deletions
diff --git a/CHICKEN.html.markdown b/CHICKEN.html.markdown
index 7fb0270b..bb2f91f0 100644
--- a/CHICKEN.html.markdown
+++ b/CHICKEN.html.markdown
@@ -8,7 +8,7 @@ contributors:
CHICKEN is an implementation of Scheme programming language that can
compile Scheme programs to C code as well as interpret them. CHICKEN
-supports RSR5 and RSR7 (work in progress) standards and many extensions.
+supports R5RS and R7RS (work in progress) standards and many extensions.
```scheme
@@ -510,7 +510,7 @@ sqr ;; => #<procedure (sqr x)>
```
## Further Reading
* [CHICKEN User's Manual](http://wiki.call-cc.org/man/4/The%20User%27s%20Manual).
-* [RSR5 standards](http://www.schemers.org/Documents/Standards/R5RS)
+* [R5RS standards](http://www.schemers.org/Documents/Standards/R5RS)
## Extra Info
diff --git a/awk.html.markdown b/awk.html.markdown
index 0e27528d..e3ea6318 100644
--- a/awk.html.markdown
+++ b/awk.html.markdown
@@ -38,7 +38,7 @@ BEGIN {
a = count + 1
b = count - 1
c = count * 1
- d = count / 1
+ d = count / 1 # integer division
e = count % 1 # modulus
f = count ^ 1 # exponentiation
@@ -143,7 +143,7 @@ BEGIN {
}
# Here's how you define a function
-function arithmetic_functions(a, b, c, localvar) {
+function arithmetic_functions(a, b, c, d) {
# Probably the most annoying part of AWK is that there are no local
# variables. Everything is global. For short scripts, this is fine, even
diff --git a/bash.html.markdown b/bash.html.markdown
index 981d7a1e..0c097c27 100644
--- a/bash.html.markdown
+++ b/bash.html.markdown
@@ -56,7 +56,7 @@ Variable= 'Some string' # => returns error: "Some string: command not found"
# Using the variable:
echo $Variable # => Some string
echo "$Variable" # => Some string
-echo '$Variable' # => Some string
+echo '$Variable' # => $Variable
# When you use the variable itself — assign it, export it, or else — you write
# its name without $. If you want to use the variable's value, you should use $.
# Note that ' (single quote) won't expand the variables!
diff --git a/c.html.markdown b/c.html.markdown
index 1ff8658c..87a047be 100644
--- a/c.html.markdown
+++ b/c.html.markdown
@@ -348,7 +348,7 @@ int main (int argc, char** argv)
printf("Error occurred at i = %d & j = %d.\n", i, j);
/*
https://ideone.com/GuPhd6
- this will print out "Error occurred at i = 52 & j = 99."
+ this will print out "Error occurred at i = 51 & j = 99."
*/
///////////////////////////////////////
diff --git a/ca-es/groovy-ca.html.markdown b/ca-es/groovy-ca.html.markdown
index 57674970..f0a9adbe 100644
--- a/ca-es/groovy-ca.html.markdown
+++ b/ca-es/groovy-ca.html.markdown
@@ -233,10 +233,12 @@ for (i in array) {
//Itera per un mapa
def map = ['name':'Roberto', 'framework':'Grails', 'language':'Groovy']
-x = 0
+x = ""
for ( e in map ) {
x += e.value
+ x += " "
}
+assert x.equals("Roberto Grails Groovy ")
/*
Operadors
diff --git a/chapel.html.markdown b/chapel.html.markdown
index 96ddc69d..9190f462 100644
--- a/chapel.html.markdown
+++ b/chapel.html.markdown
@@ -2,11 +2,11 @@
language: chapel
filename: learnchapel.chpl
contributors:
- - ["Ian J. Bertolacci", "http://www.cs.colostate.edu/~ibertola/"]
- - ["Ben Harshbarger", "http://github.com/benharsh/"]
+ - ["Ian J. Bertolacci", "https://www.cs.arizona.edu/~ianbertolacci/"]
+ - ["Ben Harshbarger", "https://github.com/benharsh/"]
---
-You can read all about Chapel at [Cray's official Chapel website](http://chapel.cray.com).
+You can read all about Chapel at [Cray's official Chapel website](https://chapel-lang.org).
In short, Chapel is an open-source, high-productivity, parallel-programming
language in development at Cray Inc., and is designed to run on multi-core PCs
as well as multi-kilocore supercomputers.
@@ -188,7 +188,7 @@ if 10 < 100 then
if -1 < 1 then
writeln("Continuing to believe reality");
else
- writeln("Send mathematician, something's wrong");
+ writeln("Send mathematician, something is wrong");
// You can use parentheses if you prefer.
if (10 > 100) {
@@ -213,7 +213,7 @@ if a % 3 == 0 {
var maximum = if thisInt < thatInt then thatInt else thisInt;
// select statements are much like switch statements in other languages.
-// However, select statements don't cascade like in C or Java.
+// However, select statements do not cascade like in C or Java.
var inputOption = "anOption";
select inputOption {
when "anOption" do writeln("Chose 'anOption'");
@@ -223,7 +223,7 @@ select inputOption {
}
otherwise {
writeln("Any other Input");
- writeln("the otherwise case doesn't need a do if the body is one line");
+ writeln("the otherwise case does not need a do if the body is one line");
}
}
@@ -282,7 +282,7 @@ var range2to10by2: range(stridable=true) = 2..10 by 2; // 2, 4, 6, 8, 10
var reverse2to10by2 = 2..10 by -2; // 10, 8, 6, 4, 2
var trapRange = 10..1 by -1; // Do not be fooled, this is still an empty range
-writeln("Size of range '", trapRange, "' = ", trapRange.length);
+writeln("Size of range ", trapRange, " = ", trapRange.length);
// Note: range(boundedType= ...) and range(stridable= ...) are only
// necessary if we explicitly type the variable.
@@ -425,7 +425,7 @@ var thisPlusThat = thisArray + thatArray;
writeln(thisPlusThat);
// Moving on, arrays and loops can also be expressions, where the loop
-// body's expression is the result of each iteration.
+// body expression is the result of each iteration.
var arrayFromLoop = for i in 1..10 do i;
writeln(arrayFromLoop);
@@ -1124,16 +1124,16 @@ This tutorial is for people who want to learn the ropes of chapel without
having to hear about what fiber mixture the ropes are, or how they were
braided, or how the braid configurations differ between one another. It won't
teach you how to develop amazingly performant code, and it's not exhaustive.
-Refer to the [language specification](http://chapel.cray.com/language.html) and
-the [module documentation](http://chapel.cray.com/docs/latest/) for more
+Refer to the [language specification](https://chapel-lang.org/docs/latest/language/spec.html) and
+the [module documentation](https://chapel-lang.org/docs/latest/) for more
details.
-Occasionally check back here and on the [Chapel site](http://chapel.cray.com)
+Occasionally check back here and on the [Chapel site](https://chapel-lang.org)
to see if more topics have been added or more tutorials created.
### What this tutorial is lacking:
- * Exposition of the [standard modules](http://chapel.cray.com/docs/latest/modules/modules.html)
+ * Exposition of the [standard modules](https://chapel-lang.org/docs/latest/modules/standard.html)
* Multiple Locales (distributed memory system)
* Records
* Parallel iterators
@@ -1141,7 +1141,7 @@ to see if more topics have been added or more tutorials created.
Your input, questions, and discoveries are important to the developers!
-----------------------------------------------------------------------
-The Chapel language is still in-development (version 1.15.0), so there are
+The Chapel language is still in-development (version 1.16.0), so there are
occasional hiccups with performance and language features. The more information
you give the Chapel development team about issues you encounter or features you
would like to see, the better the language becomes. Feel free to email the team
@@ -1158,8 +1158,8 @@ Chapel can be built and installed on your average 'nix machine (and cygwin).
[Download the latest release version](https://github.com/chapel-lang/chapel/releases/)
and it's as easy as
- 1. `tar -xvf chapel-1.15.0.tar.gz`
- 2. `cd chapel-1.15.0`
+ 1. `tar -xvf chapel-1.16.0.tar.gz`
+ 2. `cd chapel-1.16.0`
3. `source util/setchplenv.bash # or .sh or .csh or .fish`
4. `make`
5. `make check # optional`
diff --git a/clojure-macros.html.markdown b/clojure-macros.html.markdown
index 89066faf..3864f676 100644
--- a/clojure-macros.html.markdown
+++ b/clojure-macros.html.markdown
@@ -131,7 +131,7 @@ You'll want to be familiar with Clojure. Make sure you understand everything in
; However, we'll need to make it a macro if we want it to be run at compile time
(defmacro inline-2 [form]
- (inline-2-helper form)))
+ (inline-2-helper form))
(macroexpand '(inline-2 (1 + (3 / 2) - (1 / 2) + 1)))
; -> (+ (- (+ 1 (/ 3 2)) (/ 1 2)) 1)
diff --git a/csharp.html.markdown b/csharp.html.markdown
index 963f38f4..f27adf18 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,144 @@ 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());
+ }
+ }
+
+ // PATTERN MATCHING
+ class PatternMatchingTest
+ {
+ public static (string, int)? CreateLogMessage(object data)
+ {
+ switch(data)
+ {
+ // Additional filtering using when
+ case System.Net.Http.HttpRequestException h when h.Message.Contains("404"):
+ return (h.Message, 404);
+ case System.Net.Http.HttpRequestException h when h.Message.Contains("400"):
+ return (h.Message, 400);
+ case Exception e:
+ return (e.Message, 500);
+ case string s:
+ return (s, s.Contains("Error") ? 500 : 200);
+ case null:
+ return null;
+ default:
+ return (data.ToString(), 500);
+ }
+ }
+ }
+
+ // REFERENCE LOCALS
+ // Allow you to return a reference to an object instead of just its value
+ class RefLocalsTest
+ {
+ // note ref in return
+ public static ref string FindItem(string[] arr, string el)
+ {
+ for(int i=0; i<arr.Length; i++)
+ {
+ if(arr[i] == el) {
+ // return the reference
+ return ref arr[i];
+ }
+ }
+ throw new Exception("Item not found");
+ }
+
+ public static void SomeMethod()
+ {
+ string[] arr = {"this", "is", "an", "array"};
+
+ // note refs everywhere
+ ref string item = ref FindItem(arr, "array");
+ item = "apple";
+ Console.WriteLine(arr[3]); // => apple
+ }
+ }
+
+ // LOCAL FUNCTIONS
+ class LocalFunctionTest
+ {
+ private static int _id = 0;
+ public int id;
+ public LocalFunctionTest()
+ {
+ id = generateId();
+
+ // This local function can only be accessed in this scope
+ int generateId()
+ {
+ return _id++;
+ }
+ }
+
+ public static void AnotherMethod()
+ {
+ var lf1 = new LocalFunctionTest();
+ var lf2 = new LocalFunctionTest();
+ Console.WriteLine($"{lf1.id}, {lf2.id}"); // => 0, 1
+
+ int id = generateId();
+ // error CS0103: The name 'generateId' does not exist in the current context
+ }
+ }
}
```
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/git-de.html.markdown b/de-de/git-de.html.markdown
index 61f7bb67..a0ed120f 100644
--- a/de-de/git-de.html.markdown
+++ b/de-de/git-de.html.markdown
@@ -205,6 +205,12 @@ Speichert die aktuellen Inhalte des Index in einen neuen *Commit*. Dieser Commit
```bash
# Commit mit Beschreibung erstellen.
$ git commit -m "Added multiplyNumbers() function to HelloWorld.c"
+
+# Alle veränderten oder gelöschten Dateien außer neue Dateien werden gestaged und dann wird ein Commit erstellt.
+$ git commit -a -m "Modified foo.php and removed bar.php"
+
+# Ändert den letzten Commit (der letzte Commit wird mit einem neuen Commit ersetzt)
+$ git commit --amend -m "Correct message"
```
### diff
diff --git a/de-de/html-de.html.markdown b/de-de/html-de.html.markdown
index 2ee18129..0bf58f9c 100644
--- a/de-de/html-de.html.markdown
+++ b/de-de/html-de.html.markdown
@@ -9,7 +9,7 @@ lang: de-de
---
HTML steht für HyperText Markup Language (Hypertext-Auszeichnungssprache).
-Sie ist eine Sprache, um Seiten für das World Wide Web zu schreiben..
+Sie ist eine Sprache, um Seiten für das World Wide Web zu schreiben.
Es ist eine Auszeichnugssprache, die es uns ermöglicht Webseiten mithilfe des Codes zu schreiben, der kennzeichnet wie Text und Daten angezeigt werden sollen. Eigentlich sind HTML Dateien nur einfache Textdateien.
Was sind das für Auszeichnungen? Es ist eine Methode, um die Daten der Website zu organisieren mithilfe von Start- und Endtags.
Diese Auszeichnung dient dazu dem Text Bedeutung zu geben, welchen sie umschließt.
@@ -111,7 +111,7 @@ Dieser Artikel ist bedacht darauf, nur HTML Syntax und nützliche Tipps zu geben
## Verwendung
-HTML Dateien enden mit `.html`.
+HTML Dateien enden mit `.html` oder mit `.htm`. Der Mime Typ ist meist `text/html`.
## Um mehr zu lernen
diff --git a/de-de/nix-de.html.markdown b/de-de/nix-de.html.markdown
new file mode 100644
index 00000000..79b60d20
--- /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 Anführungszeichen."
+
+ "
+ 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 primitiven 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 durch 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 überschreiben 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 dem 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
+
+ # Verschachtelte 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 zugewiesen wurde.
+ {
+ a = { b = 1; };
+ a.c = 2;
+ }
+ #=> error: attribute ‘a’ already defined
+
+
+ # With
+ #=========================================
+
+ # Der Körper eines Sets Blocks wird mit der Zuordnung 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 beispielsweise "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 Packetmanager entscheidend ist,
+ # werden in der Nix Sprache reine funktionale Elemente betont. Es gibt aber ein paar
+ # unreine Elemente.
+ # Du kannst auf Umgebungsvariablen 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 herunterladen.
+ (fetchurl "https://example.com/package-1.2.3.tgz")
+ #=> "/nix/store/2drvlh8r57f19s9il42zg89rdr33m2rm-package-1.2.3.tgz"
+
+]
+```
+
+### Weitere Ressourcen
+
+* [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/de-de/swift-de.html.markdown b/de-de/swift-de.html.markdown
index b58a72d3..08f72a35 100644
--- a/de-de/swift-de.html.markdown
+++ b/de-de/swift-de.html.markdown
@@ -440,13 +440,13 @@ if let circle = myEmptyCircle {
// Wie Klassen auch können sie Methoden haben
enum Suit {
- case Spades, Hearts, Diamonds, Clubs
+ case spades, hearts, diamonds, clubs
func getIcon() -> String {
switch self {
- case .Spades: return "♤"
- case .Hearts: return "♡"
- case .Diamonds: return "♢"
- case .Clubs: return "♧"
+ case .spades: return "♤"
+ case .hearts: return "♡"
+ case .diamonds: return "♢"
+ case .clubs: return "♧"
}
}
}
@@ -455,35 +455,35 @@ enum Suit {
// Enum-Werte können vereinfacht geschrieben werden, es muss nicht der Enum-Typ
// genannt werden, wenn die Variable explizit deklariert wurde
-var suitValue: Suit = .Hearts
+var suitValue: Suit = .hearts
// Nicht-Integer-Enums brauchen direkt zugewiesene "Rohwerte"
enum BookName: String {
- case John = "John"
- case Luke = "Luke"
+ case john = "John"
+ case luke = "Luke"
}
-print("Name: \(BookName.John.rawValue)")
+print("Name: \(BookName.john.rawValue)")
// Enum mit assoziierten Werten
enum Furniture {
// mit Int assoziiert
- case Desk(height: Int)
+ case desk(height: Int)
// mit String und Int assoziiert
- case Chair(String, Int)
-
+ case chair(String, Int)
+
func description() -> String {
switch self {
- case .Desk(let height):
+ case .desk(let height):
return "Desk with \(height) cm"
- case .Chair(let brand, let height):
+ case .chair(let brand, let height):
return "Chair of \(brand) with \(height) cm"
}
}
}
-var desk: Furniture = .Desk(height: 80)
+var desk: Furniture = .desk(height: 80)
print(desk.description()) // "Desk with 80 cm"
-var chair = Furniture.Chair("Foo", 40)
+var chair = Furniture.chair("Foo", 40)
print(chair.description()) // "Chair of Foo with 40 cm"
diff --git a/dynamic-programming.html.markdown b/dynamic-programming.html.markdown
index 7df367e7..4db8e92e 100644
--- a/dynamic-programming.html.markdown
+++ b/dynamic-programming.html.markdown
@@ -26,7 +26,7 @@ The Longest Increasing Subsequence problem is to find the longest increasing sub
First of all we have to find the value of the longest subsequences(LSi) at every index i with last element of sequence being ai. Then largest LSi would be the longest subsequence in the given sequence. To begin LSi is assigned to be one since ai is element of the sequence(Last element). Then for all `j` such that `j<i` and `aj<ai`, we find Largest LSj and add it to LSi. Then algorithm take *O(n2)* time.
Pseudo-code for finding the length of the longest increasing subsequence:
-This algorithms complexity could be reduced by using better data structure rather than array. Storing predecessor array and variable like largest_sequences_so_far and its index would save a lot time.
+This algorithms complexity could be reduced by using better data structure rather than array. Storing predecessor array and variable like `largest_sequences_so_far` and its index would save a lot time.
Similar concept could be applied in finding longest path in Directed acyclic graph.
diff --git a/edn.html.markdown b/edn.html.markdown
index 04346eb8..f47853f0 100644
--- a/edn.html.markdown
+++ b/edn.html.markdown
@@ -44,13 +44,13 @@ false
:cheese
:olives
-; Symbols are used to represent identifiers. They start with #.
+; Symbols are used to represent identifiers.
; You can namespace symbols by using /. Whatever precedes / is
-; the namespace of the name.
-#spoon
-#kitchen/spoon ; not the same as #spoon
-#kitchen/fork
-#github/fork ; you can't eat with this
+; the namespace of the symbol.
+spoon
+kitchen/spoon ; not the same as spoon
+kitchen/fork
+github/fork ; you can't eat with this
; Integers and floats
42
@@ -84,22 +84,26 @@ false
#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/es-es/groovy-es.html.markdown b/es-es/groovy-es.html.markdown
index 799fc609..262d5e6a 100644
--- a/es-es/groovy-es.html.markdown
+++ b/es-es/groovy-es.html.markdown
@@ -232,10 +232,12 @@ for (i in array) {
// Iterando sobre un mapa
def map = ['name':'Roberto', 'framework':'Grails', 'language':'Groovy']
-x = 0
+x = ""
for ( e in map ) {
x += e.value
+ x += " "
}
+assert x.equals("Roberto Grails Groovy ")
/*
Operadores
diff --git a/es-es/learnsmallbasic-es.html.markdown b/es-es/learnsmallbasic-es.html.markdown
new file mode 100644
index 00000000..21208792
--- /dev/null
+++ b/es-es/learnsmallbasic-es.html.markdown
@@ -0,0 +1,132 @@
+---
+language: SmallBASIC
+filename: learnsmallbasic-es.bas
+contributors:
+ - ["Chris Warren-Smith", "http://smallbasic.sourceforge.net"]
+translators:
+ - ["José Juan Hernández García", "http://jjuanhdez.es"]
+lang: es-es
+---
+
+## Acerca de
+
+SmallBASIC es un intérprete del lenguaje BASIC rápido y fácil de aprender, ideal para cálculos cotidianos, scripts y prototipos. SmallBASIC incluye funciones trigonométricas, matrices y álgebra, un IDE integrado, una potente librería de cadenas de texto, comandos de sistema, sonido y gráficos, junto con una sintaxis de programación estructurada.
+
+## Desarrollo
+
+SmallBASIC fue desarrollado originalmente por Nicholas Christopoulos a finales de 1999 para el Palm Pilot. El desarrollo del proyecto ha sido continuado por Chris Warren-Smith desde el año 2005.
+Versiones de SmallBASIC se han hecho para una serie dispositivos de mano antiguos, incluyendo Franklin eBookman y el Nokia 770. También se han publicado varias versiones de escritorio basadas en una variedad de kits de herramientas GUI, algunas de las cuales han desaparecido. Las plataformas actualmente soportadas son Linux y Windows basadas en SDL2 y Android basadas en NDK. También está disponible una versión de línea de comandos de escritorio, aunque no suele publicarse en formato binario.
+Alrededor de 2008 una gran corporación lanzó un entorno de programación BASIC con un nombre de similar. SmallBASIC no está relacionado con este otro proyecto.
+
+```SmallBASIC
+REM Esto es un comentario
+' y esto tambien es un comentario
+
+REM Imprimir texto
+PRINT "hola"
+? "? es la abreviatura de PRINT"
+
+REM Estructuras de control
+FOR index = 0 TO 10 STEP 2
+ ? "Este es el numero de linea "; index
+NEXT
+J = 0
+REPEAT
+ J++
+UNTIL J = 10
+WHILE J > 0
+ J--
+WEND
+
+REM Estructura Select Case
+SELECT CASE "Cool"
+ CASE "null", 1, 2, 3, 4, 5, 6, 7, 8, "Cool", "blah"
+ CASE "No Cool"
+ PRINT "Fallo epico"
+ CASE ELSE
+ PRINT "Fallo"
+END SELECT
+
+REM Captura de errores con TRY/CATCH
+TRY
+ fn = Freefile
+ OPEN filename FOR INPUT As #fn
+CATCH err
+ PRINT "No se pudo abrir"
+END TRY
+
+REM Procedimientos y funciones definidas por el usuario
+FUNC add2(x, y)
+ ' variables pueden declararse como locales en el ambito de una SUB o FUNC
+ LOCAL k
+ k = "k dejara de existir cuando retorne FUNC"
+ add2 = x + y
+END
+PRINT add2(5, 5)
+
+SUB print_it(it)
+ PRINT it
+END
+print_it "IT...."
+
+REM Visualizacion de lineas y pixeles
+At 0, ymax / 2 + txth ("Q")
+COLOR 1: ? "sin(x)":
+COLOR 8: ? "cos(x)":
+COLOR 12: ? "tan(x)"
+LINE 0, ymax / 2, xmax, ymax / 2
+FOR i = 0 TO xmax
+ PSET i, ymax / 2 - SIN(i * 2 * pi / ymax) * ymax / 4 COLOR 1
+ PSET i, ymax / 2 - COS(i * 2 * pi / ymax) * ymax / 4 COLOR 8
+ PSET i, ymax / 2 - TAN(i * 2 * pi / ymax) * ymax / 4 COLOR 12
+NEXT
+SHOWPAGE
+
+REM SmallBASIC es ideal para experimentar con fractales y otros efectos interesantes
+DELAY 3000
+RANDOMIZE
+ff = 440.03
+FOR j = 0 TO 20
+ r = RND * 1000 % 255
+ b = RND * 1000 % 255
+ g = RND * 1000 % 255
+ c = RGB(r, b, g)
+ ff += 9.444
+ FOR i = 0 TO 25000
+ ff += ff
+ x = MIN(xmax, -x + COS(f * i))
+ y = MIN(ymax, -y + SIN(f * i))
+ PSET x, y COLOR c
+ IF (i % 1000 == 0) THEN
+ SHOWPAGE
+ fi
+ NEXT
+NEXT j
+
+REM Para historiadores de computadoras, SmallBASIC puede ejecutar programas
+REM encontrados en los primeros libros de computacion y revistas, por ejemplo:
+10 LET A = 9
+20 LET B = 7
+30 PRINT A * B
+40 PRINT A / B
+
+REM SmallBASIC también tiene soporte para algunos conceptos modernos como JSON
+aa = ARRAY("{\"cat\":{\"name\":\"harry\"},\"pet\":\"true\"}")
+IF (ismap(aa) == false) THEN
+ THROW "no es un mapa"
+END IF
+PRINT aa
+
+PAUSE
+
+```
+## Artículos
+
+* [Primeros pasos](http://smallbasic.sourceforge.net/?q=node/1573)
+* [Bienvenido a SmallBASIC](http://smallbasic.sourceforge.net/?q=node/838)
+
+## GitHub
+
+* [Código fuente](https://github.com/smallbasic/SmallBASIC)
+* [Reference snapshot](http://smallbasic.github.io/)
+
diff --git a/es-es/swift-es.html.markdown b/es-es/swift-es.html.markdown
index 8f63517a..22e3c532 100644
--- a/es-es/swift-es.html.markdown
+++ b/es-es/swift-es.html.markdown
@@ -446,48 +446,48 @@ if let circle = myEmptyCircle {
// Al igual que las clases, pueden contener métodos
enum Suit {
- case Spades, Hearts, Diamonds, Clubs
+ case spades, hearts, diamonds, clubs
func getIcon() -> String {
switch self {
- case .Spades: return "♤"
- case .Hearts: return "♡"
- case .Diamonds: return "♢"
- case .Clubs: return "♧"
+ case .spades: return "♤"
+ case .hearts: return "♡"
+ case .diamonds: return "♢"
+ case .clubs: return "♧"
}
}
}
// Los valores de enum permite la sintaxis corta, sin necesidad de poner
// el tipo del enum cuando la variable es declarada de manera explícita
-var suitValue: Suit = .Hearts
+var suitValue: Suit = .hearts
// Enums de tipo no-entero requiere asignaciones de valores crudas directas
enum BookName: String {
- case John = "John"
- case Luke = "Luke"
+ case john = "John"
+ case luke = "Luke"
}
-print("Name: \(BookName.John.rawValue)")
+print("Name: \(BookName.john.rawValue)")
// Enum con valores asociados
enum Furniture {
// Asociación con Int
- case Desk(height: Int)
+ case desk(height: Int)
// Asociación con String e Int
- case Chair(String, Int)
+ case chair(String, Int)
func description() -> String {
switch self {
- case .Desk(let height):
+ case .desk(let height):
return "Desk with \(height) cm"
- case .Chair(let brand, let height):
+ case .chair(let brand, let height):
return "Chair of \(brand) with \(height) cm"
}
}
}
-var desk: Furniture = .Desk(height: 80)
+var desk: Furniture = .desk(height: 80)
print(desk.description()) // "Desk with 80 cm"
-var chair = Furniture.Chair("Foo", 40)
+var chair = Furniture.chair("Foo", 40)
print(chair.description()) // "Chair of Foo with 40 cm"
diff --git a/forth.html.markdown b/forth.html.markdown
index 09f3beb0..ff094017 100644
--- a/forth.html.markdown
+++ b/forth.html.markdown
@@ -59,7 +59,7 @@ Forth, but most of what is written here should work elsewhere.
\ ---------------------- More Advanced Stack Manipulation ----------------------
-1 2 3 4 tuck \ duplicate the top item into the second slot: 1 2 4 3 4 ok
+1 2 3 4 tuck \ duplicate the top item below the second slot: 1 2 4 3 4 ok
1 2 3 4 over \ duplicate the second item to the top: 1 2 3 4 3 ok
1 2 3 4 2 roll \ *move* the item at that position to the top: 1 3 4 2 ok
1 2 3 4 2 pick \ *duplicate* the item at that position to the top: 1 2 3 4 2 ok
diff --git a/fr-fr/d.html.markdown b/fr-fr/d-fr.html.markdown
index 8d98f9dc..8d98f9dc 100644
--- a/fr-fr/d.html.markdown
+++ b/fr-fr/d-fr.html.markdown
diff --git a/fr-fr/haskell.html.markdown b/fr-fr/haskell-fr.html.markdown
index a34dc098..a34dc098 100644
--- a/fr-fr/haskell.html.markdown
+++ b/fr-fr/haskell-fr.html.markdown
diff --git a/fr-fr/java-fr.html.markdown b/fr-fr/java-fr.html.markdown
new file mode 100644
index 00000000..d0f91611
--- /dev/null
+++ b/fr-fr/java-fr.html.markdown
@@ -0,0 +1,939 @@
+---
+language: java
+contributors:
+ - ["Jake Prather", "https://github.com/JakeHP"]
+ - ["Jakukyo Friel", "https://weakish.github.io"]
+ - ["Madison Dickson", "https://github.com/mix3d"]
+ - ["Simon Morgan", "https://sjm.io/"]
+ - ["Zachary Ferguson", "https://github.com/zfergus2"]
+ - ["Cameron Schermerhorn", "https://github.com/cschermerhorn"]
+ - ["Rachel Stiyer", "https://github.com/rstiyer"]
+ - ["Michael Dähnert", "https://github.com/JaXt0r"]
+ - ["Rob Rose", "https://github.com/RobRoseKnows"]
+ - ["Sean Nam", "https://github.com/seannam"]
+filename: JavaFr.java
+translators:
+ - ['Mathieu Gemard', 'https://github.com/mgemard']
+lang: fr-fr
+---
+Java est un langage orienté objet, concurrent et très facilement portable. Java
+est inspiré du C++ mais ne reprend pas tous les concepts comme par exemple les
+pointeurs et en ajoute de nouveaux comme les interfaces.
+[En savoir plus.](https://fr.wikipedia.org/wiki/Java_(langage))
+
+```java
+// Les commentaires sur une seule ligne commencent par //
+
+/*
+Les commentaires sur plusieurs lignes ressemblent à ceci.
+*/
+
+/**
+ * Les commentaires de la JavaDoc ressemblent à ceci. Ils sont utilisés pour
+ * décrire la classe et ses différents attributs.
+ * Attributs principaux:
+ *
+ * @author Nom (et information de contact comme l'email) de(s) auteur(s).
+ * @version Version actuelle du programme.
+ * @since Date à laquelle cette partie du programme a été ajouté.
+ * @param Décrit les différents paramètres pour d'une méthode.
+ * @return Décrit le retour de la méthode.
+ * @deprecated Indique si le code est déprécié ou ne doit plus être utilisé.
+ * @see Lien vers une autre partie de la documentation.
+*/
+
+// Importe la classe ArrayList qui se trouve dans le package java.util
+import java.util.ArrayList;
+// Importe toutes les classes qui se trouvent dans le package java.security
+import java.security.*;
+
+// Chaque fichier .java doit contenir une classe public portant le même nom que
+le fichier.
+public class JavaFr {
+
+ // Pour exécuter un programme Java, celui-ci doit posséder une méthode main
+ // qui fournir un point d'entrée.
+ public static void main(String[] args) {
+
+ ///////////////////////////////////////
+ // Entrée/Sortie
+ ///////////////////////////////////////
+
+ /*
+ * Sortie
+ */
+
+ // Utilisez System.out.println() pour afficher un texte dans la console.
+ System.out.println("Hello World!");
+ System.out.println(
+ "Integer: " + 10 +
+ " Double: " + 3.14 +
+ " Boolean: " + true);
+
+ // Pour afficher sans retour à la ligne, on utilise System.out.print().
+ System.out.print("Hello ");
+ System.out.print("World");
+
+ // Utilisez System.out.printf() pour formatter les données à afficher.
+ System.out.printf("pi = %.5f", Math.PI); // => pi = 3.14159
+
+ /*
+ * Entrée
+ */
+
+ // Utilisez Scanner pour lire l'entrée
+ // Nécessite: import java.util.Scanner;
+ Scanner scanner = new Scanner(System.in);
+
+ // Lire une chaîne de caractères
+ String name = scanner.next();
+
+ // Lire un byte
+ byte numByte = scanner.nextByte();
+
+ // Lire un entier
+ int numInt = scanner.nextInt();
+
+ // Lire une entrée de type long
+ float numFloat = scanner.nextFloat();
+
+ // Lire une entrée de type double
+ double numDouble = scanner.nextDouble();
+
+ // Lire une entrée de type boolean
+ boolean bool = scanner.nextBoolean();
+
+ ///////////////////////////////////////
+ // Variables
+ ///////////////////////////////////////
+
+ /*
+ * Déclaration de variable
+ */
+ // Déclarez une variable avec la forme <type> <name>
+ int fooInt;
+ // Declarez plusieurs variables du même type <type> <name1>, <name2>,
+ // <name3>
+ int fooInt1, fooInt2, fooInt3;
+
+ /*
+ * Initialisation de variable
+ */
+
+ // Initialisez une variable sous la forme <type> <name> = <val>
+ int barInt = 1;
+ // Initialisez plusieurs variables du même type et avec la même valeur
+ // sous la forme
+ // <type> <name1>, <name2>, <name3>
+ // <name1> = <name2> = <name3> = <val>
+ int barInt1, barInt2, barInt3;
+ barInt1 = barInt2 = barInt3 = 1;
+
+ /*
+ * Types de variable
+ */
+ // byte - Entier signé utilisant la notation en complément à deux sur
+ // 8 bits
+ // (-128 <= byte <= 127)
+ byte fooByte = 100;
+
+ // Si vous voulez interpréter un byte en entier non-signé, cette simple
+ // opération peut vous aider
+ int unsignedIntLessThan256 = 0xff & fooByte;
+ // cela contraste avec une conversion qui peut être négative.
+ int signedInt = (int) fooByte;
+
+ // short - Entier signé utilisant la notation en complément à deux sur
+ // 16 bits
+ // (-32,768 <= short <= 32,767)
+ short fooShort = 10000;
+
+ // int - Entier signé utilisant la notation en complément à deux sur
+ // 32 bits
+ // (-2,147,483,648 <= int <= 2,147,483,647)
+ int bazInt = 1;
+
+ // long - Entier signé utilisant la notation en complément à deux sur
+ // 64 bits
+ // (-9,223,372,036,854,775,808 <= long <= 9,223,372,036,854,775,807)
+ long fooLong = 100000L;
+ // L est utilisé pour indiquer que la variable est de type long;
+ // le nombre serait traité comme un int sans le L
+
+ // Note: byte, short, int et long sont signés. Ils peuvent avoir des
+ // valeurs positives et négatives.
+ // Il n'existe pas de variantes non-signées.
+ // char, toutefois, est non-signé sur 16 bits
+
+ // float - nombre à virgule flottante selon la norme IEEE 754 utilisant
+ // le format simple précision sur 32 bits
+ // 2^-149 <= float <= (2-2^-23) * 2^127
+ float fooFloat = 234.5f;
+ // f ou F sont utilisés pour indiquer que la variable est de type float;
+ // autrement elle serait traitée comme un double.
+
+ // double - nombre à virgule flottante selon la norme IEEE 754 utilisant
+ // le format double précision sur 64 bits
+ // 2^-1074 <= x <= (2-2^-52) * 2^1023
+ double fooDouble = 123.4;
+
+ // boolean - vrai & faux
+ boolean fooBoolean = true;
+ boolean barBoolean = false;
+
+ // char - un caractère Unicode sur 16 bits
+ char fooChar = 'A';
+
+ // les variables final ne peuvent pas être réassignés à un autre objet,
+ final int HOURS_I_WORK_PER_WEEK = 9001;
+ // mais ils peuvent être initialisés plus tard.
+ final double E;
+ E = 2.71828;
+
+ // BigInteger - entier immuable de taille arbitraire
+ //
+ // BigInteger est un type de donné qui autorise les développeurs à
+ // manipuler des entiers au delà de 64 bits. Les entiers sont stockés
+ // dans un tableau de bytes et sont manipulés grâce à des functions
+ // de la classe BigIntger
+ //
+ // BigInteger peut être initialiser en utilisant un tableau de bytes ou
+ // une chaîne de caractère.
+ BigInteger fooBigInteger = new BigInteger(fooByteArray);
+
+ // BigDecimal - entier immuable et positif de taille arbitraire
+ //
+ // BigDecimal comprend deux parties: une entier de taille arbitraire
+ // (BigInteger) et un entier de 32 bits représantant la position de la
+ // virgule.
+ //
+ // BigDecimal donne aux développeurs un contrôle total pour l'arrondie
+ // à la décimale. Il est recommandé de l'utiliser pour les valeurs
+ // monétaires et pour les cas où la value exacte de l'arondie à la
+ // décimale est requis.
+ //
+ // BigInteger peut être initialiser en utilisant un int, long, double ou
+ // String.
+ // On peut également utiliser un BigInteger et un int pour la
+ // position de la virgule.
+ BigDecimal fooBigDecimal = new BigDecimal(fooBigInteger, fooInt);
+
+ // Sachez que la création d'un BigDecimal avec un float ou
+ // un double prendra en compte l'inexactitude des représention en float
+ // ou double.
+ // Préférez String pour une représention exacte.
+ BigDecimal tenCents = new BigDecimal("0.1");
+
+ // String - Chaîne de caractères
+ String fooString = "My String Is Here!";
+
+ // \n est un caractère d'échappement qui indique une nouvelle ligne
+ String barString = "Printing on a new line?\nNo Problem!";
+ // \t est un caractère d'échappement qui indique une tabulation
+ String bazString = "Do you want to add a tab?\tNo Problem!";
+ System.out.println(fooString);
+ System.out.println(barString);
+ System.out.println(bazString);
+
+ // Construction de chaînes de caractères
+ // #1 - avec l'opérateur +
+ // C'est la manière la plus simple et optimisé par le compilateur
+ String plusConcatenated = "Strings can " + "be concatenated " + "via + operator.";
+ System.out.println(plusConcatenated);
+ // Affiche: Strings can be concatenated via + operator.
+
+ // #2 - avec StringBuilder
+ // Cette méthode ne nécessite pas d'objet String intermédiaire. Elle
+ // stocke juste les différentes chaînes de caractères et les assemble
+ // lorsque la méthode toString() est appelée.
+ // Attention: Cette classe n'est pas thread-safe (l'objet ne peut pas être partagé
+ // entre les threads). Une alternative
+ // (avec un impact sur les performances) thread-safe est d'utiliser la
+ // classe StringBuffer.
+ StringBuilder builderConcatenated = new StringBuilder();
+ builderConcatenated.append("You ");
+ builderConcatenated.append("can use ");
+ builderConcatenated.append("the StringBuilder class.");
+ System.out.println(builderConcatenated.toString()); // only now is the string built
+ // Affiche: You can use the StringBuilder class.
+
+ // StringBuffer est efficace quand la chaîne de caractères n'est pas
+ // utilisée avec la fin de sa construction.
+ StringBuilder stringBuilder = new StringBuilder();
+ String inefficientString = "";
+ for (int i = 0 ; i < 10; i++) {
+ stringBuilder.append(i).append(" ");
+ inefficientString += i + " ";
+ }
+ System.out.println(inefficientString);
+ System.out.println(stringBuilder.toString());
+ // inefficientString est moins performant car une chaîne de caractères
+ // est créée à chaque itération de la boucle.
+ // Les concaténations avec + sont compilés en un StringBuilder et
+ // toString().
+ // Evitez les concaténations de string dans les boucles.
+
+ // #3 - avec la méthode format() de la classe String.
+ // Une autre alternative. Rapide et lisible.
+ String.format("%s may prefer %s.", "Or you", "String.format()");
+ // Affiche: Or you may prefer String.format().
+
+ // Tableau
+ // La taille du tableau doit être précisée à l'instantiation
+ // Les formats suivant sont possibles pour déclarer un tableau
+ // <datatype>[] <var name> = new <datatype>[<array size>];
+ // <datatype> <var name>[] = new <datatype>[<array size>];
+ int[] intArray = new int[10];
+ String[] stringArray = new String[1];
+ boolean boolArray[] = new boolean[100];
+
+ // Une autre manière de déclarer et initialiser un tableau
+ int[] y = {9000, 1000, 1337};
+ String names[] = {"Bob", "John", "Fred", "Juan Pedro"};
+ boolean bools[] = {true, false, false};
+
+ // Accéder à un élément
+ System.out.println("intArray @ 0: " + intArray[0]);
+
+ // Les tableaus commencent à 0 et sont muables
+ intArray[1] = 1;
+ System.out.println("intArray @ 1: " + intArray[1]); // => 1
+
+ // Les autres types de donnés utiles sont
+ // ArrayList - Identique aux tableaux mais avec plus de fonctionnalités
+ // et de taille muable.
+ // LinkedList - Implémentation de listes doublement chaînées. Toutes Les
+ // opérations éffectuées le sont comme attendue pour une
+ // liste doublement chaînée.
+ // Map - Une collection d'objets qui fait correspondre une valeur à une
+ // clé. Map est une interface et ne peut pas être instantiée. Le
+ // type des clés et des valeurs doit être précisés à
+ // l'instantiation. Chaque clé doit correspondre à une seule
+ // valeur et chaque clé doit être unique (pas de clés dupliquées).
+ // HashMap - Cette classe utilise une table de hachage pour implémenter
+ // l'interface Map. Cela garantie que le temps d'exécution des
+ // opérations basiques, comme get (récuper une valeur) et
+ // insert (insérer une valeur), reste constant quelque soit la
+ // la taille.
+ // TreeMap - Cette classe utilise une structure en arbre et est
+ // ordonnée. Elle implémente un arbre bicolore (ou arbre rouge
+ // et noir) et ordonne les éléments en se basant sur la clé ou
+ // en utilisant un comparateur fournit à la création.
+
+ ///////////////////////////////////////
+ // Opérateurs
+ ///////////////////////////////////////
+ System.out.println("\n->Operators");
+
+ int i1 = 1, i2 = 2; // Raccourcis pour des déclarations multiples
+
+ // L'arithmétique
+ System.out.println("1+2 = " + (i1 + i2)); // => 3
+ System.out.println("2-1 = " + (i2 - i1)); // => 1
+ System.out.println("2*1 = " + (i2 * i1)); // => 2
+ System.out.println("1/2 = " + (i1 / i2)); // => 0 (int/int returns int)
+ System.out.println("1/2 = " + (i1 / (double)i2)); // => 0.5
+
+ // Le modulo
+ System.out.println("11%3 = "+(11 % 3)); // => 2
+
+ // Opérateurs de comparaison
+ System.out.println("3 == 2? " + (3 == 2)); // => faux
+ System.out.println("3 != 2? " + (3 != 2)); // => vrai
+ System.out.println("3 > 2? " + (3 > 2)); // => vrai
+ System.out.println("3 < 2? " + (3 < 2)); // => faux
+ System.out.println("2 <= 2? " + (2 <= 2)); // => vrai
+ System.out.println("2 >= 2? " + (2 >= 2)); // => vrai
+
+ // Opérateurs boolean
+ System.out.println("3 > 2 && 2 > 3? " + ((3 > 2) && (2 > 3))); // => false
+ System.out.println("3 > 2 || 2 > 3? " + ((3 > 2) || (2 > 3))); // => true
+ System.out.println("!(3 == 2)? " + (!(3 == 2))); // => true
+
+ // Opérateurs sur les bits
+ /*
+ ~ Complément à un
+ << Décalage des bits vers la gauche
+ >> Décalage des bits vers la droite, le signe est conservé
+ >>> Décalage des bits vers la droite, zéro est utilisé pour les bits
+ les plus à gauche
+ & Opérateur ET
+ ^ Opérateur OU exlusif
+ | Opérateur OU inclusif
+ */
+
+ // Opérateurs d'incrémentation
+ int i = 0;
+ System.out.println("\n->Inc/Dec-rementation");
+ // Les opérateurs ++ et -- incrémentent et décrémentent respectivement
+ // de 1.
+ // S'ils sont placés avant la variable, ils incrémentent la variable puis
+ // retournent la valeur. Placés après la varible, ils retournent la variable
+ // puis l'incrémentent.
+ System.out.println(i++); // i = 1, affiche 0 (pré-incrément)
+ System.out.println(++i); // i = 2, affiche 2 (post-incrément)
+ System.out.println(i--); // i = 1, affiche 2 (post-incrément)
+ System.out.println(--i); // i = 0, affiche 0 (pré-incrément)
+
+ ///////////////////////////////////////
+ // Structures de contôles
+ ///////////////////////////////////////
+ System.out.println("\n->Control Structures");
+
+ // Les instructions conditionnelle sont identiques aux langage C
+ int j = 10;
+ if (j == 10) {
+ System.out.println("I get printed");
+ } else if (j > 10) {
+ System.out.println("I don't");
+ } else {
+ System.out.println("I also don't");
+ }
+
+ // Bouble while
+ int fooWhile = 0;
+ while(fooWhile < 100) {
+ System.out.println(fooWhile);
+ // Incrémente le compteur
+ // Itéré 100 fois, fooWhile 0,1,2...99
+ fooWhile++;
+ }
+ System.out.println("fooWhile Value: " + fooWhile);
+
+ // Boucle do-while
+ int fooDoWhile = 0;
+ do {
+ System.out.println(fooDoWhile);
+ // Incrémente le compteur
+ // Itéré 99 fois, fooDoWhile 0->99
+ fooDoWhile++;
+ } while(fooDoWhile < 100);
+ System.out.println("fooDoWhile Value: " + fooDoWhile);
+
+ // Boucle for
+ // De la forme for(<start_statement>; <conditional>; <step>)
+ for (int fooFor = 0; fooFor < 10; fooFor++) {
+ System.out.println(fooFor);
+ // Itéré 10 fois, fooFor 0->9
+ }
+ System.out.println("fooFor Value: " + fooFor);
+
+ // Fin d'une boucle for avec un label
+ outer:
+ for (int i = 0; i < 10; i++) {
+ for (int j = 0; j < 10; j++) {
+ if (i == 5 && j ==5) {
+ break outer;
+ // termine l'itération de la boucle englobante avec le label outer
+ }
+ }
+ }
+
+ // Boucle for-each
+ // La boucle for est également capable d'itérer aussi bien sur un
+ // tableau que sur des objets qui implémentent l'interface Iterable.
+ int[] fooList = {1, 2, 3, 4, 5, 6, 7, 8, 9};
+ // De la forme: for (<object> : <iterable>)
+ // Lu comme: "Pour chaque élément du tableau"
+ // note: le type doit correspondre à celui de l'objet itérable
+ for (int bar : fooList) {
+ System.out.println(bar);
+ //Itère 9 fois et affiche les chiffres de 1 à 9
+ }
+
+ // Le switch-case
+ // Un switch fonctionne avec les données de type byte, short, char et
+ // int.
+ // On peut également utiliser le type Enum, la classe String et les
+ // classes spéciales qui englobent les types primitifs (Character, Byte,
+ // Short et Integer).
+ // Depuis Java 7, on peut utiliser le type String.
+ int month = 3;
+ String monthString;
+ switch (month) {
+ case 1: monthString = "January";
+ break;
+ case 2: monthString = "February";
+ break;
+ case 3: monthString = "March";
+ break;
+ default: monthString = "Some other month";
+ break;
+ }
+ System.out.println("Switch Case Result: " + monthString);
+
+ // try-with-resources (Java 7+)
+ // Le mécanisme de gestion des erreurs try-catch-finally peut être
+ // utilisé mais depuis Java 7 il est également possible d'utiliser
+ // try-with-ressources.
+ // try-with-resources simplifie try-catch-finally en fermant
+ // automatiquement les ressources
+
+ // Pour utiliser un try-with-resources, il suffit d'inclure l'instance
+ // d'une classe qui implémente l'interface java.lang.AutoCloseable
+ try (BufferedReader br = new BufferedReader(new FileReader("foo.txt"))) {
+ // Ici, vous pouvez essayer de faire quelque chose qui lance une
+ // exception.
+ System.out.println(br.readLine());
+ // Avec Java 7, la ressource sera toujours fermé, même si elle lance
+ // une exception.
+ } catch (Exception ex) {
+ // La ressource sera fermé avant que le catch s'exécute.
+ System.out.println("readLine() failed.");
+ }
+ // Il n'y a pas besoin de finally dans ce cas, l'objet BufferedReader
+ // sera déjà fermé. Cela peut être utile dans certains cas spécifiques
+ // où le code contenu dans finally ne serait pas exécuté.
+ // Consulter la documention Oracle pour en savoir plus (en anglais) :
+ // https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html
+
+
+ // Expression ternaire
+ // Vous pouvez utiliser l'opérateur ternaire '?' pour faire un
+ // assignement rapide avec une condition logique.
+ // Il faut lire "Si la (condition) est vraie alors utiliser la
+ // <première valeur> sinon utilisez la <deuxième valeur>".
+ int foo = 5;
+ String bar = (foo < 10) ? "A" : "B";
+ System.out.println("bar : " + bar); // Affiche "bar : A", car la condition est vraie
+ // Ou alors plus simplement
+ System.out.println("bar : " + (foo < 10 ? "A" : "B")); // Affiche également "bar : A"
+
+ ////////////////////////////////////////
+ // Conversion de type
+ ////////////////////////////////////////
+
+ // Autoboxing
+
+ // Convertir un objet String en un objet Integer
+ Integer.parseInt("123"); // retourne un le type primitif int de 123
+
+ // Convert Integer To String
+ Integer.toString(123); // retourne un object String correspondant à"123"
+
+ // Pour les autres conversions, référer vous aux classes suivantes:
+ // Double
+ // Long
+ // String
+
+ ///////////////////////////////////////
+ // Classes et fonctions
+ ///////////////////////////////////////
+
+ System.out.println("\n->Classes & Functions");
+
+ // (voir plus loin pour la définition de la classe Bicycle)
+
+ // Utilisez new pour instancier une classe
+ Bicycle trek = new Bicycle();
+
+ // Pour appeler une méthode de l'objet
+ trek.speedUp(3); // !! Il est conseillé de passer par une méthode pour
+ // changer la valeur d'une variable.
+ trek.setCadence(100);
+
+ // toString retourne une représentation de l'objet en chaîne de caractères.
+ System.out.println("trek info: " + trek.toString());
+
+ // Initialisation avec double accolades
+ // Le langage Java ne permet pas de créer des collections statiques d'une
+ // manière simple. Généralement, on utilise la forme suivante:
+ private static final Set<String> COUNTRIES = new HashSet<String>();
+ static {
+ COUNTRIES.add("DENMARK");
+ COUNTRIES.add("SWEDEN");
+ COUNTRIES.add("FINLAND");
+ }
+
+ // Mais on peut le faire d'une manière plus habile, dite initialisation
+ // avec double semi-colonnes
+ private static final Set<String> COUNTRIES = new HashSet<String>() {{
+ add("DENMARK");
+ add("SWEDEN");
+ add("FINLAND");
+ }}
+
+ // La première semi-colonne crée une classe anonyme et la deuxième est
+ // un bloc d'initialisation du bloc. Ce dernier est appelé lorsque Copyright (c)
+ // classe anonyme est crée. Cela ne fonctionne pas uniquement pour les
+ // collections mais également pour toutes les classes n'étant pas
+ // déclarées comme final.
+
+ } // Fin de la méthode main
+} // Fin de la class JavaFr
+
+// Vous pouvez inclure des classes qui ne sont pas publics dans un fichier Java.
+// Cependant, il est préférable de séparer les
+// classes dans des fichiers différents.
+
+// Syntaxe de déclaration des classes:
+// <public/private/protected> class <Nom de la classe> {
+// // Les attributs, les constructeurs et les méthodes de la classe vont ici.
+// // Les functions de classes sont appelées méthode.
+// }
+
+class Bicycle {
+
+ // Attributs et variables de la classe Bicycle
+ public int cadence; // Public: Peut être accesible depuis n'importe où
+ private int speed; // Private: Accisible depuis la classe
+ protected int gear; // Protected: Accisible depuis la classe et ses sous-
+ // classes
+ String name; // default: Uniquement accesible depuis ce package
+ static String className; // Variable de classe static
+
+ // Bloc static
+ // Java n'a pas d'implémentation pour les constructeurs statiques mais
+ // possède le bloc static qui peut être utilisé pour initialiser les
+ // variables de classe.
+ // Ce bloc sera appelé lorsque la classe sera chargée.
+ static {
+ className = "Bicycle";
+ }
+
+ // Les constructeurs sont un moyen de créer les classe
+ // Ceci est le constructeur de la classe Bicycle
+ public Bicycle() {
+ // Vous pouvez aussie appeler un autre constructeur. Par exemple en
+ // appelant le constructeur de la classe mère (voir héritage):
+ // this(1, 50, 5, "Bontrager");
+ gear = 1;
+ cadence = 50;
+ speed = 5;
+ name = "Bontrager";
+ }
+ // Le constructeur peut prendre plusieurs arguments
+ public Bicycle(int startCadence, int startSpeed, int startGear,
+ String name) {
+ this.gear = startGear;
+ this.cadence = startCadence;
+ this.speed = startSpeed;
+ this.name = name;
+ }
+
+ // Syntaxe d'une méthode :
+ // <public/private/protected> <type de retour> <nom de la fonction>(
+ // <arguments>)
+
+ // Les classes Java possèdent souvent des accesseurs (getters) et mutateurs
+ // (setters) pour leurs attributs.
+
+ public int getCadence() {
+ return cadence;
+ }
+
+ // Les méthodes void ne retourne aucune valeur
+ public void setCadence(int newValue) {
+ cadence = newValue;
+ }
+ public void setGear(int newValue) {
+ gear = newValue;
+ }
+ public void speedUp(int increment) {
+ speed += increment;
+ }
+ public void slowDown(int decrement) {
+ speed -= decrement;
+ }
+ public void setName(String newName) {
+ name = newName;
+ }
+ public String getName() {
+ return name;
+ }
+
+ // Méthode pour afficher la valeur des attributs de l'objet. @Override est
+ // une annotation (voir plus loin).
+ @Override //On dit ici qu'on remplace la méthode de la classe Objet.
+ public String toString() {
+ return "gear: " + gear + " cadence: " + cadence + " speed: " + speed +
+ " name: " + name;
+ }
+} // Fin de la classe Bicycle
+
+// PennyFarthing est une sous-classe de Bicycle
+class PennyFarthing extends Bicycle {
+ // (Les Penny Farthings sont des bicyclette avec une grande roue avant.
+ // Il n'y a pas de roue libre, le cycliste est obligé de pédaler en
+ // permanence.)
+
+ public PennyFarthing(int startCadence, int startSpeed) {
+ // Appelez le constructeur parent avec la méthode super()
+ super(startCadence, startSpeed, 0, "PennyFarthing");
+ }
+
+ // Ici nous modifions la méthode setGear() de la classe mère. Il faut donc
+ // utiliser l'annotation @Overide. Pour en savoir plus sur les annotations,
+ // consulter la documention officiel (en anglais) :
+ // out: http://docs.oracle.com/javase/tutorial/java/annotations/
+ @Override
+ public void setGear(int gear) {
+ this.gear = 0;
+ }
+}
+
+// Polymorphisme (cast d'objets)
+// Comme la classe PennyFarthing héritent de la classe Bicycle, on peut dire
+// qu'un PennyFarthing est un Bicycle (un vélo en anglais) et écrire :
+// Bicycle bicycle = new PennyFarthing();
+// Le polymorphisme est la capacité d'un objet de se faire passer pour un autre.
+// Vous pouvez consulter la documentation Oracle pour plus de détails et
+// concepts (en anglais) :
+// https://docs.oracle.com/javase/tutorial/java/IandI/subclasses.html
+
+// Interfaces
+// Déclaration d'une interface
+// <niveau d'accès> interface <nom de l'interface> extends <nom de l'interface
+// mère> {
+// // Constantes
+// // Délaration des méthodes
+// }
+
+// Exemple - Toute nourriture peut être mangée et digégée différemment
+// L'interface Edible (traduction : comestible) décrit l'action de manger
+public interface Edible {
+ public void eat(); // Toute classe qui implémente cette interface doit
+ // implémenter cette méthode
+}
+
+// L'interface Digestible décrit l'action de digérer
+public interface Digestible {
+ public void digest();
+ // Depuis Java 8, les interfaces peuvent avoir des méthodes par défaut.
+ public void defaultMethod() {
+ System.out.println("Hi from default method ...");
+ }
+}
+
+// On peut maintenant créer une classe qui implémente chacune de ces interfaces.
+public class Fruit implements Edible, Digestible {
+ @Override
+ public void eat() {
+ // ...
+ }
+
+ @Override
+ public void digest() {
+ // ...
+ }
+}
+
+// En Java, on peut hériter uniquement d'une classe mais on peut implémenter
+// plusieurs interfaces:
+public class ExampleClass extends ExampleClassParent implements InterfaceOne,
+ InterfaceTwo {
+ @Override
+ public void InterfaceOneMethod() {
+ }
+
+ @Override
+ public void InterfaceTwoMethod() {
+ }
+
+}
+
+// Classes abstraites
+
+// Syntaxe de déclaration:
+// <niveau d'accès> abstract class <nom de la classe abstraite> extends <nom de la
+// classe mère abstraite> {
+// // Constantes et variables
+// // Méthodes
+// }
+
+// Une classe abstraite contient au moins une méthode abstraite qui doit être
+// définee dans la classe fille. Comme les interfaces, les classes abstraites ne
+// peuvent pas être instanciées mais doivent être étendues avec les méthodes
+// abstraites implémentées. À la différence des interfaces, une classe abstraite
+// peut contenir des méthodes abstraites ou non-abstraites. Les méthodes dans une
+// interfaces ne peuvent pas être implémentées à l'exception des méthodes static.
+// Les variables d'une classe abstraite sont déclarées comme final par défaut à
+// l'opposé des interfaces. Finalement les classes abstraites peuvent avoir une
+// méthode main.
+public abstract class Animal
+{
+ public abstract void makeSound();
+
+ // Les méthodes peuvent avoir une implémentation dans une classe abstraite.
+ public void eat()
+ {
+ System.out.println("I am an animal and I am Eating.");
+ // Note: On peut accéder à une variable privée ici.
+ age = 30;
+ }
+
+ // On n'a pas besoin d'initialiser les variables dans les classe abstraites.
+ // Cependant, dans une interfaces, les variables sont implicitement
+ // déclarées comme final et doivent donc être initialisées.
+ private int age;
+
+ public void printAge()
+ {
+ System.out.println(age);
+ }
+
+ // Les classes abstraites peuvent avoir une fonction main.
+ public static void main(String[] args)
+ {
+ System.out.println("I am abstract");
+ }
+}
+
+class Dog extends Animal
+{
+ // On doit également utiliser l'annotation @Override lors de la surchage de
+ // la méthode abstraite d'une classe abstraite.
+ @Override
+ public void makeSound()
+ {
+ System.out.println("Bark");
+ // age = 30; ==> ERREUR! age est privé et n'est pas accesible.
+ }
+
+ // NOTE: Vous obtiendrez une erreur si vous utilisé l'annotation @Override
+ // ici car Java n'autorise pas la surcharge de méthodes statiques. Ce qui ce
+ // passe est appelé "method hiding". Si vous voulez en savoir plus,
+ // consultez cette discussion (en anglais) :
+ // http://stackoverflow.com/questions/16313649/
+ public static void main(String[] args)
+ {
+ Dog pluto = new Dog();
+ pluto.makeSound();
+ pluto.eat();
+ pluto.printAge();
+ }
+}
+
+// Classes finales
+
+// Syntaxe de déclaration
+// <niveau d'accès> final <nom de la classe final> {
+// // Constantes et variables
+// // Méthodes déclarations
+// }
+
+// Les classe déclarées comme final ne peuvent pas avoir de classe fille. Elles
+// peuvent être considérées comme l'opposé des classes abstraites.
+public final class SaberToothedCat extends Animal
+{
+ // On doit également utiliser l'annotation @Override lors de la surchage de
+ // la méthode abstraite d'une classe abstraite.
+ @Override
+ public void makeSound()
+ {
+ System.out.println("Roar");
+ }
+}
+
+// Méthodes final
+public abstract class Mammal()
+{
+ // Syntaxe:
+ // <niveau d'accès> final <type de retour> <nom de la fonction>(<arguments>)
+
+ // Les méthodes déclarées comme final ne peuvent pas être surchargées par
+ // une classe fille et en sont donc l'implémentation finale.
+ public final boolean isWarmBlooded()
+ {
+ return true;
+ }
+}
+
+// Enumérations
+//
+// Le type enum est un type de donnée spécial qui permet à une variable de ne
+// prendre que certaines valeurs prédéfinies. La variable doit être égales à une
+// des valeurs pédéfinies pour celle-ci. En Java, les variables constantes sont
+// notées en majuscules.
+// On définie un type enum en utilisant le mot clé enum. Par exemple pour les
+// jours de l'année:
+public enum Day {
+ SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
+ THURSDAY, FRIDAY, SATURDAY
+}
+
+// On l'utilise ainsi:
+public class EnumTest {
+ // On utilise notre énumération
+ Day day;
+
+ public EnumTest(Day day) {
+ this.day = day;
+ }
+
+ public void tellItLikeItIs() {
+ switch (day) {
+ case MONDAY:
+ System.out.println("Mondays are bad.");
+ break;
+ case FRIDAY:
+ System.out.println("Fridays are better.");
+ break;
+ case SATURDAY:
+ case SUNDAY:
+ System.out.println("Weekends are best.");
+ break;
+ default:
+ System.out.println("Midweek days are so-so.");
+ break;
+ }
+ }
+
+ public static void main(String[] args) {
+ EnumTest firstDay = new EnumTest(Day.MONDAY);
+ firstDay.tellItLikeItIs(); // => affiche "Mondays are bad"
+ EnumTest thirdDay = new EnumTest(Day.WEDNESDAY);
+ thirdDay.tellItLikeItIs(); // => affiche "Midweek days are so-so"
+ }
+}
+
+// Le type enum permet de faire bien plus que ce qui est montré ici. Il ne se
+// limite pas à une liste de constante mais peut inclure des champs et méthodes.
+// Vous pouvez en savoir plus ici (en anglais):
+//https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html
+
+```
+
+## Pour aller plus loin (en anglais)
+
+Les liens ci-dessous sont données si vous souhaitez approfondir sur le sujet,
+n'hésitez pas à consulter Google pour trouver des exemples spécifiques.
+
+**Guides officiels d'Oracle**:
+
+* [Java Tutorial Trail from Sun / Oracle](https://docs.oracle.com/javase/tutorial/index.html)
+
+* [Java Access level modifiers](https://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html)
+
+* [Object-Oriented Programming Concepts](https://docs.oracle.com/javase/tutorial/java/concepts/index.html):
+ * [Inheritance](https://docs.oracle.com/javase/tutorial/java/IandI/subclasses.html)
+ * [Polymorphism](https://docs.oracle.com/javase/tutorial/java/IandI/polymorphism.html)
+ * [Abstraction](https://docs.oracle.com/javase/tutorial/java/IandI/abstract.html)
+
+* [Exceptions](https://docs.oracle.com/javase/tutorial/essential/exceptions/index.html)
+
+* [Interfaces](https://docs.oracle.com/javase/tutorial/java/IandI/createinterface.html)
+
+* [Generics](https://docs.oracle.com/javase/tutorial/java/generics/index.html)
+
+* [Java Code Conventions](https://www.oracle.com/technetwork/java/codeconvtoc-136057.html)
+
+* Nouvelles fonctionnalités Java 8:
+ * [Lambda expressions (functional programming)](https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html)
+ * [Date and time API (java.time package)](http://www.oracle.com/technetwork/articles/java/jf14-date-time-2125367.html)
+
+**Pratiquer en ligne et tutoriels**
+
+* [Learneroo.com - Learn Java](http://www.learneroo.com)
+
+* [Codingbat.com](http://codingbat.com/java)
+
+**Livres**:
+
+* [Head First Java](http://www.headfirstlabs.com/books/hfjava/)
+
+* [Thinking in Java](http://www.mindview.net/Books/TIJ/)
+
+* [Objects First with Java](https://www.amazon.com/Objects-First-Java-Practical-Introduction/dp/0132492660)
+
+* [Java The Complete Reference](https://www.amazon.com/gp/product/0071606300)
diff --git a/fr-fr/markdown.html.markdown b/fr-fr/markdown-fr.html.markdown
index 2e4e8461..2e4e8461 100644
--- a/fr-fr/markdown.html.markdown
+++ b/fr-fr/markdown-fr.html.markdown
diff --git a/fr-fr/scala.html.markdown b/fr-fr/scala-fr.html.markdown
index c6a61745..c6a61745 100644
--- a/fr-fr/scala.html.markdown
+++ b/fr-fr/scala-fr.html.markdown
diff --git a/fr-fr/vim.html.markdown b/fr-fr/vim-fr.html.markdown
index b2f1d24d..b2f1d24d 100644
--- a/fr-fr/vim.html.markdown
+++ b/fr-fr/vim-fr.html.markdown
diff --git a/git.html.markdown b/git.html.markdown
index 088c109f..582f8863 100644
--- a/git.html.markdown
+++ b/git.html.markdown
@@ -292,6 +292,10 @@ contains the changes made and a message created by the user.
# commit with a message
$ git commit -m "Added multiplyNumbers() function to HelloWorld.c"
+# signed commit with a message (user.signingkey must have been set
+# with your GPG key e.g. git config --global user.signingkey 5173AAD5)
+$ git commit -S -m "signed commit message"
+
# automatically stage modified or deleted files, except new files, and then commit
$ git commit -a -m "Modified foo.php and removed bar.php"
diff --git a/groovy.html.markdown b/groovy.html.markdown
index a3a45757..efbb2b32 100644
--- a/groovy.html.markdown
+++ b/groovy.html.markdown
@@ -230,10 +230,12 @@ for (i in array) {
//Iterate over a map
def map = ['name':'Roberto', 'framework':'Grails', 'language':'Groovy']
-x = 0
+x = ""
for ( e in map ) {
x += e.value
+ x += " "
}
+assert x.equals("Roberto Grails Groovy ")
/*
Operators
diff --git a/haxe.html.markdown b/haxe.html.markdown
index e811031e..df2a1e78 100644
--- a/haxe.html.markdown
+++ b/haxe.html.markdown
@@ -770,8 +770,8 @@ class UsingExample {
```
We're still only scratching the surface here of what Haxe can do. For a formal
-overiew of all Haxe features, checkout the [online
-manual](http://haxe.org/manual), the [online api](http://api.haxe.org/), and
+overview of all Haxe features, checkout the [online
+manual](http://haxe.org/manual), the [online API](http://api.haxe.org/), and
"haxelib", the [haxe library repo] (http://lib.haxe.org/).
For more advanced topics, consider checking out:
diff --git a/html.html.markdown b/html.html.markdown
index 3c855b5c..6516e5dd 100644
--- a/html.html.markdown
+++ b/html.html.markdown
@@ -111,7 +111,7 @@ This article is concerned principally with HTML syntax and some useful tips.
## Usage
-HTML is written in files ending with `.html`.
+HTML is written in files ending with `.html` or `.htm`. The mime type is `text/html`.
## To Learn More
diff --git a/id-id/bf-id.html.markdown b/id-id/bf-id.html.markdown
new file mode 100644
index 00000000..9901290b
--- /dev/null
+++ b/id-id/bf-id.html.markdown
@@ -0,0 +1,86 @@
+---
+language: "Brainfuck"
+filename: brainfuck-id.bf
+contributors:
+ - ["Prajit Ramachandran", "http://prajitr.github.io/"]
+ - ["Mathias Bynens", "http://mathiasbynens.be/"]
+translators:
+ - ["Muhammad Rifqi Fatchurrahman", "http://muhrifqii.github.io/"]
+lang: id-id
+---
+
+Brainfuck (tidak dalam huruf kapital kecuali pada awal kalimat) adalah sebuah
+bahasa pemrograman Turing-complete yang sangat minim yang hanya memiliki 8 perintah.
+
+Anda bisa mencoba brainfuck pada browser dengan menggunakan [brainfuck-visualizer](http://fatiherikli.github.io/brainfuck-visualizer/).
+
+```bf
+Karakter apapun selain "><+-.,[]" (tanda kutip tidak termasuk) diabaikan.
+
+Brainfuck direpresentasikan dengan sebuah array yang memiliki 30,000 cell yang
+diinisialisasi dengan nol dan pointer data yang menunjuk ke current cell.
+
+Terdapat delapan perintah:
++ : Menaikkan nilai pada current cell sebesar satu.
+- : Menurunkan nilai pada current cell sebesar satu.
+> : Menggeser pointer data ke cell selanjutnya (cell sebelah kanan).
+< : Menggeser pointer data ke cell sebelumnya (cell sebelah kiri).
+. : Mencetak nilai ASCII pada current cell (misal 65 = 'A').
+, : Membaca sebuah karakter masukan tunggal ke dalam current cell.
+[ : Jika nilai pada current cell bernilai nol, lewati hingga mencapai ] yang sesuai.
+ Jika tidak, pindah ke instruksi berikutnya.
+] : Jika nilai pada current cell bernilai nol, pindah ke instruksi berikutnya.
+ Jika tidak, mundur pada instruksi hingga mencapai [ yang sesuai.
+
+[ dan ] membentuk sebuah rekursi while. Tentu saja mereka harus seimbang.
+
+Mari kita lihat beberapa program brainfuck dasar.
+
+++++++ [ > ++++++++++ < - ] > +++++ .
+
+Program ini mencetak huruf 'A'. Mula-mula, cell #1 dinaikkan ke 6.
+Cell #1 akan digunakan untuk rekursi. Lalu, masuk ke rekursi ([) dan pindah
+ke cell #2. Cell #2 dinaikkan 10 kali, mundur ke cell #1, dan menurunkan
+cell #1. Rekursi ini berlangsung 6 kali (melakukan 6 penurunan nilai untuk
+cell #1 hingga mencapai 0, di titik mana dia melewati hingga mencapai ] dan
+terus berlanjut).
+
+Pada titik ini, kita berada pada cell #1, yang memiliki nilai 0, sedangkan cell #2
+memiliki sebuah nilai 60. Kita berpindah ke cell #2, menaikkan nilai 5 kali, memunculkan
+nilai 65, lalu cetak nilai pada cell #2. 65 adalah 'A' pada ASCII, jadi 'A'
+dicetak ke terminal.
+
+, [ > + < - ] > .
+
+Program ini membaca sebuah karakter dari masukan user dan menyalin karakternya ke
+cell #1. Setelah itu rekursi dimulai. Geser ke cell #2, menaikkan nilai pada cell #2,
+mundur ke cell #1, dan menurunkan nilai pada cell #1. Hal ini berlanjut sampai cell #1
+bernilai 0, dan cell #2 menyimpan nilai lama dari cell #1. Karena kita berada di cell #1
+saat ujung rekursi, geser ke cell #2, lalu cetak nilai dalam bentuk ASCII.
+
+Perlu diingat bahwa spasi itu murni untuk memudahkan membaca. Anda bisa
+menuliskannya dengan mudah seperti:
+
+,[>+<-]>.
+
+Coba dan cari tahu apa yang program ini lakukan:
+
+,>,< [ > [ >+ >+ << -] >> [- << + >>] <<< -] >>
+
+Program ini menerima dua buah angka sebagai input, lalu mengalikannya.
+
+Intinya adalah membaca dua masukan. Lalu mulai pada rekursi terluar yang
+kondisinya pada cell #1. Lalu pindah ke cell #2, dan mulai rekursi terdalam
+yang kondisinya ada pada cell #2, menaikkan nilai pada cell #3. Namun,
+ada suatu masalah: Pada akhir dari rekursi terdalam, cell #2 bernilai nol.
+Pada kasus tersebut, rekursi terdalam tidak dapat bekerja lagi mulai setelah ini.
+Untuk menyelesaikan masalah tersebut, kita juga menaikkan cell #4, dan menyalin
+ulang cell #4 ke cell #2. Maka cell #3 adalah hasilnya.
+```
+
+Dan itulah brainfuck. Tidak terlalu sulit kan? Hanya untuk iseng-iseng, anda
+bisa menuliskan porgram brainfuck anda sendiri, atau anda bisa menuliskan interpreter
+brainfuck pada bahasa lain. Interpreternya tidak begitu sulit untuk diimplementasikan,
+tapi jika anda seorang masokis, cobalah menulis sebuah interpreter brainfuck... dalam
+brainfuck.
+
diff --git a/id-id/rst-id.html.markdown b/id-id/rst-id.html.markdown
new file mode 100644
index 00000000..06d80089
--- /dev/null
+++ b/id-id/rst-id.html.markdown
@@ -0,0 +1,122 @@
+---
+language: restructured text (RST)
+filename: rst-id.html
+contributors:
+ - ["DamienVGN", "https://github.com/martin-damien"]
+ - ["Andre Polykanine", "https://github.com/Oire"]
+translators:
+ - ["Haydar Ali Ismail", "https://github.com/haydarai"]
+lang: id-id
+---
+
+RST adalah sebual format file yang dibuat oleh komunitas Python untuk menulis
+dokumentasi (dan menjadi bagian dari Docutils).
+
+File-file RST adalah sebuah file-file teks simpel dengan sintaks yang ringan
+(dibandingkan dengan HTML).
+
+
+## Pemasangan
+
+Untuk menggunakan RST, anda harus memasang [Python](http://www.python.org) dan
+paket `docutils` terlebih dahulu.
+
+`docutils` bisa dipasang menggunakan command berikut:
+
+```bash
+$ easy_install docutils
+```
+
+Jika sistem anda sudah mempunyai `pip`, anda bisa menggunakannya juga:
+
+```bash
+$ pip install docutils
+```
+
+
+## Sintaks file
+
+Sebuah contoh sederhana dari sintaks file:
+
+```
+.. Baris yang dimulai dengan dua titik adalah perintah spesial. Tetapi jika
+perintah tidak ditemukan, maka baris tersebut akan dianggap sebagai komentar
+
+===============================================================================
+Judul utama ditulis menggunakan rentetan tanda sama dengan di atas dan bawahnya
+===============================================================================
+
+Ingat bahwa jumlah tanda sama dengan harus sama panjangnya dengan total
+karakter judul
+
+Judul juga digarisbawahi dengan tanda sama dengan juga
+======================================================
+
+Sub-judul dengan menggunakan dash
+---------------------------------
+
+Dan sub-sub-judul dengan menggunakan tilde
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Anda bisa menulis teks dalam *italik* atau *tebal*, anda bisa "menandai" teks
+sebagai kode dengan menggunakan backquote ganda ``: ``print()``.
+
+Membuat daftar semudah seperti dalam Markdown:
+
+- Barang pertama
+- Barang kedua
+ - Sub barang
+
+atau
+
+* Barang pertama
+* Barang kedua
+ * Sub barang
+
+Tabel sangat mudah untuk ditulis:
+
+=========== ========
+Negara Ibu Kota
+=========== ========
+Prancis Paris
+Jepang Tokyo
+=========== ========
+
+Tabel yang lebih kompleks bisa dibuat dengan mudah (kolom tergabung atau/dan
+baris) tetapi saya menyarankan anda untuk membaca dokumentasi lengkap tentang
+ini :)
+
+Ada berbagai macam cara untuk membuat tautan:
+
+- Dengan menambahkan garis bawah setelah sebuah huruf : Github_ dan dengan
+menambahkan URL target setelah teks (cara ini mempunyai kelebihan dengan tidak
+memasukkan URL yang tidak penting ke dalam teks yang bisa dibaca).
+- Dengan mengetik URL lengkap yang dapat dipahami : https://github.com (akan
+otomatis diubah menjadi sebuah link)
+- Dengan membuat link seperti di Markdown: `Github <https://github.com/>`_ .
+
+.. _Github https://github.com/
+
+```
+
+
+## Bagaimana Cara Menggunakannya
+
+RST hadir dengan docutils di mana anda mempunyai `rst2html`, sebagai contoh:
+
+```bash
+$ rst2html fileku.rst hasil.html
+```
+
+*Catatan : Di beberapa sistem, perintah tersebut bisa menjadi rst2html.py*
+
+Tetapi ada beberapa aplikasi kompleks yang menggunakan format RST:
+
+- [Pelican](http://blog.getpelican.com/), Generator web statik
+- [Sphinx](http://sphinx-doc.org/), Generator dokumnetasi
+- dan masih banyak lainnya
+
+
+## Bacaan
+
+- [Referensi singkat resmi](http://docutils.sourceforge.net/docs/user/rst/quickref.html)
diff --git a/it-it/go-it.html.markdown b/it-it/go-it.html.markdown
index e005f2dc..e49ccd79 100644
--- a/it-it/go-it.html.markdown
+++ b/it-it/go-it.html.markdown
@@ -26,14 +26,14 @@ Aggiunge la concorrenza in maniera diretta e semplice da capire, per far
forza sulle CPU multi-core di oggigiorno. Presenta caratteristiche utili
per la programmazione in larga scala.
-Go comes with a great standard library and an enthusiastic community.
+Go include un'ottima libreria standard e ha una community entusiasta.
```go
// Commento su riga singola
/* Commento
su riga multipla */
-// In cima a ogni file è necessario specificare il package.
+// In cima ad ogni file è necessario specificare il package.
// Main è un package speciale che identifica un eseguibile anziché una libreria.
package main
@@ -65,19 +65,19 @@ func oltreIlCiaoMondo() {
x = 3 // Assegnazione di una variabile.
// E' possibile la dichiarazione "rapida" := per inferire il tipo, dichiarare e assegnare contemporaneamente.
y := 4
- // Una funzione che ritorna due valori.
- somma, prod := imparaMoltepliciValoriDiRitorno(x, y)
+ // Una funzione che restituisce due valori.
+ somma, prod := imparaMoltepliciValoriRestituiti(x, y)
fmt.Println("somma:", somma, "prodotto:", prod) // Semplice output.
imparaTipi() // < y minuti, devi imparare ancora!
}
/* <- commento su righe multiple
-Le funzioni possono avere parametri e ritornare (molteplici!) valori.
-Qua, x e y sono gli argomenti, mentre somma e prod sono i valori ritornati.
+Le funzioni possono avere parametri e restituire (molteplici!) valori.
+In questo esempio, x e y sono gli argomenti, mentre somma e prod sono i valori restituiti.
Da notare il fatto che x e somma vengono dichiarati come interi.
*/
-func imparaMoltepliciValoriDiRitorno(x, y int) (somma, prod int) {
- return x + y, x * y // Ritorna due valori.
+func imparaMoltepliciValoriRestituiti(x, y int) (somma, prod int) {
+ return x + y, x * y // Restituisce due valori.
}
// Ecco alcuni tipi presenti in Go
@@ -86,7 +86,7 @@ func imparaTipi() {
str := "Impara il Go!" // Tipo stringa.
s2 := `Una stringa letterale
-puo' includere andata a capo.` // Sempre di tipo stringa.
+può includere andata a capo.` // Sempre di tipo stringa.
// Stringa letterale non ASCII. I sorgenti Go sono in UTF-8.
g := 'Σ' // Il tipo runa, alias per int32, è costituito da un code point unicode.
@@ -144,20 +144,20 @@ puo' includere andata a capo.` // Sempre di tipo stringa.
imparaControlloDiFlusso() // Torniamo in carreggiata.
}
-// In Go è possibile associare dei nomi ai valori di ritorno di una funzione.
-// Assegnare un nome al tipo di dato ritornato permette di fare return in vari
+// In Go è possibile associare dei nomi ai valori restituiti da una funzione.
+// Assegnare un nome al tipo di dato restituito permette di fare return in vari
// punti all'interno del corpo della funzione, ma anche di usare return senza
-// specificare in modo esplicito che cosa ritornare.
-func imparaValoriDiRitornoConNome(x, y int) (z int) {
+// specificare in modo esplicito che cosa restituire.
+func imparaValoriRestituitiConNome(x, y int) (z int) {
z = x * y
return // z è implicito, perchè compare nella definizione di funzione.
}
// Go è dotato di garbage collection. Ha i puntatori, ma non l'aritmetica dei
-// puntatori. Puoi fare errori coi puntatori a nil, ma non puoi direttamente
-// incrementare un puntatore.
+// puntatori. Puoi commettere errori a causa di puntatori nulli, ma non puoi
+// incrementare un puntatore direttamente.
func imparaLaMemoria() (p, q *int) {
- // I valori di ritorno (con nome) p e q sono puntatori a int.
+ // I valori restituiti (con nome) p e q sono puntatori a int.
p = new(int) // La funzione new si occupa di allocare memoria.
// L'int allocato viene inizializzato a 0, dunque p non è più nil.
s := make([]int, 20) // Alloca 20 int come un singolo blocco di memoria.
@@ -207,14 +207,14 @@ func imparaControlloDiFlusso() {
}
// x == 42 qua.
- // Il for è l'unica istruzione per ciclare in Go, ma ha varie forme.
+ // Il for è l'unica istruzione per i loop in Go, ma ha varie forme.
for { // Ciclo infinito.
break // Scherzavo.
continue // Non si arriva qua.
}
- // Puoi usare range per ciclare su un vettore, slice, stringa, mappa o canale.
- // range ritorna uno (per i canali) o due valori (vettore, slice, stringa, mappa).
+ // Puoi usare range per iterare lungo un vettore, slice, stringa, mappa o canale.
+ // range restituisce uno (per i canali) o due valori (vettore, slice, stringa, mappa).
for chiave, valore := range map[string]int{"uno": 1, "due": 2, "tre": 3} {
// per ogni coppia dentro la mappa, stampa chiave e valore
fmt.Printf("chiave=%s, valore=%d\n", chiave, valore)
@@ -236,7 +236,7 @@ func imparaControlloDiFlusso() {
// Inoltre le funzioni letterali possono essere definite e chiamate
// inline, col ruolo di parametri di funzione, a patto che:
// a) la funzione letterale venga chiamata subito (),
- // b) il valore ritornato è in accordo con il tipo dell'argomento.
+ // b) il valore restituito è in accordo con il tipo dell'argomento.
fmt.Println("Somma e raddoppia due numeri: ",
func(a, b int) int {
return (a + b) * 2
@@ -247,7 +247,7 @@ func imparaControlloDiFlusso() {
goto amore
amore:
- imparaFabbricaDiFunzioni() // Una funzione che ritorna un'altra funzione è divertente!
+ imparaFabbricaDiFunzioni() // Una funzione che restituisce un'altra funzione è divertente!
imparaDefer() // Un tour veloce di una parola chiave importante.
imparaInterfacce() // Arriva la roba buona!
}
@@ -271,7 +271,7 @@ func fabbricaDiFrasi(miaStringa string) func(prima, dopo string) string {
func imparaDefer() (ok bool) {
// Le istruzioni dette "deferred" (rinviate) sono eseguite
- // appena prima che la funzione ritorni.
+ // appena prima che la funzione abbia termine.
defer fmt.Println("le istruzioni 'deferred' sono eseguite in ordine inverso (LIFO).")
defer fmt.Println("\nQuesta riga viene stampata per prima perché")
// defer viene usato di solito per chiudere un file, così la funzione che
diff --git a/it-it/html-it.html.markdown b/it-it/html-it.html.markdown
new file mode 100644
index 00000000..471019a1
--- /dev/null
+++ b/it-it/html-it.html.markdown
@@ -0,0 +1,121 @@
+---
+language: html
+filename: learnhtml-it.html
+contributors:
+ - ["Christophe THOMAS", "https://github.com/WinChris"]
+translators:
+ - ["Ale46", "http://github.com/Ale46/"]
+lang: it-it
+---
+
+HTML sta per HyperText Markup Language (linguaggio a marcatori per ipertesti).
+È un linguaggio che consente di scrivere pagine web per il world wide web.
+È un linguaggio di markup, che permette di scrivere pagine web usando del codice che indica come il testo ed i dati devono essere mostrati.
+Infatti, i files html sono semplici file di testo.
+Cos'è il markup? È un metodo per organizzare i dati della pagina circondandoli con tag di apertura e tag di chiusura.
+Questo markup serve a dare significato al testo che racchiude.
+Come altri linguaggi di programmazione, HTML ha molte versioni. Qui discuteremo di HTML5.
+
+**NOTA :** Puoi testare i differenti tags ed elementi man mano che prosegui nel tutorial in un sito come [codepen](http://codepen.io/pen/) per vedere i loro effetti, capire come lavorano e familiarizzare con il linguaggio.
+Questo articolo riguarda principalmente la sintassi HTML ed alcuni suggerimenti utili.
+
+
+```html
+<!-- I commenti sono racchiusi come in questa riga! -->
+
+<!-- #################### I Tags #################### -->
+
+<!-- Ecco un esempio di file HTML che andremo ad analizzare. -->
+
+<!doctype html>
+ <html>
+ <head>
+ <title>Il mio sito</title>
+ </head>
+ <body>
+ <h1>Ciao, mondo!</h1>
+ <a href = "http://codepen.io/anon/pen/xwjLbZ">Vieni a vedere ciò che mostra</a>
+ <p>Questo è un paragrafo.</p>
+ <p>Questo è un altro paragrafo.</p>
+ <ul>
+ <li>Questo è un elemento di un elenco non numerato (elenco puntato)</li>
+ <li>Questo è un altro elemento</li>
+ <li>E questo è l'ultimo elemento dell'elenco</li>
+ </ul>
+ </body>
+ </html>
+
+<!-- Un file HTML inizia sempre indicando al browser che la pagina è HTML. -->
+<!doctype html>
+
+<!-- Dopo questo, inizia aprendo un tag <html>. -->
+<html>
+
+<!-- che sarà chiuso alla fine del file con </html>. -->
+</html>
+
+<!-- Nulla dovrebbe apparire dopo questo tag finale. -->
+
+<!-- All'interno (tra i tag di apertura e chiusura <html> </html>) troviamo: -->
+
+<!-- Un'intestazione definita da <head> (deve essere chiusa con </head>). -->
+<!-- L'intestazione contiene alcune descrizioni e informazioni aggiuntive non visualizzate; questi sono i metadati. -->
+
+<head>
+ <title>Il mio sito</title> <!-- Il tag <title> indica al browser il titolo da mostrare nella barra del titolo della finestra del browser e nel nome della scheda. -->
+</head>
+
+<!-- Dopo la sezione <head>, troviamo il tag - <body> -->
+<!-- Fino a questo punto, niente di ciò che abbiamo descritto verrà visualizzato nella finestra del browser. -->
+<!-- Dobbiamo riempire il corpo con il contenuto da visualizzare. -->
+
+<body>
+ <h1>Ciao, mondo!</h1> <!-- Il tag h1 crea un titolo. -->
+ <!-- Ci sono anche sottotitoli a <h1> dal più importante (h2) al più preciso (h6). -->
+ <a href = "http://codepen.io/anon/pen/xwjLbZ">Vieni a vedere ciò che mostra</a> <!-- un collegamento ipertestuale all'URL fornito dall'attributo href="" -->
+ <p>Questo è un paragrafo.</p> <!-- Il tag <p> ci permette di includere del testo nella pagina html. -->
+ <p>Questo è un altro paragrafo.</p>
+ <ul> <!-- Il tag <ul> crea un elenco puntato. -->
+ <!-- Per avere un elenco numerato, invece, usiamo <ol> che restituisce 1. per il primo elemento, 2. per il secondo, etc. -->
+ <li>Questo è un elemento in un elenco non elencato (elenco puntato)</li>
+ <li>Questo è un altro elemento</li>
+ <li>E questo è l'ultimo elemento dell'elenco</li>
+ </ul>
+</body>
+
+<!-- E questo è tutto, creare un file HTML può essere molto semplice. -->
+
+<!-- Ma è possibile aggiungere molti altri tipi di tag HTML. -->
+
+<!-- Per inserire un'immagine. -->
+<img src="http://i.imgur.com/XWG0O.gif"/> <!-- La fonte dell'immagine viene indicata usando l'attributo src="" -->
+<!-- La fonte può essere un URL o persino un percorso di un file sul tuo computer. -->
+
+<!-- È anche possibile creare una tabella. -->
+
+<table> <!-- Apriamo un elemento <table>. -->
+ <tr> <!-- <tr> ci permette di creare una riga. -->
+ <th>Prima intestazione</th> <!-- <th> ci permette di dare un titolo ad una colonna della tabella. -->
+ <th>Seconda intestazione</th>
+ </tr>
+ <tr>
+ <td>prima riga, prima colonna</td> <!-- <td> ci permette di creare una cella della tabella. -->
+ <td>prima riga, seconda colonna</td>
+ </tr>
+ <tr>
+ <td>seconda riga, prima colonna</td>
+ <td>seconda riga, seconda colonna</td>
+ </tr>
+</table>
+
+```
+
+## Uso
+
+HTML è scritto in files che finiscono con `.html`.
+
+## Per saperne di più
+
+* [wikipedia](https://it.wikipedia.org/wiki/HTML)
+* [HTML tutorial](https://developer.mozilla.org/it/docs/Web/HTML)
+* [W3School](http://www.w3schools.com/html/html_intro.asp)
diff --git a/it-it/markdown.html.markdown b/it-it/markdown.html.markdown
index b006dbb4..44801747 100644
--- a/it-it/markdown.html.markdown
+++ b/it-it/markdown.html.markdown
@@ -2,41 +2,65 @@
language: markdown
contributors:
- ["Dan Turkel", "http://danturkel.com/"]
+ - ["Jacob Ward", "http://github.com/JacobCWard/"]
translators:
- ["Jacopo Andrea Giola", "http://geekpanda.net"]
+ - ["Ale46", "https://github.com/Ale46"]
filename: markdown-it.md
lang: it-it
---
Markdown è stato creato da John Gruber nel 2004. Il suo scopo è quello di essere una sintassi facile da leggere e scrivere, e che può essere convertita in HTML (ad oggi anche in molti altri formati).
-Mandate tutto il feedback che volete! / Sentitevi liberi di forkare o di mandare pull request!
+Markdown varia nelle sue implementazioni da un parser all'altro. Questa guida cercherà di chiarire quali caratteristiche esistono a livello globale o quando sono disponibili solo per un determinato parser.
+- [Elementi HTML](#elementi-html)
+- [Titoli](#titoli)
+- [Stili di testo semplici](#stili-di-testo-semplici)
+- [Paragrafi](#paragrafi)
+- [Liste](#liste)
+- [Estratti di codice](#estratti-di-codice)
+- [Linea orizzontale](#linea-orizzontale)
+- [Links](#links)
+- [Immagini](#immagini)
+- [Miscellanea](#miscellanea)
+
+## Elementi HTML
+Markdown è un superset di HTML, quindi ogni file HTML è a sua volta un file Markdown valido.
```markdown
-<!-- Markdown è un superset di HTML, quindi ogni file HTML è a sua volta un file Markdown valido. Questo significa che possiamo usare elementi di HTML in Markdown, come per esempio i commenti, e questi non saranno modificati dal parser di Markdown. State attenti però, se inserite un elemento HTML nel vostro file Markdown, non potrete usare la sua sintassi all'interno del contenuto dell'elemento. -->
+<!-- Questo significa che possiamo usare elementi di HTML in Markdown, come per esempio i commenti,
+e questi non saranno modificati dal parser di Markdown. State attenti però,
+se inserite un elemento HTML nel vostro file Markdown, non potrete usare la sua sintassi
+all'interno del contenuto dell'elemento. -->
+```
+
+## Titoli
-<!-- L'implementazione di Markdown inoltre cambia da parser a parser. In questa guida cercheremo di indicare quando una feature è universale e quando sono specifiche ad un certo parser. -->
+Potete creare gli elementi HTML da `<h1>` a `<h6>` facilmente, basta che inseriate un egual numero di caratteri cancelletto (#) prima del testo che volete all'interno dell'elemento
-<!-- Titoli -->
-<!-- Potete creare gli elementi HTML da <h1> ad <h6> facilmente, basta che inseriate un egual numero di caratteri cancelletto (#) prima del testo che volete all'interno dell'elemento -->
+```markdown
# Questo è un <h1>
## Questo è un <h2>
### Questo è un <h3>
#### Questo è un <h4>
##### Questo è un <h5>
###### Questo è un <h6>
+```
+Markdown inoltre fornisce due alternative per indicare gli elementi h1 e h2
-<!-- Markdown inoltre fornisce due alternative per indicare gli elementi h1 e h2 -->
+```markdown
Questo è un h1
==============
Questo è un h2
--------------
+```
-<!-- Stili di testo semplici -->
-<!-- Il testo può essere stilizzato in corsivo o grassetto usando markdown -->
+## Stili di testo semplici
+Il testo può essere stilizzato in corsivo o grassetto usando markdown
+```markdown
*Questo testo è in corsivo.*
_Come pure questo._
@@ -46,30 +70,38 @@ __Come pure questo.__
***Questo testo è stilizzato in entrabmi i modi.***
**_Come questo!_**
*__E questo!__*
+```
-<!-- In Github Flavored Markdown, che è utilizzato per renderizzare i file markdown su
-Github, è presente anche lo stile barrato -->
+In Github Flavored Markdown, che è utilizzato per renderizzare i file markdown su Github, è presente anche lo stile barrato:
+```markdown
~~Questo testo è barrato.~~
+```
+## Paragrafi
-<!-- I paragrafi sono uno o più linee di testo addiacenti separate da una o più righe vuote. -->
+```markdown
+I paragrafi sono una o più linee di testo adiacenti separate da una o più righe vuote.
-Qeusto è un paragrafo. Sto scrivendo in un paragrafo, non è divertente?
+Questo è un paragrafo. Sto scrivendo in un paragrafo, non è divertente?
Ora sono nel paragrafo 2.
Anche questa linea è nel paragrafo 2!
Qui siamo nel paragrafo 3!
+```
-<!-- Se volete inserire l'elemento HTML <br />, potete terminare la linea con due o più spazi e poi iniziare un nuovo paragrafo. -->
+Se volete inserire l'elemento HTML `<br />`, potete terminare la linea con due o più spazi e poi iniziare un nuovo paragrafo.
+```markdown
Questa frase finisce con due spazi (evidenziatemi per vederli).
C'è un <br /> sopra di me!
+```
-<!-- Le citazioni sono semplici da inserire, basta usare il carattere >. -->
+Le citazioni sono semplici da inserire, basta usare il carattere >.
+```markdown
> Questa è una citazione. Potete
> mandare a capo manualmente le linee e inserire un `>` prima di ognuna, oppure potete usare una sola linea e lasciare che vada a capo automaticamente.
> Non c'è alcuna differenza, basta che iniziate ogni riga con `>`.
@@ -78,9 +110,12 @@ C'è un <br /> sopra di me!
>> di indentazione!
> Quanto è comodo?
-<!-- Liste -->
-<!-- Le liste non ordinate possono essere inserite usando gli asterischi, il simbolo più o dei trattini -->
+```
+
+## Liste
+Le liste non ordinate possono essere inserite usando gli asterischi, il simbolo più o dei trattini
+```markdown
* Oggetto
* Oggetto
* Altro oggetto
@@ -96,149 +131,180 @@ oppure
- Oggetto
- Oggetto
- Un ultimo oggetto
+```
-<!-- Le liste ordinate invece, sono inserite con un numero seguito da un punto. -->
+Le liste ordinate invece, sono inserite con un numero seguito da un punto.
+```markdown
1. Primo oggetto
2. Secondo oggetto
3. Terzo oggetto
+```
-<!-- Non dovete nemmeno mettere i numeri nell'ordine giusto, markdown li visualizzerà comunque nell'ordine corretto, anche se potrebbe non essere una buona idea. -->
+Non dovete nemmeno mettere i numeri nell'ordine giusto, markdown li visualizzerà comunque nell'ordine corretto, anche se potrebbe non essere una buona idea.
+```markdown
1. Primo oggetto
1. Secondo oggetto
1. Terzo oggetto
-<!-- (Questa lista verrà visualizzata esattamente come quella dell'esempio prima) -->
+```
+(Questa lista verrà visualizzata esattamente come quella dell'esempio prima)
-<!-- Potete inserire anche sotto liste -->
+Potete inserire anche sotto liste
+```markdown
1. Primo oggetto
2. Secondo oggetto
3. Terzo oggetto
* Sotto-oggetto
* Sotto-oggetto
4. Quarto oggetto
+```
-<!-- Sono presenti anche le task list. In questo modo è possibile creare checkbox in HTML. -->
+Sono presenti anche le task list. In questo modo è possibile creare checkbox in HTML.
+```markdown
I box senza la 'x' sono checkbox HTML ancora da completare.
- [ ] Primo task da completare.
- [ ] Secondo task che deve essere completato.
Il box subito sotto è una checkbox HTML spuntata.
- [x] Questo task è stato completato.
+```
+## Estratti di codice
-<!-- Estratti di codice -->
-<!-- Potete inserire un estratto di codice (che utilizza l'elemento <code>) indentando una linea con quattro spazi oppure con un carattere tab -->
+Potete inserire un estratto di codice (che utilizza l'elemento `<code>`) indentando una linea con quattro spazi oppure con un carattere tab.
+```markdown
Questa è una linea di codice
Come questa
+```
-<!-- Potete inoltre inserire un altro tab (o altri quattro spazi) per indentare il vostro codice -->
+Potete inoltre inserire un altro tab (o altri quattro spazi) per indentare il vostro codice
+```markdown
my_array.each do |item|
puts item
end
+```
-<!-- Codice inline può essere inserito usando il carattere backtick ` -->
+Codice inline può essere inserito usando il carattere backtick `
+```markdown
Giovanni non sapeva neppure a cosa servisse la funzione `go_to()`!
+```
-<!-- In Github Flavored Markdown, potete inoltre usare una sintassi speciale per il codice -->
-
-\`\`\`ruby <!-- In realtà dovete rimuovere i backslash, usate solo ```ruby ! -->
+In Github Flavored Markdown, potete inoltre usare una sintassi speciale per il codice
+<pre>
+<code class="highlight">&#x60;&#x60;&#x60;ruby
def foobar
puts "Hello world!"
end
-\`\`\` <!-- Anche qui, niente backslash, solamente ``` -->
+&#x60;&#x60;&#x60;</code></pre>
+Se usate questa sintassi, il testo non richiederà di essere indentato, inoltre Github userà l'evidenziazione della sintassi del linguaggio specificato dopo i \`\`\` iniziali
-<!-- Se usate questa sintassi, il testo non richiederà di essere indentanto, inoltre Github userà la syntax highlighting del linguaggio specificato dopo i ``` iniziali -->
-
-<!-- Linea orizzontale (<hr />) -->
-<!-- Le linee orizzontali sono inserite facilemtne usanto tre o più asterischi o trattini senza spazi consecutivi e senza spazi. -->
+## Linea orizzontale
+Le linee orizzontali (`<hr/>`) sono inserite facilmente usanto tre o più asterischi o trattini, con o senza spazi.
+```markdown
***
---
- - -
****************
+```
-<!-- Link -->
-<!-- Una delle funzionalità migliori di markdown è la facilità con cui si possono inserire i link. Mettete il testo da visualizzare fra parentesi quadre [] seguite dall'url messo fra parentesi tonde () -->
+## Links
+Una delle funzionalità migliori di markdown è la facilità con cui si possono inserire i link. Mettete il testo da visualizzare fra parentesi quadre [] seguite dall'url messo fra parentesi tonde ()
+```markdown
[Cliccami!](http://test.com/)
+```
-<!-- Potete inoltre aggiungere al link un titolo mettendolo fra doppie apici dopo il link -->
+Potete inoltre aggiungere al link un titolo mettendolo fra doppi apici dopo il link
+```markdown
[Cliccami!](http://test.com/ "Link a Test.com")
+```
-<!-- La sintassi funziona anche i path relativi. -->
+La sintassi funziona anche con i path relativi.
+```markdown
[Vai a musica](/music/).
+```
-<!-- Markdown supporta inoltre anche la possibilità di aggiungere i link facendo riferimento ad altri punti del testo -->
-
+Markdown supporta inoltre anche la possibilità di aggiungere i link facendo riferimento ad altri punti del testo.
+```markdown
[Apri questo link][link1] per più informazioni!
[Guarda anche questo link][foobar] se ti va.
[link1]: http://test.com/ "Bello!"
[foobar]: http://foobar.biz/ "Va bene!"
+```
+l titolo può anche essere inserito in apici singoli o in parentesi, oppure omesso interamente. Il riferimento può essere inserito in un punto qualsiasi del vostro documento e l'identificativo del riferimento può essere lungo a piacere a patto che sia univoco.
-<!-- Il titolo può anche essere inserito in apici singoli o in parentesi, oppure omesso interamente. Il riferimento può essere inserito in un punto qualsiasi del vostro documento e l'identificativo del riferimento può essere lungo a piacere a patto che sia univoco. -->
-
-<!-- Esiste anche un "identificativo implicito" che vi permette di usare il testo del link come id -->
-
+Esiste anche un "identificativo implicito" che vi permette di usare il testo del link come id.
+```markdown
[Questo][] è un link.
[Questo]: http://thisisalink.com/
+```
+Ma non è comunemente usato.
-<!-- Ma non è comunemente usato. -->
-
-<!-- Immagini -->
-<!-- Le immagini sono inserite come i link ma con un punto esclamativo inserito prima delle parentesi quadre! -->
+## Immagini
+Le immagini sono inserite come i link ma con un punto esclamativo inserito prima delle parentesi quadre!
+```markdown
![Qeusto è il testo alternativo per l'immagine](http://imgur.com/myimage.jpg "Il titolo opzionale")
+```
-<!-- E la modalità a riferimento funziona esattamente come ci si aspetta -->
+E la modalità a riferimento funziona esattamente come ci si aspetta
+```markdown
![Questo è il testo alternativo.][myimage]
[myimage]: relative/urls/cool/image.jpg "Se vi serve un titolo, lo mettete qui"
+```
+## Miscellanea
+### Auto link
-<!-- Miscellanea -->
-<!-- Auto link -->
-
+```markdown
<http://testwebsite.com/> è equivalente ad
[http://testwebsite.com/](http://testwebsite.com/)
+```
+### Auto link per le email
-<!-- Auto link per le email -->
-
+```markdown
<foo@bar.com>
+```
+### Caratteri di escaping
-<!-- Caratteri di escaping -->
-
+```markdown
Voglio inserire *questo testo circondato da asterischi* ma non voglio che venga renderizzato in corsivo, quindi lo inserirò così: \*questo testo è circondato da asterischi\*.
+```
-<!-- Combinazioni di tasti -->
-<!-- In Github Flavored Markdown, potete utilizzare il tag <kbd> per raffigurare i tasti della tastiera -->
+### Combinazioni di tasti
+In Github Flavored Markdown, potete utilizzare il tag `<kbd>` per raffigurare i tasti della tastiera.
+```markdown
Il tuo computer è crashato? Prova a premere
<kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Canc</kbd>
+```
-<!-- Tabelle -->
-<!-- Le tabelle sono disponibili solo in Github Flavored Markdown e sono leggeremente complesse, ma se proprio volete inserirle fate come segue: -->
+### Tabelle
+Le tabelle sono disponibili solo in Github Flavored Markdown e sono leggeremente complesse, ma se proprio volete inserirle fate come segue:
+```markdown
| Col1 | Col2 | Col3 |
| :------------------- | :------: | -----------------: |
| Allineato a sinistra | Centrato | Allineato a destra |
| blah | blah | blah |
+```
+oppure, per lo stesso risultato
-<!-- oppure, per lo stesso risultato -->
-
+```markdown
Col 1 | Col2 | Col3
:-- | :-: | --:
È una cosa orrenda | fatela | finire in fretta
-
-<!-- Finito! -->
-
```
+---
Per altre informazioni, leggete il post ufficiale di John Gruber sulla sintassi [qui](http://daringfireball.net/projects/markdown/syntax) e il magnifico cheatsheet di Adam Pritchard [qui](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet).
diff --git a/it-it/rst-it.html.markdown b/it-it/rst-it.html.markdown
new file mode 100644
index 00000000..a834e899
--- /dev/null
+++ b/it-it/rst-it.html.markdown
@@ -0,0 +1,111 @@
+---
+language: restructured text (RST)
+filename: restructuredtext-it.rst
+contributors:
+ - ["DamienVGN", "https://github.com/martin-damien"]
+ - ["Andre Polykanine", "https://github.com/Oire"]
+translators:
+ - ["Ale46", "https://github.com/Ale46"]
+ - ["Chris54721", "https://chris54721.net"]
+lang: it-it
+---
+
+RST (Restructured Text) è un formato di file inizialmente creato dalla comunità Python
+per la documentazione (per questo motivo appartiene a Docutils).
+
+I file RST sono semplici file di testo con una sintassi leggera (in confronto all'HTML).
+
+## Installazione
+
+Per usare Restructured Text, sarà necessario installare [Python](http://www.python.org) ed il pacchetto `docutils`.
+
+`docutils` può essere installato da riga di comando:
+
+```bash
+$ easy_install docutils
+```
+
+Oppure, se hai `pip` installato sul tuo sistema:
+
+```bash
+$ pip install docutils
+```
+
+
+## Sintassi del file
+
+Ecco un semplice esempio della sintassi RST:
+
+```
+.. Le righe che iniziano con due punti sono comandi speciali. Ma se non è possibile trovare alcun comando, la riga viene considerata come un commento
+
+===============================================================================
+I titoli principali sono scritti utilizzando caratteri di uguale, sopra e sotto
+===============================================================================
+
+Si noti che devono esserci tanti caratteri di uguale quanti caratteri del titolo.
+
+Anche i titoli normali usano caratteri di uguale, ma solo sotto
+===============================================================
+
+I sottotitoli usano i trattini
+------------------------------
+
+E i sotto-sottotitoli le tildi
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Puoi inserire il testo in *corsivo* o in **grassetto**, puoi "contrassegnare" il testo come codice con un doppio apice ``: `` print () ``.
+
+Le liste sono semplici come in Markdown:
+
+- primo articolo
+- Secondo elemento
+     - Sottoelemento
+
+oppure
+
+* Primo elemento
+* Secondo elemento
+     * Sottoelemento
+
+Le tabelle sono molto semplici da inserire:
+
+=========== ========
+Stato Capitale
+=========== ========
+Francia Parigi
+Giappone Tokio
+=========== ========
+
+Anche le tabelle più complesse possono essere inserite facilmente (colonne e/o righe unite) ma ti suggerisco di leggere la documentazione completa per questo :)
+
+Esistono diversi modi per creare collegamenti:
+
+- Aggiungendo un underscore dopo una parola: Github_ e aggiungendo l'URL di destinazione dopo il testo (questo metodo ha il vantaggio di non inserire URL non necessari all'interno del testo leggibile).
+- Digitando un URL completo: https://github.com/ (verrà automaticamente convertito in un collegamento)
+- Utilizzando una sintassi simile a Markdown: `Github <https://github.com/>`_ .
+
+.. _Github https://github.com/
+
+```
+
+## Come usarlo
+
+RST viene fornito con docutils, che dispone di `rst2html`, per esempio:
+
+```bash
+$ rst2html miofile.rst output.html
+```
+
+*Nota : In alcuni sistemi il comando potrebbe essere rst2html.py*
+
+Ma ci sono applicazioni più complesse che utilizzano il formato RST:
+
+- [Pelican](http://blog.getpelican.com/), un generatore di siti statici
+- [Sphinx](http://sphinx-doc.org/), un generatore di documentazione
+- e molti altri
+
+
+## Letture
+
+- [Riferimento ufficiale rapido](http://docutils.sourceforge.net/docs/user/rst/quickref.html)
diff --git a/java.html.markdown b/java.html.markdown
index fa1ff3d1..dd875c16 100644
--- a/java.html.markdown
+++ b/java.html.markdown
@@ -173,7 +173,7 @@ public class LearnJava {
// Char - A single 16-bit Unicode character
char fooChar = 'A';
- // final variables can't be reassigned to another object,
+ // final variables can't be reassigned,
final int HOURS_I_WORK_PER_WEEK = 9001;
// but they can be initialized later.
final double E;
@@ -280,7 +280,7 @@ public class LearnJava {
// LinkedLists - Implementation of doubly-linked list. All of the
// operations perform as could be expected for a
// doubly-linked list.
- // Maps - A set of objects that map keys to values. Map is
+ // Maps - A mapping of key Objects to value Objects. Map is
// an interface and therefore cannot be instantiated.
// The type of keys and values contained in a Map must
// be specified upon instantiation of the implementing
@@ -289,10 +289,16 @@ public class LearnJava {
// HashMaps - This class uses a hashtable to implement the Map
// interface. This allows the execution time of basic
// operations, such as get and insert element, to remain
- // constant even for large sets.
- // TreeMap - This class is a sorted tree structure. It implements a red
- // black tree and sorts the entries based on the key value or
- // the comparator provided while creating the object
+ // constant-amortized even for large sets.
+ // TreeMap - A Map that is sorted by its keys. Each modification
+ // maintains the sorting defined by either a Comparator
+ // supplied at instantiation, or comparisons of each Object
+ // if they implement the Comparable interface.
+ // Failure of keys to implement Comparable combined with failure to
+ // supply a Comparator will throw ClassCastExceptions.
+ // Insertion and removal operations take O(log(n)) time
+ // so avoid using this data structure unless you are taking
+ // advantage of the sorting.
///////////////////////////////////////
// Operators
@@ -306,7 +312,7 @@ public class LearnJava {
System.out.println("2-1 = " + (i2 - i1)); // => 1
System.out.println("2*1 = " + (i2 * i1)); // => 2
System.out.println("1/2 = " + (i1 / i2)); // => 0 (int/int returns int)
- System.out.println("1/2 = " + (i1 / (double)i2)); // => 0.5
+ System.out.println("1/2.0 = " + (i1 / (double)i2)); // => 0.5
// Modulo
System.out.println("11%3 = "+(11 % 3)); // => 2
@@ -418,6 +424,8 @@ public class LearnJava {
// String class, and a few special classes that wrap primitive types:
// Character, Byte, Short, and Integer.
// Starting in Java 7 and above, we can also use the String type.
+ // Note: Do remember that, not adding "break" at end any particular case ends up in
+ // executing the very next case(given it satisfies the condition provided) as well.
int month = 3;
String monthString;
switch (month) {
@@ -660,7 +668,7 @@ public interface Edible {
public interface Digestible {
public void digest();
// Since Java 8, interfaces can have default method.
- public void defaultMethod() {
+ public default void defaultMethod() {
System.out.println("Hi from default method ...");
}
}
@@ -701,15 +709,21 @@ public class ExampleClass extends ExampleClassParent implements InterfaceOne,
// // Method declarations
// }
-// Marking a class as abstract means that it contains at least one abstract
-// method that must be defined in a child class. Similar to interfaces, abstract
-// classes cannot be instantiated, but instead must be extended and the abstract
-// methods defined. Different from interfaces, abstract classes can contain a
-// mixture of concrete and abstract methods. Methods in an interface cannot
-// have a body, unless the method is static, and variables are final by default,
-// unlike an abstract class. Also abstract classes CAN have the "main" method.
+// Abstract Classes cannot be instantiated.
+// Abstract classes may define abstract methods.
+// Abstract methods have no body and are marked abstract
+// Non-abstract child classes must @Override all abstract methods
+// from their super-classes.
+// Abstract classes can be useful when combining repetitive logic
+// with customised behavior, but as Abstract classes require
+// inheritance, they violate "Composition over inheritance"
+// so consider other approaches using composition.
+// https://en.wikipedia.org/wiki/Composition_over_inheritance
+
public abstract class Animal
{
+ private int age;
+
public abstract void makeSound();
// Method can have a body
@@ -720,17 +734,12 @@ public abstract class Animal
age = 30;
}
- // No need to initialize, however in an interface
- // a variable is implicitly final and hence has
- // to be initialized.
- private int age;
-
public void printAge()
{
System.out.println(age);
}
- // Abstract classes can have main function.
+ // Abstract classes can have main method.
public static void main(String[] args)
{
System.out.println("I am abstract");
@@ -886,6 +895,8 @@ The links provided here below are just to get an understanding of the topic, fee
* [Codingbat.com](http://codingbat.com/java)
+* [Codewars - Java Katas](https://www.codewars.com/?language=java)
+
**Books**:
* [Head First Java](http://www.headfirstlabs.com/books/hfjava/)
diff --git a/javascript.html.markdown b/javascript.html.markdown
index 85c8a52d..4ed8f849 100644
--- a/javascript.html.markdown
+++ b/javascript.html.markdown
@@ -103,7 +103,7 @@ false;
// ... which works with more than just strings
"1, 2, " + 3; // = "1, 2, 3"
-"Hello " + ["world", "!"] // = "Hello world,!"
+"Hello " + ["world", "!"]; // = "Hello world,!"
// and are compared with < and >
"a" < "b"; // = true
@@ -222,7 +222,7 @@ while (true){
var input;
do {
input = getInput();
-} while (!isValid(input))
+} while (!isValid(input));
// The `for` loop is the same as C and Java:
// initialization; continue condition; iteration.
@@ -293,7 +293,7 @@ myFunction("foo"); // = "FOO"
// automatic semicolon insertion. Watch out for this when using Allman style.
function myFunction(){
return // <- semicolon automatically inserted here
- {thisIsAn: 'object literal'}
+ {thisIsAn: 'object literal'};
}
myFunction(); // = undefined
@@ -388,7 +388,7 @@ myFunc(); // = undefined
// through `this`, even if it wasn't attached when it was defined.
var myOtherFunc = function(){
return this.myString.toUpperCase();
-}
+};
myObj.myOtherFunc = myOtherFunc;
myObj.myOtherFunc(); // = "HELLO WORLD!"
@@ -397,7 +397,7 @@ myObj.myOtherFunc(); // = "HELLO WORLD!"
var anotherFunc = function(s){
return this.myString + s;
-}
+};
anotherFunc.call(myObj, " And Hello Moon!"); // = "Hello World! And Hello Moon!"
// The `apply` function is nearly identical, but takes an array for an argument
@@ -420,7 +420,7 @@ boundFunc(" And Hello Saturn!"); // = "Hello World! And Hello Saturn!"
// `bind` can also be used to partially apply (curry) a function.
-var product = function(a, b){ return a * b; }
+var product = function(a, b){ return a * b; };
var doubler = product.bind(this, 2);
doubler(8); // = 16
@@ -430,11 +430,11 @@ doubler(8); // = 16
var MyConstructor = function(){
this.myNumber = 5;
-}
+};
myNewObj = new MyConstructor(); // = {myNumber: 5}
myNewObj.myNumber; // = 5
-// Unlike most other popular object-oriented languages, JavaScript has no
+// Unlike most other popular object-oriented languages, JavaScript has no
// concept of 'instances' created from 'class' blueprints; instead, JavaScript
// combines instantiation and inheritance into a single concept: a 'prototype'.
@@ -451,7 +451,7 @@ var myObj = {
var myPrototype = {
meaningOfLife: 42,
myFunc: function(){
- return this.myString.toLowerCase()
+ return this.myString.toLowerCase();
}
};
@@ -515,7 +515,7 @@ MyConstructor.prototype = {
};
var myNewObj2 = new MyConstructor();
myNewObj2.getMyNumber(); // = 5
-myNewObj2.myNumber = 6
+myNewObj2.myNumber = 6;
myNewObj2.getMyNumber(); // = 6
// Built-in types like strings and numbers also have constructors that create
@@ -540,7 +540,7 @@ if (new Number(0)){
// you can actually add functionality to a string, for instance.
String.prototype.firstCharacter = function(){
return this.charAt(0);
-}
+};
"abc".firstCharacter(); // = "a"
// This fact is often used in "polyfilling", which is implementing newer
@@ -556,7 +556,7 @@ if (Object.create === undefined){ // don't overwrite it if it exists
Constructor.prototype = proto;
// then use it to create a new, appropriately-prototyped object
return new Constructor();
- }
+ };
}
```
diff --git a/nim.html.markdown b/nim.html.markdown
index 07674532..30dfa94f 100644
--- a/nim.html.markdown
+++ b/nim.html.markdown
@@ -12,6 +12,25 @@ that gives the programmer power without compromises on runtime efficiency.
Nim is efficient, expressive, and elegant.
```nim
+# Single-line comments start with a #
+
+#[
+ Multi-line comments begin with a #[
+ ... and end with ]#
+
+They don't care about indentation
+
+ #[
+ and they can be nested
+ ]#
+
+]#
+
+discard """
+This can also work as a multiline comment.
+Or for unparsable, broken code
+"""
+
var # Declare (and assign) variables,
letter: char = 'n' # with or without type annotations
lang = "N" & "im"
@@ -35,10 +54,6 @@ when compileBadCode: # `when` is a compile time `if`
discard 1 > 2 # Note: The compiler will complain if the result of an expression
# is unused. `discard` bypasses this.
-discard """
-This can work as a multiline comment.
-Or for unparsable, broken code
-"""
#
# Data Structures
diff --git a/nix.html.markdown b/nix.html.markdown
index ef59a135..ba122a46 100644
--- a/nix.html.markdown
+++ b/nix.html.markdown
@@ -208,6 +208,12 @@ with builtins; [
{ a = 1; b = 2; }.a
#=> 1
+ # The ? operator tests whether a key is present in a set.
+ ({ a = 1; b = 2; } ? a)
+ #=> true
+ ({ a = 1; b = 2; } ? c)
+ #=> false
+
# The // operator merges two sets.
({ a = 1; } // { b = 2; })
#=> { a = 1; b = 2; }
diff --git a/pt-br/amd.html.markdown b/pt-br/amd-pt.html.markdown
index 38c1f70f..40c7cd09 100644
--- a/pt-br/amd.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/asymptoticnotation-pt.html.markdown b/pt-br/asymptoticnotation-pt.html.markdown
deleted file mode 100644
index c5299a11..00000000
--- a/pt-br/asymptoticnotation-pt.html.markdown
+++ /dev/null
@@ -1,161 +0,0 @@
----
-category: Algorithms & Data Structures
-name: Asymptotic Notation
-contributors:
- - ["Jake Prather", "http://github.com/JakeHP"]
-translators:
- - ["Carolina Knoll", "http://github.com/carolinaknoll"]
-lang: pt-br
----
-
-# Aprenda X em Y minutos
-## Onde X=Notação Assintótica
-
-# Notações Assintóticas
-## O que são?
-
-Notações assintóticas são notações matemáticas que nos permitem analisar tempo de execução
-de um algoritmo, identificando o seu comportamento de acordo como o tamanho de entrada para
-o algoritmo aumenta. Também é conhecido como taxa de "crescimento" de um algoritmo. O algoritmo
-simplesmente se torna incrivelmente lento conforme o seu tamanho aumenta? Será que pode-se na
-maior parte manter o seu tempo de execução rápido mesmo quando o tamanho de entrada aumenta?
-A notação assintótica nos dá a capacidade de responder a essas perguntas.
-
-## Além desta, existem outras alternativas para responder a essas perguntas?
-
-Uma forma seria a de contar o número de operações primitivas em diferentes tamanhos de entrada.
-Embora esta seja uma solução válida, a quantidade de trabalho necessário, mesmo para algoritmos
-simples, não justifica a sua utilização.
-
-Outra maneira é a de medir fisicamente a quantidade de tempo que leva para se executar um algoritmo
-de diferentes tamanhos. No entanto, a precisão e a relatividade (já que tempos obtidos só teriam
-relação à máquina em que eles foram testados) deste método estão ligadas a variáveis ambientais,
-tais como especificações de hardware, poder de processamento, etc.
-
-## Tipos de Notação Assintótica
-
-Na primeira seção deste documento nós descrevemos como uma notação assintótica identifica o comportamento
-de um algoritmo como as alterações de tamanho de entrada (input). Imaginemos um algoritmo como uma função
-f, n como o tamanho da entrada, e f (n) sendo o tempo de execução. Assim, para um determinado algoritmo f,
-com tamanho de entrada n você obtenha algum tempo de execução resultante f (n). Isto resulta num gráfico,
-em que o eixo Y representa o tempo de execução, o eixo X é o tamanho da entrada, e os pontos marcados são
-os resultantes da quantidade de tempo para um dado tamanho de entrada.
-
-Pode-se rotular uma função ou algoritmo com uma notação assintótica de diversas maneiras diferentes.
-Dentre seus exemplos, está descrever um algoritmo pelo seu melhor caso, pior caso, ou caso equivalente.
-O mais comum é o de analisar um algoritmo pelo seu pior caso. Isso porque você normalmente não avaliaria
-pelo melhor caso, já que essas condições não são as que você está planejando. Um bom exemplo disto é o de
-algoritmos de ordenação; especificamente, a adição de elementos a uma estrutura de tipo árvore. O melhor
-caso para a maioria dos algoritmos pode ser tão simples como uma única operação. No entanto, na maioria
-dos casos, o elemento que você está adicionando terá de ser ordenado de forma adequada através da árvore,
-o que poderia significar a análise de um ramo inteiro. Este é o pior caso, e é por ele que precisamos seguir.
-
-### Tipos de funções, limites, e simplificação
-
-```
-Função Logaritmica - log n
-Função Linear - an + b
-Função Quadrática - an^2 + bn + c
-Função Polinomial - an^z + . . . + an^2 + a*n^1 + a*n^0, onde z é uma constante
-Função Exponencial - a^n, onde a é uma constante
-```
-
-Estas são algumas classificações básicas de crescimento de função usados em várias notações. A lista
-começa com a função crescimento mais lento (logarítmica, com tempo de execução mais rápido) e vai até
-a mais rápida (exponencial, com tempo de execução mais lento). Observe que 'n', ou nossa entrada,
-cresce em cada uma dessas funções, e o resultado claramente aumenta muito mais rapidamente em função
-quadrática, polinomial e exponencial, em comparação com a logarítmica e a linear.
-
-Uma observação de boa importância é que, para as notações a serem discutidas, deve-se fazer o melhor
-para utilizar termos mais simples. Isto significa desrespeitar constantes, e simplificar termos de
-ordem, porque, como o tamanho da entrada (ou n no nosso f (n) exemplo) aumenta infinitamente (limites
-matemáticos), os termos em ordens mais baixas e constantes são de pouca ou nenhuma importância. Dito
-isto, se você possui constantes com valor 2^9001, ou alguma outra quantidade ridícula, inimaginável,
-perceberá que a simplificação distorcerá a precisão de sua notação.
-
-Já que nós queremos a forma mais simples, vamos modificar nossas funções um pouco.
-
-```
-Logaritmica - log n
-Linear - n
-Quadrática - n^2
-Polinomial - n^z, onde z é uma constante
-Exponencial - a^n, onde a é uma constante
-```
-
-### O Grande-O
-
-Grande-O, geralmente escrita como O, é uma Notação Assintótica para o pior caso para uma dada função. Digamos
-que `f(n)` é o tempo de execução de seu algoritmo, e `g(n)` é uma complexidade de tempo arbitrário que você está
-tentando se relacionar com o seu algoritmo. `f(n)` será O(g(n)), se, por qualquer constante real c (c > 0),
-`f(n)` <= `c g(n)` para cada tamanho de entrada n (n > 0).
-
-*Exemplo 1*
-
-```
-f(n) = 3log n + 100
-g(n) = log n
-```
-
-É `f(n)` um O(g(n))?
-É 3 `log n + 100` igual a O(log n)?
-Vamos checar na definição de Grande-O.
-
-```
-3log n + 100 <= c * log n
-```
-
-Existe alguma constante c que satisfaça isso para todo n?
-
-```
-3log n + 100 <= 150 * log n, n > 2 (indefinido em n = 1)
-```
-
-Sim! A definição de Grande-O foi satisfeita. Sendo assim, `f(n)` é O(g(n)).
-
-*Exemplo 2*
-
-```
-f(n) = 3 * n^2
-g(n) = n
-```
-
-É `f(n)` um O(g(n))?
-É `3 * n^2` um O(n)?
-Vamos ver na definição de Grande-O.
-
-```
-3 * n^2 <= c * n
-```
-
-Existe alguma constante que satisfaça isso para todo n?
-Não, não existe. `f(n)` NÃO É O(g(n)).
-
-### Grande-Omega
-
-Grande-Omega, comumente escrito como Ω, é uma Notação Assintótica para o melhor caso, ou
-uma taxa de crescimento padrão para uma determinada função.
-
-`f(n)` é Ω(g(n)), se, por qualquer constante c real (c > 0), `f(n)` é >= `c g(n)` para cada
-tamanho de entrada n (n > 0).
-
-Sinta-se livre para pesquisar recursos adicionais e obter mais exemplos sobre este assunto!
-Grande-O é a notação primária utilizada para tempo de execução de algoritmos, de modo geral.
-
-### Notas de Finalização
-
-É complicado exibir este tipo de assunto de forma tão curta, então é definitivamente recomendado
-pesquisar além dos livros e recursos on-line listados. Eles serão capazes de analisar o assunto com
-uma profundidade muito maior, além de ter definições e exemplos. Mais sobre onde X="Algoritmos e
-Estruturas de Dados" está a caminho: Haverá conteúdo focado na análise de exemplos de códigos reais
-em breve.
-
-## Livros
-
-* [Algorithms] (http://www.amazon.com/Algorithms-4th-Robert-Sedgewick/dp/032157351X)
-* [Algorithm Design] (http://www.amazon.com/Algorithm-Design-Foundations-Analysis-Internet/dp/0471383651)
-
-## Recursos Online
-
-* [MIT] (http://web.mit.edu/16.070/www/lecture/big_o.pdf)
-* [KhanAcademy] (https://www.khanacademy.org/computing/computer-science/algorithms/asymptotic-notation/a/asymptotic-notation)
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/bf.html.markdown b/pt-br/bf-pt.html.markdown
index 52a5269e..52a5269e 100644
--- a/pt-br/bf.html.markdown
+++ b/pt-br/bf-pt.html.markdown
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.html.markdown b/pt-br/csharp-pt.html.markdown
index 547f4817..b6e95d36 100644
--- a/pt-br/csharp.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 +
@@ -784,13 +784,13 @@ on a new line! ""Wow!"", the masses cried";
} // end class Bicycle
- // PennyFarthing is a subclass of Bicycle
+ // PennyFarthing é uma subclasse de Bicycle
class PennyFarthing : Bicycle
{
- // (Penny Farthings are those bicycles with the big front wheel.
- // They have no gears.)
+ // (Penny Farthings são aquelas bicicletas com uma grande roda frontal.
+ // Elas não tem correias.)
- // calling parent constructor
+ // chamando construtor pai
public PennyFarthing(int startCadence, int startSpeed) :
base(startCadence, startSpeed, 0, "PennyFarthing", true, BikeBrand.Electra)
{
@@ -823,10 +823,10 @@ on a new line! ""Wow!"", the masses cried";
}
}
- // Interfaces only contain signatures of the members, without the implementation.
+ // Interfaces contêm apenas as assinaturas dos membros, sem a implementação.
interface IJumpable
{
- void Jump(int meters); // all interface members are implicitly public
+ void Jump(int meters); // todos os membros da interface são implicitamente públicos
}
interface IBreakable
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/dynamic-programming-pt.html.markdown b/pt-br/dynamic-programming-pt.html.markdown
index 8de9bee6..84b055d9 100644
--- a/pt-br/dynamic-programming-pt.html.markdown
+++ b/pt-br/dynamic-programming-pt.html.markdown
@@ -22,16 +22,16 @@ Sempre se lembre!!
## Maneiras de Solucionar tais Problemas
-1. Top-Down (De cima para baixo): Começe solucionando o problema quebrando-o em
+1. Top-Down (De cima para baixo): Comece solucionando o problema quebrando-o em
partes. Se você perceber que o problema já foi resolvido, então simplemente
pegue a resposta salva. Se ainda não foi resolvido, solucione-o e salve a
resposta. Isso é geralmente fácil de pensar e muito intuitivo. É geralmente
referenciado como Memorização.
2. Bottom-Up (De baixo para cima): Analise o problema e veja a ordem em que os
-subproblemas são resolvidos e começe a solucionar dos problemas mais triviais,
+subproblemas são resolvidos e comece a solucionar dos problemas mais triviais,
até o problema dado. Neste processo, é garantido que os subproblemas são
-resolvidos antes de resoler o problema. Isto é referenciado como Programação Dinâmica.
+resolvidos antes de resolver o problema. Isto é referenciado como Programação Dinâmica.
## Exemplo de Programação Dinâmica
@@ -51,7 +51,7 @@ array antecedente e uma variável como maiorSequenciasAteAgora e seu índice
ajudariam a poupar muito tempo.
Um conceito similar poderia ser aplicado ao procurar o maior caminho em um
grafo acíclico dirigido.
----------------------------------------------------------------------------
+
```
for i=0 to n-1
LS[i]=1
@@ -62,7 +62,7 @@ grafo acíclico dirigido.
if (largest < LS[i])
```
-### Alguns Problemas Famosos de Programação Dinâmica
+## Alguns Problemas Famosos de Programação Dinâmica
```
Floyd Warshall Algorithm - Tutorial and C Program source code:http://www.thelearningpoint.net/computer-science/algorithms-all-to-all-shortest-paths-in-graphs---floyd-warshall-algorithm-with-c-program-source-code
diff --git a/pt-br/elixir.html.markdown b/pt-br/elixir-pt.html.markdown
index f8c56101..f8c56101 100644
--- a/pt-br/elixir.html.markdown
+++ b/pt-br/elixir-pt.html.markdown
diff --git a/pt-br/groovy-pt.html.markdown b/pt-br/groovy-pt.html.markdown
index 25e123c0..aed23df1 100644
--- a/pt-br/groovy-pt.html.markdown
+++ b/pt-br/groovy-pt.html.markdown
@@ -226,10 +226,12 @@ for (i in array) {
//Itera sobre um mapa
def map = ['name':'Roberto', 'framework':'Grails', 'language':'Groovy']
-x = 0
+x = ""
for ( e in map ) {
x += e.value
+ x += " "
}
+assert x.equals("Roberto Grails Groovy ")
/*
Operadores
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/pyqt-pt.html.markdown b/pt-br/pyqt-pt.html.markdown
new file mode 100644
index 00000000..10d55784
--- /dev/null
+++ b/pt-br/pyqt-pt.html.markdown
@@ -0,0 +1,92 @@
+---
+category: tool
+tool: PyQT
+filename: learnpyqt-pt.py
+contributors:
+ - ["Nathan Hughes", "https://github.com/sirsharpest"]
+translators:
+ - ["Lucas Pugliesi", "https://github.com/fplucas"]
+lang: pt-br
+---
+
+**Qt** é amplamente conhecido como um framework para desenvolvimento de
+software multi-plataforma que pode rodar em vários outras plataformas de
+softwares e hardwares com pouca ou nenhuma alteração no código, enquanto mantém
+o poder e a velocidade de uma aplicação nativa. Embora o **Qt** tenha sido
+originalmente escrito em *C++*.
+
+
+Essa é uma adaptação de uma introdução ao QT em C++ por
+[Aleksey Kholovchuk](https://github.com/vortexxx192), alguns dos exemplos de
+código podem resultar na mesma funcionalidade que essa versão, apenas usando
+o pyqt!
+
+```python
+import sys
+from PyQt4 import QtGui
+
+def window():
+ # Cria um objeto para a aplicação
+ app = QtGui.QApplication(sys.argv)
+ # Cria um widget onde o nosso label será inserido
+ w = QtGui.QWidget()
+ # Adiciona um label ao widget
+ b = QtGui.QLabel(w)
+ # Informa algum texto ao label
+ b.setText("Hello World!")
+ # Define os tamanhos e posições dos objetos
+ w.setGeometry(100, 100, 200, 50)
+ b.move(50, 20)
+ # Define o título da janela
+ w.setWindowTitle("PyQt")
+ # Exibe a janela
+ w.show()
+ # Executa tudo o que foi pedido, apenas uma vez
+ sys.exit(app.exec_())
+
+if __name__ == '__main__':
+ window()
+
+```
+
+Para utilizar mais funcionalidades no **pyqt** veremos a construção de alguns
+outros elementos.
+Aqui mostraremos como criar uma janela popup, muito útil para perguntar ao
+usuário qual decisão tomar ou exibir alguma informação.
+
+```Python
+import sys
+from PyQt4.QtGui import *
+from PyQt4.QtCore import *
+
+
+def window():
+ app = QApplication(sys.argv)
+ w = QWidget()
+ # Cria um botão e o anexa ao widget w
+ b = QPushButton(w)
+ b.setText("Press me")
+ b.move(50, 50)
+ # Informa b a chamar essa função quando for clicado
+ # observe que a função chamada não necessita de "()"
+ b.clicked.connect(showdialog)
+ w.setWindowTitle("PyQt Dialog")
+ w.show()
+ sys.exit(app.exec_())
+
+# Essa função deve criar uma janela de diálogo com um botão,
+# aguarda ser clicado e encerra o programa
+def showdialog():
+ d = QDialog()
+ b1 = QPushButton("ok", d)
+ b1.move(50, 50)
+ d.setWindowTitle("Dialog")
+ # Essa modalidade define que o popup deve bloquear as outras janelas quando ativo
+ d.setWindowModality(Qt.ApplicationModal)
+ # Ao ser clicado deve encerrar o processo
+ b1.clicked.connect(sys.exit)
+ d.exec_()
+
+if __name__ == '__main__':
+ window()
+```
diff --git a/pt-br/qt-pt.html.markdown b/pt-br/qt-pt.html.markdown
new file mode 100644
index 00000000..99579c35
--- /dev/null
+++ b/pt-br/qt-pt.html.markdown
@@ -0,0 +1,174 @@
+---
+category: tool
+tool: Qt Framework
+language: c++
+filename: learnqt-pt.cpp
+contributors:
+ - ["Aleksey Kholovchuk", "https://github.com/vortexxx192"]
+translators:
+ - ["Lucas Pugliesi", "https://github.com/fplucas"]
+lang: pt-br
+---
+
+**Qt** é amplamente conhecido como um framework para desenvolvimento de
+software multi-plataforma que pode rodar em vários outras plataformas de
+softwares e hardwares com pouca ou nenhuma alteração no código, enquanto mantém
+o poder e a velocidade de uma aplicação nativa. Embora o **Qt** tenha sido
+originalmente escrito em *C++*, é possível utilizá-lo em outras linguagens:
+*[PyQt](https://learnxinyminutes.com/docs/pyqt/)*, *QtRuby*, *PHP-Qt*, etc.
+
+**Qt** é ótimo para criar aplicações com interface gráfica (GUI). Esse tutorial
+será feito em *C++*.
+
+```c++
+/*
+ * Vamos começar
+ */
+
+// Todos as dependências do framework Qt iniciam com a letra 'Q' maiúscula
+#include <QApplication>
+#include <QLineEdit>
+
+int main(int argc, char *argv[]) {
+ // Cria um objeto para utilizar todos os recursos da aplicação
+ QApplication app(argc, argv);
+
+ // Cria um widget com linha editável e exibe na tela
+ QLineEdit lineEdit("Hello world!");
+ lineEdit.show();
+
+ // Inicia a aplicação em um evento de loop
+ return app.exec();
+}
+```
+
+A parte gráfica do **Qt** é toda composta de *widgets* e *conexões* entre eles.
+
+[LEIA MAIS SOBRE WIDGETS](http://doc.qt.io/qt-5/qtwidgets-index.html)
+
+```c++
+/*
+ * Vamos criar um label e um botão.
+ * Um label irá aparecer quando o botão for clicado
+ *
+ * O próprio código do Qt é autoexplicativo.
+ */
+
+#include <QApplication>
+#include <QDialog>
+#include <QVBoxLayout>
+#include <QPushButton>
+#include <QLabel>
+
+int main(int argc, char *argv[]) {
+ QApplication app(argc, argv);
+
+ QDialog dialogWindow;
+ dialogWindow.show();
+
+ // Adiciona um layout vertical
+ QVBoxLayout layout;
+ dialogWindow.setLayout(&layout);
+
+ QLabel textLabel("Thanks for pressing that button");
+ layout.addWidget(&textLabel);
+ textLabel.hide();
+
+ QPushButton button("Press me");
+ layout.addWidget(&button);
+
+ // Exibe o label oculto quando o botão é clicado
+ QObject::connect(&button, &QPushButton::pressed,
+ &textLabel, &QLabel::show);
+
+ return app.exec();
+}
+```
+
+Veja o *QObject::connect*. O método é usado para conectar o *SINAL* de um objeto
+ao *ENCAIXE* outro.
+
+**Sinais** são emitidos quando algo ocorre com o objeto, como quando o sinal de
+*clique* é acionado apertando o QPushButton.
+
+**Encaixes** são *ações* que são executadas em resposta aos sinais recebidos.
+
+[LEIA MAIS SOBRE SINAIS E ENCAIXES](http://doc.qt.io/qt-5/signalsandslots.html)
+
+
+A seguir vamos aprender como usar não somente o comportamento padrão dos
+widgets, mas também extender seus comportamentos usando herança. Vamos criar um
+botão e contar quantas vezes é pressionado. Para esse propósito definiremos
+nossa própria classe *CounterLabel*. Ela deve ser declarada em um arquivo
+diferente devido a estrutura específica do Qt.
+
+```c++
+// counterlabel.hpp
+
+#ifndef COUNTERLABEL
+#define COUNTERLABEL
+
+#include <QLabel>
+
+class CounterLabel : public QLabel {
+ Q_OBJECT // Define os macros presente em todo objeto Qt
+
+public:
+ CounterLabel() : counter(0) {
+ setText("Counter has not been increased yet"); // método do QLabel
+ }
+
+public slots:
+ // Ação que será chamada em resposta ao clique do botão
+ void increaseCounter() {
+ setText(QString("Counter value: %1").arg(QString::number(++counter)));
+ }
+
+private:
+ int counter;
+};
+
+#endif // COUNTERLABEL
+```
+
+```c++
+// main.cpp
+// Quase igual ao exemplo anterior
+
+#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("Push me once more");
+ layout.addWidget(&button);
+ QObject::connect(&button, &QPushButton::pressed,
+ &counterLabel, &CounterLabel::increaseCounter);
+
+ return app.exec();
+}
+```
+
+É isso! Claro, o framework Qt é muito maior do que exemplificamos no tutorial,
+então esteja preparado para ler e praticar mais.
+
+## Leitura complementar
+
+- [Tutoriais Qt 4.8](http://doc.qt.io/qt-4.8/tutorials.html)
+- [Tutoriais Qt 5](http://doc.qt.io/qt-5/qtexamplesandtutorials.html)
+
+Boa sorte e divirta-se!
diff --git a/rust-pt.html.markdown b/pt-br/rust-pt.html.markdown
index 8134d3c5..8134d3c5 100644
--- a/rust-pt.html.markdown
+++ b/pt-br/rust-pt.html.markdown
diff --git a/pt-br/swift-pt.html.markdown b/pt-br/swift-pt.html.markdown
index ebf74b6f..bf410352 100644
--- a/pt-br/swift-pt.html.markdown
+++ b/pt-br/swift-pt.html.markdown
@@ -389,13 +389,13 @@ if mySquare === mySquare {
// Podem conter métodos do mesmo jeito que classes.
enum Suit {
- case Spades, Hearts, Diamonds, Clubs
+ case spades, hearts, diamonds, clubs
func getIcon() -> String {
switch self {
- case .Spades: return "♤"
- case .Hearts: return "♡"
- case .Diamonds: return "♢"
- case .Clubs: return "♧"
+ case .spades: return "♤"
+ case .hearts: return "♡"
+ case .diamonds: return "♢"
+ case .clubs: return "♧"
}
}
}
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/pt-pt/bf.html.markdown b/pt-pt/bf-pt.html.markdown
index 13c22387..13c22387 100644
--- a/pt-pt/bf.html.markdown
+++ b/pt-pt/bf-pt.html.markdown
diff --git a/pt-pt/swift.html.markdown b/pt-pt/swift-pt.html.markdown
index 9462ee1c..6b263942 100644
--- a/pt-pt/swift.html.markdown
+++ b/pt-pt/swift-pt.html.markdown
@@ -445,49 +445,49 @@ if let circle = myEmptyCircle {
// Enums pode opcionalmente ser um tipo especifico ou não.
// Enums podem conter métodos tal como as classes.
-enum Suit {
- case Spades, Hearts, Diamonds, Clubs
+enum suit {
+ case spades, hearts, diamonds, clubs
func getIcon() -> String {
switch self {
- case .Spades: return "♤"
- case .Hearts: return "♡"
- case .Diamonds: return "♢"
- case .Clubs: return "♧"
+ case .spades: return "♤"
+ case .hearts: return "♡"
+ case .diamonds: return "♢"
+ case .clubs: return "♧"
}
}
}
// Os valores de Enum permitem syntax reduzida, não é preciso escrever o tipo do enum
// quando a variável é explicitamente definida.
-var suitValue: Suit = .Hearts
+var suitValue: Suit = .hearts
// Enums que não sejam inteiros obrigam a atribuições valor bruto (raw value) diretas
enum BookName: String {
- case John = "John"
- case Luke = "Luke"
+ case john = "John"
+ case luke = "Luke"
}
-print("Name: \(BookName.John.rawValue)")
+print("Name: \(BookName.john.rawValue)")
// Enum com valores associados
enum Furniture {
// Associar com um inteiro (Int)
- case Desk(height: Int)
+ case desk(height: Int)
// Associar com uma String e um Int
- case Chair(String, Int)
+ case chair(String, Int)
func description() -> String {
switch self {
- case .Desk(let height):
+ case .desk(let height):
return "Desk with \(height) cm"
- case .Chair(let brand, let height):
+ case .chair(let brand, let height):
return "Chair of \(brand) with \(height) cm"
}
}
}
-var desk: Furniture = .Desk(height: 80)
+var desk: Furniture = .desk(height: 80)
print(desk.description()) // "Desk with 80 cm"
-var chair = Furniture.Chair("Foo", 40)
+var chair = Furniture.chair("Foo", 40)
print(chair.description()) // "Chair of Foo with 40 cm"
diff --git a/python.html.markdown b/python.html.markdown
index 946cbc0c..89fa7046 100644
--- a/python.html.markdown
+++ b/python.html.markdown
@@ -363,6 +363,12 @@ filled_set | other_set # => {1, 2, 3, 4, 5, 6}
# Check for existence in a set with in
2 in filled_set # => True
10 in filled_set # => False
+10 not in filled_set # => True
+
+# Check data type of variable
+type(li) # => list
+type(filled_dict) # => dict
+type(5) # => int
####################################################
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/r.html.markdown b/r.html.markdown
index 7a94ba05..e7486e60 100644
--- a/r.html.markdown
+++ b/r.html.markdown
@@ -663,7 +663,8 @@ require(plyr)
# "pets.csv" is a file on the internet
# (but it could just as easily be a file on your own computer)
-pets <- read.csv("http://learnxinyminutes.com/docs/pets.csv")
+require(RCurl)
+pets <- read.csv(textConnection(getURL("http://learnxinyminutes.com/docs/pets.csv")))
pets
head(pets, 2) # first two rows
tail(pets, 1) # last row
diff --git a/ru-ru/haml-ru.html.markdown b/ru-ru/haml-ru.html.markdown
new file mode 100644
index 00000000..c2f8852e
--- /dev/null
+++ b/ru-ru/haml-ru.html.markdown
@@ -0,0 +1,233 @@
+---
+language: haml
+filename: learnhaml-ru.haml
+contributors:
+ - ["Simon Neveu", "https://github.com/sneveu"]
+ - ["Vasiliy Petrov", "https://github.com/Saugardas"]
+translators:
+ - ["Vasiliy Petrov", "https://github.com/Saugardas"]
+lang: ru-ru
+---
+
+Haml - язык разметки (в основном используемый с Ruby), с помощью которого могут быть легко описаны HTML-документы.
+Он является популярной альтернативой используемому в Rails шаблонизатору (.erb), и позволяет вставлять Ruby-код в вашу разметку.
+
+Haml убирает избыточность закрывающих тегов благодаря отступам.
+В результате получается меньшая по размерам, хорошо структурированная, логичная и читаемая разметка.
+
+Вы можете использовать Haml и вне Ruby-проекта. Установите гем Haml и используйте командную строку для конвертирования html-файлов:
+
+```shell
+$ haml input_file.haml output_file.html
+```
+
+
+```haml
+/ -------------------------------------------
+/ Отступы
+/ -------------------------------------------
+
+/
+ Отступы являются важным элементом синтаксиса, поэтому они должны быть
+ одинаковыми во всём документе. Обычно используют два пробела,
+ но это не является обязательным правилом - можно использовать любое
+ количество пробелов для отступов. Главное, чтобы это количество было
+ одинаковым во всём документе.
+
+
+/ -------------------------------------------
+/ Комментарии
+/ -------------------------------------------
+
+/ Комментари начинается с символа косой черты.
+
+/
+ Для написания многострочного комментария расположите ваш комментарий
+ на следующем уровне вложенности от символа косой черты
+
+-# "Скрытый" комментарий. Этот комментарий не попадёт в результирующий документ
+
+
+/ -------------------------------------------
+/ Элементы HTML
+/ -------------------------------------------
+
+/ Чтобы написать тег, используйте символ процента (%) и название тега
+%body
+ %header
+ %nav
+
+/ Обратите внимание на отсутствие закрывающих тегов. Код выше выведет:
+ <body>
+ <header>
+ <nav></nav>
+ </header>
+ </body>
+
+/
+ Так как тег div используется очень часто, его можно опустить.
+ Можно указать только имя класса или идентификатора (. или #)
+ Например код:
+
+%div.my_class
+ %div#my_id
+
+/ Можно записать:
+.my_class
+ #my_id
+
+/ Для добавления контента в тег, просто добавьте текст после объявления тега
+%h1 Заголовок
+
+/ Для многострочного содержания используйте отступы
+%p
+ Многострочное содержание
+ в две строки.
+
+/
+ Амперсанд - равно (&=) обрабатывают Ruby код также, как и без амперсанда,
+ но HTML-символы в результате будут экранированы. Например:
+
+%p
+ &= "Да & да"
+
+/ выведет 'Да &amp; да'
+
+/
+ Чтобы выполнять Ruby-код без экранрования, можно использовать
+ "восклицательный знак" и "равно" (!=)
+
+%p
+ != "Тег абзаца <p></p>"
+
+/ выведет 'Тег абзаца <p></p>'
+
+/ CSS - классы могут быть добавлены через точку от определения тега
+%div.foo.bar
+
+/ Или с помощью хеша атрибутов
+%div{ :class => 'foo bar' }
+
+/ Хеш атрибутов может быть добавлен для любого тега
+%a{ :href => '#', :class => 'bar', :title => 'Bar' }
+
+/ Для булевых атрибутов просто присвойте значение 'true'
+%input{ :selected => true }
+
+/ Для data - атрибутов присвойте ключу :data хеш с данными
+%div{ :data => { :attribute => 'foo' } }
+
+/ Для Ruby версии 1.9 или выше, можно использовать новый синтаксис хешей
+%div{ data: { attribute: 'foo' } }
+
+/ Также можно использовать HTML-синтаксис атрибутов
+%a(href='#' title='bar')
+
+/ Можно использовать оба варианта одновременно
+%a(href='#'){ title: @my_class.title }
+
+
+/ -------------------------------------------
+/ Включение Ruby
+/ -------------------------------------------
+
+/ Для включения Ruby кода используйте знак "равно"
+
+%h1= book.name
+
+%p
+ = book.author
+ = book.publisher
+
+
+/ Для выполнения Ruby кода без вывода в HTML, используйте знак дефиса
+- books = ['book 1', 'book 2', 'book 3']
+
+/
+ Можно выполнять любой Ruby код, например с блоками.
+ Закрывающий "end" не нужен, так как они будут закрыты автоматически,
+ основываясь на вложенности.
+
+- books.shuffle.each_with_index do |book, index|
+ %h1= book
+
+ - if book do
+ %p This is a book
+
+/ Добавление списка
+%ul
+ %li
+ =item1
+ =item2
+
+/ -------------------------------------------
+/ Пример таблицы с классами Bootstrap'a
+/ -------------------------------------------
+
+%table.table.table-hover
+ %thead
+ %tr
+ %th Header 1
+ %th Header 2
+
+ %tr
+ %td Value1
+ %td value2
+
+ %tfoot
+ %tr
+ %td
+ Foot value
+
+
+/ -------------------------------------------
+/ Интерполяция Ruby кода
+/ -------------------------------------------
+
+/ Ruby код может быть интерполирован в текст с помощью #{}
+%p Ваша самая любимая игра - #{best_game}
+
+/ Тоже самое, что и:
+%p= "Ваша самая любимая игра - #{best_game}"
+
+
+/ -------------------------------------------
+/ Фильтры
+/ -------------------------------------------
+
+/
+ Фильтры передают связанный блок текста в соотвествующую
+ фильтрующую программу и возвращают результат в Haml
+ Фильтр обозначается двоеточием и названием фильтра:
+
+/ Markdown filter
+:markdown
+ # Заголовк
+
+ Текст **внутри** *блока*
+
+/ Код выше будет скомпилирован в
+<h1>Заголовок</h1>
+
+<p>Текст <strong>внутри</strong> <em>блока</em></p>
+
+/ Javascript - фильтр
+:javascript
+ console.log('This is inline <script>');
+
+/ скомпилируется в:
+<script>
+ console.log('This is inline <script>');
+</script>
+
+/
+ Существует множество типов фильров (:markdown, :javascript, :coffee,
+ :css, :ruby и так далее). Вы можете определить собственный фильтр c
+ помощью Haml::Filters.
+
+```
+
+## Дополнительные ресурсы
+
+- [О Haml](https://haml.ru) - Хорошее введение, описывает преимущества Haml.
+- [Документация](https://haml.ru/documentation/) - Документация Haml на русском языке.
diff --git a/ru-ru/php-ru.html.markdown b/ru-ru/php-ru.html.markdown
index 014ff5d0..af77a9ca 100644
--- a/ru-ru/php-ru.html.markdown
+++ b/ru-ru/php-ru.html.markdown
@@ -61,6 +61,8 @@ $int4 = 0x0F; // => 15 (ведущие символы 0x означают шес
// Двоичная запись integer доступна начиная с PHP 5.4.0.
$int5 = 0b11111111; // 255 (0b в начале означает двоичное число)
+// Удаление переменной
+unset($int1);
// Дробные числа
$float = 1.234;
diff --git a/ru-ru/ruby-ru.html.markdown b/ru-ru/ruby-ru.html.markdown
index f54c89b4..e69c6d94 100644
--- a/ru-ru/ruby-ru.html.markdown
+++ b/ru-ru/ruby-ru.html.markdown
@@ -182,8 +182,9 @@ array.[] 12 #=> nil
array[-1] #=> 5
array.last #=> 5
-# С заданными левой и правой границами индексов
-array[2, 4] #=> [3, 4, 5]
+# Задавая индекс и количество элементов
+array[0,2] #=> [1, 2]
+array[0,999] #=> [1, 2, 3, 4, 5]
# Или с использованием диапазона значений
array[1..3] #=> [2, 3, 4]
diff --git a/ru-ru/swift-ru.html.markdown b/ru-ru/swift-ru.html.markdown
index 7ff660e1..f2b1fd36 100644
--- a/ru-ru/swift-ru.html.markdown
+++ b/ru-ru/swift-ru.html.markdown
@@ -376,14 +376,14 @@ print("Имя :\(name)") // Имя: Яков
// Протокол `Error` используется для перехвата выбрасываемых ошибок
enum MyError: Error {
- case BadValue(msg: String)
- case ReallyBadValue(msg: String)
+ case badValue(msg: String)
+ case reallyBadValue(msg: String)
}
// фунции помеченные словом `throws` должны вызываться с помощью `try`
func fakeFetch(value: Int) throws -> String {
guard 7 == value else {
- throw MyError.ReallyBadValue(msg: "Действительно плохое значение")
+ throw MyError.reallyBadValue(msg: "Действительно плохое значение")
}
return "тест"
@@ -401,7 +401,7 @@ func testTryStuff() {
do {
// обычно try оператор, позволяющий обработать ошибку в `catch` блоке
try fakeFetch(value: 1)
- } catch MyError.BadValue(let msg) {
+ } catch MyError.badValue(let msg) {
print("Ошибка: \(msg)")
} catch {
// все остальное
@@ -535,49 +535,49 @@ if let circle = myEmptyCircle {
// Они могут содержать методы подобно классам.
enum Suit {
- case Spades, Hearts, Diamonds, Clubs
+ case spades, hearts, diamonds, clubs
func getIcon() -> String {
switch self {
- case .Spades: return "♤"
- case .Hearts: return "♡"
- case .Diamonds: return "♢"
- case .Clubs: return "♧"
+ case .spades: return "♤"
+ case .hearts: return "♡"
+ case .diamonds: return "♢"
+ case .clubs: return "♧"
}
}
}
// Значения перечислений допускают сокращенный синтаксис, нет необходимости
// указывать тип перечисления, когда переменная объявляется явно
-var suitValue: Suit = .Hearts
+var suitValue: Suit = .hearts
// Значения нецелочисленных перечислений должны быть указаны явно
// или могут выводится с помощью функции `rawValue` из имени
enum BookName: String {
- case John
- case Luke = "Лука"
+ case john
+ case luke = "Лука"
}
-print("Имя: \(BookName.John.rawValue)")
+print("Имя: \(BookName.john.rawValue)")
// Перечисление (enum) со связанными значениями
enum Furniture {
// Связать с типом Int
- case Desk(height: Int)
+ case desk(height: Int)
// Связать с типами String и Int
- case Chair(String, Int)
+ case chair(String, Int)
func description() -> String {
switch self {
- case .Desk(let height):
+ case .desk(let height):
return "Письменный стол высотой \(height) см."
- case .Chair(let brand, let height):
+ case .chair(let brand, let height):
return "Стул марки \(brand) высотой \(height) см."
}
}
}
-var desk: Furniture = .Desk(height: 80)
+var desk: Furniture = .desk(height: 80)
print(desk.description()) // "Письменный стол высотой 80 см."
-var chair = Furniture.Chair("Foo", 40)
+var chair = Furniture.chair("Foo", 40)
print(chair.description()) // "Стул марки Foo высотой 40 см."
diff --git a/sk-sk/bash.html.markdown b/sk-sk/bash-sk.html.markdown
index e9d1490c..e9d1490c 100644
--- a/sk-sk/bash.html.markdown
+++ b/sk-sk/bash-sk.html.markdown
diff --git a/sk-sk/coffeescript.html.markdown b/sk-sk/coffeescript-sk.html.markdown
index 30bbceec..30bbceec 100644
--- a/sk-sk/coffeescript.html.markdown
+++ b/sk-sk/coffeescript-sk.html.markdown
diff --git a/sk-sk/elixir.html.markdown b/sk-sk/elixir-sk.html.markdown
index 2401f92e..2401f92e 100644
--- a/sk-sk/elixir.html.markdown
+++ b/sk-sk/elixir-sk.html.markdown
diff --git a/sk-sk/git.html.markdown b/sk-sk/git-sk.html.markdown
index 21741406..21741406 100644
--- a/sk-sk/git.html.markdown
+++ b/sk-sk/git-sk.html.markdown
diff --git a/sk-sk/json.html.markdown b/sk-sk/json-sk.html.markdown
index 2b1fbb58..2b1fbb58 100644
--- a/sk-sk/json.html.markdown
+++ b/sk-sk/json-sk.html.markdown
diff --git a/sk-sk/latex.html.markdown.tex b/sk-sk/latex-sk.html.markdown.tex
index 5e2f9c7f..5e2f9c7f 100644
--- a/sk-sk/latex.html.markdown.tex
+++ b/sk-sk/latex-sk.html.markdown.tex
diff --git a/sk-sk/ruby.html.markdown b/sk-sk/ruby-sk.html.markdown
index 799865b0..799865b0 100644
--- a/sk-sk/ruby.html.markdown
+++ b/sk-sk/ruby-sk.html.markdown
diff --git a/smalltalk.html.markdown b/smalltalk.html.markdown
index fd40afe9..a253df55 100644
--- a/smalltalk.html.markdown
+++ b/smalltalk.html.markdown
@@ -186,7 +186,7 @@ x := Float pi. "pi"
x := Float e. "exp constant"
x := Float infinity. "infinity"
x := Float nan. "not-a-number"
-x := Random new next; yourself. x next. "random number stream (0.0 to 1.0)
+x := Random new next; yourself. x next. "random number stream (0.0 to 1.0)"
x := 100 atRandom. "quick random number"
```
@@ -904,7 +904,7 @@ b := String isVariable. "true if has indexed
b := String isPointers. "true if index instance vars contain objects"
b := String isBits. "true if index instance vars contain bytes/words"
b := String isBytes. "true if index instance vars contain bytes"
-b := String isWords. true if index instance vars contain words"
+b := String isWords. "true if index instance vars contain words"
Object withAllSubclasses size. "get total number of class entries"
```
diff --git a/swift.html.markdown b/swift.html.markdown
index 60915d72..516debed 100644
--- a/swift.html.markdown
+++ b/swift.html.markdown
@@ -361,14 +361,14 @@ print("Name is \(name)") // Name is Them
// The `Error` protocol is used when throwing errors to catch
enum MyError: Error {
- case BadValue(msg: String)
- case ReallyBadValue(msg: String)
+ case badValue(msg: String)
+ case reallyBadValue(msg: String)
}
// functions marked with `throws` must be called using `try`
func fakeFetch(value: Int) throws -> String {
guard 7 == value else {
- throw MyError.ReallyBadValue(msg: "Some really bad value")
+ throw MyError.reallyBadValue(msg: "Some really bad value")
}
return "test"
@@ -385,7 +385,7 @@ func testTryStuff() {
do {
// normal try operation that provides error handling via `catch` block
try fakeFetch(value: 1)
- } catch MyError.BadValue(let msg) {
+ } catch MyError.badValue(let msg) {
print("Error message: \(msg)")
} catch {
// must be exhaustive
@@ -518,49 +518,49 @@ if let circle = myEmptyCircle {
// They can contain methods like classes.
enum Suit {
- case Spades, Hearts, Diamonds, Clubs
+ case spades, hearts, diamonds, clubs
func getIcon() -> String {
switch self {
- case .Spades: return "♤"
- case .Hearts: return "♡"
- case .Diamonds: return "♢"
- case .Clubs: return "♧"
+ case .spades: return "♤"
+ case .hearts: return "♡"
+ case .diamonds: return "♢"
+ case .clubs: return "♧"
}
}
}
// Enum values allow short hand syntax, no need to type the enum type
// when the variable is explicitly declared
-var suitValue: Suit = .Hearts
+var suitValue: Suit = .hearts
// String enums can have direct raw value assignments
// or their raw values will be derived from the Enum field
enum BookName: String {
- case John
- case Luke = "Luke"
+ case john
+ case luke = "Luke"
}
-print("Name: \(BookName.John.rawValue)")
+print("Name: \(BookName.john.rawValue)")
// Enum with associated Values
enum Furniture {
// Associate with Int
- case Desk(height: Int)
+ case desk(height: Int)
// Associate with String and Int
- case Chair(String, Int)
+ case chair(String, Int)
func description() -> String {
switch self {
- case .Desk(let height):
+ case .desk(let height):
return "Desk with \(height) cm"
- case .Chair(let brand, let height):
+ case .chair(let brand, let height):
return "Chair of \(brand) with \(height) cm"
}
}
}
-var desk: Furniture = .Desk(height: 80)
+var desk: Furniture = .desk(height: 80)
print(desk.description()) // "Desk with 80 cm"
-var chair = Furniture.Chair("Foo", 40)
+var chair = Furniture.chair("Foo", 40)
print(chair.description()) // "Chair of Foo with 40 cm"
diff --git a/tr-tr/swift-tr.html.markdown b/tr-tr/swift-tr.html.markdown
index e694d95d..4c2cf59b 100644
--- a/tr-tr/swift-tr.html.markdown
+++ b/tr-tr/swift-tr.html.markdown
@@ -443,47 +443,47 @@ if let daire = benimBosDairem {
// Sınıflar gibi metotlar içerebilirler.
enum Kart {
- case Kupa, Maca, Sinek, Karo
+ case kupa, maca, sinek, karo
func getIcon() -> String {
switch self {
- case .Maca: return "♤"
- case .Kupa: return "♡"
- case .Karo: return "♢"
- case .Sinek: return "♧"
+ case .maca: return "♤"
+ case .kupa: return "♡"
+ case .karo: return "♢"
+ case .sinek: return "♧"
}
}
}
// Enum değerleri kısayol syntaxa izin verir. Eğer değişken tipi açık olarak belirtildiyse enum tipini yazmaya gerek kalmaz.
-var kartTipi: Kart = .Kupa
+var kartTipi: Kart = .kupa
// Integer olmayan enumlar direk değer (rawValue) atama gerektirir.
enum KitapAdi: String {
- case John = "John"
- case Luke = "Luke"
+ case john = "John"
+ case luke = "Luke"
}
-print("Name: \(KitapAdi.John.rawValue)")
+print("Name: \(KitapAdi.john.rawValue)")
// Değerlerle ilişkilendirilmiş Enum
enum Mobilya {
// Int ile ilişkilendirilmiş
- case Masa(yukseklik: Int)
+ case masa(yukseklik: Int)
// String ve Int ile ilişkilendirilmiş
- case Sandalye(String, Int)
-
+ case sandalye(String, Int)
+
func aciklama() -> String {
switch self {
- case .Masa(let yukseklik):
+ case .masa(let yukseklik):
return "Masa boyu \(yukseklik) cm"
- case .Sandalye(let marka, let yukseklik):
+ case .sandalye(let marka, let yukseklik):
return "\(brand) marka sandalyenin boyu \(yukseklik) cm"
}
}
}
-var masa: Mobilya = .Masa(yukseklik: 80)
+var masa: Mobilya = .masa(yukseklik: 80)
print(masa.aciklama()) // "Masa boyu 80 cm"
-var sandalye = Mobilya.Sandalye("Foo", 40)
+var sandalye = Mobilya.sandalye("Foo", 40)
print(sandalye.aciklama()) // "Foo marka sandalyenin boyu 40 cm"
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/uk-ua/javascript-ua.html.markdown b/uk-ua/javascript-ua.html.markdown
index ac6a2bde..397b1c5e 100644
--- a/uk-ua/javascript-ua.html.markdown
+++ b/uk-ua/javascript-ua.html.markdown
@@ -17,7 +17,7 @@ JavaScript було створено в 1995 році Бренданом Айк
вбудована підтримка браузерами призвела до того, що JavaScript став популярніший
за власне Java.
-Зараз JavaScript не обмежується тільки веб-браузеорм. Наприклад, Node.js,
+Зараз JavaScript не обмежується тільки веб-браузером. Наприклад, Node.js,
програмна платформа, що дозволяє виконувати JavaScript код з використанням
рушія V8 від браузера Google Chrome, стає все більш і більш популярною.
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/markdown-vi.html.markdown b/vi-vn/markdown-vi.html.markdown
new file mode 100644
index 00000000..0ba267f9
--- /dev/null
+++ b/vi-vn/markdown-vi.html.markdown
@@ -0,0 +1,325 @@
+---
+language: markdown
+contributors:
+ - ["Dan Turkel", "http://danturkel.com/"]
+ - ["Jacob Ward", "http://github.com/JacobCWard/"]
+translators:
+ - ["Thanh Duy Phan", "https://github.com/thanhpd"]
+filename: markdown-vi.md
+lang: vi-vn
+---
+
+
+Ngôn ngữ Markdown được sáng lập bởi John Gruber vào năm 2004. Nó được tạo ra với mục đích dễ đọc với cú pháp có thể được dễ dàng chuyển đổi qua HTML và các ngôn ngữ khác
+
+Markdown có sự khác biệt trong cách cài đặt giữa các trình phân tích cú pháp. Hướng dẫn này sẽ đề cập, giải thích tới nếu tính năng có thể được sử dụng chung hay nó chỉ áp dụng cho một trình phân tích riêng biệt.
+
+- [Phần tử HTML](#html-elements)
+- [Đầu mục](#headings)
+- [Định dạng văn bản](#simple-text-styles)
+- [Đoạn văn](#paragraphs)
+- [Danh sách](#lists)
+- [Khối code](#code-blocks)
+- [Đường kẻ ngang](#horizontal-rule)
+- [Liên kết](#links)
+- [Ảnh](#images)
+- [Khác](#miscellany)
+
+## Phần tử HTML
+Markdown là tập cha của HTML, vì vậy bất cứ file HTML nào đều là Markdown đúng.
+
+```markdown
+<!-- Điều này đồng nghĩa ta có thể sử dụng các phần tử HTML
+trong Markdown, ví dụ như phần tử chú thích/comment.
+Tuy nhiên, nếu sử dụng một phần tử HTML trong file Markdown,
+ta không thể sử dụng cú pháp Markdown cho nội dung bên trong phần tử đó. -->
+```
+
+## Đầu mục
+
+Ta có thể tạo các phần tử đầu mục HTML từ `<h1>` cho đến `<h6>` dễ dàng
+bằng cách thêm số lượng dấu thăng (#) đằng trước chuỗi cần tạo đầu mục.
+
+```markdown
+# Đây là đầu mục <h1>
+## Đây là đầu mục <h2>
+### Đây là đầu mục <h3>
+#### Đây là đầu mục <h4>
+##### Đây là đầu mục <h5>
+###### Đây là đầu mục <h6>
+```
+Markdown còn cung cấp cách khác để tạo đầu mục hạng nhất h1 và hạng nhì h2.
+
+```markdown
+Đây là đầu mục h1
+=============
+
+Đây là đầu mục h2
+-------------
+```
+
+## Định dạng văn bản
+
+Văn bản có thể được định dạng dễ dàng như in nghiêng hay làm đậm sử dụng Markdown.
+
+```markdown
+*Đoạn văn bản này được in nghiêng.*
+_Và đoạn này cũng như vậy._
+
+**Đoạn văn bản này được in đậm.**
+__Và đoạn này cũng vậy.__
+
+***Đoạn văn bản này được in nghiêng và đậm.***
+**_Cách này cũng tương tự_**
+*__Và cách này nữa__*
+```
+
+Trong cài đặt Markdown để hiển thị file của GitHub,ta còn có gạch ngang:
+
+```markdown
+~~Đoạn văn bản này được gạch ngang.~~
+```
+## Đoạn văn
+
+Đoạn văn bao gồm một hay nhiều dòng văn bản liên tiếp nhau được phân cách
+bởi một hay nhiều dòng trống.
+
+```markdown
+Đây là đoạn văn thứ nhất.
+
+Đây là đoạn văn thứ hai.
+Dòng này vẫn thuộc đoạn văn thứ hai, do không có cách dòng.
+
+
+Đây là đoạn văn thứ ba.
+```
+
+Nếu cần chèn thêm thẻ ngắt dòng `<br />` của HTML, ta có thể kết thúc đoạn văn bản
+bằng cách thêm vào từ 2 dấu cách (space) trở lên và bắt đầu đoạn văn bản mới.
+
+```markdown
+Dòng này kết thúc với 2 dấu cách (highlight để nhìn thấy).
+
+Có phần tử <br /> ở bên trên.
+```
+
+Khối trích dẫn được sử dụng với kí tự >
+
+```markdown
+> Đây là khối trích dẫn. Ta có thể
+> ngắt dòng thủ công và thêm kí tự `>` trước mỗi dòng hoặc ta có thể để dòng tự ngắt nếu cần thiệt khi quá dài.
+> Không có sự khác biệt nào, chỉ cần nó bắt đầu với kí tự `>`
+
+> Ta còn có thể dùng nhiều mức
+>> của khối trích dẫn.
+> Như vậy có tốt không?
+
+```
+
+## Danh sách
+
+Danh sách không có thứ tự có thể được tạo sử dụng dấu sao, dấu cộng hay dấu trừ đầu dòng.
+
+```markdown
+* Một mục
+* Một mục
+* Một mục nữa
+
+hoặc
+
++ Một mục
++ Một mục
++ Một mục khác
+
+hay
+
+- Một mục
+- Một mục
+- Một mục sau
+```
+
+Danh sách có thứ tự được tạo bởi một số theo sau bằng một dấu chấm.
+
+```markdown
+1. Mục thứ nhất
+2. Mục thứ hai
+3. Mục thứ ba
+```
+
+Ta không nhất thiết phải điền số thứ thự cho chỉ mục đúng mà Markdown sẽ tự hiển thị danh sách theo thứ tự đã được sắp xếp, tuy nhiên cách làm này không tốt!
+
+```markdown
+1. Mục thứ nhất
+1. Mục thứ hai
+1. Mục thứ ba
+```
+(Sẽ hiển thị như ví dụ trước đó)
+
+Ta còn có thể sử dụng danh sách con
+
+```markdown
+1. Mục thứ nhất
+2. Mục thứ hai
+3. Mục thứ ba
+ * Mục nhỏ
+ * Mục nhỏ
+4. Mục thứ tư
+```
+
+Markdown còn cung cấp danh mục (checklist). Nó sẽ hiển thị ra hộp đánh dấu dạng HTML.
+
+```markdown
+Boxes below without the 'x' are unchecked HTML checkboxes.
+- [ ] First task to complete.
+- [ ] Second task that needs done
+This checkbox below will be a checked HTML checkbox.
+- [x] This task has been completed
+```
+
+## Khối code
+
+Ta có thể đánh dấu một đoạn code (tương tự sử dụng phần tử HTML `<code>`) bằng việc thụt đầu dòng sử dụng bốn dấu cách (space) hoặc một dấu nhảy (tab)
+
+```markdown
+ This is code
+ So is this
+```
+
+Ta còn có thể thêm dấu nhảy (hoặc thêm vào bốn dấu cách nữa) để căn chỉnh phần bên trong đoạn code
+
+```markdown
+ my_array.each do |item|
+ puts item
+ end
+```
+
+Code hiển thị cùng dòng có thể được đánh dấu sử dụng cặp ``.
+
+```markdown
+John didn't even know what the `go_to()` function did!
+```
+
+Trong Markdown của GitHub, ta còn có thêm cách để hiển thị code:
+
+<pre>
+<code class="highlight">&#x60;&#x60;&#x60;ruby
+def foobar
+ puts "Hello world!"
+end
+&#x60;&#x60;&#x60;</code></pre>
+
+The above text doesn't require indenting, plus GitHub will use syntax
+highlighting of the language you specify after the \`\`\`
+Đoạn trên không cần sử dụng thụt đầu dòng, và GitHub sẽ tô sáng cú pháp sử dụng ngôn ngữ mà ta cung cấp sau đoạn kí tự \`\`\`
+
+## Kẻ ngang
+
+Dòng kẻ ngang (`<hr />`) có thể được thêm vào dễ dàng sử dụng từ 3 kí tự sao (*) hoặc gạch ngang (-), không quan trọng có khoảng cách giữa các kí tự hay không.
+
+
+```markdown
+***
+---
+- - -
+****************
+```
+
+## Liên kết
+
+Một trong những thứ tốt nhất khi làm việc với Markdown là khả năng tạo liên kết hết sức dễ dàng. Đoạn text hiển thị được đóng trong cặp ngoặc vuông [] kèm theo đường dẫn url trong cặp ngoặc tròn ().
+
+```markdown
+[Click me!](http://test.com/)
+```
+Ta còn có thể tạo tiêu đề cho liên kết sử dụng cặp ngoặc nháy bên trong cặp ngoặc tròn
+
+```markdown
+[Click me!](http://test.com/ "Link to Test.com")
+```
+Đường dẫn tương đối cũng hoạt động.
+
+```markdown
+[Go to music](/music/).
+```
+
+Markdown còn hỗ trợ liên kết kiểu tham chiếu.
+
+<pre><code class="highlight">&#x5b;<span class="nv">Nhấn vào đây</span>][<span class="ss">link1</span>] để xem thêm!
+&#x5b;<span class="nv">Ngoài ra nhấn vào đây</span>][<span class="ss">foobar</span>] nếu bạn muốn xem qua.
+
+&#x5b;<span class="nv">link1</span>]: <span class="sx">http://test.com/</span> <span class="nn">"Tuyệt!"</span>
+&#x5b;<span class="nv">foobar</span>]: <span class="sx">http://foobar.biz/</span> <span class="nn">"Tốt!"</span></code></pre>
+
+Tiêu đề có thể được đóng trong dấu nháy hay ngoặc đơn, hoặc có thể được bỏ qua. Tham chiếu có thể được đặt bất kì đâu trong văn bản và ID của tham chiếu có thể là bất kì gì miễn là nó độc nhất.
+
+Ngoài ra còn có kiểu đặt tên ngầm cho phép ta sử dụng đường dẫn làm ID.
+
+<pre><code class="highlight">&#x5b;<span class="nv">This</span>][] is a link.
+
+&#x5b;<span class="nv">this</span>]: <span class="sx">http://thisisalink.com/</span></code></pre>
+
+Nhưng nó không được sử dụng rộng rãi.
+
+## Ảnh
+
+Hiển thị ảnh tương tự như liên kết nhưng có thêm dấu chấm than đằng trước
+
+```markdown
+![Thuộc tính alt cho ảnh](http://imgur.com/myimage.jpg "Tiêu đề tùy chọn")
+```
+
+Và kiểu tham chiếu cũng hoạt động như vậy.
+
+<pre><code class="highlight">!&#x5b;<span class="nv">Đây là thuộc tính alt.</span>][<span class="ss">myimage</span>]
+
+&#x5b;<span class="nv">myimage</span>]: <span class="sx">relative/urls/cool/image.jpg</span> <span class="nn">"Đây là tiêu đề"</span></code></pre>
+
+## Khác
+
+### Tự động đặt liên kết
+
+```markdown
+<http://testwebsite.com/> tương đương với
+[http://testwebsite.com/](http://testwebsite.com/)
+```
+
+### Tự động đặt liên kết cho email
+
+```markdown
+<foo@bar.com>
+```
+
+### Hiển thị Kí tự đặc biệt
+
+```markdown
+Khi ta muốn viết *đoạn văn bản này có dấu sao bao quanh* nhưng ta không muốn nó bị in nghiêng, ta có thể sử dụng: \*đoạn văn bản này có dấu sao bao quanh\*.
+```
+
+### Phím bàn phím
+
+Trong Markdown của Github, ta có thể sử dụng thẻ `<kbd>` để thay cho phím trên bàn phím.
+
+```markdown
+Máy treo? Thử bấm tổ hợp
+<kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Del</kbd>
+```
+### Bảng biểu
+
+Bảng biểu được hỗ trợ trên Markdown của GitHub, Jira, Trello, v.v và khá khó viết:
+
+```markdown
+| Cột 1 | Cột2 | Cột 3 |
+| :----------- | :------: | ------------: |
+| Căn trái | Căn giữa | Căn phải |
+| blah | blah | blah |
+```
+Hoặc có thể sử dụng kết quả dưới đây
+
+```markdown
+Cột 1 | Cột 2 | Cột 3
+:-- | :-: | --:
+blah | blah | blah
+```
+
+---
+Để biết thêm thông tin, hãy ghé qua hướng dẫn chính thức về cú pháp của John Gruber [tại đây](http://daringfireball.net/projects/markdown/syntax) và cheatsheet của Adam Pritchard [tại đây](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet).
diff --git a/vi-vn/sass-vi.html.markdown b/vi-vn/sass-vi.html.markdown
new file mode 100644
index 00000000..313890d4
--- /dev/null
+++ b/vi-vn/sass-vi.html.markdown
@@ -0,0 +1,590 @@
+---
+language: sass
+filename: learnsass-vi.scss
+contributors:
+ - ["Laura Kyle", "https://github.com/LauraNK"]
+ - ["Sean Corrales", "https://github.com/droidenator"]
+ - ["Kyle Mendes", "https://github.com/pink401k"]
+ - ["Keith Miyake", "https://github.com/kaymmm"]
+translators:
+ - ["Thanh Duy Phan", "https://github.com/thanhpd"]
+lang: vi-vn
+---
+
+Less là một ngôn ngữ mở rộng CSS/ CSS pre-processor, thêm các tính năng như biến (variable), lồng (nesting), mixin và nhiều thứ khác. Sass cùng với các CSS pre-processor khác như [Less](http://lesscss.org/) 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).
+
+Sass có hai lựa chọn sử dụng cú pháp khác nhau. Một là SCSS, sử dụng cú pháp giống như CSS nhưng bổ sung thêm các tính năng của Sass. Hai là Sass (cú pháp nguyên bản), sử dụng thụt đầu dòng - indention thay vì ngoặc nhọn và dấu chấm phẩy.
+Bài hướng dẫn này sử dụng SCSS.
+
+Nếu bạn đọc đã quen thuộc với CSS3 thì sẽ tương đối nhanh chóng để nắm được Sass. Nó không cung cấp thuộc tính để style CSS mới nhưng đưa ra những công cụ để có thể viết CSS hiệu quả hơn và có thể bảo trì dễ dàng hơn.
+
+```sass
+
+
+// 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 */
+
+
+
+/* Variable - 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. */
+
+
+
+/* Control Directive - Chỉ thị
+============================== */
+
+
+/* Sass cho phép sử dụng @if, @else, @for, @while và @each để quản lý luồng code sinh ra CSS */
+
+/* Khối điều kiện @if/@else hoạt động như các ngôn ngữ khác */
+
+$debug: true !default;
+
+@mixin debugmode {
+ @if $debug {
+ @debug "Debug mode enabled";
+
+ display: inline-block;
+ }
+ @else {
+ display: none;
+ }
+}
+
+.info {
+ @include debugmode;
+}
+
+/* Trong đoạn code trên, nếu $debug được đặt là true thì class .info sẽ được sinh ra và ngược lại.
+ Lưu ý: @debug sẽ sinh ra thông tin debug trên dòng lệnh (command line).
+ Chế độ này rất có ích khi thực hiện debug trên file SCSS. */
+
+.info {
+ display: inline-block;
+}
+
+/* @for là khối vòng lặp trên một khoảng các giá trị.
+ Nó rất có ích cho việc đặt style của một tập hợp các phần tử.
+ Có hai cách để lặp, "through" sẽ lặp tới kể cả giá trị cuối cùng, "to" sẽ lặp tới và dừng khi đến giá trị cuối cùng. */
+
+// Lặp 3 lần (không kể 4)
+@for $c from 1 to 4 {
+ div:nth-of-type(#{$c}) {
+ left: ($c - 1) * 900 / 3;
+ }
+}
+
+// Lặp 3 lần (kể cả 3)
+@for $c from 1 through 3 {
+ .myclass-#{$c} {
+ color: rgb($c * 255 / 3, $c * 255 / 3, $c * 255 / 3);
+ }
+}
+
+/* Biên dịch thành */
+
+div:nth-of-type(1) {
+ left: 0;
+}
+
+div:nth-of-type(2) {
+ left: 300;
+}
+
+div:nth-of-type(3) {
+ left: 600;
+}
+
+.myclass-1 {
+ color: #555555;
+}
+
+.myclass-2 {
+ color: #aaaaaa;
+}
+
+.myclass-3 {
+ color: white;
+// SASS tự động chuyển mã #FFFFFF thành white (trắng)
+}
+
+/* Khối lặp @while rất cơ bản: */
+
+$columns: 4;
+$column-width: 80px;
+
+@while $columns > 0 {
+ .col-#{$columns} {
+ width: $column-width;
+ left: $column-width * ($columns - 1);
+ }
+
+ $columns: $columns - 1;
+}
+
+/* Sẽ được biên dịch thành: */
+
+.col-4 {
+ width: 80px;
+ left: 240px;
+}
+
+.col-3 {
+ width: 80px;
+ left: 160px;
+}
+
+.col-2 {
+ width: 80px;
+ left: 80px;
+}
+
+.col-1 {
+ width: 80px;
+ left: 0px;
+}
+
+/* @each hoạt động giống như @for, nhưng sử dụng một danh sách (list) thay vì thứ tự số đếm.
+ List được khai báo như những biến khác, sử dụng dấu cách để làm dấu phân cách. */
+
+$social-links: facebook twitter linkedin reddit;
+
+.social-links {
+ @each $sm in $social-links {
+ .icon-#{$sm} {
+ background-image: url("images/#{$sm}.png");
+ }
+ }
+}
+
+/* Sẽ sinh ra: */
+
+.social-links .icon-facebook {
+ background-image: url("images/facebook.png");
+}
+
+.social-links .icon-twitter {
+ background-image: url("images/twitter.png");
+}
+
+.social-links .icon-linkedin {
+ background-image: url("images/linkedin.png");
+}
+
+.social-links .icon-reddit {
+ background-image: url("images/reddit.png");
+}
+
+
+/* Mixin
+==============================*/
+
+/* 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.
+ Sử dụng cú pháp '@mixin' kèm theo tên để tạo một mixin. */
+
+@mixin center {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ left: 0;
+ right: 0;
+}
+
+/* Ta có thể dùng mixin bằng cú pháp '@include' kèm theo tên của mixin. */
+
+div {
+ @include center;
+ background-color: $primary-color;
+}
+
+/* Được biên dịch thành: */
+div {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ left: 0;
+ right: 0;
+ background-color: #A3A4FF;
+}
+
+/* Ta có thể dùng mixin để tạo nhanh các thuộc tính. */
+
+@mixin size($width, $height) {
+ width: $width;
+ height: $height;
+}
+
+/* Trong ví dụ này ta có thể tạo nhanh 2 thuộc tính width và height
+ bằng cách sử dụng mixin size và truyền vào tham số cho width và height. */
+
+.rectangle {
+ @include size(100px, 60px);
+}
+
+.square {
+ @include size(40px, 40px);
+}
+
+/* Biên dịch thành: */
+.rectangle {
+ width: 100px;
+ height: 60px;
+}
+
+.square {
+ width: 40px;
+ height: 40px;
+}
+
+
+
+/* Function - Hàm
+============================== */
+
+
+
+/* Less cung cấp các hàm có thể được dùng để hoàn thành
+ các công việc khác nhau. */
+
+/* Hàm đượ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);
+}
+
+.footer {
+ background-color: fade_out(#000000, 0.25);
+}
+
+/* Biên dịch thành: */
+
+body {
+ width: 10px;
+}
+
+.footer {
+ background-color: rgba(0, 0, 0, 0.75);
+}
+
+/* Ta có thể định nghĩa hàm mới.
+ hàm 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 hàm hay mixin,
+ hãy nhớ mixin được tối ưu cho việc tạo ra CSS trong khi
+ hàm 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ử toán học' là ứng cử viên
+ sáng giá cho việc dùng hàm có thể tái sử dụng được.
+*/
+
+/* Hàm này sẽ tính độ tương đối giữa hai giá trị kích thước. */
+
+@function calculate-percentage($target-size, $parent-size) {
+ @return $target-size / $parent-size * 100%;
+}
+
+$main-content: calculate-percentage(600px, 960px);
+
+.main-content {
+ width: $main-content;
+}
+
+.sidebar {
+ width: calculate-percentage(300px, 960px);
+}
+
+/* Biên dịch thành: */
+
+.main-content {
+ width: 62.5%;
+}
+
+.sidebar {
+ width: 31.25%;
+}
+
+
+
+/* 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 {
+ @include size(5em, 5em);
+ border: 5px solid $secondary-color;
+}
+
+.display-success {
+ @extend .display;
+ border-color: #22df56;
+}
+
+/* Biên dịch thành: */
+.display, .display-success {
+ width: 5em;
+ height: 5em;
+ border: 5px solid #51527F;
+}
+
+.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.
+*/
+
+
+
+/* Nesting - Lồng
+============================== */
+
+
+
+/* Sass cho phép ta có thể lồng selector bên trong selector */
+
+ul {
+ list-style-type: none;
+ margin-top: 2em;
+
+ li {
+ background-color: #FF0000;
+ }
+}
+
+/* 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;
+}
+
+
+
+/* Partials and Imports - Chia nhỏ thành tệp con 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.
+ File con không được biên dịch thành file CSS riêng. */
+
+/* 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;
+}
+
+/* Sass 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 Sass 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;
+}
+
+
+
+/* Placeholder Selectors - Selector trống
+============================== */
+
+
+
+/* Khai báo trống rất hữu dụng khi ta cần tạo một khai báo CSS cần được mở rộng.
+ Nếu bạn cần tạo một khai báo CSS gốc cho các lần mở rộng sau ta có thể
+ sử dụng một khai báo trống. Khai báo trống bắt đầu với kí tự '$' thay vì
+ sử dụng '.' hay '#'. Khai báo trống sẽ không xuất hiện trong code CSS được biên dịch. */
+
+%content-window {
+ font-size: 14px;
+ padding: 10px;
+ color: #000;
+ border-radius: 4px;
+}
+
+.message-window {
+ @extend %content-window;
+ background-color: #0000ff;
+}
+
+/* Biên dịch thành: */
+
+.message-window {
+ font-size: 14px;
+ padding: 10px;
+ color: #000;
+ border-radius: 4px;
+}
+
+.message-window {
+ background-color: #0000ff;
+}
+
+
+
+/* Toán tử toán học
+============================== */
+
+
+
+/* Sass 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 Sass 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%;
+}
+
+```
+
+## SASS hay Sass?
+Bạn đã bao giờ thắc mắc liệu Sass có phải là từ viết tắt hay không? Nhiều nguwòi lầm tưởng nó là từ viết tắt nhưng thực chất tên của ngôn ngữ này lại là một từ - Sass.
+Do sự lầm tưởng như vậy và mọi người thường xuyên viết nó là "SASS", người sáng lập ra ngôn ngữ này đã đặt một cái tên hài hước cho nó là "Syntactically Awesome StyleSheets" (Thiết lập style có cú pháp một cách tuyệt vời đáng kinh ngạc).
+
+
+## Tập sử dụng Sass
+Nếu bạn muốn thử dùng Sass trên trình duyệt, hãy ghé qua [SassMeister](http://sassmeister.com/). Bạn có thể dùng cả hai cú pháp, hoặc mở cài đặt và chọn Sass hoặc SCSS.
+
+## Tính tương thích
+Sass 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://sass-lang.com/documentation/file.SASS_REFERENCE.html)
+* [The Sass Way](http://thesassway.com/) cung cấp các hướng dẫn từ cơ bản đến nâng cao cùng với các tin tức.
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/vim.html.markdown b/vim.html.markdown
index 7723136f..15144b8d 100644
--- a/vim.html.markdown
+++ b/vim.html.markdown
@@ -8,15 +8,16 @@ filename: LearnVim.txt
[Vim](http://www.vim.org)
-(Vi IMproved) is a clone of the popular vi editor for Unix. It is a text
-editor designed for speed and increased productivity, and is ubiquitous in most
-unix-based systems. It has numerous keybindings for speedy navigation to
+(Vi IMproved) is a clone of the popular vi editor for Unix. It is a text
+editor designed for speed and increased productivity, and is ubiquitous in most
+unix-based systems. It has numerous keybindings for speedy navigation to
specific points in the file, and for fast editing.
## Basics of navigating Vim
```
vim <filename> # Open <filename> in vim
+ :help <topic> # Open up built-in help docs about <topic> if any exists
:q # Quit vim
:w # Save current file
:wq # Save file and quit vim
@@ -51,12 +52,12 @@ specific points in the file, and for fast editing.
# Jumping to characters
f<character> # Jump forward and land on <character>
- t<character> # Jump forward and land right before <character>
+ t<character> # Jump forward and land right before <character>
- # For example,
+ # For example,
f< # Jump forward and land on <
t< # Jump forward and land right before <
-
+
# Moving by word
w # Move forward by one word
@@ -73,19 +74,28 @@ specific points in the file, and for fast editing.
L # Move to the bottom of the screen
```
+## Help docs:
+
+Vim has built in help documentation that can accessed with `:help <topic>`.
+For example `:help navigation` will pull up documentation about how to navigate
+your workspace!
+
+`:help` can also be used without an option. This will bring up a default help dialog
+that aims to make getting started with vim more approachable!
+
## Modes:
Vim is based on the concept on **modes**.
-Command Mode - vim starts up in this mode, used to navigate and write commands
-Insert Mode - used to make changes in your file
-Visual Mode - used to highlight text and do operations to them
+Command Mode - vim starts up in this mode, used to navigate and write commands
+Insert Mode - used to make changes in your file
+Visual Mode - used to highlight text and do operations to them
Ex Mode - used to drop down to the bottom with the ':' prompt to enter commands
```
i # Puts vim into insert mode, before the cursor position
a # Puts vim into insert mode, after the cursor position
- v # Puts vim into visual mode
+ v # Puts vim into visual mode
: # Puts vim into ex mode
<esc> # 'Escapes' from whichever mode you're in, into Command mode
@@ -102,18 +112,18 @@ Ex Mode - used to drop down to the bottom with the ':' prompt to enter comm
## The 'Grammar' of vim
-Vim can be thought of as a set of commands in a
+Vim can be thought of as a set of commands in a
'Verb-Modifier-Noun' format, where:
-Verb - your action
-Modifier - how you're doing your action
+Verb - your action
+Modifier - how you're doing your action
Noun - the object on which your action acts on
A few important examples of 'Verbs', 'Modifiers', and 'Nouns':
```
# 'Verbs'
-
+
d # Delete
c # Change
y # Yank (copy)
@@ -135,7 +145,7 @@ A few important examples of 'Verbs', 'Modifiers', and 'Nouns':
s # Sentence
p # Paragraph
b # Block
-
+
# Sample 'sentences' or commands
d2w # Delete 2 words
@@ -180,7 +190,7 @@ Here's a sample ~/.vimrc file:
```
" Example ~/.vimrc
-" 2015.10
+" 2015.10
" Required for vim to be iMproved
set nocompatible
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有指针,但是不支持指针运算。
// 你会因为空指针而犯错,但是不会因为增加指针而犯错。
diff --git a/zh-cn/groovy-cn.html.markdown b/zh-cn/groovy-cn.html.markdown
index 562a0284..0e7a020c 100644
--- a/zh-cn/groovy-cn.html.markdown
+++ b/zh-cn/groovy-cn.html.markdown
@@ -219,10 +219,12 @@ for (i in array) {
//遍历映射
def map = ['name':'Roberto', 'framework':'Grails', 'language':'Groovy']
-x = 0
+x = ""
for ( e in map ) {
x += e.value
+ x += " "
}
+assert x.equals("Roberto Grails Groovy ")
/*
运算符
diff --git a/zh-cn/swift-cn.html.markdown b/zh-cn/swift-cn.html.markdown
index cba9252d..c25b2918 100644
--- a/zh-cn/swift-cn.html.markdown
+++ b/zh-cn/swift-cn.html.markdown
@@ -445,47 +445,47 @@ if let circle = myEmptyCircle {
// 枚举可以像类一样,拥有方法
enum Suit {
- case Spades, Hearts, Diamonds, Clubs
+ case spades, hearts, diamonds, clubs
func getIcon() -> String {
switch self {
- case .Spades: return "♤"
- case .Hearts: return "♡"
- case .Diamonds: return "♢"
- case .Clubs: return "♧"
+ case .spades: return "♤"
+ case .hearts: return "♡"
+ case .diamonds: return "♢"
+ case .clubs: return "♧"
}
}
}
// 当变量类型明确指定为某个枚举类型时,赋值时可以省略枚举类型
-var suitValue: Suit = .Hearts
+var suitValue: Suit = .hearts
// 非整型的枚举类型需要在定义时赋值
enum BookName: String {
- case John = "John"
- case Luke = "Luke"
+ case john = "John"
+ case luke = "Luke"
}
-print("Name: \(BookName.John.rawValue)")
+print("Name: \(BookName.john.rawValue)")
// 与特定数据类型关联的枚举
enum Furniture {
// 和 Int 型数据关联的枚举记录
- case Desk(height: Int)
+ case desk(height: Int)
// 和 String, Int 关联的枚举记录
- case Chair(brand: String, height: Int)
+ case chair(brand: String, height: Int)
func description() -> String {
switch self {
- case .Desk(let height):
+ case .desk(let height):
return "Desk with \(height) cm"
- case .Chair(let brand, let height):
+ case .chair(let brand, let height):
return "Chair of \(brand) with \(height) cm"
}
}
}
-var desk: Furniture = .Desk(height: 80)
+var desk: Furniture = .desk(height: 80)
print(desk.description()) // "Desk with 80 cm"
-var chair = Furniture.Chair(brand: "Foo", height: 40)
+var chair = Furniture.chair(brand: "Foo", height: 40)
print(chair.description()) // "Chair of Foo with 40 cm"