summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CHICKEN.html.markdown6
-rw-r--r--LOLCODE.html.markdown2
-rw-r--r--angularjs.html.markdown8
-rw-r--r--awk.html.markdown6
-rw-r--r--bf.html.markdown3
-rw-r--r--bg-bg/perl-bg.html.markdown2
-rw-r--r--c++.html.markdown2
-rw-r--r--c.html.markdown4
-rw-r--r--chapel.html.markdown6
-rw-r--r--cmake.html.markdown4
-rw-r--r--crystal.html.markdown2
-rw-r--r--csharp.html.markdown28
-rw-r--r--cypher.html.markdown6
-rw-r--r--d.html.markdown2
-rw-r--r--de-de/java-de.html.markdown2
-rw-r--r--de-de/scala-de.html.markdown5
-rw-r--r--edn.html.markdown4
-rw-r--r--elisp.html.markdown13
-rw-r--r--elixir.html.markdown4
-rw-r--r--elm.html.markdown2
-rw-r--r--es-es/amd-es.html.markdown2
-rw-r--r--es-es/bf-es.html.markdown3
-rw-r--r--es-es/csharp-es.html.markdown5
-rw-r--r--es-es/git-es.html.markdown2
-rw-r--r--es-es/go-es.html.markdown12
-rw-r--r--es-es/sass-es.html.markdown2
-rw-r--r--es-es/xml-es.html.markdown2
-rw-r--r--fa-ir/bf-fa.html.markdown1
-rw-r--r--fa-ir/java-fa.html.markdown2
-rw-r--r--fortran95.html.markdown4
-rw-r--r--fr-fr/css-fr.html.markdown1
-rw-r--r--fr-fr/d.html.markdown34
-rw-r--r--fr-fr/haml-fr.html.markdown2
-rw-r--r--fr-fr/php.html.markdown1
-rw-r--r--fr-fr/ruby-ecosystem-fr.html.markdown25
-rw-r--r--fr-fr/ruby-fr.html.markdown49
-rw-r--r--fr-fr/scala.html.markdown2
-rw-r--r--fr-fr/vim.html.markdown2
-rw-r--r--fr-fr/yaml-fr.html.markdown2
-rw-r--r--git.html.markdown18
-rw-r--r--go.html.markdown10
-rw-r--r--hack.html.markdown4
-rw-r--r--haml.html.markdown2
-rw-r--r--haskell.html.markdown1
-rw-r--r--haxe.html.markdown2
-rw-r--r--hy.html.markdown2
-rw-r--r--it-it/bf-it.html.markdown1
-rw-r--r--it-it/json-it.html.markdown1
-rw-r--r--it-it/python-it.html.markdown2
-rw-r--r--ja-jp/php-jp.html.markdown2
-rw-r--r--java.html.markdown129
-rw-r--r--json.html.markdown1
-rw-r--r--kdb+.html.markdown20
-rw-r--r--ko-kr/bf-kr.html.markdown1
-rw-r--r--kotlin.html.markdown2
-rw-r--r--lfe.html.markdown459
-rw-r--r--lt-lt/tmux-lt.html.markdown5
-rw-r--r--matlab.html.markdown2
-rw-r--r--nim.html.markdown4
-rw-r--r--nl-nl/bf.html.markdown1
-rw-r--r--objective-c.html.markdown2
-rw-r--r--ocaml.html.markdown1
-rw-r--r--perl6.html.markdown29
-rw-r--r--php.html.markdown12
-rw-r--r--pl-pl/bf-pl.html.markdown3
-rw-r--r--pl-pl/haskell-pl.html.markdown7
-rw-r--r--pl-pl/json-pl.html.markdown3
-rw-r--r--pl-pl/perl-pl.html.markdown5
-rw-r--r--prolog.html.markdown331
-rw-r--r--pt-br/bf.html.markdown1
-rw-r--r--pt-br/c++-pt.html.markdown2
-rw-r--r--pt-br/c-pt.html.markdown2
-rw-r--r--pt-br/groovy-pt.html.markdown2
-rw-r--r--pt-br/hy-pt.html.markdown2
-rw-r--r--pt-br/javascript-pt.html.markdown1
-rw-r--r--pt-br/kotlin-pt.html.markdown384
-rw-r--r--pt-br/solidity-pt.html.markdown914
-rw-r--r--pt-br/swift-pt.html.markdown3
-rw-r--r--pt-pt/bf.html.markdown1
-rw-r--r--purescript.html.markdown1
-rw-r--r--python3.html.markdown1
-rw-r--r--pythonstatcomp.html.markdown2
-rw-r--r--qt.html.markdown6
-rw-r--r--r.html.markdown4
-rw-r--r--red.html.markdown14
-rw-r--r--rst.html.markdown2
-rw-r--r--ru-ru/bf.html.markdown1
-rw-r--r--ru-ru/c++-ru.html.markdown2
-rw-r--r--ru-ru/c-ru.html.markdown2
-rw-r--r--ru-ru/elixir-ru.html.markdown467
-rw-r--r--ru-ru/haskell-ru.html.markdown1
-rw-r--r--ru-ru/html-ru.html.markdown2
-rw-r--r--ru-ru/java-ru.html.markdown3
-rw-r--r--ru-ru/nim-ru.html.markdown279
-rw-r--r--ru-ru/objective-c-ru.html.markdown2
-rw-r--r--ru-ru/php-ru.html.markdown41
-rw-r--r--ruby-ecosystem.html.markdown2
-rw-r--r--ruby.html.markdown6
-rw-r--r--rust-pt.html.markdown2
-rw-r--r--scala.html.markdown46
-rw-r--r--shutit.html.markdown8
-rw-r--r--smalltalk.html.markdown3
-rw-r--r--solidity.html.markdown9
-rw-r--r--standard-ml.html.markdown10
-rw-r--r--sv-se/brainfuck-sv.html.markdown1
-rw-r--r--swift.html.markdown2
-rw-r--r--ta_in/json-ta.html.markdown2
-rw-r--r--tcl.html.markdown15
-rw-r--r--tcsh.html.markdown790
-rw-r--r--tr-tr/c-tr.html.markdown2
-rw-r--r--tr-tr/dynamic-programming-tr.html.markdown5
-rw-r--r--tr-tr/kotlin-tr.html.markdown474
-rw-r--r--typescript.html.markdown2
-rw-r--r--uk-ua/java-ua.html.markdown3
-rwxr-xr-xvala.html.markdown503
-rw-r--r--vi-vn/html-vi.html.markdown2
-rw-r--r--vi-vn/python3-vi.html.markdown3
-rw-r--r--vi-vn/ruby-vi.html.markdown2
-rw-r--r--vim.html.markdown6
-rw-r--r--visualbasic.html.markdown2
-rw-r--r--yaml.html.markdown4
-rw-r--r--zh-cn/bf-cn.html.markdown4
-rw-r--r--zh-cn/java-cn.html.markdown4
-rw-r--r--zh-cn/livescript-cn.html.markdown2
-rw-r--r--zh-cn/matlab-cn.html.markdown2
-rw-r--r--zh-cn/red-cn.html.markdown208
-rw-r--r--zh-cn/visualbasic-cn.html.markdown2
127 files changed, 5243 insertions, 351 deletions
diff --git a/CHICKEN.html.markdown b/CHICKEN.html.markdown
index 080527a9..7fb0270b 100644
--- a/CHICKEN.html.markdown
+++ b/CHICKEN.html.markdown
@@ -235,12 +235,12 @@ sqr ;; => #<procedure (sqr x)>
(= 2 1) ;; => #f
;; 'eq?' returns #t if two arguments refer to the same object in memory
-;; In other words, it's a simple pointer comparision.
+;; In other words, it's a simple pointer comparison.
(eq? '() '()) ;; => #t ;; there's only one empty list in memory
(eq? (list 3) (list 3)) ;; => #f ;; not the same object
(eq? 'yes 'yes) ;; => #t
(eq? 3 3) ;; => #t ;; don't do this even if it works in this case
-(eq? 3 3.0) ;; => #f ;; it's better to use '=' for number comparisions
+(eq? 3 3.0) ;; => #f ;; it's better to use '=' for number comparisons
(eq? "Hello" "Hello") ;; => #f
;; 'eqv?' is same as 'eq?' all datatypes except numbers and characters
@@ -255,7 +255,7 @@ sqr ;; => #<procedure (sqr x)>
(equal? '(1 2 3) '(1 2 3)) ;; => #t
(equal? #(a b c) #(a b c)) ;; => #t
(equal? 'a 'a) ;; => #t
-(equal? "abc" "abc") ;; => #f
+(equal? "abc" "abc") ;; => #t
;; In Summary:
;; eq? tests if objects are identical
diff --git a/LOLCODE.html.markdown b/LOLCODE.html.markdown
index d7ed10c9..217b7b7d 100644
--- a/LOLCODE.html.markdown
+++ b/LOLCODE.html.markdown
@@ -7,7 +7,7 @@ contributors:
LOLCODE is an esoteric programming language designed to resemble the speech of [lolcats](https://upload.wikimedia.org/wikipedia/commons/a/ab/Lolcat_in_folder.jpg?1493656347257).
-```LOLCODE
+```
BTW This is an inline comment
BTW All code must begin with `HAI <language version>` and end with `KTHXBYE`
diff --git a/angularjs.html.markdown b/angularjs.html.markdown
index 737b99c7..9156490e 100644
--- a/angularjs.html.markdown
+++ b/angularjs.html.markdown
@@ -699,10 +699,10 @@ app.controller('myCtrl', function($scope) {
**Examples**
-- http://www.w3schools.com/angular/angular_examples.asp
+- [http://www.w3schools.com/angular/angular_examples.asp](http://www.w3schools.com/angular/angular_examples.asp)
**References**
-- http://www.w3schools.com/angular/angular_ref_directives.asp
-- http://www.w3schools.com/angular/default.asp
-- https://teamtreehouse.com/library/angular-basics/
+- [http://www.w3schools.com/angular/angular_ref_directives.asp](http://www.w3schools.com/angular/angular_ref_directives.asp)
+- [http://www.w3schools.com/angular/default.asp](http://www.w3schools.com/angular/default.asp)
+- [https://teamtreehouse.com/library/angular-basics/](https://teamtreehouse.com/library/angular-basics/)
diff --git a/awk.html.markdown b/awk.html.markdown
index 90f88b1a..0e27528d 100644
--- a/awk.html.markdown
+++ b/awk.html.markdown
@@ -2,8 +2,8 @@
language: awk
filename: learnawk.awk
contributors:
- - ["Marshall Mason", "http://github.com/marshallmason"]
-lang: en
+ - ["Marshall Mason", "http://github.com/marshallmason"]
+
---
AWK is a standard tool on every POSIX-compliant UNIX system. It's like a
@@ -264,7 +264,7 @@ function io_functions( localvar) {
# automatically for you.
# You can probably guess there are other $ variables. Every line is
- # implicitely split before every action is called, much like the shell
+ # implicitly split before every action is called, much like the shell
# does. And, like the shell, each field can be access with a dollar sign
# This will print the second and fourth fields in the line
diff --git a/bf.html.markdown b/bf.html.markdown
index 9c603303..69058a20 100644
--- a/bf.html.markdown
+++ b/bf.html.markdown
@@ -1,5 +1,6 @@
---
-language: bf
+language: "Brainfuck"
+filename: brainfuck.bf
contributors:
- ["Prajit Ramachandran", "http://prajitr.github.io/"]
- ["Mathias Bynens", "http://mathiasbynens.be/"]
diff --git a/bg-bg/perl-bg.html.markdown b/bg-bg/perl-bg.html.markdown
index babd2d4d..2ae7a8fd 100644
--- a/bg-bg/perl-bg.html.markdown
+++ b/bg-bg/perl-bg.html.markdown
@@ -2,7 +2,7 @@
name: perl
category: language
language: perl
-filename: learnperl.pl
+filename: learnperl-bg.pl
contributors:
- ["Korjavin Ivan", "http://github.com/korjavin"]
- ["Dan Book", "http://github.com/Grinnz"]
diff --git a/c++.html.markdown b/c++.html.markdown
index 1461c93e..23013410 100644
--- a/c++.html.markdown
+++ b/c++.html.markdown
@@ -8,7 +8,6 @@ contributors:
- ["Connor Waters", "http://github.com/connorwaters"]
- ["Ankush Goyal", "http://github.com/ankushg07"]
- ["Jatin Dhankhar", "https://github.com/jatindhankhar"]
-lang: en
---
C++ is a systems programming language that,
@@ -474,6 +473,7 @@ int main() {
// without a public or protected method for doing so
class OwnedDog : public Dog {
+public:
void setOwner(const std::string& dogsOwner);
// Override the behavior of the print function for all OwnedDogs. See
diff --git a/c.html.markdown b/c.html.markdown
index 18503eab..637311ca 100644
--- a/c.html.markdown
+++ b/c.html.markdown
@@ -336,10 +336,10 @@ int main (int argc, char** argv)
goto error;
}
error :
- printf("Error occured at i = %d & j = %d.\n", i, j);
+ printf("Error occurred at i = %d & j = %d.\n", i, j);
/*
https://ideone.com/GuPhd6
- this will print out "Error occured at i = 52 & j = 99."
+ this will print out "Error occurred at i = 52 & j = 99."
*/
///////////////////////////////////////
diff --git a/chapel.html.markdown b/chapel.html.markdown
index 68ce49cd..96ddc69d 100644
--- a/chapel.html.markdown
+++ b/chapel.html.markdown
@@ -242,7 +242,7 @@ do {
} while (j <= 10000);
writeln(jSum);
-// for loops are much like those in python in that they iterate over a
+// for loops are much like those in Python in that they iterate over a
// range. Ranges (like the 1..10 expression below) are a first-class object
// in Chapel, and as such can be stored in variables.
for i in 1..10 do write(i, ", ");
@@ -1064,14 +1064,14 @@ proc main() {
}
}
-// Heres an example using atomics and a sync variable to create a
+// Here's an example using atomics and a sync variable to create a
// count-down mutex (also known as a multiplexer).
var count: atomic int; // our counter
var lock$: sync bool; // the mutex lock
count.write(2); // Only let two tasks in at a time.
lock$.writeXF(true); // Set lock$ to full (unlocked)
- // Note: The value doesnt actually matter, just the state
+ // Note: The value doesn't actually matter, just the state
// (full:unlocked / empty:locked)
// Also, writeXF() fills (F) the sync var regardless of its state (X)
diff --git a/cmake.html.markdown b/cmake.html.markdown
index 45cf0585..c705beea 100644
--- a/cmake.html.markdown
+++ b/cmake.html.markdown
@@ -28,8 +28,8 @@ are used in the usual way.
# - cmake ..
# - make
#
-# With those steps, we will follow the best pratice to compile into a subdir
-# and the second line will request to CMake to generate a new OS-dependant
+# With those steps, we will follow the best practice to compile into a subdir
+# and the second line will request to CMake to generate a new OS-dependent
# Makefile. Finally, run the native Make command.
#------------------------------------------------------------------------------
diff --git a/crystal.html.markdown b/crystal.html.markdown
index 1449ff81..15cbc0b1 100644
--- a/crystal.html.markdown
+++ b/crystal.html.markdown
@@ -215,7 +215,7 @@ Range.new(1, 10).class #=> Range(Int32, Int32)
# possibly different types.
{1, "hello", 'x'}.class #=> Tuple(Int32, String, Char)
-# Acces tuple's value by its index
+# Access tuple's value by its index
tuple = {:key1, :key2}
tuple[1] #=> :key2
tuple[2] #=> syntax error : Index out of bound
diff --git a/csharp.html.markdown b/csharp.html.markdown
index cca99fb0..963f38f4 100644
--- a/csharp.html.markdown
+++ b/csharp.html.markdown
@@ -593,7 +593,7 @@ on a new line! ""Wow!"", the masses cried";
Console.WriteLine(bikeSummary.Name);
// ASPARALLEL
- // And this is where things get wicked - combines linq and parallel operations
+ // And this is where things get wicked - combine linq and parallel operations
var threeWheelers = bikes.AsParallel().Where(b => b.Wheels == 3).Select(b => b.Name);
// this will happen in parallel! Threads will automagically be spun up and the
// results divvied amongst them! Amazing for large datasets when you have lots of
@@ -613,7 +613,7 @@ on a new line! ""Wow!"", the masses cried";
.ThenBy(b => b.Name)
.Select(b => b.Name); // still no query run
- // Now the query runs, but opens a reader, so only populates are you iterate through
+ // Now the query runs, but opens a reader, so only populates as you iterate through
foreach (string bike in query)
Console.WriteLine(result);
@@ -711,7 +711,7 @@ on a new line! ""Wow!"", the masses cried";
// Before .NET 4: (aBike.Accessories & Bicycle.BikeAccessories.Bell) == Bicycle.BikeAccessories.Bell
public BikeAccessories Accessories { get; set; }
- // Static members belong to the type itself rather then specific object.
+ // Static members belong to the type itself rather than specific object.
// You can access them without a reference to any object:
// Console.WriteLine("Bicycles created: " + Bicycle.bicyclesCreated);
public static int BicyclesCreated { get; set; }
@@ -1095,6 +1095,28 @@ namespace Learning.More.CSharp
}
}
}
+
+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);
+ }
+ }
+}
+
```
## Topics Not Covered
diff --git a/cypher.html.markdown b/cypher.html.markdown
index 44db26ae..b7be544a 100644
--- a/cypher.html.markdown
+++ b/cypher.html.markdown
@@ -20,7 +20,7 @@ Nodes
It's an empty *node*, to indicate that there is a *node*, but it's not relevant for the query.
```(n)```
-It's a *node* refered by the variable **n**, reusable in the query. It begins with lowercase and uses camelCase.
+It's a *node* referred by the variable **n**, reusable in the query. It begins with lowercase and uses camelCase.
```(p:Person)```
You can add a *label* to your node, here **Person**. It's like a type / a class / a category. It begins with uppercase and uses camelCase.
@@ -53,7 +53,7 @@ Relationships (or Edges)
It's a *relationship* with the *label* **KNOWS**. It's a *label* as the node's label. It begins with uppercase and use UPPER_SNAKE_CASE.
```[k:KNOWS]```
-The same *relationship*, refered by the variable **k**, reusable in the query, but it's not necessary.
+The same *relationship*, referred by the variable **k**, reusable in the query, but it's not necessary.
```[k:KNOWS {since:2017}]```
The same *relationship*, with *properties* (like *node*), here **since**.
@@ -244,6 +244,6 @@ Special hints
---
- There is just single-line comments in Cypher, with double-slash : // Comments
-- You can execute a Cypher script stored in a **.cql** file directly in Neo4j (it's an import). However, you can't have multiple statements in this file (separed by **;**).
+- You can execute a Cypher script stored in a **.cql** file directly in Neo4j (it's an import). However, you can't have multiple statements in this file (separated by **;**).
- Use the Neo4j shell to write Cypher, it's really awesome.
- The Cypher will be the standard query language for all graph databases (known as **OpenCypher**).
diff --git a/d.html.markdown b/d.html.markdown
index c682cfb5..d2a57cae 100644
--- a/d.html.markdown
+++ b/d.html.markdown
@@ -3,7 +3,7 @@ language: D
filename: learnd.d
contributors:
- ["Nick Papanastasiou", "www.nickpapanastasiou.github.io"]
-lang: en
+
---
```d
diff --git a/de-de/java-de.html.markdown b/de-de/java-de.html.markdown
index 934819f9..e8ac5bda 100644
--- a/de-de/java-de.html.markdown
+++ b/de-de/java-de.html.markdown
@@ -1,6 +1,6 @@
---
language: java
-filename: LearnJavaDe.java
+filename: LearnJavaDe-de.java
contributors:
- ["Jake Prather", "http://github.com/JakeHP"]
- ["Jakukyo Friel", "http://weakish.github.io"]
diff --git a/de-de/scala-de.html.markdown b/de-de/scala-de.html.markdown
index 456403a2..ddadcd8e 100644
--- a/de-de/scala-de.html.markdown
+++ b/de-de/scala-de.html.markdown
@@ -538,8 +538,9 @@ res2: Boolean = true
scala> b.beissen
res3: Boolean = false
-
-// Traits können auch via Mixins (Schlüsselwort "with") eingebunden werden
+// Ein Trait kann auch als Mixin eingebunden werden. Die Klasse erbt vom
+// ersten Trait mit dem Schlüsselwort "extends", während weitere Traits
+// mit "with" verwendet werden können.
trait Bellen {
def bellen: String = "Woof"
diff --git a/edn.html.markdown b/edn.html.markdown
index ca04df89..79107269 100644
--- a/edn.html.markdown
+++ b/edn.html.markdown
@@ -32,7 +32,7 @@ false
"hungarian breakfast"
"farmer's cheesy omelette"
-; Characters are preceeded by backslashes
+; Characters are preceded by backslashes
\g \r \a \c \e
; Keywords start with a colon. They behave like enums. Kind of
@@ -42,7 +42,7 @@ false
:olives
; Symbols are used to represent identifiers. They start with #.
-; You can namespace symbols by using /. Whatever preceeds / is
+; You can namespace symbols by using /. Whatever precedes / is
; the namespace of the name.
#spoon
#kitchen/spoon ; not the same as #spoon
diff --git a/elisp.html.markdown b/elisp.html.markdown
index bda5f00f..518ad985 100644
--- a/elisp.html.markdown
+++ b/elisp.html.markdown
@@ -9,8 +9,6 @@ filename: learn-emacs-lisp.el
```scheme
;; This gives an introduction to Emacs Lisp in 15 minutes (v0.2d)
;;
-;; Author: Bastien / @bzg2 / https://bzg.fr
-;;
;; First make sure you read this text by Peter Norvig:
;; http://norvig.com/21-days.html
;;
@@ -303,7 +301,7 @@ filename: learn-emacs-lisp.el
(hello-to-bonjour)
-;; Let's colorize the names:
+;; Let's boldify the names:
(defun boldify-names ()
(switch-to-buffer-other-window "*test*")
@@ -344,13 +342,4 @@ filename: learn-emacs-lisp.el
;;
;; To read an online introduction to Emacs Lisp:
;; https://www.gnu.org/software/emacs/manual/html_node/eintr/index.html
-
-;; Thanks to these people for their feedback and suggestions:
-;; - Wes Hardaker
-;; - notbob
-;; - Kevin Montuori
-;; - Arne Babenhauserheide
-;; - Alan Schmitt
-;; - LinXitoW
-;; - Aaron Meurer
```
diff --git a/elixir.html.markdown b/elixir.html.markdown
index 9dfffc41..a74baa38 100644
--- a/elixir.html.markdown
+++ b/elixir.html.markdown
@@ -4,6 +4,7 @@ contributors:
- ["Joao Marques", "http://github.com/mrshankly"]
- ["Dzianis Dashkevich", "https://github.com/dskecse"]
- ["Ryan Plant", "https://github.com/ryanplant-au"]
+ - ["Ev Bogdanov", "https://github.com/evbogdanov"]
filename: learnelixir.ex
---
@@ -127,7 +128,8 @@ rem(10, 3) #=> 1
# These operators expect a boolean as their first argument.
true and true #=> true
false or true #=> true
-# 1 and true #=> ** (ArgumentError) argument error
+# 1 and true
+#=> ** (BadBooleanError) expected a boolean on left-side of "and", got: 1
# Elixir also provides `||`, `&&` and `!` which accept arguments of any type.
# All values except `false` and `nil` will evaluate to true.
diff --git a/elm.html.markdown b/elm.html.markdown
index 99c23980..23ae9eeb 100644
--- a/elm.html.markdown
+++ b/elm.html.markdown
@@ -286,7 +286,7 @@ leftmostElement tree =
-- Put this at the top of the file. If omitted, you're in Main.
module Name where
--- By default, everything is exported. You can specify exports explicity.
+-- By default, everything is exported. You can specify exports explicitly.
module Name (MyType, myValue) where
-- One common pattern is to export a union type but not its tags. This is known
diff --git a/es-es/amd-es.html.markdown b/es-es/amd-es.html.markdown
index 7a59ddd6..40aa6647 100644
--- a/es-es/amd-es.html.markdown
+++ b/es-es/amd-es.html.markdown
@@ -190,7 +190,7 @@ Para usar el fichero creado en producción, simplemente intercambia `data-main`:
Un increíblemente detallado [resumen de opciones de generación](https://github.com/jrburke/r.js/blob/master/build/example.build.js) está disponible en el repositorio de GitHub.
-### Tópicos no cubiertos en este tutorial
+### Temas no cubiertos en este tutorial
* [Cargador de plugins / transformaciones](http://requirejs.org/docs/plugins.html)
* [Cargando y exportando estilos CommonJS](http://requirejs.org/docs/commonjs.html)
* [Configuración avanzada](http://requirejs.org/docs/api.html#config)
diff --git a/es-es/bf-es.html.markdown b/es-es/bf-es.html.markdown
index c93b8c3a..90c6202f 100644
--- a/es-es/bf-es.html.markdown
+++ b/es-es/bf-es.html.markdown
@@ -1,5 +1,6 @@
---
-language: bf
+language: Brainfuck
+filename: brainfuck-es.bf
contributors:
- ["Prajit Ramachandran", "http://prajitr.github.io/"]
- ["Mathias Bynens", "http://mathiasbynens.be/"]
diff --git a/es-es/csharp-es.html.markdown b/es-es/csharp-es.html.markdown
index ef26d8ce..5d730497 100644
--- a/es-es/csharp-es.html.markdown
+++ b/es-es/csharp-es.html.markdown
@@ -1,12 +1,13 @@
---
-language: c#
+language: C#(C Sharp)
+filename: LearnCSharp-es.cs
contributors:
- ["Irfan Charania", "https://github.com/irfancharania"]
- ["Max Yankov", "https://github.com/golergka"]
translators:
- ["Olfran Jiménez", "https://twitter.com/neslux"]
-filename: LearnCSharp-es.cs
lang: es-es
+
---
C# es un lenguaje orientado a objetos elegante y de tipado seguro que
diff --git a/es-es/git-es.html.markdown b/es-es/git-es.html.markdown
index 1a8e275a..749365d1 100644
--- a/es-es/git-es.html.markdown
+++ b/es-es/git-es.html.markdown
@@ -1,11 +1,11 @@
---
category: tool
tool: git
+filename: LearnGit-es.txt
contributors:
- ["Jake Prather", "http://github.com/JakeHP"]
translator:
- ["Raúl Ascencio", "http://rscnt.github.io"]
-filename: LearnGit.txt
lang: es-es
---
diff --git a/es-es/go-es.html.markdown b/es-es/go-es.html.markdown
index c41d693d..78267695 100644
--- a/es-es/go-es.html.markdown
+++ b/es-es/go-es.html.markdown
@@ -26,7 +26,7 @@ Es rápido compilando y rápido al ejecutar, añade una concurrencia fácil de
entender para las CPUs de varios núcleos de hoy día, y tiene
características que ayudan con la programación a gran escala.
-Go viene con una biblioteca estándar muy buena y una entusiasta comunidad.
+Go viene con una biblioteca estándar muy buena y una comunidad entusiasta.
```go
// Comentario de una sola línea
@@ -52,7 +52,7 @@ import (
// para el ejecutable. Te guste o no, Go utiliza llaves.
func main() {
// Println imprime una línea a stdout.
- // Cualificalo con el nombre del paquete, fmt.
+ // Llámalo con el nombre del paquete, fmt.
fmt.Println("¡Hola mundo!")
// Llama a otra función de este paquete.
@@ -90,12 +90,12 @@ saltos de línea.` // mismo tipo cadena
g := 'Σ' // Tipo rune, un alias de int32, alberga un carácter unicode.
f := 3.14195 // float64, el estándar IEEE-754 de coma flotante 64-bit.
c := 3 + 4i // complex128, representado internamente por dos float64.
- // Sintaxis Var con iniciadores.
+ // Sintaxis var con iniciadores.
var u uint = 7 // Sin signo, pero la implementación depende del tamaño
// como en int.
var pi float32 = 22. / 7
- // Sintáxis de conversión con una declaración corta.
+ // Sintaxis de conversión con una declaración corta.
n := byte('\n') // byte es un alias para uint8.
// Los Arreglos tienen un tamaño fijo a la hora de compilar.
@@ -377,8 +377,8 @@ func aprendeConcurrencia() {
go func() { c <- 84 }() // Inicia una nueva rutinago solo para
// enviar un valor.
go func() { cs <- "verboso" }() // Otra vez, para cs en esta ocasión.
- // Select tiene una sintáxis parecida a la instrucción switch pero cada
- // caso involucra una operacion con un canal. Selecciona un caso de
+ // Select tiene una sintaxis parecida a la instrucción switch pero cada
+ // caso involucra una operación con un canal. Selecciona un caso de
// forma aleatoria de los casos que están listos para comunicarse.
select {
case i := <-c: // El valor recibido se puede asignar a una variable,
diff --git a/es-es/sass-es.html.markdown b/es-es/sass-es.html.markdown
index 89e56ba5..d130fe8c 100644
--- a/es-es/sass-es.html.markdown
+++ b/es-es/sass-es.html.markdown
@@ -1,6 +1,6 @@
---
language: sass
-filename: learnsass.scss
+filename: learnsass-es.scss
contributors:
- ["Laura Kyle", "https://github.com/LauraNK"]
- ["Sean Corrales", "https://github.com/droidenator"]
diff --git a/es-es/xml-es.html.markdown b/es-es/xml-es.html.markdown
index 2e9326cf..23831f3b 100644
--- a/es-es/xml-es.html.markdown
+++ b/es-es/xml-es.html.markdown
@@ -1,6 +1,6 @@
---
language: xml
-filename: learnxml.xml
+filename: learnxml-es.xml
contributors:
- ["João Farias", "https://github.com/JoaoGFarias"]
translators:
diff --git a/fa-ir/bf-fa.html.markdown b/fa-ir/bf-fa.html.markdown
index bc5d8dc4..81c73980 100644
--- a/fa-ir/bf-fa.html.markdown
+++ b/fa-ir/bf-fa.html.markdown
@@ -1,5 +1,6 @@
---
language: bf
+filename: bf-fa.bf
contributors:
- ["Mohammad Valipour", "https://github.com/mvalipour"]
lang: fa-ir
diff --git a/fa-ir/java-fa.html.markdown b/fa-ir/java-fa.html.markdown
index e8182e81..cb965fc4 100644
--- a/fa-ir/java-fa.html.markdown
+++ b/fa-ir/java-fa.html.markdown
@@ -54,7 +54,7 @@ public class LearnJava {
///////////////////////////////////////
/*
- * Ouput
+ * Output
*/
// Use System.out.println() to print lines.
diff --git a/fortran95.html.markdown b/fortran95.html.markdown
index 8479fef8..c256bb38 100644
--- a/fortran95.html.markdown
+++ b/fortran95.html.markdown
@@ -6,7 +6,7 @@ filename: learnfortran.f95
---
Fortran is one of the oldest computer languages. It was developed in the 1950s
-by IBM for numeric calculations (Fortran is an abreviation of "Formula
+by IBM for numeric calculations (Fortran is an abbreviation of "Formula
Translation"). Despite its age, it is still used for high-performance computing
such as weather prediction. However, the language has changed considerably over
the years, although mostly maintaining backwards compatibility; well known
@@ -242,7 +242,7 @@ program example !declare a program called example.
close(12)
! There are more features available than discussed here and alternative
- ! variants due to backwards compatability with older Fortran versions.
+ ! variants due to backwards compatibility with older Fortran versions.
! Built-in Functions
diff --git a/fr-fr/css-fr.html.markdown b/fr-fr/css-fr.html.markdown
index 35673c47..74a49c9a 100644
--- a/fr-fr/css-fr.html.markdown
+++ b/fr-fr/css-fr.html.markdown
@@ -1,5 +1,6 @@
---
language: css
+filename: cascading-fr.css
contributors:
- ["Mohammad Valipour", "https://github.com/mvalipour"]
- ["Marco Scannadinari", "https://github.com/marcoms"]
diff --git a/fr-fr/d.html.markdown b/fr-fr/d.html.markdown
index bfb9f2ce..8d98f9dc 100644
--- a/fr-fr/d.html.markdown
+++ b/fr-fr/d.html.markdown
@@ -54,7 +54,7 @@ void main() {
} while(n > 0);
// For et while sont très utiles, mais en D, on préfère foreach.
- // Les deux points : '..', créent un intervalle continue de valeurs
+ // Les deux points : '..', créent un intervalle continu de valeurs
// incluant la première mais excluant la dernière.
foreach(i; 1..1_000_000) {
if(n % 2 == 0)
@@ -72,7 +72,7 @@ void main() {
}
```
On peut définir de nouveaux types avec les mots-clés `struct`, `class`,
-`union` et `enum`. Ces types sont passés au fonction par valeur (ils sont copiés)
+`union` et `enum`. Ces types sont passés à la fonction par valeur (ils sont copiés)
De plus, on peut utiliser les templates pour rendre toutes ces abstractions génériques.
```c
@@ -88,7 +88,7 @@ struct LinkedList(T) {
class BinTree(T) {
T data = null;
- // Si il n'y a qu'un seul paramètre de template,
+ // S'il n'y a qu'un seul paramètre de template,
// on peut s'abstenir de mettre des parenthèses.
BinTree!T left;
BinTree!T right;
@@ -152,7 +152,7 @@ class MyClass(T, U) {
T _data;
U _other;
- // Les constructeurs s'apellent toujours 'this'.
+ // Les constructeurs s'appellent toujours 'this'.
this(T t, U u) {
// Ceci va appeller les setters ci-dessous.
data = t;
@@ -197,8 +197,8 @@ void main() {
writefln("Later: data = %d, str = %s", mc.data, mc.other);
}
```
-Avec les propriétés, on peut constuire nos setters et nos getters
-comme on le souhaite, tout en gardant un syntaxe très propre,
+Avec les propriétés, on peut construire nos setters et nos getters
+comme on le souhaite, tout en gardant une syntaxe très propre,
comme si on accédait directement à des membres de la classe.
Les autres fonctionnalités orientées objets à notre disposition
@@ -208,8 +208,8 @@ d'une seule classe et implémenter autant d'interface que voulu.
Nous venons d'explorer les fonctionnalités objet du D, mais changeons
un peu de domaine. D permet la programmation fonctionelle, avec les fonctions
-de premier ordre, les fonctions `pure` et les données immuables.
-De plus, tout vos algorithmes fonctionelles favoris (map, reduce, filter)
+de premier ordre, les fonctions `pures` et les données immuables.
+De plus, tout vos algorithmes fonctionels favoris (map, reduce, filter)
sont disponibles dans le module `std.algorithm`.
```c
@@ -217,11 +217,11 @@ import std.algorithm : map, filter, reduce;
import std.range : iota; // construit un intervalle excluant la dernière valeur.
void main() {
- // On veut un algorithm qui affiche la somme de la listes des carrés
+ // On veut un algorithme qui affiche la somme de la liste des carrés
// des entiers paires de 1 à 100. Un jeu d'enfant !
- // On se content de passer des expressions lambda en paramètre à des templates.
- // On peut fournier au template n'importe quelle fonction, mais dans notre
+ // On se contente de passer des expressions lambda en paramètre à des templates.
+ // On peut fournir au template n'importe quelle fonction, mais dans notre
// cas, les lambdas sont pratiques.
auto num = iota(1, 101).filter!(x => x % 2 == 0)
.map!(y => y ^^ 2)
@@ -231,15 +231,15 @@ void main() {
}
```
-Vous voyez comme on a calculé `num` comme on le ferait en haskell par exemple ?
-C'est grâce à une innvoation de D qu'on appelle "Uniform Function Call Syntax".
-Avec l'UFCS, on peut choisir d'écrire un appelle à une fonction de manière
-classique, ou comme un appelle à une méthode. Walter Brighter a écrit un
+Vous voyez qu'on a calculé `num` comme on le ferait en haskell par exemple ?
+C'est grâce à une innovation de D qu'on appelle "Uniform Function Call Syntax".
+Avec l'UFCS, on peut choisir d'écrire un appel à une fonction de manière
+classique, ou comme un appel à une méthode. Walter Brighter a écrit un
article en anglais sur l'UFCS [ici.](http://www.drdobbs.com/cpp/uniform-function-call-syntax/232700394)
Pour faire court, on peut appeller une fonction dont le premier paramètre
est de type A, comme si c'était une méthode de A.
-J'aime le parallélisme. Vous aimez les parallélisme ? Bien sur que vous aimez ça
+J'aime le parallélisme. Vous aimez le parallélisme ? Bien sûr que vous aimez ça.
Voyons comment on le fait en D !
```c
@@ -248,7 +248,7 @@ import std.parallelism : parallel;
import std.math : sqrt;
void main() {
- // On veut calculer la racine carré de tous les nombres
+ // On veut calculer la racine carrée de tous les nombres
// dans notre tableau, et profiter de tous les coeurs
// à notre disposition.
auto arr = new double[1_000_000];
diff --git a/fr-fr/haml-fr.html.markdown b/fr-fr/haml-fr.html.markdown
index 24be8bf9..f5d096fe 100644
--- a/fr-fr/haml-fr.html.markdown
+++ b/fr-fr/haml-fr.html.markdown
@@ -1,6 +1,6 @@
---
language: haml
-filename: learnhaml.haml
+filename: learnhaml-fr.haml
contributors:
- ["Simon Neveu", "https://github.com/sneveu"]
- ["Thibault", "https://github.com/iTech-"]
diff --git a/fr-fr/php.html.markdown b/fr-fr/php.html.markdown
index f4eaf396..823630bd 100644
--- a/fr-fr/php.html.markdown
+++ b/fr-fr/php.html.markdown
@@ -1,5 +1,6 @@
---
language: PHP
+filename: php-fr.php
contributors:
- ["Malcolm Fell", "http://emarref.net/"]
- ["Trismegiste", "https://github.com/Trismegiste"]
diff --git a/fr-fr/ruby-ecosystem-fr.html.markdown b/fr-fr/ruby-ecosystem-fr.html.markdown
index 9b52069a..edc69068 100644
--- a/fr-fr/ruby-ecosystem-fr.html.markdown
+++ b/fr-fr/ruby-ecosystem-fr.html.markdown
@@ -6,6 +6,7 @@ contributors:
- ["Rafal Chmiel", "http://github.com/rafalchmiel"]
translators:
- ["Xuan-thi Nguyen", "http://github.com/mellenguyen"]
+ - ["Sylvain Abélard", "http://github.com/abelards"]
lang: fr-fr
---
@@ -17,9 +18,9 @@ dépendances des gems.
## Ruby Managers
Quelques plateformes possèdent Ruby pré-installé ou disponible en tant que
-paquet. La plupart des rubyists ne les utilisent pas, ou si c'est le cas, ne
-les utilise que pour faire démarrer un autre installateur ou implémentation de
-Ruby. Les rubyists tendent plutôt à installer un manager Ruby pour installer
+paquet. La plupart des rubyistes ne les utilisent pas, ou si c'est le cas, ne
+les utilisent que pour faire démarrer un autre installateur ou implémentation de
+Ruby. Les rubyistes tendent plutôt à installer un gestionnaire en Ruby pour installer
et changer entre les différentes et nombreuses versions de Ruby et les
environnements de leurs projets Ruby.
@@ -47,14 +48,14 @@ Implementation).
Les trois versions majeures de Ruby actuellement utilisées sont :
-* 2.0.0 - Sortie en février 2013. La plupart des librairies et frameworks
+* 2.0.0 - Sortie en février 2013. La plupart des bibliothèques et frameworks
gèrent la versions 2.0.0.
* 1.9.3 - Sortie en octobre 2011. Il s'agit de la version que la majorité des
rubyists utilisent actuellement. [Fin de vie](https://www.ruby-lang.org/en/news/2015/02/23/support-for-ruby-1-9-3-has-ended/)
* 1.8.7 - Sortie en juin 2006. [Fin de vie](http://www.ruby-lang.org/en/news/2013/06/30/we-retire-1-8-7/).
-Les changements entre 1.8.7 à 1.9.x sont bien plus grands qu'entre 1.9.3
-jusqu'à 2.0.0. Par exemple, les versions 1.9 ont introduit le support des
+Les changements entre 1.8.7 et 1.9.x sont bien plus grands qu'entre 1.9.3
+et 2.0.0. Par exemple, les versions 1.9 ont introduit le support des
encodages et d'une VM bytecode ([YARV](https://fr.wikipedia.org/wiki/YARV)).
Il y a toujours des projets sur 1.8.7, mais ils deviennent minoritaires, étant
donné que la majorité de la communauté a migré vers au moins 1.9.2 ou 1.9.3.
@@ -89,7 +90,7 @@ Mpyennement mature/compatible:
* [Maglev](http://maglev.github.io/) - Basée sur Gemstone, une VM Smalltalk.
Smalltalk possède quelques outils impressionnants, et ce projet tente
de les apporter dans le développement Ruby.
-* [RubyMotion](http://www.rubymotion.com/) - Ruby pour développement iOS.
+* [RubyMotion](http://www.rubymotion.com/) - Ruby pour développement iOS et Android.
* [Opal](http://opalrb.org/) - Compile le Ruby en Javascript
Les implémentations de Ruby peuvent avoir leurs propres numéros de versions,
@@ -122,17 +123,17 @@ l(es) auteur(s) et la/les licence(s).
## Bundler
-[Bundler](http://bundler.io/) est un résolveur de dépendances des gems. Il
-utilise le Gemfile d'un projet ppur trouver les dépendances, et récupère
+[Bundler](http://bundler.io/) est un outil de résolution de dépendances des gems. Il
+utilise le Gemfile d'un projet pour en trouver les dépendances, et récupère
ensuite les dépendances de ces dépendances récursivement. Il déroule cet
algorithme jusqu'à ce que toutes les dépendances soient résolues et
téléchargées, ou s'arrête si un conflit est trouvé.
Bundler lèvera une erreur s'il trouve des conflits de dépendances. Par exemple,
si la gem A recquiert la version 3 ou plus de gem Z, mais que gem B recquiert
-seulement la version 2, Bundler vous notifiera ce conflict. Cela devient
+seulement la version 2 de la même gem Z, Bundler vous notifiera ce conflit. Cela devient
extrêmement utile, étant donné que beaucoup de gems font référence à d'autres
-gems (qui se réfèrent à d'autres gems), ce qui peut former un large graphe de
+gems (qui se réfèrent à d'autres gems et ainsi de suite), ce qui peut former un large graphe de
dépendance à résoudre.
# Les tests
@@ -151,4 +152,4 @@ différents.
La communauté Ruby est fière d'être une communauté ouverte, riche et
accueillante. Matz lui-même est extrêmement sociable, et la générosité des
-rubyists est généralement remarquable.
+rubyistes est généralement remarquable.
diff --git a/fr-fr/ruby-fr.html.markdown b/fr-fr/ruby-fr.html.markdown
index 1564d2b6..6b487a07 100644
--- a/fr-fr/ruby-fr.html.markdown
+++ b/fr-fr/ruby-fr.html.markdown
@@ -7,9 +7,11 @@ contributors:
- ["Luke Holder", "http://twitter.com/lukeholder"]
- ["Tristan Hume", "http://thume.ca/"]
- ["Nick LaMuro", "https://github.com/NickLaMuro"]
+
translators:
- ["Geoffrey Roguelon", "https://github.com/GRoguelon"]
- ["Nami-Doc", "https://github.com/Nami-Doc"]
+ - ["Sylvain Abélard", "http://github.com/abelards"]
lang: fr-fr
---
@@ -22,19 +24,23 @@ Personne ne les utilise
Vous devriez en faire de même
=end
-# Tout d'abord : Tout est un objet.
+# Tout d'abord : tout est un objet.
# Les nombres sont des objets
-3.class #=> Fixnum
+3.class #=> Fixnum # on voit que c'est une classe Ruby et non un "type spécial"
-3.to_s #=> "3"
+3.to_s #=> "3" # on peut appeler des méthodes sur ces objets, comme `to_s` (transforme en texte)
# Les opérateurs de base
1 + 1 #=> 2
8 - 1 #=> 7
10 * 2 #=> 20
-35 / 5 #=> 7
+22 / 7 #=> 3 # si les deux éléments sont entiers, c'est une division entière
+22.0 / 7 #=> 3.142857142857143
+22 / 7.0 #=> 3.142857142857143
+2**10 #=> 1024 # exposant
+1024 % 10 #=> 4 # modulo (reste de la division euclidienne)
# Les opérateurs sont juste des raccourcis
# pour appeler une méthode sur un objet
@@ -42,9 +48,9 @@ Vous devriez en faire de même
10.* 5 #=> 50
# Les valeurs spéciales sont des objets
-nil # Nul
-true # Vrai
-false # Faux
+nil # nul, vide ou indéfini
+true # vrai
+false # faux
nil.class #=> NilClass
true.class #=> TrueClass
@@ -60,8 +66,7 @@ false.class #=> FalseClass
!true #=> false
!false #=> true
-# à part false lui-même, nil est la seule autre valeur 'false'
-
+# à part false lui-même, nil est la seule autre valeur "considérée comme fausse"
!nil #=> true
!false #=> true
!0 #=> false
@@ -73,7 +78,6 @@ false.class #=> FalseClass
2 >= 2 #=> true
# Les chaînes de caractères sont des objets
-
'Je suis une chaîne de caractères'.class #=> String
"Je suis également une chaîne de caractères".class #=> String
@@ -84,6 +88,15 @@ placeholder = "utiliser l'interpolation de chaîne de caractères"
# Affichez un message
puts "J'affiche à l'écran!"
+# Il y a quelques autres raccourcis pour les chaînes de caractères
+rb = "Ruby"
+interpolation = "Bonjour Ruby" # s'écrit aussi %Q[Bonjour #{rb}] %Q{Bonjour #{rb}} avec l'interpolation
+literal = "Bonjour \#{rb}" # avec le backslash, le dièse est un "vrai dièse" (le slash ne s'affiche que pour le debug)
+literal == %q[Bonjour #{rb}] # le Q majuscule fait l'interpolation, le q minuscule ne la fait pas
+multi = %Q[Cette chaîne
+est sur plusieurs
+lignes] # => "Cette chaîne\nest sur plusieurs\nlignes" # le caractère \n signifie retour à la ligne
+
# Variables
x = 25 #=> 25
x #=> 25
@@ -131,7 +144,7 @@ array = [1, 2, 3, 4, 5] #=> [1, 2, 3, 4, 5]
[1, "hello", false] #=> [1, "hello", false]
# Les tableaux peuvent être indexés
-# Du début
+# Trouver la valeur en donnant la position en partant du début (le premier élément est à l'index 0)
array[0] #=> 1
array[12] #=> nil
@@ -140,13 +153,13 @@ array[12] #=> nil
array.[] 0 #=> 1
array.[] 12 #=> nil
-# Depuis la fin
+# On peut compter en partant de la fin avec un index négatif (le dernier élément est à l'index -1)
array[-1] #=> 5
-# Avec un index de début et de fin
-array[2, 4] #=> [3, 4, 5]
+# Avec un index de début et un nombre d'éléments [position, nombre]
+array[1, 3] #=> [2, 3, 4]
-# Ou avec un intervalle
+# Ou avec un intervalle [index de début .. index de fin]
array[1..3] #=> [2, 3, 4]
# Ajoutez un élément au tableau comme ceci
@@ -180,11 +193,11 @@ new_hash.keys #=> [:defcon, :action]
# Structures de contrôle
if true
- "si instruction"
+ "si l'instruction est vraie"
elsif false
- "autrement si, facultatif"
+ "si l'instruction de départ n'était pas vraie, et que cette nouvelle condition est vraie (facultatif)"
else
- "autrement, également facultatif"
+ "tous les autres cas (il est également facultatif de faire une clause else)"
end
for compteur in 1..5
diff --git a/fr-fr/scala.html.markdown b/fr-fr/scala.html.markdown
index c6d06361..c6a61745 100644
--- a/fr-fr/scala.html.markdown
+++ b/fr-fr/scala.html.markdown
@@ -276,7 +276,7 @@ i // Montre la valeur de i. Notez que while est une boucle au sens classique.
i = 0
// La boucle do while
do {
- println("x is still less then 10");
+ println("x is still less than 10");
i += 1
} while (i < 10)
diff --git a/fr-fr/vim.html.markdown b/fr-fr/vim.html.markdown
index 54c00b26..b2f1d24d 100644
--- a/fr-fr/vim.html.markdown
+++ b/fr-fr/vim.html.markdown
@@ -1,7 +1,7 @@
---
category: tool
tool: vim
-filename: LearnVim.txt
+filename: LearnVim-fr.txt
contributors:
- ["RadhikaG", "https://github.com/RadhikaG"]
translators:
diff --git a/fr-fr/yaml-fr.html.markdown b/fr-fr/yaml-fr.html.markdown
index 1e8296d3..c7cb9421 100644
--- a/fr-fr/yaml-fr.html.markdown
+++ b/fr-fr/yaml-fr.html.markdown
@@ -1,6 +1,6 @@
---
language: yaml
-filename: learnyaml.yaml
+filename: learnyaml-fr.yaml
contributors:
- ["Andrei Curelaru", "http://www.infinidad.fr"]
lang: fr-fr
diff --git a/git.html.markdown b/git.html.markdown
index 01dc92c1..088c109f 100644
--- a/git.html.markdown
+++ b/git.html.markdown
@@ -8,6 +8,7 @@ contributors:
- ["Bruno Volcov", "http://github.com/volcov"]
- ["Andrew Taylor", "http://github.com/andrewjt71"]
- ["Jason Stathopulos", "http://github.com/SpiritBreaker226"]
+ - ["Milo Gilad", "http://github.com/Myl0g"]
filename: LearnGit.txt
---
@@ -23,7 +24,7 @@ manage your source code.
Version control is a system that records changes to a file(s), over time.
-### Centralized Versioning VS Distributed Versioning
+### Centralized Versioning vs. Distributed Versioning
* Centralized version control focuses on synchronizing, tracking, and backing
up files.
@@ -157,6 +158,7 @@ $ git init --help
To intentionally untrack file(s) & folder(s) from git. Typically meant for
private & temp files which would otherwise be shared in the repository.
+
```bash
$ echo "temp/" >> .gitignore
$ echo "private_key" >> .gitignore
@@ -189,6 +191,9 @@ $ git add /path/to/file/HelloWorld.c
# Regular Expression support!
$ git add ./*.java
+
+# You can also add everything in your working directory to the staging area.
+$ git add -A
```
This only adds a file to the staging area/index, it doesn't commit it to the
@@ -226,7 +231,7 @@ Manage your tags
$ git tag
# Create a annotated tag
-# The -m specifies a tagging message,which is stored with the tag.
+# The -m specifies a tagging message, which is stored with the tag.
# If you don’t specify a message for an annotated tag,
# Git launches your editor so you can type it in.
$ git tag -a v2.0 -m 'my version 2.0'
@@ -427,7 +432,7 @@ Stashing takes the dirty state of your working directory and saves it on a
stack of unfinished changes that you can reapply at any time.
Let's say you've been doing some work in your git repo, but you want to pull
-from the remote. Since you have dirty (uncommited) changes to some files, you
+from the remote. Since you have dirty (uncommitted) changes to some files, you
are not able to run `git pull`. Instead, you can run `git stash` to save your
changes onto a stack!
@@ -516,7 +521,7 @@ $ git reset --hard
$ git reset 31f2bb1
# Moves the current branch tip backward to the specified commit
-# and makes the working dir match (deletes uncommited changes and all commits
+# and makes the working dir match (deletes uncommitted changes and all commits
# after the specified commit).
$ git reset --hard 31f2bb1
```
@@ -526,12 +531,13 @@ $ git reset --hard 31f2bb1
Reflog will list most of the git commands you have done for a given time period,
default 90 days.
-This give you the a change to reverse any git commands that have gone wrong
-for instance if a rebase is has broken your application.
+This give you the chance to reverse any git commands that have gone wrong
+(for instance, if a rebase has broken your application).
You can do this:
1. `git reflog` to list all of the git commands for the rebase
+
```
38b323f HEAD@{0}: rebase -i (finish): returning to refs/heads/feature/add_git_reflog
38b323f HEAD@{1}: rebase -i (pick): Clarify inc/dec operators
diff --git a/go.html.markdown b/go.html.markdown
index f097caeb..e5263cf6 100644
--- a/go.html.markdown
+++ b/go.html.markdown
@@ -99,12 +99,12 @@ can include line breaks.` // Same string type.
// Arrays have size fixed at compile time.
var a4 [4]int // An array of 4 ints, initialized to all 0.
- a3 := [...]int{3, 1, 5} // An array initialized with a fixed size of three
- // elements, with values 3, 1, and 5.
+ a5 := [...]int{3, 1, 5, 10, 100} // An array initialized with a fixed size of five
+ // elements, with values 3, 1, 5, 10, and 100.
// Slices have dynamic size. Arrays and slices each have advantages
// but use cases for slices are much more common.
- s3 := []int{4, 5, 9} // Compare to a3. No ellipsis here.
+ s3 := []int{4, 5, 9} // Compare to a5. No ellipsis here.
s4 := make([]int, 4) // Allocates slice of 4 ints, initialized to all 0.
var d2 [][]float64 // Declaration only, nothing allocated here.
bs := []byte("a slice") // Type conversion syntax.
@@ -134,7 +134,7 @@ can include line breaks.` // Same string type.
// Unused variables are an error in Go.
// The underscore lets you "use" a variable but discard its value.
- _, _, _, _, _, _, _, _, _, _ = str, s2, g, f, u, pi, n, a3, s4, bs
+ _, _, _, _, _, _, _, _, _, _ = str, s2, g, f, u, pi, n, a5, s4, bs
// Usually you use it to ignore one of the return values of a function
// For example, in a quick and dirty script you might ignore the
// error value returned from os.Create, and expect that the file
@@ -295,7 +295,7 @@ type pair struct {
x, y int
}
-// Define a method on type pair. Pair now implements Stringer.
+// Define a method on type pair. Pair now implements Stringer because Pair has defined all the methods in the interface.
func (p pair) String() string { // p is called the "receiver"
// Sprintf is another public function in package fmt.
// Dot syntax references fields of p.
diff --git a/hack.html.markdown b/hack.html.markdown
index b3d19f8e..fb6af8e1 100644
--- a/hack.html.markdown
+++ b/hack.html.markdown
@@ -257,7 +257,7 @@ class InvalidFooSubclass extends ConsistentFoo
// ...
}
- // Using the __Override annotation on a non-overriden method will cause a
+ // Using the __Override annotation on a non-overridden method will cause a
// type checker error:
//
// "InvalidFooSubclass::otherMethod() is marked as override; no non-private
@@ -299,7 +299,7 @@ $cat instanceof KittenInterface === true; // True
## More Information
Visit the [Hack language reference](http://docs.hhvm.com/manual/en/hacklangref.php)
-for detailed explainations of the features Hack adds to PHP, or the [official Hack website](http://hacklang.org/)
+for detailed explanations of the features Hack adds to PHP, or the [official Hack website](http://hacklang.org/)
for more general information.
Visit the [official HHVM website](http://hhvm.com/) for HHVM installation instructions.
diff --git a/haml.html.markdown b/haml.html.markdown
index 0948e9ef..5dd4cb6d 100644
--- a/haml.html.markdown
+++ b/haml.html.markdown
@@ -36,7 +36,7 @@ $ haml input_file.haml output_file.html
To write a multi line comment, indent your commented code to be
wrapped by the forward slash
--# This is a silent comment, which means it wont be rendered into the doc at all
+-# This is a silent comment, which means it won't be rendered into the doc at all
/ -------------------------------------------
diff --git a/haskell.html.markdown b/haskell.html.markdown
index 4e254070..70ef8fb2 100644
--- a/haskell.html.markdown
+++ b/haskell.html.markdown
@@ -1,5 +1,6 @@
---
language: Haskell
+filename: learnhaskell.hs
contributors:
- ["Adit Bhargava", "http://adit.io"]
---
diff --git a/haxe.html.markdown b/haxe.html.markdown
index 03b3099e..e811031e 100644
--- a/haxe.html.markdown
+++ b/haxe.html.markdown
@@ -466,7 +466,7 @@ class LearnHaxe3{
The untyped keyword operates on entire *blocks* of code, skipping
any type checks that might be otherwise required. This keyword should
be used very sparingly, such as in limited conditionally-compiled
- situations where type checking is a hinderance.
+ situations where type checking is a hindrance.
In general, skipping type checks is *not* recommended. Use the
enum, inheritance, or structural type models in order to help ensure
diff --git a/hy.html.markdown b/hy.html.markdown
index 79c16c23..1287095f 100644
--- a/hy.html.markdown
+++ b/hy.html.markdown
@@ -102,7 +102,7 @@ True ; => True
(apply something-fancy ["My horse" "amazing"] { "mane" "spectacular" })
; anonymous functions are created using `fn' or `lambda' constructs
-; which are similiar to `defn'
+; which are similar to `defn'
(map (fn [x] (* x x)) [1 2 3 4]) ;=> [1 4 9 16]
;; Sequence operations
diff --git a/it-it/bf-it.html.markdown b/it-it/bf-it.html.markdown
index a79710d0..97e5b88e 100644
--- a/it-it/bf-it.html.markdown
+++ b/it-it/bf-it.html.markdown
@@ -1,5 +1,6 @@
---
language: bf
+filename: learnbf-it.bf
contributors:
- ["Prajit Ramachandran", "http://prajitr.github.io/"]
- ["Mathias Bynens", "http://mathiasbynens.be/"]
diff --git a/it-it/json-it.html.markdown b/it-it/json-it.html.markdown
index 379bad73..e1e16c42 100644
--- a/it-it/json-it.html.markdown
+++ b/it-it/json-it.html.markdown
@@ -1,5 +1,6 @@
---
language: json
+filename: learnjson-it.json
contributors:
- ["Anna Harren", "https://github.com/iirelu"]
- ["Marco Scannadinari", "https://github.com/marcoms"]
diff --git a/it-it/python-it.html.markdown b/it-it/python-it.html.markdown
index 71f6dc1c..e81d1676 100644
--- a/it-it/python-it.html.markdown
+++ b/it-it/python-it.html.markdown
@@ -1,11 +1,11 @@
---
language: python
+filename: learnpython-it.py
contributors:
- ["Louie Dinh", "http://ldinh.ca"]
- ["Amin Bandali", "http://aminbandali.com"]
- ["Andre Polykanine", "https://github.com/Oire"]
- ["evuez", "http://github.com/evuez"]
-filename: learnpython.py
translators:
- ["Ale46", "http://github.com/Ale46/"]
- ["Tommaso Pifferi", "http://github.com/neslinesli93/"]
diff --git a/ja-jp/php-jp.html.markdown b/ja-jp/php-jp.html.markdown
index 112916f4..a02ae56a 100644
--- a/ja-jp/php-jp.html.markdown
+++ b/ja-jp/php-jp.html.markdown
@@ -119,7 +119,7 @@ echo 'Multiple', 'Parameters', 'Valid';
define("FOO", "something");
// 定義した名前をそのまま($はつけずに)使用することで、定数にアクセスできます
-// access to a constant is possible by direct using the choosen name
+// access to a constant is possible by direct using the chosen name
echo 'This outputs '.FOO;
diff --git a/java.html.markdown b/java.html.markdown
index e8c15234..fa1ff3d1 100644
--- a/java.html.markdown
+++ b/java.html.markdown
@@ -48,16 +48,16 @@ import java.security.*;
// as the file.
public class LearnJava {
- // In order to run a java program, it must have a main method as an entry
+ // In order to run a java program, it must have a main method as an entry
// point.
- public static void main (String[] args) {
+ public static void main(String[] args) {
///////////////////////////////////////
// Input/Output
///////////////////////////////////////
/*
- * Ouput
+ * Output
*/
// Use System.out.println() to print lines.
@@ -109,7 +109,7 @@ public class LearnJava {
*/
// Declare a variable using <type> <name>
int fooInt;
- // Declare multiple variables of the same
+ // Declare multiple variables of the same
// type <type> <name1>, <name2>, <name3>
int fooInt1, fooInt2, fooInt3;
@@ -119,8 +119,9 @@ public class LearnJava {
// Initialize a variable using <type> <name> = <val>
int barInt = 1;
- // Initialize multiple variables of same type with same
- // value <type> <name1>, <name2>, <name3> = <val>
+ // Initialize multiple variables of same type with same
+ // value <type> <name1>, <name2>, <name3>
+ // <name1> = <name2> = <name3> = <val>
int barInt1, barInt2, barInt3;
barInt1 = barInt2 = barInt3 = 1;
@@ -130,7 +131,7 @@ public class LearnJava {
// Byte - 8-bit signed two's complement integer
// (-128 <= byte <= 127)
byte fooByte = 100;
-
+
// If you would like to interpret a byte as an unsigned integer
// then this simple operation can help
int unsignedIntLessThan256 = 0xff & fooByte;
@@ -184,12 +185,12 @@ public class LearnJava {
// integers longer than 64-bits. Integers are stored as an array of
// of bytes and are manipulated using functions built into BigInteger
//
- // BigInteger can be initialized using an array of bytes or a string.
+ // BigInteger can be initialized using an array of bytes or a string.
BigInteger fooBigInteger = new BigInteger(fooByteArray);
// BigDecimal - Immutable, arbitrary-precision signed decimal number
//
- // A BigDecimal takes two parts: an arbitrary precision integer
+ // A BigDecimal takes two parts: an arbitrary precision integer
// unscaled value and a 32-bit integer scale
//
// BigDecimal allows the programmer complete control over decimal
@@ -199,7 +200,7 @@ public class LearnJava {
// BigDecimal can be initialized with an int, long, double or String
// or by initializing the unscaled value (BigInteger) and scale (int).
BigDecimal fooBigDecimal = new BigDecimal(fooBigInteger, fooInt);
-
+
// Be wary of the constructor that takes a float or double as
// the inaccuracy of the float/double will be copied in BigDecimal.
// Prefer the String constructor when you need an exact value.
@@ -231,13 +232,13 @@ public class LearnJava {
builderConcatenated.append("You ");
builderConcatenated.append("can use ");
builderConcatenated.append("the StringBuilder class.");
- System.out.println(builderConcatenated.toString()); // only now is the string built
+ System.out.println(builderConcatenated.toString()); // only now is the string built
// Output: You can use the StringBuilder class.
-
+
// StringBuilder is efficient when the fully constructed String is not required until the end of some processing.
StringBuilder stringBuilder = new StringBuilder();
String inefficientString = "";
- for(int i = 0 ; i < 10; i++){
+ for (int i = 0 ; i < 10; i++) {
stringBuilder.append(i).append(" ");
inefficientString += i + " ";
}
@@ -246,12 +247,12 @@ public class LearnJava {
// inefficientString requires a lot more work to produce, as it generates a String on every loop iteration.
// Simple concatenation with + is compiled to a StringBuilder and toString()
// Avoid string concatenation in loops.
-
+
// #3 - with String formatter
// Another alternative way to create strings. Fast and readable.
String.format("%s may prefer %s.", "Or you", "String.format()");
// Output: Or you may prefer String.format().
-
+
// Arrays
// The array size must be decided upon instantiation
// The following formats work for declaring an array
@@ -387,7 +388,7 @@ public class LearnJava {
// Iterated 10 times, fooFor 0->9
}
System.out.println("fooFor Value: " + fooFor);
-
+
// Nested For Loop Exit with Label
outer:
for (int i = 0; i < 10; i++) {
@@ -398,7 +399,7 @@ public class LearnJava {
}
}
}
-
+
// For Each Loop
// The for loop is also able to iterate over arrays as well as objects
// that implement the Iterable interface.
@@ -416,6 +417,7 @@ public class LearnJava {
// It also works with enumerated types (discussed in Enum Types), the
// 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.
int month = 3;
String monthString;
switch (month) {
@@ -429,38 +431,21 @@ public class LearnJava {
break;
}
System.out.println("Switch Case Result: " + monthString);
-
- // Starting in Java 7 and above, switching Strings works like this:
- String myAnswer = "maybe";
- switch(myAnswer) {
- case "yes":
- System.out.println("You answered yes.");
- break;
- case "no":
- System.out.println("You answered no.");
- break;
- case "maybe":
- System.out.println("You answered maybe.");
- break;
- default:
- System.out.println("You answered " + myAnswer);
- break;
- }
-
-
+
+
// Try-with-resources (Java 7+)
// Try-catch-finally statements work as expected in Java but in Java 7+
// the try-with-resources statement is also available. Try-with-resources
// simplifies try-catch-finally statements by closing resources
// automatically.
-
+
// In order to use a try-with-resources, include an instance of a class
// in the try statement. The class must implement java.lang.AutoCloseable.
- try(BufferedReader br = new BufferedReader(new FileReader("foo.txt"))) {
+ try (BufferedReader br = new BufferedReader(new FileReader("foo.txt"))) {
// You can attempt to do something that could throw an exception.
System.out.println(br.readLine());
// In Java 7, the resource will always be closed, even if it throws
- // an Exception.
+ // an Exception.
} catch (Exception ex) {
//The resource will be closed before the catch statement executes.
System.out.println("readLine() failed.");
@@ -470,18 +455,22 @@ public class LearnJava {
// a finally statement might not be called.
// To learn more:
// https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html
-
-
+
+
// Conditional Shorthand
// You can use the '?' operator for quick assignments or logic forks.
// Reads as "If (statement) is true, use <first value>, otherwise, use
// <second value>"
int foo = 5;
String bar = (foo < 10) ? "A" : "B";
- System.out.println(bar); // Prints A, because the statement is true
+ System.out.println("bar : " + bar); // Prints "bar : A", because the
+ // statement is true.
+ // Or simply
+ System.out.println("bar : " + (foo < 10 ? "A" : "B"));
+
////////////////////////////////////////
- // Converting Data Types And Typecasting
+ // Converting Data Types
////////////////////////////////////////
// Converting data
@@ -497,11 +486,6 @@ public class LearnJava {
// Long
// String
- // Typecasting
- // You can also cast Java objects, there's a lot of details and deals
- // with some more intermediate concepts. Feel free to check it out here:
- // https://docs.oracle.com/javase/tutorial/java/IandI/subclasses.html
-
///////////////////////////////////////
// Classes And Functions
///////////////////////////////////////
@@ -566,10 +550,10 @@ class Bicycle {
String name; // default: Only accessible from within this package
static String className; // Static class variable
- // Static block
+ // Static block
// Java has no implementation of static constructors, but
- // has a static block that can be used to initialize class variables
- // (static variables).
+ // has a static block that can be used to initialize class variables
+ // (static variables).
// This block will be called when the class is loaded.
static {
className = "Bicycle";
@@ -652,6 +636,14 @@ class PennyFarthing extends Bicycle {
}
}
+// Object casting
+// Since the PennyFarthing class is extending the Bicycle class, we can say
+// a PennyFarthing is a Bicycle and write :
+// Bicycle bicycle = new PennyFarthing();
+// This is called object casting where an object is taken for another one. There
+// are lots of details and deals with some more intermediate concepts here:
+// https://docs.oracle.com/javase/tutorial/java/IandI/subclasses.html
+
// Interfaces
// Interface declaration syntax
// <access-level> interface <interface-name> extends <super-interfaces> {
@@ -667,10 +659,10 @@ public interface Edible {
public interface Digestible {
public void digest();
- // In Java 8, interfaces can have default method.
- // public void digest() {
- // System.out.println("digesting ...");
- // }
+ // Since Java 8, interfaces can have default method.
+ public void defaultMethod() {
+ System.out.println("Hi from default method ...");
+ }
}
// We can now create a class that implements both of these interfaces.
@@ -703,14 +695,15 @@ public class ExampleClass extends ExampleClassParent implements InterfaceOne,
// Abstract Classes
// Abstract Class declaration syntax
-// <access-level> abstract <abstract-class-name> extends <super-abstract-classes> {
+// <access-level> abstract class <abstract-class-name> extends
+// <super-abstract-classes> {
// // Constants and variables
// // Method declarations
// }
-// Marking a class as abstract means that it contains abstract methods that
-// must be defined in a child class. Similar to interfaces, abstract classes
-// cannot be instantiated, but instead must be extended and the abstract
+// 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,
@@ -734,7 +727,7 @@ public abstract class Animal
public void printAge()
{
- System.out.println(age);
+ System.out.println(age);
}
// Abstract classes can have main function.
@@ -816,18 +809,18 @@ public abstract class Mammal()
// you would specify a days-of-the-week enum type as:
public enum Day {
SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
- THURSDAY, FRIDAY, SATURDAY
+ THURSDAY, FRIDAY, SATURDAY
}
// We can use our enum Day like that:
public class EnumTest {
// Variable Enum
Day day;
-
+
public EnumTest(Day day) {
this.day = day;
}
-
+
public void tellItLikeItIs() {
switch (day) {
case MONDAY:
@@ -835,17 +828,17 @@ public class EnumTest {
break;
case FRIDAY:
System.out.println("Fridays are better.");
- break;
- case SATURDAY:
+ break;
+ case SATURDAY:
case SUNDAY:
System.out.println("Weekends are best.");
- break;
+ 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(); // => Mondays are bad.
@@ -854,7 +847,7 @@ public class EnumTest {
}
}
-// Enum types are much more powerful than we show above.
+// Enum types are much more powerful than we show above.
// The enum body can include methods and other fields.
// You can see more at https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html
diff --git a/json.html.markdown b/json.html.markdown
index a612cffe..cd42d42d 100644
--- a/json.html.markdown
+++ b/json.html.markdown
@@ -11,6 +11,7 @@ contributors:
JSON is an extremely simple data-interchange format. As [json.org](http://json.org) says, it is easy for humans to read and write and for machines to parse and generate.
A piece of JSON must represent either:
+
* A collection of name/value pairs (`{ }`). In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
* An ordered list of values (`[ ]`). In various languages, this is realized as an array, vector, list, or sequence.
an array/list/sequence (`[ ]`) or a dictionary/object/associated array (`{ }`).
diff --git a/kdb+.html.markdown b/kdb+.html.markdown
index 099d1529..5ae86a4f 100644
--- a/kdb+.html.markdown
+++ b/kdb+.html.markdown
@@ -6,7 +6,7 @@ contributors:
filename: learnkdb.q
---
-The q langauge and its database component kdb+ were developed by Arthur Whitney
+The q language and its database component kdb+ were developed by Arthur Whitney
and released by Kx systems in 2003. q is a descendant of APL and as such is
very terse and a little strange looking for anyone from a "C heritage" language
background. Its expressiveness and vector oriented nature make it well suited
@@ -301,7 +301,7 @@ l:1+til 9 / til is a useful shortcut for generating ranges
-5#l / => 5 6 7 8 9
/ drop the last 5
-5_l / => 1 2 3 4
-/ find the first occurance of 4
+/ find the first occurrence of 4
l?4 / => 3
l[3] / => 4
@@ -316,7 +316,7 @@ key d / => `a`b`c
/ and value the second
value d / => 1 2 3
-/ Indexing is indentical to lists
+/ Indexing is identical to lists
/ with the first list as a key instead of the position
d[`a] / => 1
d[`b] / => 2
@@ -406,7 +406,7 @@ k!t
/ We can also use this shortcut for defining keyed tables
kt:([id:1 2 3]c1:1 2 3;c2:4 5 6;c3:7 8 9)
-/ Records can then be retreived based on this key
+/ Records can then be retrieved based on this key
kt[1]
/ => c1| 1
/ => c2| 4
@@ -428,7 +428,7 @@ kt[`id!1]
f:{x+x}
f[2] / => 4
-/ Functions can be annonymous and called at point of definition
+/ Functions can be anonymous and called at point of definition
{x+x}[2] / => 4
/ By default the last expression is returned
@@ -440,7 +440,7 @@ f[2] / => 4
/ Function arguments can be specified explicitly (separated by ;)
{[arg1;arg2] arg1+arg2}[1;2] / => 3
-/ or if ommited will default to x, y and z
+/ or if omitted will default to x, y and z
{x+y+z}[1;2;3] / => 6
/ Built in functions are no different, and can be called the same way (with [])
@@ -472,7 +472,7 @@ a / => 1
/ Functions cannot see nested scopes (only local and global)
{local:1;{:local}[]}[] / throws error as local is not defined in inner function
-/ A function can have one or more of it's arguments fixed (projection)
+/ A function can have one or more of its arguments fixed (projection)
f:+[4]
f[4] / => 8
f[5] / => 9
@@ -483,7 +483,7 @@ f[6] / => 10
////////// q-sql //////////
////////////////////////////////////
-/ q has it's own syntax for manipulating tables, similar to standard SQL
+/ q has its own syntax for manipulating tables, similar to standard SQL
/ This contains the usual suspects of select, insert, update etc.
/ and some new functionality not typically available
/ q-sql has two significant differences (other than syntax) to normal SQL:
@@ -682,7 +682,7 @@ aj[`time`sym;trades;quotes]
/ where possible functionality should be vectorized (i.e. operations on lists)
/ adverbs supplement this, modifying the behaviour of functions
/ and providing loop type functionality when required
-/ (in q functions are sometimes refered to as verbs, hence adverbs)
+/ (in q functions are sometimes referred to as verbs, hence adverbs)
/ the "each" adverb modifies a function to treat a list as individual variables
first each (1 2 3;4 5 6;7 8 9)
/ => 1 4 7
@@ -762,7 +762,7 @@ select from splayed / (the columns are read from disk on request)
/ kdb+ is typically used for data capture and analysis.
/ This involves using an architecture with multiple processes
/ working together. kdb+ frameworks are available to streamline the setup
-/ and configuration of this architecuture and add additional functionality
+/ and configuration of this architecture and add additional functionality
/ such as disaster recovery, logging, access, load balancing etc.
/ https://github.com/AquaQAnalytics/TorQ
```
diff --git a/ko-kr/bf-kr.html.markdown b/ko-kr/bf-kr.html.markdown
index 3d366d7c..5849d2fd 100644
--- a/ko-kr/bf-kr.html.markdown
+++ b/ko-kr/bf-kr.html.markdown
@@ -1,5 +1,6 @@
---
language: bf
+filename: learnbf-kr.bf
contributors:
- ["Prajit Ramachandran", "http://prajitr.github.io/"]
- ["Mathias Bynens", "http://mathiasbynens.be/"]
diff --git a/kotlin.html.markdown b/kotlin.html.markdown
index ca11ee3c..0c787d7e 100644
--- a/kotlin.html.markdown
+++ b/kotlin.html.markdown
@@ -65,7 +65,7 @@ fun helloWorld(val name : String) {
A template expression starts with a dollar sign ($).
*/
val fooTemplateString = "$fooString has ${fooString.length} characters"
- println(fooTemplateString)
+ println(fooTemplateString) // => My String Is Here! has 18 characters
/*
For a variable to hold null it must be explicitly specified as nullable.
diff --git a/lfe.html.markdown b/lfe.html.markdown
new file mode 100644
index 00000000..413de36e
--- /dev/null
+++ b/lfe.html.markdown
@@ -0,0 +1,459 @@
+---
+
+language: "Lisp Flavoured Erlang(LFE)"
+filename: lispflavourederlang.lfe
+contributors:
+ - ["Pratik Karki", "https://github.com/prertik"]
+---
+
+Lisp Flavoured Erlang(LFE) is a functional, concurrent, general-purpose programming
+language and Lisp dialect(Lisp-2) built on top of Core Erlang and the Erlang Virtual Machine(BEAM).
+
+LFE can be obtained from [LFE](https://github.com/rvirding/lfe)
+
+The classic starting point is [LFE DOCS.](http://docs.lfe.io)
+
+Another new site is being built to replace it.[LFE DEV.](http://docs.lfe.io/dev)
+
+
+
+```lisp
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; 0. Syntax
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;; General form.
+
+;; Lisp comprises of two syntax called: the ATOM and the S-expression.
+;; `forms` are known as grouped S-expressions.
+
+8 ; an atom; it evaluates to itself
+
+:ERLANG ;Atom; evaluates to the symbol :ERLANG.
+
+t ; another atom which denotes true.
+
+(* 2 21) ; an S- expression
+
+'(8 :foo t) ;another one
+
+
+;;; Comments
+
+;; Single line comments start with a semicolon; use two for normal
+;; comments, three for section comments, and four fo file-level
+;; comments.
+
+;; Block Comment
+
+ #| comment text |#
+
+;;; Environment
+
+;; LFE is the de-facto standard.
+
+;; Libraries can be used directly from the Erlang ecosystem. Rebar3 is the build tool.
+
+;; LFE is usually developed with a text editor(preferably Emacs) and a REPL
+;; (Read Evaluate Print Loop) running at the same time. The REPL
+;; allows for interactive exploration of the program as it is "live"
+;; in the system.
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; 1. Literals and Special Syntactic Rules
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;; Integers
+
+1234 -123 ; Regular decimal notation
+#b0 #b10101 ; Binary notation
+#0 #10101 ; Binary notation (alternative form)
+#o377 #o-111 ; Octal notation
+#d123456789 #d+123 ; Explicitly decimal notation
+#xc0ffe 0x-01 ; Hexadecimal notation
+#2r1010 #8r377 ;Notation with explicit base (up to 36)
+#\a #$ #\ä #\🐭 ;Character notation (the value is the Unicode code point of the character)
+#\x1f42d; ;Character notation with the value in hexadecimal
+
+;;; Floating point numbers
+1.0 +2.0 -1.5 1.0e10 1.111e-10
+
+;;; Strings
+
+"any text between double quotes where \" and other special characters like \n can be escaped".
+; List String
+"Cat: \x1f639;" ; writing unicode in string for regular font ending with semicolon.
+
+#"This is a binary string \n with some \"escaped\" and quoted (\x1f639;) characters"
+; Binary strings are just strings but function different in the VM.
+; Other ways of writing it are: #B("a"), #"a", and #B(97).
+
+
+;;; Character escaping
+
+\b ; => Backspace
+\t ; => Tab
+\n ; => Newline
+\v ; => Vertical tab
+\f ; => Form Feed
+\r ; => Carriage Return
+\e ; => Escape
+\s ; => Space
+\d ; => Delete
+
+;;; Binaries
+;; It is used to create binaries with any contents.
+#B((#"a" binary) (#"b" binary)) ; #"ab" (Evaluated form)
+
+;;; Lists are: () or (foo bar baz)
+
+;;; Tuples are written in: #(value1 value2 ...). Empty tuple #() is also valid.
+
+;;; Maps are written as: #M(key1 value1 key2 value2 ...). Empty map #M() is also valid.
+
+;;; Symbols: Things that cannot be parsed. Eg: foo, Foo, foo-bar, :foo
+| foo | ; explicit construction of symbol by wrapping vertical bars.
+
+;;; Evaluation
+
+;; #.(... some expression ...). E.g. '#.(+ 1 1) will evaluate the (+ 1 1) while it ;; reads the expression and then be effectively '2.
+
+;; List comprehension in LFE REPL
+
+lfe> (list-comp
+ ((<- x '(0 1 2 3)))
+ (trunc (math:pow 3 x)))
+ (1 3 9 27)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 2. Core forms
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; These forms are same as those found at Common Lisp and Scheme.
+
+(quote e)
+(cons head tail)
+(car e)
+(cdr e)
+(list e ... )
+(tuple e ... )
+(binary seg ... )
+(map key val ...), (map-get m k), (map-set m k v ...), (map-update m k v ...)
+
+(lambda (arg ...) ...)
+ (match-lambda
+ ((arg ... ) {{(when e ...)}} ...) ; Matches clauses
+ ... )
+(let ((pat {{(when e ...)}} e)
+ ...)
+ ... )
+(let-function ((name lambda|match-lambda) ; Only define local
+ ... ) ; functions
+ ... )
+(letrec-function ((name lambda|match-lambda) ; Only define local
+ ... ) ; functions
+ ... )
+(let-macro ((name lambda-match-lambda) ; Only define local
+ ...) ; macros
+ ...)
+(progn ... )
+(if test true-expr {{false-expr}})
+(case e
+ (pat {{(when e ...)}} ...)
+ ... ))
+(receive
+ (pat {{(when e ...)}} ... )
+ ...
+ (after timeout ... ))
+(catch ... )
+(try
+ e
+ {{(case ((pat {{(when e ...)}} ... )
+ ... ))}}
+ {{(catch
+ ; Next must be tuple of length 3!
+ (((tuple type value ignore) {{(when e ...)}}
+ ... )
+ ... )}}
+ {{(after ... )}})
+
+(funcall func arg ... )
+(call mod func arg ... ) - Call to Erlang Mod:Func(Arg, ... )
+(define-module name declaration ... )
+(extend-module declaration ... ) - Define/extend module and declarations.
+(define-function name lambda|match-lambda)
+(define-macro name lambda|match-lambda) - Define functions/macros at top-level.
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 3. Macros
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Macros are part of the language to allow you to create abstractions
+;; on top of the core language and standard library that move you closer
+;; toward being able to directly express the things you want to express.
+
+;; Top-level function
+
+(defun name (arg ...) ...)
+
+;; Adding comments in functions
+
+(defun name
+ "Toplevel function with pattern-matching arguments"
+ ((argpat ...) ...)
+ ...)
+
+;; Top-level macro
+
+(defmacro name (arg ...) ...)
+(defmacro name arg ...)
+
+;; Top-level macro with pattern matching arguments
+
+(defmacro name
+ ((argpat ...) ...)
+ ...)
+
+;; Top-level macro using Scheme inspired syntax-rules format
+
+(defsyntax name
+ (pat exp)
+ ...)
+
+;;; Local macros in macro or syntax-rule format
+
+(macrolet ((name (arg ... ) ... )
+ ... )
+ ... )
+
+(syntaxlet ((name (pat exp) ...)
+ ...)
+ ...)
+
+;; Like CLISP
+
+(prog1 ...)
+(prog2 ...)
+
+;; Erlang LFE module
+
+(defmodule name ...)
+
+;; Erlang LFE record
+
+(defrecord name ...)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 4. Patterns and Guards
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Using patterns in LFE compared to that of Erlang
+
+;; Erlang ;; LFE
+;; {ok, X} (tuple 'ok x)
+;; error 'error
+;; {yes, [X|Xs]} (tuple 'yes (cons x xs))
+;; <<34,F/float>> (binary 34 (f float))
+;; [P|Ps]=All (= (cons p ps) all)
+
+ _ ; => is don't care while pattern matching
+
+ (= pattern1 pattern2) ; => easier, better version of pattern matching
+
+;; Guards
+
+;; Whenever pattern occurs(let, case, receive, lc, etc) it can be followed by an optional
+;; guard which has the form (when test ...).
+
+(progn gtest ...) ;; => Sequence of guard tests
+(if gexpr gexpr gexpr)
+(type-test e)
+(guard-bif ...) ;; => Guard BIFs, arithmetic, boolean and comparison operators
+
+;;; REPL
+
+lfe>(set (tuple len status msg) #(8 ok "Trillian"))
+ #(8 ok "Trillian")
+lfe>msg
+ "Trillian"
+
+;;; Program illustrating use of Guards
+
+(defun right-number?
+ ((x) (when (orelse (== x 42) (== x 276709)))
+ 'true)
+ ((_) 'false))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 5. Functions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; A simple function using if.
+
+(defun max (x y)
+ "The max function."
+ (if (>= x y) x y))
+
+;; Same function using more clause
+
+(defun max
+ "The max function."
+ ((x y) (when (>= x y)) x)
+ ((x y) y))
+
+;; Same function using similar style but using local functions defined by flet or fletrec
+
+(defun foo (x y)
+ "The max function."
+ (flet ((m (a b) "Local comment."
+ (if (>= a b) a b)))
+ (m x y)))
+
+;; LFE being Lisp-2 has separate namespaces for variables and functions
+;; Both variables and function/macros are lexically scoped.
+;; Variables are bound by lambda, match-lambda and let.
+;; Functions are bound by top-level defun, flet and fletrec.
+;; Macros are bound by top-level defmacro/defsyntax and by macrolet/syntaxlet.
+
+;; (funcall func arg ...) like CL to call lambdas/match-lambdas
+;; (funs) bound to variables are used.
+
+;; separate bindings and special for apply.
+apply _F (...),
+apply _F/3 ( a1, a2, a3 )
+
+;; Cons'ing in function heads
+(defun sum (l) (sum l 0))
+ (defun sum
+ (('() total) total)
+ (((cons h t) total) (sum t (+ h total))))
+
+;; ``cons`` literal instead of constructor form
+ (defun sum (l) (sum l 0))
+ (defun sum
+ (('() total) total)
+ ((`(,h . ,t) total) (sum t (+ h total))))
+
+;; Matching records in function heads
+
+(defun handle_info
+ (('ping (= (match-state remote-pid 'undefined) state))
+ (gen_server:cast (self) 'ping)
+ `#(noreply ,state))
+ (('ping state)
+ `#(noreply ,state)))
+
+;; Receiving Messages
+ (defun universal-server ()
+ (receive
+ ((tuple 'become func)
+ (funcall func))))
+
+;; another way for receiving messages
+
+ (defun universal-server ()
+ (receive
+ (`#(become ,func)
+ (funcall func))))
+
+;; Composing a complete function for specific tasks
+
+(defun compose (f g)
+ (lambda (x)
+ (funcall f
+ (funcall g x))))
+
+(defun check ()
+ (let* ((sin-asin (compose #'sin/1 #'asin/1))
+ (expected (sin (asin 0.5)))
+ (compose-result (funcall sin-asin 0.5)))
+ (io:format "Expected answer: ~p~n" (list expected))
+ (io:format "Answer with compose: ~p~n" (list compose-result))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 6. Concurrency
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Message passing as done by Erlang's light-weight "processes".
+
+(defmodule messenger-back
+ (export (print-result 0) (send-message 2)))
+
+(defun print-result ()
+ (receive
+ ((tuple pid msg)
+ (io:format "Received message: '~s'~n" (list msg))
+ (io:format "Sending message to process ~p ...~n" (list pid))
+ (! pid (tuple msg))
+ (print-result))))
+
+(defun send-message (calling-pid msg)
+ (let ((spawned-pid (spawn 'messenger-back 'print-result ())))
+ (! spawned-pid (tuple calling-pid msg))))
+
+;; Multiple simultaneous HTTP Requests:
+
+(defun parse-args (flag)
+ "Given one or more command-line arguments, extract the passed values.
+
+ For example, if the following was passed via the command line:
+
+ $ erl -my-flag my-value-1 -my-flag my-value-2
+
+ One could then extract it in an LFE program by calling this function:
+
+ (let ((args (parse-args 'my-flag)))
+ ...
+ )
+ In this example, the value assigned to the arg variable would be a list
+ containing the values my-value-1 and my-value-2."
+ (let ((`#(ok ,data) (init:get_argument flag)))
+ (lists:merge data)))
+
+(defun get-pages ()
+ "With no argument, assume 'url parameter was passed via command line."
+ (let ((urls (parse-args 'url)))
+ (get-pages urls)))
+
+(defun get-pages (urls)
+ "Start inets and make (potentially many) HTTP requests."
+ (inets:start)
+ (plists:map
+ (lambda (x)
+ (get-page x)) urls))
+
+(defun get-page (url)
+ "Make a single HTTP request."
+ (let* ((method 'get)
+ (headers '())
+ (request-data `#(,url ,headers))
+ (http-options ())
+ (request-options '(#(sync false))))
+ (httpc:request method request-data http-options request-options)
+ (receive
+ (`#(http #(,request-id #(error ,reason)))
+ (io:format "Error: ~p~n" `(,reason)))
+ (`#(http #(,request-id ,result))
+ (io:format "Result: ~p~n" `(,result))))))
+
+
+;; Check out Erlang's documentation for more concurrency and OTP docs.
+```
+
+## Further Reading
+
+* [LFE DOCS](http://docs.lfe.io)
+* [LFE GitBook](https://lfe.gitbooks.io/reference-guide/index.html)
+* [LFE Wiki](https://en.wikipedia.org/wiki/LFE_(programming_language))
+
+## Extra Info
+* [LFE PDF](http://www.erlang-factory.com/upload/presentations/61/Robertvirding-LispFlavouredErlang.pdf)
+* [LFE mail](https://groups.google.com/d/msg/lisp-flavoured-erlang/XA5HeLbQQDk/TUHabZCHXB0J)
+
+## Credits
+
+Lots of thanks to Robert Virding for creating LFE, Duncan McGreggor for documenting it and other LFE contributors who made LFE awesome.
+
diff --git a/lt-lt/tmux-lt.html.markdown b/lt-lt/tmux-lt.html.markdown
index b5b3de05..f05f55e2 100644
--- a/lt-lt/tmux-lt.html.markdown
+++ b/lt-lt/tmux-lt.html.markdown
@@ -1,12 +1,13 @@
---
category: tool
tool: tmux
-filename: tmux.json
-lang: lt-lt
+filename: tmux-lt.json
contributors:
- ["mdln", "https://github.com/mdln"]
translators:
- ["Zygimantus", "https://github.com/zygimantus"]
+lang: lt-lt
+
---
diff --git a/matlab.html.markdown b/matlab.html.markdown
index 86b116c6..6dc9f697 100644
--- a/matlab.html.markdown
+++ b/matlab.html.markdown
@@ -353,7 +353,7 @@ double_input(6) % ans = 12
% anonymous function. Useful when quickly defining a function to pass to
% another function (eg. plot with fplot, evaluate an indefinite integral
% with quad, find roots with fzero, or find minimum with fminsearch).
-% Example that returns the square of it's input, assigned to the handle sqr:
+% Example that returns the square of its input, assigned to the handle sqr:
sqr = @(x) x.^2;
sqr(10) % ans = 100
doc function_handle % find out more
diff --git a/nim.html.markdown b/nim.html.markdown
index 5d00304d..07674532 100644
--- a/nim.html.markdown
+++ b/nim.html.markdown
@@ -76,7 +76,7 @@ let myDrink = drinks[2]
# static typing powerful and useful.
type
- Name = string # A type alias gives you a new type that is interchangable
+ Name = string # A type alias gives you a new type that is interchangeable
Age = int # with the old type but is more descriptive.
Person = tuple[name: Name, age: Age] # Define data structures too.
AnotherSyntax = tuple
@@ -109,7 +109,7 @@ when compileBadCode:
type
Color = enum cRed, cBlue, cGreen
- Direction = enum # Alternative formating
+ Direction = enum # Alternative formatting
dNorth
dWest
dEast
diff --git a/nl-nl/bf.html.markdown b/nl-nl/bf.html.markdown
index 016e2ba2..8cb06471 100644
--- a/nl-nl/bf.html.markdown
+++ b/nl-nl/bf.html.markdown
@@ -1,5 +1,6 @@
---
language: bf
+filename: learnbf-nl.bf
contributors:
- ["Prajit Ramachandran", "http://prajitr.github.io/"]
- ["Mathias Bynens", "http://mathiasbynens.be/"]
diff --git a/objective-c.html.markdown b/objective-c.html.markdown
index 2b599378..04c4e529 100644
--- a/objective-c.html.markdown
+++ b/objective-c.html.markdown
@@ -786,7 +786,7 @@ MyClass *newVar = [classVar retain]; // If classVar is released, object is still
// Automatic Reference Counting (ARC)
// Because memory management can be a pain, Xcode 4.2 and iOS 4 introduced Automatic Reference Counting (ARC).
// ARC is a compiler feature that inserts retain, release, and autorelease automatically for you, so when using ARC,
-// you must not use retain, relase, or autorelease
+// you must not use retain, release, or autorelease
MyClass *arcMyClass = [[MyClass alloc] init];
// ... code using arcMyClass
// Without ARC, you will need to call: [arcMyClass release] after you're done using arcMyClass. But with ARC,
diff --git a/ocaml.html.markdown b/ocaml.html.markdown
index 59ead9ec..c087216c 100644
--- a/ocaml.html.markdown
+++ b/ocaml.html.markdown
@@ -1,5 +1,6 @@
---
language: OCaml
+filename: learnocaml.ml
contributors:
- ["Daniil Baturin", "http://baturin.org/"]
---
diff --git a/perl6.html.markdown b/perl6.html.markdown
index d0ccdc9a..364711af 100644
--- a/perl6.html.markdown
+++ b/perl6.html.markdown
@@ -54,10 +54,11 @@ my $forced-bool = so $str; # And you can use the prefix `so` operator
# which turns its operand into a Bool
```
-### Lists
+### Arrays and Lists
```perl6
-# Lists represent multiple values. Their name start with `@`.
+# Arrays represent multiple values. Their name start with `@`.
+# Lists are similar but are an immutable type
my @array = 'a', 'b', 'c';
# equivalent to :
@@ -446,7 +447,7 @@ False ~~ True; # True
# http://perlcabal.org/syn/S03.html#Smart_matching
# You also, of course, have `<`, `<=`, `>`, `>=`.
-# Their string equivalent are also avaiable : `lt`, `le`, `gt`, `ge`.
+# Their string equivalent are also available : `lt`, `le`, `gt`, `ge`.
3 > 4;
## * Range constructors
@@ -617,7 +618,7 @@ my @arrayplus3 = map(*+3, @array); # `*+3` is the same as `{ $_ + 3 }`
my @arrayplus3 = map(*+*+3, @array); # Same as `-> $a, $b { $a + $b + 3 }`
# also `sub ($a, $b) { $a + $b + 3 }`
say (*/2)(4); #=> 2
- # Immediatly execute the function Whatever created.
+ # Immediately execute the function Whatever created.
say ((*+3)/5)(5); #=> 1.6
# works even in parens !
@@ -749,7 +750,7 @@ sub call_say_dyn {
my $*dyn_scoped_1 = 25; # Defines $*dyn_scoped_1 only for this sub.
$*dyn_scoped_2 = 100; # Will change the value of the file scoped variable.
say_dyn(); #=> 25 100 $*dyn_scoped 1 and 2 will be looked for in the call.
- # It uses he value of $*dyn_scoped_1 from inside this sub's lexical
+ # It uses the value of $*dyn_scoped_1 from inside this sub's lexical
# scope even though the blocks aren't nested (they're call-nested).
}
say_dyn(); #=> 1 10
@@ -815,7 +816,7 @@ $class-obj.other-attrib = 10; # This, however, works, because the public
# Perl 6 also has inheritance (along with multiple inheritance)
# While `method`'s are inherited, `submethod`'s are not.
# Submethods are useful for object construction and destruction tasks,
-# such as BUILD, or methods that must be overriden by subtypes.
+# such as BUILD, or methods that must be overridden by subtypes.
# We will learn about BUILD later on.
class Parent {
@@ -839,7 +840,7 @@ $Richard.talk; #=> "Hi, my name is Richard"
# # $Richard is able to access the submethod, he knows how to say his name.
my Child $Madison .= new(age => 1, name => 'Madison');
-$Madison.talk; # prints "Goo goo ga ga" due to the overrided method.
+$Madison.talk; # prints "Goo goo ga ga" due to the overridden method.
# $Madison.favorite-color does not work since it is not inherited
# When you use `my T $var`, `$var` starts off with `T` itself in it,
@@ -1053,7 +1054,7 @@ say why-not[^5]; #=> 5 15 25 35 45
## * `state` (happens at run time, but only once)
# State variables are only initialized one time
-# (they exist in other langages such as C as `static`)
+# (they exist in other languages such as C as `static`)
sub fixed-rand {
state $val = rand;
say $val;
@@ -1104,7 +1105,7 @@ PRE {
say "If this block doesn't return a truthy value,
an exception of type X::Phaser::PrePost is thrown.";
}
-# exemple:
+# example:
for 0..2 {
PRE { $_ > 1 } # This is going to blow up with "Precondition failed"
}
@@ -1203,7 +1204,7 @@ say (1, 10, (20, 10) ).flat; #> (1 10 20 10) Now the iterable is flat
# - `lazy` - Defer actual evaluation until value is fetched (forces lazy context)
my @lazy-array = (1..100).lazy;
-say @lazy-array.is-lazy; #> True # Check for lazyness with the `is-lazy` method.
+say @lazy-array.is-lazy; #> True # Check for laziness with the `is-lazy` method.
say @lazy-array; #> [...] List has not been iterated on!
my @lazy-array { .print }; # This works and will only do as much work as is
# needed.
@@ -1598,7 +1599,7 @@ so 'ayc' ~~ / a [ b | y ] c /; # `True`. Obviously enough ...
# To decide which part is the "longest", it first splits the regex in two parts:
# The "declarative prefix" (the part that can be statically analyzed)
# and the procedural parts.
-# Declarative prefixes include alternations (`|`), conjuctions (`&`),
+# Declarative prefixes include alternations (`|`), conjunctions (`&`),
# sub-rule calls (not yet introduced), literals, characters classes and quantifiers.
# The latter include everything else: back-references, code assertions,
# and other things that can't traditionnaly be represented by normal regexps.
@@ -1754,13 +1755,11 @@ If you want to go further, you can:
This will give you a dropdown menu of all the pages referencing your search
term (Much better than using Google to find Perl 6 documents!)
- Read the [Perl 6 Advent Calendar](http://perl6advent.wordpress.com/). This
- is a great source of Perl 6 snippets and explainations. If the docs don't
+ is a great source of Perl 6 snippets and explanations. If the docs don't
describe something well enough, you may find more detailed information here.
This information may be a bit older but there are many great examples and
- explainations. Posts stopped at the end of 2015 when the language was declared
+ explanations. Posts stopped at the end of 2015 when the language was declared
stable and Perl 6.c was released.
- Come along on `#perl6` at `irc.freenode.net`. The folks here are always helpful.
- Check the [source of Perl 6's functions and classes](https://github.com/rakudo/rakudo/tree/nom/src/core). Rakudo is mainly written in Perl 6 (with a lot of NQP, "Not Quite Perl", a Perl 6 subset easier to implement and optimize).
- Read [the language design documents](http://design.perl6.org). They explain P6 from an implementor point-of-view, but it's still very interesting.
-
- [//]: # ( vim: set filetype=perl softtabstop=2 shiftwidth=2 expandtab cc=80 : )
diff --git a/php.html.markdown b/php.html.markdown
index f247ba77..f82cea7d 100644
--- a/php.html.markdown
+++ b/php.html.markdown
@@ -122,9 +122,9 @@ echo 'Multiple', 'Parameters', 'Valid'; // Returns 'MultipleParametersValid'
// followed by any number of letters, numbers, or underscores.
define("FOO", "something");
-// access to a constant is possible by calling the choosen name without a $
+// access to a constant is possible by calling the chosen name without a $
echo FOO; // Returns 'something'
-echo 'This outputs ' . FOO; // Returns 'This ouputs something'
+echo 'This outputs ' . FOO; // Returns 'This outputs something'
@@ -132,9 +132,7 @@ echo 'This outputs ' . FOO; // Returns 'This ouputs something'
* Arrays
*/
-// All arrays in PHP are associative arrays (hashmaps),
-
-// Associative arrays, known as hashmaps in some languages.
+// All arrays in PHP are associative arrays (hashmaps in some languages)
// Works with all PHP versions
$associative = array('One' => 1, 'Two' => 2, 'Three' => 3);
@@ -839,7 +837,7 @@ try {
// Handle exception
}
-// When using try catch blocks in a namespaced enviroment use the following
+// When using try catch blocks in a namespaced environment use the following
try {
// Do something
@@ -856,7 +854,7 @@ try {
$condition = true;
if ($condition) {
- throw new MyException('Something just happend');
+ throw new MyException('Something just happened');
}
} catch (MyException $e) {
diff --git a/pl-pl/bf-pl.html.markdown b/pl-pl/bf-pl.html.markdown
index 801f1a9a..88f928cf 100644
--- a/pl-pl/bf-pl.html.markdown
+++ b/pl-pl/bf-pl.html.markdown
@@ -1,11 +1,14 @@
---
+category: language
language: bf
+filename: learnbf-pl.bf
contributors:
- ["Prajit Ramachandran", "http://prajitr.github.io/"]
- ["Mathias Bynens", "http://mathiasbynens.be/"]
translators:
- ["Jakub Młokosiewicz", "https://github.com/hckr"]
lang: pl-pl
+
---
Brainfuck (pisane małymi literami, za wyjątkiem początku zdania) jest bardzo
diff --git a/pl-pl/haskell-pl.html.markdown b/pl-pl/haskell-pl.html.markdown
index 3a51ade5..236b8958 100644
--- a/pl-pl/haskell-pl.html.markdown
+++ b/pl-pl/haskell-pl.html.markdown
@@ -1,8 +1,13 @@
---
+category: language
+filename: haskell-pl.hs
language: Haskell
-lang: pl-pl
contributors:
+ - ["Adit Bhargava", "http://adit.io"]
+translators:
- ["Remigiusz Suwalski", "https://github.com/remigiusz-suwalski"]
+lang: pl-pl
+
---
Haskell został zaprojektowany jako praktyczny, czysto funkcyjny język
diff --git a/pl-pl/json-pl.html.markdown b/pl-pl/json-pl.html.markdown
index 872455de..edd059bf 100644
--- a/pl-pl/json-pl.html.markdown
+++ b/pl-pl/json-pl.html.markdown
@@ -1,6 +1,6 @@
---
+category: language
language: json
-filename: learnjson-pl.json
contributors:
- ["Anna Harren", "https://github.com/iirelu"]
- ["Marco Scannadinari", "https://github.com/marcoms"]
@@ -9,6 +9,7 @@ contributors:
translators:
- ["Michał Mitrosz", "https://github.com/Voltinus"]
lang: pl-pl
+filename: learnjson-pl.json
---
JSON to bardzo prosty format wymiany danych. Jak jest napisane na [json.org](http://json.org), jest łatwy do pisania i czytania dla ludzi i do parsowania i generowania dla maszyn.
diff --git a/pl-pl/perl-pl.html.markdown b/pl-pl/perl-pl.html.markdown
index 029ca006..3e27cc4f 100644
--- a/pl-pl/perl-pl.html.markdown
+++ b/pl-pl/perl-pl.html.markdown
@@ -2,11 +2,14 @@
name: perl
category: language
language: perl
-filename: learnperl.pl
+filename: learnperl-pl.pm
contributors:
- ["Korjavin Ivan", "http://github.com/korjavin"]
+ - ["Dan Book", "http://github.com/Grinnz"]
+translators:
- ["Michał Kupczyński", "http://github.com/ukoms"]
lang: pl-pl
+
---
Perl 5 jest wysoce użytecznym, bogatym w wiele opcji językiem programowania
diff --git a/prolog.html.markdown b/prolog.html.markdown
new file mode 100644
index 00000000..7a18a144
--- /dev/null
+++ b/prolog.html.markdown
@@ -0,0 +1,331 @@
+---
+language: prolog
+filename: learnprolog.pl
+contributors:
+ - ["hyphz", "http://github.com/hyphz/"]
+---
+
+Prolog is a logic programming language first specified in 1972, and refined into multiple modern implementations.
+
+```
+% This is a comment.
+
+% Prolog treats code entered in interactive mode differently
+% to code entered in a file and loaded ("consulted").
+% This code must be loaded from a file to work as intended.
+% Lines that begin with ?- can be typed in interactive mode.
+% A bunch of errors and warnings will trigger when you load this file
+% due to the examples which are supposed to fail - they can be safely
+% ignored.
+
+% Output is based on SWI-prolog 7.2.3. Different Prologs may behave
+% differently.
+
+% Prolog is based on the ideal of logic programming.
+% A subprogram (called a predicate) represents a state of the world.
+% A command (called a goal) tells Prolog to make that state of the world
+% come true, if possible.
+
+% As an example, here is a definition of the simplest kind of predicate:
+% a fact.
+
+magicNumber(7).
+magicNumber(9).
+magicNumber(42).
+
+% This introduces magicNumber as a predicate and says that it is true
+% with parameter 7, 9, or 42, but no other parameter. Note that
+% predicate names must start with lower case letters. We can now use
+% interactive mode to ask if it is true for different values:
+
+?- magicNumber(7). % True
+?- magicNumber(8). % False
+?- magicNumber(9). % True
+
+% Some older Prologs may display "Yes" and "No" instead of True and
+% False.
+
+% What makes Prolog unusual is that we can also tell Prolog to _make_
+% magicNumber true, by passing it an undefined variable. Any name
+% starting with a capital letter is a variable in Prolog.
+
+?- magicNumber(Presto). % Presto = 7 ;
+ % Presto = 9 ;
+ % Presto = 42.
+
+% Prolog makes magicNumber true by assigning one of the valid numbers to
+% the undefined variable Presto. By default it assigns the first one, 7.
+% By pressing ; in interactive mode you can reject that solution and
+% force it to assign the next one, 9. Pressing ; again forces it to try
+% the last one, 42, after which it no longer accepts input because this
+% is the last solution. You can accept an earlier solution by pressing .
+% instead of ;.
+
+% This is Prolog's central operation: unification. Unification is
+% essentially a combination of assignment and equality! It works as
+% follows:
+% If both sides are bound (ie, defined), check equality.
+% If one side is free (ie, undefined), assign to match the other side.
+% If both sides are free, abort because this can't be resolved.
+% The = sign in Prolog represents unification, so:
+
+?- 2 = 3. % False - equality test
+?- X = 3. % X = 3 - assignment
+?- X = 2, X = Y. % X = Y = 2 - two assignments
+ % Note Y is assigned to, even though it is
+ % on the right hand side, because it is free
+?- X = 3, X = 2. % False
+ % First acts as assignment and binds X=3
+ % Second acts as equality because X is bound
+ % Since 3 does not equal 2, gives False
+ % Thus in Prolog variables are immutable
+?- X = 3+2. % X = 3+2 - unification can't do arithmetic
+?- X is 3+2. % X = 5 - "is" does arithmetic.
+?- 5 = X+2. % This is why = can't do arithmetic -
+ % because Prolog can't solve equations
+?- 5 is X+2. % Error. Unlike =, the right hand side of IS
+ % must always be bound, thus guaranteeing
+ % no attempt to solve an equation.
+
+% Any unification, and thus any predicate in Prolog, can either:
+% Succeed (return True) without changing anything,
+% because an equality-style unification was true
+% Succeed (return True) and bind one or more variables in the process,
+% because an assignment-style unification was made true
+% or Fail (return False)
+% because an equality-style unification was false
+% (Failure can never bind variables)
+
+% The ideal of being able to give any predicate as a goal and have it
+% made true is not always possible, but can be worked toward. For
+% example, Prolog has a built in predicate plus which represents
+% arithmetic addition but can reverse simple additions.
+
+?- plus(1, 2, 3). % True
+?- plus(1, 2, X). % X = 3 because 1+2 = X.
+?- plus(1, X, 3). % X = 2 because 1+X = 3.
+?- plus(X, 2, 3). % X = 1 because X+1 = 3.
+?- plus(X, 5, Y). % Error - although this could be solved,
+ % the number of solutions is infinite,
+ % which most predicates try to avoid.
+
+% When a predicate such as magicNumber can give several solutions, the
+% overall compound goal including it may have several solutions too.
+
+?- magicNumber(X), plus(X,Y,100). % X = 7, Y = 93 ;
+ % X = 9, Y = 91 ;
+ % X = 42, Y = 58 .
+% Note: on this occasion it works to pass two variables to plus because
+% only Y is free (X is bound by magicNumber).
+
+% However, if one of the goals is fully bound and thus acts as a test,
+% then solutions which fail the test are rejected.
+?- magicNumber(X), X > 40. % X = 42
+?- magicNumber(X), X > 100. % False
+
+% To see how Prolog actually handles this, let's introduce the print
+% predicate. Print always succeeds, never binds any variables, and
+% prints out its parameter as a side effect.
+
+?- print("Hello"). % "Hello" true.
+?- X = 2, print(X). % 2 true.
+?- X = 2, print(X), X = 3. % 2 false - print happens immediately when
+ % it is encountered, even though the overall
+ % compound goal fails (because 2 != 3,
+ % see the example above).
+
+% By using Print we can see what actually happens when we give a
+% compound goal including a test that sometimes fails.
+?- magicNumber(X), print(X), X > 40. % 7 9 42 X = 42 .
+
+% MagicNumber(X) unifies X with its first possibility, 7.
+% Print(X) prints out 7.
+% X > 40 tests if 7 > 40. It is not, so it fails.
+% However, Prolog remembers that magicNumber(X) offered multiple
+% solutions. So it _backtracks_ to that point in the code to try
+% the next solution, X = 9.
+% Having backtracked it must work through the compound goal
+% again from that point including the Print(X). So Print(X) prints out
+% 9.
+% X > 40 tests if 9 > 40 and fails again.
+% Prolog remembers that magicNumber(X) still has solutions and
+% backtracks. Now X = 42.
+% It works through the Print(X) again and prints 42.
+% X > 40 tests if 42 > 40 and succeeds so the result bound to X
+% The same backtracking process is used when you reject a result at
+% the interactive prompt by pressing ;, for example:
+
+?- magicNumber(X), print(X), X > 8. % 7 9 X = 9 ;
+ % 42 X = 42.
+
+% As you saw above we can define our own simple predicates as facts.
+% More complex predicates are defined as rules, like this:
+
+nearby(X,Y) :- X = Y.
+nearby(X,Y) :- Y is X+1.
+nearby(X,Y) :- Y is X-1.
+
+% nearby(X,Y) is true if Y is X plus or minus 1.
+% However this predicate could be improved. Here's why:
+
+?- nearby(2,3). % True ; False.
+% Because we have three possible definitions, Prolog sees this as 3
+% possibilities. X = Y fails, so Y is X+1 is then tried and succeeds,
+% giving the True answer. But Prolog still remembers there are more
+% possibilities for nearby() (in Prolog terminology, "it has a
+% choice point") even though "Y is X-1" is doomed to fail, and gives us
+% the option of rejecting the True answer, which doesn't make a whole
+% lot of sense.
+
+?- nearby(4, X). % X = 4 ;
+ % X = 5 ;
+ % X = 3. Great, this works
+?- nearby(X, 4). % X = 4 ;
+ % error
+% After rejecting X = 4 prolog backtracks and tries "Y is X+1" which is
+% "4 is X+1" after substitution of parameters. But as we know from above
+% "is" requires its argument to be fully instantiated and it is not, so
+% an error occurs.
+
+% One way to solve the first problem is to use a construct called the
+% cut, !, which does nothing but which cannot be backtracked past.
+
+nearbychk(X,Y) :- X = Y, !.
+nearbychk(X,Y) :- Y is X+1, !.
+nearbychk(X,Y) :- Y is X-1.
+
+% This solves the first problem:
+?- nearbychk(2,3). % True.
+
+% But unfortunately it has consequences:
+?- nearbychk(2,X). % X = 2.
+% Because Prolog cannot backtrack past the cut after X = Y, it cannot
+% try the possibilities "Y is X+1" and "Y is X-1", so it only generates
+% one solution when there should be 3.
+% However if our only interest is in checking if numbers are nearby,
+% this may be all we need, thus the name nearbychk.
+% This structure is used in Prolog itself from time to time (for example
+% in list membership).
+
+% To solve the second problem we can use built-in predicates in Prolog
+% to verify if a parameter is bound or free and adjust our calculations
+% appropriately.
+nearby2(X,Y) :- nonvar(X), X = Y.
+nearby2(X,Y) :- nonvar(X), Y is X+1.
+nearby2(X,Y) :- nonvar(X), Y is X-1.
+nearby2(X,Y) :- var(X), nonvar(Y), nearby2(Y,X).
+
+% We can combine this with a cut in the case where both variables are
+% bound, to solve both problems.
+nearby3(X,Y) :- nonvar(X), nonvar(Y), nearby2(X,Y), !.
+nearby3(X,Y) :- nearby2(X,Y).
+
+% However when writing a predicate it is not normally necessary to go to
+% these lengths to perfectly support every possible parameter
+% combination. It suffices to support parameter combinations we need to
+% use in the program. It is a good idea to document which combinations
+% are supported. In regular Prolog this is informally in structured
+% comments, but in some Prolog variants like Visual Prolog and Mercury
+% this is mandatory and checked by the compiler.
+
+% Here is the structured comment declaration for nearby3:
+
+%% nearby3(+X:Int, +Y:Int) is semidet.
+%% nearby3(+X:Int, -Y:Int) is multi.
+%% nearby3(-X:Int, +Y:Int) is multi.
+
+% For each variable we list a type. The + or - before the variable name
+% indicates if the parameter is bound (+) or free (-). The word after
+% "is" describes the behaviour of the predicate:
+% semidet - can succeed once or fail
+% ( Two specific numbers are either nearby or not )
+% multi - can succeed multiple times but cannot fail
+% ( One number surely has at least 3 nearby numbers )
+% Other possibilities are:
+% det - always succeeds exactly once (eg, print)
+% nondet - can succeed multiple times or fail.
+% In Prolog these are just structured comments and strictly informal but
+% extremely useful.
+
+% An unusual feature of Prolog is its support for atoms. Atoms are
+% essentially members of an enumerated type that are created on demand
+% whenever an unquoted non variable value is used. For example:
+character(batman). % Creates atom value batman
+character(robin). % Creates atom value robin
+character(joker). % Creates atom value joker
+character(darthVader). % Creates atom value darthVader
+?- batman = batman. % True - Once created value is reused
+?- batman = batMan. % False - atoms are case sensitive
+?- batman = darthVader. % False - atoms are distinct
+
+% Atoms are popular in examples but were created on the assumption that
+% Prolog would be used interactively by end users - they are less
+% useful for modern applications and some Prolog variants abolish them
+% completely. However they can be very useful internally.
+
+% Loops in Prolog are classically written using recursion.
+% Note that below, writeln is used instead of print because print is
+% intended for debugging.
+
+%% countTo(+X:Int) is det.
+%% countUpTo(+Value:Int, +Limit:Int) is det.
+countTo(X) :- countUpTo(1,X).
+countUpTo(Value, Limit) :- Value = Limit, writeln(Value), !.
+countUpTo(Value, Limit) :- Value \= Limit, writeln(Value),
+ NextValue is Value+1,
+ countUpTo(NextValue, Limit).
+
+?- countTo(10). % Outputs 1 to 10
+
+% Note the use of multiple declarations in countUpTo to create an
+% IF test. If Value = Limit fails the second declaration is run.
+% There is also a more elegant syntax.
+
+%% countUpTo2(+Value:Int, +Limit:Int) is det.
+countUpTo2(Value, Limit) :- writeln(Value),
+ Value = Limit -> true ; (
+ NextValue is Value+1,
+ countUpTo2(NextValue, Limit)).
+
+?- countUpTo2(1,10). % Outputs 1 to 10
+
+% If a predicate returns multiple times it is often useful to loop
+% through all the values it returns. Older Prologs used a hideous syntax
+% called a "failure-driven loop" to do this, but newer ones use a higher
+% order function.
+
+%% countTo2(+X:Int) is det.
+countTo2(X) :- forall(between(1,X,Y),writeln(Y)).
+
+?- countTo2(10). % Outputs 1 to 10
+
+% Lists are given in square brackets. Use memberchk to check membership.
+% A group is safe if it doesn't include Joker or does include Batman.
+%% safe(Group:list(atom)) is det.
+safe(Group) :- memberchk(joker, Group) -> memberchk(batman, Group) ; true.
+
+?- safe([robin]). % True
+?- safe([joker]). % False
+?- safe([joker, batman]). % True
+
+% The member predicate works like memberchk if both arguments are bound,
+% but can accept free variables and thus can be used to loop through
+% lists.
+
+?- member(X, [1,2,3]). % X = 1 ; X = 2 ; X = 3 .
+?- forall(member(X,[1,2,3]),
+ (Y is X+1, writeln(Y))). % 2 3 4
+
+% The maplist function can be used to generate lists based on other
+% lists. Note that the output list is a free variable, causing an
+% undefined value to be passed to plus, which is then bound by
+% unification. Also notice the use of currying on the plus predicate -
+% it's a 3 argument predicate, but we specify only the first, because
+% the second and third are filled in by maplist.
+
+?- maplist(plus(1), [2,3,4], Output). % Output = [3, 4, 5].
+```
+
+##Ready For More?
+
+* [SWI-Prolog](http://www.swi-prolog.org/)
diff --git a/pt-br/bf.html.markdown b/pt-br/bf.html.markdown
index d6d7c6e9..52a5269e 100644
--- a/pt-br/bf.html.markdown
+++ b/pt-br/bf.html.markdown
@@ -1,5 +1,6 @@
---
language: bf
+filename: learnbf-pt.bf
contributors:
- ["Prajit Ramachandran", "http://prajitr.github.io/"]
- ["Mathias Bynens", "http://mathiasbynens.be/"]
diff --git a/pt-br/c++-pt.html.markdown b/pt-br/c++-pt.html.markdown
index fd392b9e..c1cfbbb1 100644
--- a/pt-br/c++-pt.html.markdown
+++ b/pt-br/c++-pt.html.markdown
@@ -1,6 +1,6 @@
---
language: c++
-filename: learncpp.cpp
+filename: learncpp-pt.cpp
contributors:
- ["Steven Basart", "http://github.com/xksteven"]
- ["Matt Kline", "https://github.com/mrkline"]
diff --git a/pt-br/c-pt.html.markdown b/pt-br/c-pt.html.markdown
index 0af553c8..6e7aa8c2 100644
--- a/pt-br/c-pt.html.markdown
+++ b/pt-br/c-pt.html.markdown
@@ -647,7 +647,7 @@ Se você tem uma pergunta, leia [compl.lang.c Frequently Asked Questions](http:/
É importante usar espaços e indentação adequadamente e ser consistente com seu estilo de código em geral.
Código legível é melhor que código 'esperto' e rápido. Para adotar um estilo de código bom e são, veja
-[Linux kernel coding stlye](https://www.kernel.org/doc/Documentation/CodingStyle).
+[Linux kernel coding style](https://www.kernel.org/doc/Documentation/CodingStyle).
Além disso, Google é teu amigo.
[1] http://stackoverflow.com/questions/119123/why-isnt-sizeof-for-a-struct-equal-to-the-sum-of-sizeof-of-each-member
diff --git a/pt-br/groovy-pt.html.markdown b/pt-br/groovy-pt.html.markdown
index 2ec7d967..25e123c0 100644
--- a/pt-br/groovy-pt.html.markdown
+++ b/pt-br/groovy-pt.html.markdown
@@ -1,7 +1,7 @@
---
language: Groovy
category: language
-filename: learngroovy.groovy
+filename: learngroovy-pt.groovy
contributors:
- ["Roberto Pérez Alcolea", "http://github.com/rpalcolea"]
translators:
diff --git a/pt-br/hy-pt.html.markdown b/pt-br/hy-pt.html.markdown
index 5fa4df75..c69ac859 100644
--- a/pt-br/hy-pt.html.markdown
+++ b/pt-br/hy-pt.html.markdown
@@ -1,6 +1,6 @@
---
language: hy
-filename: learnhy.hy
+filename: learnhy-pt.hy
contributors:
- ["Abhishek L", "http://twitter.com/abhishekl"]
translators:
diff --git a/pt-br/javascript-pt.html.markdown b/pt-br/javascript-pt.html.markdown
index e337f4bc..7b6729ef 100644
--- a/pt-br/javascript-pt.html.markdown
+++ b/pt-br/javascript-pt.html.markdown
@@ -1,5 +1,6 @@
---
language: javascript
+filename: javascript-pt.js
contributors:
- ["Adam Brenecki", "http://adam.brenecki.id.au"]
- ["Ariel Krakowski", "http://www.learneroo.com"]
diff --git a/pt-br/kotlin-pt.html.markdown b/pt-br/kotlin-pt.html.markdown
new file mode 100644
index 00000000..7c3313fc
--- /dev/null
+++ b/pt-br/kotlin-pt.html.markdown
@@ -0,0 +1,384 @@
+---
+language: kotlin
+filename: LearnKotlin-pt.kt
+contributors:
+ - ["S Webber", "https://github.com/s-webber"]
+translators:
+ - ["Márcio Torres", "https://github.com/marciojrtorres"]
+lang: pt-br
+---
+
+Kotlin é uma linguagem de programação estaticamente tipada para a JVM, Android e navegadores web. Ela é 100% interoperável com Java.
+[Leia mais aqui.](https://kotlinlang.org/)
+
+```kotlin
+// Comentários de uma linha iniciam com //
+/*
+Comentários multilinha se parecem com este.
+*/
+
+// A palavra-chave "package" funciona do mesmo modo que no Java.
+package com.learnxinyminutes.kotlin
+
+/*
+O ponto de entrada para um programa em Kotlin é uma função chamada "main"
+Esta função recebe um vetor contendo quaisquer argumentos da linha de comando
+*/
+fun main(args: Array<String>) {
+ /*
+ A declaração de valores pode ser feita tanto com "var" como "val"
+ Declarações com "val" não podem ser reatribuídas, enquanto com "var" podem.
+ */
+ val umVal = 10 // não se poderá reatribuir qualquer coisa a umVal
+ var umVar = 10
+ umVar = 20 // umVar pode ser reatribuída, mas respeitando o tipo
+
+ /*
+ Na maioria dos casos Kotlin pode inferir o tipo, então não é preciso sempre
+ especificar o tipo explicitamente, mas quando o fazemos é assim:
+ */
+ val umInteiro: Int = 7
+
+ /*
+ Strings podem ser representadas de forma semelhante a Java.
+ A contrabarra realiza o "escape", da mesma forma.
+ */
+ val umaString = "Minha String está aqui!"
+ val outraString = "Imprimir na outra linha?\nSem problema!"
+ val maisString = "Você quer adicionar um tab?\tSem problema!"
+ println(umaString)
+ println(outraString)
+ println(maisString)
+
+ /*
+ Uma string bruta é delimitada com três aspas (""").
+ Strings brutas podem conter novas linhas e outros caracteres.
+ */
+ val umaStringBruta = """
+fun olaMundo(val nome : String) {
+ println("Olá, mundo!")
+}
+"""
+ println(umaStringBruta)
+
+ /*
+ As strings podem conter expressões modelo (template).
+ Uma expressão modelo começa com um cifrão ($).
+ É semelhante à interpolação de Strings em Ruby.
+ */
+ val umaStringModelo = "$umaString tem ${umaString.length} caracteres"
+ println(umaStringModelo)
+
+ /*
+ Para uma variável receber null deve-se explicitamente declara-la
+ como anulável.
+ A declaração de anulável é realizada incluindo uma "?" ao fim do tipo.
+ Pode-se acessar uma variável anulável usando o operador "?."
+ Usa-se o operador "?:" (também conhecido como operador Elvis) para
+ atribuir um valor alternativo para quando uma variável é nula.
+ */
+ var umaVariavelAnulavel: String? = "abc"
+ println(umaVariavelAnulavel?.length) // => 3
+ println(umaVariavelAnulavel?.length ?: -1) // => 3
+ umaVariavelAnulavel = null
+ println(umaVariavelAnulavel?.length) // => null
+ println(umaVariavelAnulavel?.length ?: -1) // => -1
+
+ /*
+ Funções podem ser declaradas usando a palavra-chave "fun"
+ Os parâmetros da função são declarados entre parênteses logo
+ após o nome da função.
+ Os parâmetros da função podem ter opcionalmente um valor padrão.
+ O tipo de retorno da função, se necessário, é especificado após os argumentos.
+ */
+ fun ola(nome: String = "mundo"): String {
+ return "Olá, $nome!"
+ }
+ println(ola("você")) // => Olá, você!
+ println(ola(nome = "tu")) // => Olá, tu!
+ println(ola()) // => Olá, mundo!
+
+ /*
+ Um parâmetro pode ser declarado com a palavra-chave "vararg" para
+ permitir que seja passado um número variável de argumentos.
+ */
+ fun exemploVarArg(vararg numeros: Int) {
+ println("Foram recebidos ${numeros.size} argumentos")
+ }
+ exemploVarArg() // => Passando nenhum argumento (0 argumentos)
+ exemploVarArg(1) // => Passando 1 argumento
+ exemploVarArg(1, 2, 3) // => Passando 3 argumentos
+
+ /*
+ Quando uma função consiste numa única expressão as chaves
+ podem ser omitidas e o corpo declarado após o símbolo de "="
+ */
+ fun impar(x: Int): Boolean = x % 2 == 1
+ println(impar(6)) // => false
+ println(impar(7)) // => true
+
+ // O tipo de retorno não precisa ser declarado se pode ser inferido.
+ fun impar(x: Int) = x % 2 == 0
+ println(impar(6)) // => true
+ println(impar(7)) // => false
+
+ // Funções podem receber e retornar outras funções
+ fun nao(f: (Int) -> Boolean): (Int) -> Boolean {
+ return {n -> !f.invoke(n)}
+ }
+ // Funções nomeadas podem ser passadas como argumento usando o operador "::"
+ val naoImpar = nao(::impar)
+ val naoPar = nao(::par)
+ // Expressões Lambda podem ser usadas como argumentos
+ val naoZero = nao {n -> n == 0}
+ /*
+ Se uma lambda têm apenas um parâmetro sua declaração pode ser omitida,
+ incluindo o símbolo "->".
+ Neste caso o nome do único parâmetro deve ser "it".
+ */
+ val naoPositivo = nao {it > 0}
+ for (i in 0..4) {
+ println("${naoImpar(i)} ${naoPar(i)} ${naoZero(i)} ${naoPositivo(i)}")
+ }
+
+ // A palavra-chave "class" é usada para declarar classes
+ class ClasseExemplo(val x: Int) {
+ fun funcaoMembro(y: Int): Int { // ou "método"
+ return x + y
+ }
+
+ infix fun funcaoMembroInfixa(y: Int): Int {
+ return x * y
+ }
+ }
+ /*
+ Para criar uma nova instância chama-se o construtor.
+ Note que Kotlin não tem a palavra-chave "new".
+ */
+ val umaInstanciaDaClasseExemplo = ClasseExemplo(7)
+ // Funções membro (métodos) podem ser chamados usando a notação ponto "."
+ println(umaInstanciaDaClasseExemplo.funcaoMembro(4)) // => 11
+ /*
+ Se uma função foi declarada com a palavra-chave "infix" então
+ ela pode ser invocada com a notação infixa.
+ */
+ println(umaInstanciaDaClasseExemplo funcaoMembroInfixa 4) // => 28
+
+ /*
+ Classes de dados são um modo sucinto de criar classes que servem apenas
+ para guardas informações.
+ Os métodos "hashCode", "equals" e "toString" são gerados automaticamente.
+ */
+ data class ExemploClasseDados (val x: Int, val y: Int, val z: Int)
+ val objetoDados = ExemploClasseDados(1, 2, 4)
+ println(objetoDados) // => ExemploClasseDados(x=1, y=2, z=4)
+
+ // Classes de dados têm uma função "copy"
+ val dadosCopia = objetoDados.copy(y = 100)
+ println(dadosCopia) // => ExemploClasseDados(x=1, y=100, z=4)
+
+ // Objetos podem ser desestruturados em múltiplas variáveis.
+ val (a, b, c) = dadosCopia
+ println("$a $b $c") // => 1 100 4
+
+ // desestruturando em um laço "for"
+ for ((a, b, c) in listOf(objetoDados)) {
+ println("$a $b $c") // => 1 100 4
+ }
+
+ val mapaDados = mapOf("a" to 1, "b" to 2)
+ // Map.Entry também é desestruturável
+ for ((chave, valor) in mapaDados) {
+ println("$chave -> $valor")
+ }
+
+ // A função "with" é semelhante à declaração "with" do JavaScript
+ data class ExemploClasseDadosMutaveis (var x: Int, var y: Int, var z: Int)
+ val objDadosMutaveis = ExemploClasseDadosMutaveis(7, 4, 9)
+ with (objDadosMutaveis) {
+ x -= 2
+ y += 2
+ z--
+ }
+ println(objDadosMutaveis) // => ExemploClasseDadosMutaveis(x=5, y=6, z=8)
+
+ /*
+ Pode-se criar uma lista usando a função "listOf".
+ A lista é imutável, isto é, elementos não podem ser adicionados ou removidos.
+ */
+ val umaLista = listOf("a", "b", "c")
+ println(umaLista.size) // => 3
+ println(umaLista.first()) // => a
+ println(umaLista.last()) // => c
+ // Elementos de uma lista podem ser acessados pelo índice
+ println(umaLista[1]) // => b
+
+ // Uma lista mutável pode ser criada com a função "mutableListOf".
+ val umaListaMutavel = mutableListOf("a", "b", "c")
+ umaListaMutavel.add("d")
+ println(umaListaMutavel.last()) // => d
+ println(umaListaMutavel.size) // => 4
+
+ // Similarmente, pode-se criar um conjunto com a função "setOf".
+ val umConjunto = setOf("a", "b", "c")
+ println(umConjunto.contains("a")) // => true
+ println(umConjunto.contains("z")) // => false
+
+ // Da mesma forma que um mapa com a função "mapOf".
+ val umMapa = mapOf("a" to 8, "b" to 7, "c" to 9)
+ // Os valores contidos no mapa podem ser acessados pela sua chave.
+ println(umMapa["a"]) // => 8
+
+ /*
+ Sequências representam coleções avaliadas "preguiçosamente" (sob demanda).
+ Pode-se criar uma sequência usando a função "generateSequence".
+ */
+ val umaSequencia = generateSequence(1, { it + 1 })
+ val x = umaSequencia.take(10).toList()
+ println(x) // => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+
+ // Um exemplo de uma sequência usada para gerar Números de Fibonacci:
+ fun sequenciaFibonacci(): Sequence<Long> {
+ var a = 0L
+ var b = 1L
+
+ fun proximo(): Long {
+ val resultado = a + b
+ a = b
+ b = resultado
+ return a
+ }
+
+ return generateSequence(::proximo)
+ }
+ val y = sequenciaFibonacci().take(10).toList()
+ println(y) // => [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
+
+ // Kotlin oferece funções de alta-ordem para trabalhar com coleções.
+ val z = (1..9).map {it * 3}
+ .filter {it < 20}
+ .groupBy {it % 2 == 0}
+ .mapKeys {if (it.key) "par" else "impar"}
+ println(z) // => {impar=[3, 9, 15], par=[6, 12, 18]}
+
+ // Um "for" pode ser usado com qualquer coisa que ofereça um "iterator"
+ for (c in "salve") {
+ println(c)
+ }
+
+ // O "while" funciona da mesma forma que em outras linguagens.
+ var contador = 0
+ while (contador < 5) {
+ println(contador)
+ contador++
+ }
+ do {
+ println(contador)
+ contador++
+ } while (contador < 10)
+
+ /*
+ "if" pode ser usado como uma expressão que retorna um valor.
+ Por este motivo o operador ternário "? :" não é necessário em Kotlin.
+ */
+ val numero = 5
+ val mensagem = if (numero % 2 == 0) "par" else "impar"
+ println("$numero é $mensagem") // => 5 é impar
+
+ // "when" pode ser usado como alternativa às correntes de "if-else if".
+ val i = 10
+ when {
+ i < 7 -> println("primeiro block")
+ umaString.startsWith("oi") -> println("segundo block")
+ else -> println("bloco else")
+ }
+
+ // "when" pode ser usado com um argumento.
+ when (i) {
+ 0, 21 -> println("0 ou 21")
+ in 1..20 -> println("entre 1 e 20")
+ else -> println("nenhum dos anteriores")
+ }
+
+ // "when" pode ser usada como uma função que retorna um valor.
+ var resultado = when (i) {
+ 0, 21 -> "0 ou 21"
+ in 1..20 -> "entre 1 e 20"
+ else -> "nenhum dos anteriores"
+ }
+ println(resultado)
+
+ /*
+ Pode-se verificar se um objeto é de um certo tipo usando o operador "is".
+ Se o objeto passar pela verificação então ele pode ser usado como
+ este tipo, sem a necessidade de uma coerção (cast) explícita (SmartCast).
+ */
+ fun exemploSmartCast(x: Any) : Boolean {
+ if (x is Boolean) {
+ // x é automaticamente coagido para Boolean
+ return x
+ } else if (x is Int) {
+ // x é automaticamente coagido para Int
+ return x > 0
+ } else if (x is String) {
+ // x é automaticamente coagido para String
+ return x.isNotEmpty()
+ } else {
+ return false
+ }
+ }
+ println(exemploSmartCast("Olá, mundo!")) // => true
+ println(exemploSmartCast("")) // => false
+ println(exemploSmartCast(5)) // => true
+ println(exemploSmartCast(0)) // => false
+ println(exemploSmartCast(true)) // => true
+
+ // O Smartcast também funciona com blocos "when"
+ fun exemploSmartCastComWhen(x: Any) = when (x) {
+ is Boolean -> x
+ is Int -> x > 0
+ is String -> x.isNotEmpty()
+ else -> false
+ }
+
+ /*
+ As extensões são uma maneira nova de adicionar funcionalidades a classes.
+ Elas são similares aos "extension methods" da linguagem C#.
+ */
+ fun String.remove(c: Char): String {
+ return this.filter {it != c}
+ }
+ println("olá, mundo!".remove('o')) // => lá, mund!
+
+ println(ExemploEnum.A) // => A
+ println(ExemploObjeto.ola()) // => olá
+}
+
+// Classes Enum são similares aos "enum types" do Java.
+enum class ExemploEnum {
+ A, B, C
+}
+
+/*
+A palavra-chave "object" pode ser usar para criar Singletons.
+Eles não são instanciados, mas podem referenciar sua instância única pelo nome.
+É semelhante aos "singleton objects" da linguagem Scala.
+*/
+object ExemploObjeto {
+ fun ola(): String {
+ return "olá"
+ }
+}
+
+fun usaObjeto() {
+ ExemploObjeto.ola()
+ val algumaReferencia: Any = ExemploObjeto // usa-se o nome diretamente
+}
+
+```
+
+### Leitura Adicional
+
+* [Tutoriais de Kotlin](https://kotlinlang.org/docs/tutorials/)(EN)
+* [Experimente Kotlin no seu navegador](http://try.kotlinlang.org/)(EN)
+* [Uma lista de material sobre Kotlin](http://kotlin.link/)(EN)
diff --git a/pt-br/solidity-pt.html.markdown b/pt-br/solidity-pt.html.markdown
new file mode 100644
index 00000000..84d02e50
--- /dev/null
+++ b/pt-br/solidity-pt.html.markdown
@@ -0,0 +1,914 @@
+---
+language: Solidity
+filename: learnSolidity.sol
+contribuidors:
+ - ["Nemil Dalal", "https://www.nemil.com"]
+ - ["Joseph Chow", ""]
+translators:
+ - ["João Farias", "http://thatsabug.com/"]
+lang: pt-br
+---
+
+Solidity permite você programar para a [Ethereum]
+(https://www.ethereum.org/), uma máquina virtual baseada na tecnologia blockhain
+para criação e execução de contratos inteligentes, sem necessidade de partes
+centralizadas ou de confiança.
+
+Solidity é uma linguagem de contratos estaticamente tipaada com similaridade com
+Javascript e C. Como objetos em programação orientada a objetos, cada contrato
+possue variáveis de estado, funções e tipos de dados comuns. Funcionalidades
+particulares de contratados incluem cláusuras modificadoras (guarda), notifica
+dores de eventos para listerners e variáveis globais customizadas.
+
+
+Exemplos de contratos Ethereum incluem crowdfunding, votações e audições cegas.
+
+Erros em código Solidity causam grandes riscos e custos; portanto, você
+deve ser muito cuidado com teste e divulgação. DEVIDO ÀS CONSTANTES MUDANÇAS
+NO ETHEREUM, ESTE DOCUMENTOS PROVAVELMENTE NÃO ESTARÁ ATUALIZADO, VOCÊ DEVE
+ACOMPANHAR A CHATROOM DO SOLIDITY E O BLOG DO ETHEREUM PARA NOTÍCIAS ATUALIZADAS.
+TODO CÓDIGO AQUI É ENTREGUE COMO ESTÁ, COM SUBSTANCIAL RISCO DE ERRROS E PADRÕES
+DE CÓDIGO DEPRECADOS.
+
+Diferentemente de outros tipo de código, você também deve adicionar padrões
+como pausa, deprecação e retração para reduzir riscos. Este documento discute
+sintaxe, então, muito padrões populares são excluídos.
+
+Como Solidity e Ethereum ainda estão sob desenvolvimento, funcionalidades beta
+e experimentais são tipicamente marcadas e sujeitas à mudanças. Pull requests
+são bem-vindos.
+
+```javascript
+// Primeiramente, um contrato de um Banco simples
+// Permite depósitos, retiradas e checagens de saldo
+
+// banco_simples.sol (note a extensão .sol)
+
+/* **** INCICIO DO EXEMPLO **** */
+
+// Declare a versão do compilador.
+pragma solidity ^0.4.2;
+
+// Inicie com comentários Natspec (as três barras)
+// usados para documentação - e como dados descritivos para elementos/ação de UI
+
+/// @title BancoSimples
+/// @author nemild
+
+/* 'contrato' tem similadirades com 'classes' em outras linguagens (variáveis de
+class, herança, etc.) */
+
+contract BancoSimples { // CamelCase
+ // Declare variáveis de estado fora da função, para persistí-la durante a
+ // duração do contrato
+
+ // dicionário que mapeia endereços para saldos
+ // tenha cuidado sobre ataques de overflow com números
+
+ mapping (address => uint) private saldos;
+
+ // "private" significa que outros contratos não podem acessar saldos
+ // diretamente, mas o dado ainda é visível para outras partes da blockchain
+
+ address public dono;
+
+ // ´public´ é legível (mas sem acesso de escrita) por usuários e contratos
+
+ // Eventos - ações públicas para ouvintes externo
+ event LogRealizacaoDeDeposito(address numeroDaConta, uint quantidade);
+
+ // Construtor, pode receber uma ou várias variáveis; apenas uma opção é
+ // permitidas
+
+ function BancoSimples() {
+ // msg dá detalhes sobre a mensagem mandada pelo contrato
+ // msg.sender é um chamador do contrato (endereço do criador do
+ // contrato)
+
+ dono = msg.sender;
+ }
+
+ /// @notice Deposita ether no banco
+ /// @return O saldo do usuário após o depósito
+
+ function deposito() public returns (uint) {
+ saldos[msg.sender] += msg.value;
+
+ // Sem necessidade de "this." ou "self." para variáveis de estado
+ // todos as variáveis são inciadas com seu valor default
+
+ LogRealizacaoDeDeposito(msg.sender, msg.value); // dispara evento
+
+ return saldos[msg.sender];
+ }
+
+ /// @notice Retira ether do banco
+ /// @dev Isto não retorna nenhum ether excendente
+ /// @param quantidadeDeRetirada quantidade que você quer retirar
+ /// @return O saldo restante do usuário
+ function retirada(uint quantidadeDeRetirada) public returns (uint saldoRestate) {
+ if(saldos[msg.sender] >= quantidadeDeRetirada) {
+
+ // Observe como deduzimos o saldo imediatamente, antes de enviar -
+ // devido ao risco de uma chamada recursiva que permite o chamador
+ // pedir um valor maior que seu saldo
+
+ saldos[msg.sender] -= quantidadeDeRetirada;
+
+ if (!msg.sender.send(quantidadeDeRetirada)) {
+ // incremente de volta só se falhar, como pode estar enviando
+ // para o contrato que substituiu 'enviar' no final
+ // do recebimento
+ saldos[msg.sender] += quantidadeDeRetirada;
+ }
+ }
+
+ return saldos[msg.sender];
+ }
+
+ /// @notice Retorna o saldo
+ /// @return O saldo do usuário
+ // 'constant' evita que a função edite variáveis de estado
+ // permite a função executar localmente/fora da blockchain
+ function saldo() constant returns (uint) {
+ return saldos[msg.sender];
+ }
+
+ // Função de fallback - Chamada se outras funções não forem chamadas ou
+ // se ether sem dados forem enviados
+ // Tipicamente chamada quando dados inválidos são enviados
+ // Adicionada para que ether enviado neste contrato seja revertido se o
+ // contrato falhar. Se não existisse, o dinheiro do enviante é transferido
+ // para o contrato
+ function () {
+ throw; // 'throw' reverte o estao para antes da chamada
+ }
+}
+// ** FIM DO EXEMPLO **
+
+// Agora, o básico de Solidity
+
+
+//1 TIPO DE DADOS E MÉTODOS ASSOCIADOS
+// uint é usado para quantidade de moeda (não existem doubles ou floats)
+// e para datas (no sistema de tempo Unix)
+
+uint x;
+
+// int de 256 bits, não pode ser mudado após sua instanciação
+int constant a = 8;
+int256 constant a = 8; // mesmo efeito, mas aqui os 256 bits são explícitos
+uint constant VERSÃO_ID = 0x123A1; // uma constante hexadecimal
+
+// com 'constant', o compilador substitui cada ocorrência com o valor
+
+// Para int e uint, é possível determinar o espaço explicitamente, em intervalos
+// de 8 a 256, e.g., int8, int16, int24
+uint8 b;
+int64 c;
+uint248 e;
+
+// Cuidado contra overflows, e proteja-se contra esse tipo de ataque
+
+// Não há funções randômicas padrão, use outros contratos para este objetivo
+
+// Casting de tipo
+int x = int(b);
+
+bool b = true; // ou então 'var b = true;' para inferição de tipo
+
+// Endereços - comportam 20 bytes/160 bits endereços Ethereum
+// Não permite operações aritiméticas
+address public dono;
+
+// Tipos de contas:
+// Conta de contrato: endereço criado ao criar (função do endereço do criador,
+// número da transação)
+// Conta externa: (pessoa/entidade externa): endereç criado a partir de chave
+// pública
+
+// Adicione o campo 'public' para indicar visibilidade pública/externa
+// um getter é automaticamente criado, mas NÃO um setter
+
+// Todos os endereços podem enviar ether
+dono.send(ALGUM_SALDO); // returna falso caso falhe
+if (dono.send) {} // LEMBRE-SE: encapsule num 'if', dado que endereços de
+// contrato tem funções executadas no envio e estas podem falhar
+//Também certifique-se que os saldos deduzidos ANTES de tentar enviar, dado que
+// há um risco de chamada recursiva que pode drenar um contrato
+
+// pode sobrescrever seu próprio
+
+// Pode verificar o saldo
+dona.balance; // o saldo do dono (usuário ou contrato)
+
+// Bytes permitidos de 1 a 32
+byte a; // byte é o mesmo que bytes1
+bytes2 b;
+bytes32 c;
+
+// Bytes dinamicamente criados
+
+bytes m; // Um array especial, mesmo que byte[] (mas mais comprimido)
+
+// Mais custoso que byte1-byte32, então, prefira estes quando possível
+
+// mesmo que bytes, mas não permite verificar tamanho ou acesso por indíce (por
+// enquanto)
+
+string n = "oi"; // guardado em UTF8, note as aspas duplas, não simples
+
+// funções de string serão adicionadas no futuro
+// prefira bytes32/bytes, dado que UTF8 usa mais espaço
+
+// Inferência de tipo
+// var não infere tipos baseados na primeira atribuição,
+// não pode ser usado em paramêtros de funções
+
+var a = true;
+
+// use com cuidado, inferência pode resultar em tipos errados
+// e.g., um int8, quando um contador precisa de int16
+
+// var pode ser usado para assinalar uma função a uma variável
+function a(uint x) returns (uint) {
+ return x * 2;
+}
+var f = a;
+f(22); // chamada
+
+// por padrão, todos os valores são inicializados com 0
+
+// Delete pode ser chamada na maioria dos tipos
+// (NÃO destroi o valor, mas retorna para o valor 0, o incial)
+
+uint x = 5;
+
+// Desestruturação/Tuplas
+(x, y) = (2, 7); // assinada/troca múltiplos valores
+
+// 2. ESTRUTURAS DE DADOS
+// Arrays
+
+bytes32[5] apelidos; // array estático
+bytes32[] nomes; // array dinâmico
+uint novoTamanho = nomes.push("João"); // adicionando retorna o novo tamanho do
+
+// Tamanho
+nomes.length; // pega o tamanho
+nomes.length = 1; // tamanhos pode ser alterados (para arrays dinâmicos)
+
+// arrays multidimensionais
+uint x[][5]; // array com 5 arrays dinâmicos como elementos (ordem da maioria
+// das linguagens)
+
+// Dicionários (qualquer tipo para qualquer tipo)
+mapping (string => uint) public saldos;
+saldos["charles"] = 1;
+console.log(saldos["ada"]); // é 0, toda chave não assinalada retorna zero
+// 'public' permite o seguinte contrato
+nomeDoContrato.saldos("charles"); // retorna 1
+// 'public' cria um getter (mas não um setter) como o seguinte
+function saldos(string _conta) returns (uint saldo) {
+ return saldos[_conta];
+}
+
+// Mapeamentos aninhados
+mapping (endereco => mapping (endereco => uint)) public guardioes;
+
+// Para deletar
+delete saldos["John"];
+delete saldos; // assinala zero para todas as chaves
+
+// Diferentemente de outras linguages, NÃO É POSSÍVEL iterar sobre todos os
+// elementos de um mapeamento, sem saber previamente as chaves - é possível
+// construir estruturas de dados personalizadas para fazer isso
+
+// Structs e enums
+struct Banco {
+ address dono;
+ uint saldo;
+}
+Banco b = Banco({
+ dono: msg.sender,
+ saldo: 5
+});
+// ou
+Banco c = Banco(msg.sender, 5);
+
+c.quantidade = 5; // cria novo valor
+delete b;
+// assinala todos os valores do enum para zero, exceto mapeamentos
+
+// Enums
+enum Estado { Criado, Travado, Inativo }; // geralmente usado para máquina de
+// estados
+Estado public estado; // Declara variável para enum
+estado = Estado.Criado;
+// enums podem ser explicitamente convertidas em ints
+uint estadoCriado = uint(Estado.Criado); // 0
+
+// Localização de dados: Memória vs. disco vs. pilha - todos os tipos complexos
+// (arrays, structs) tem uma localização de dados
+// 'memória' não é persistida, 'disco' é
+// Padrão é 'disco' para variáveis locais e de estado; 'memória' para paramêtros
+// de função. Pilha guarda pequena variáveis locais
+
+// a maioria dos tipos podem ter sua localização de dados explicitamente assinalos
+
+// 3. Operações simples
+// Comparações, operadores binários e aritimétricos são providos
+// exponenciação: **
+// ou exclusivo: ^
+// negação binária: ~
+
+// 4. Variáveis Globais de nota
+// ** this **
+this; // endereço do contrato
+// geralmente usado no final do contrato para enviar o saldo restante às partes
+this.balance;
+this.algumFuncao(); // chamada de função externa via call, não via jump interno
+
+// ** msg - Mensagem corrente recebida pelo contrato ** **
+msg.sender; // endereço do enviador
+msg.value; // quantidade de ether provida para este contrato em wei
+msg.data; // bytes, todos os dados da chamada
+msg.gas; // gas restante
+
+// ** tx - Esta transação **
+tx.origin; // endereço do enviador da transação
+tx.gasprice; // valor do gas da transação
+
+// ** block - Informação do bloco corrente **
+now; // tempo corrente (aproxiamdo), substituto para block.timestamp
+//(usa tempo do Unix)
+block.number; // número do bloco corrente
+block.difficulty; // dificuldade do bloco corrente
+block.blockhash(1); // retorna bytes32, só funciona para os 256 blocos mais
+//recentes
+block.gasLimit();
+
+// ** storage - Hash de disco persistente **
+storage['abc'] = 'def'; // mapea palavras de 256 bits em palavras de 256 bits
+
+
+// 4. FUNÇÕES E MAIS
+// A. Funções
+// Funções simples
+function incremento(uint x) returns (uint) {
+ x += 1;
+ return x;
+}
+
+// Funções podem retornar muito argumentos, e podem especificar argumentos
+// retornados sem necessidade de explicitamente usar return
+function incremento(uint x, uint y) returns (uint x, uint y) {
+ x += 1;
+ y += 1;
+}
+// Chamando a função anterior
+uint (a,b) = incremento(1,1);
+
+// 'constant' indica que uam função não altera variáveis persistidas
+// Funções constantes são executadas localmente, não na blockchain
+uint y;
+
+function incremento(uint x) constant returns (uint x) {
+ x += 1;
+ y += 1; // Esta linha deve falhar
+ // y é uma variável de estado e não pode ser alterada por uma função local
+}
+
+// 'Especificadores de visibilidade de funções'
+// Estes podem substituitir 'constante', incluíndo:
+// public - visbilidade externa e interna (padrão)
+// private - apenas visível no contrato corrente
+// internal - apenas visível no contrato corrente e seus derivados
+
+// Functions hosteada - e pode ser assinalada para variável
+function a() {
+ var z = b;
+ b();
+}
+
+function b() {
+
+}
+
+// Prefira loops sobre recursões (pilha de chamada é no máximo 1024)
+
+// B. Eventos
+// Eventos podem notificar partes externas; facilmente buscáveis e acessáveis
+// de fora da blockchain (com clientes leves)
+// tipicamente declarados após os parâmetros do contrato
+
+// Tipicamente, com letra maiúscula - e adicione Log na frente para
+// ser explicito e previnir confusão na chamada da função
+
+// Declaração
+event LogEnvio(address indexed de, address indexed para, uint quantidade);
+// Observe a letra maíscula no início do nome
+
+// Chamada
+Envio(de, para, quantidade);
+
+// Para partes externas (um contrato ou entidade externo), observe:
+Coin.Envio().watch({}, '', function(erro, resultado) {
+ if (!erro) {
+ console.log("Moeda transferida: " + resultado.args.quantidade +
+ " moedas enviadas de " + resultado.args.de +
+ " para " + resultado.args.para + ".");
+ console.log("Saldo atual:\n" +
+ "Enviador: " + Coin.balances.call(resultado.args.de) +
+ "Recebedor: " + Coin.balances.call(resultado.args.para));
+ }
+}
+// Paradigma comum para um contrato depender de outro (e.g., um contrato que
+// depende da taxa de troca provida por outro)
+
+// C. ModifiCadores
+// MOdificadores validam entradas de funções, como saldo mínimo e autorização
+// do usuário; semelhantes a guardas em outras linguagens
+
+// '_' (subtraço) geralmente incluído como última linha do corpo, indica que a
+// função sendo chamada deve ser colocada ali
+modifier apenasDepois(uint _tempo) { if (agora <= _tempo) throw; _ }
+modifier apenasDono { if (msg.sender == dono) _ }
+// geralmente usado para máquina de estado
+modifier apenasSeEmEstado (Estado estadoCorrente)
+{ if (estadoCorrente != Estado.A) _ }
+
+// Concatenado logo após a chamada da função
+function mudeDona(novoDono)
+apenasDepois(algumTempo)
+apenasDono()
+apenasSeEmEstado(Estado.A)
+{
+ dono = novoDono;
+}
+
+// subtração pode ser incluído antes do final do corpo, mas retorno explícitos
+// pode ser ignorado, então, tome cuidado
+modifier chequeValor(uint quantidade) {
+ _
+ if (msg.value > quantidade) {
+ uint quantidadeASerDevolvida = quantidade - msg.value;
+ if (!msg.sender.send(quantidadeASerDevolvida)) {
+ throw;
+ }
+ }
+}
+
+// 6. BRANCHES E LOOPS
+
+// Todas as lógicas básicas de bloco funcionam - incluindo if/else,
+// while, break, continue, return - mas não há switch
+
+// A sintaxe é semelhante a Javascript, mas sem conversão de tipos
+// de não-booleanos para booleanos (operadores de comparação precisam
+// utilizar valores booleanos)
+
+// Loops que dependem o comportamento do usuário exigem cuidado - dado
+// que contratos tem uma quantidade máxima de gas para cada bloco de
+// de código - falhas acontecerão caso ele seja excedido
+// Por exemplo:
+for(uint x = 0; x < listaDeEnderecoDeRefundo.length; x++) {
+ if (!listaDeEnderecoDeRefundo[x].send(ALGUMA_QUANTIDADE)) {
+ throw;
+ }
+}
+
+// Dois erros acima:
+// 1. Uma falha no enviar para o loop completamente, travando dinheiro
+// 2. Este loop pode ser abitrariamente longo (basado na quando que
+// o usuário precisa de refundo), portanto, pode falhar quando exceder
+// a quantidade máxima de gas do bloco
+// Ao invés disso, você deve deixar as pessoas retirarem
+// individualmente de suas subcontas e marcarem a retirada
+
+
+// 7. OBJETOS/CONTRATOS
+
+// A. Chamando um contrato externo
+contract FonteDeInformacoes {
+ function info() returns (uint ret) { return 42; }
+}
+
+contract Consumidor {
+ FonteDeInformacoes fonte; // aponta para um contrato na blockchain
+
+ // Assinala variável para uma instância do contrato
+ function setFonte(address endereco) {
+ // Cast automático, cuidado; construtor não é chamado
+ fonte = FonteDeInformacoes(endereco);
+ }
+
+ // Assinala variável para uma nova instância do contrato
+ function createNewFeed() {
+ fonte = new FonteDeInformacoes(); // nova instância criada
+ // construtor é chamado
+ }
+
+ function chameFonte() {
+ // último parenteses chama o contrato, podendo adicionar
+ // opcionalmente valores ou gas
+ fonte.info.value(10).gas(800)();
+ }
+}
+
+// B. Herança
+
+// Ordem importa, último contrato herdado (i.e., 'def') pode
+// sobrescrever partes de contratos previamente herdados
+contract MeuContratdo is abc, def("um argumento personalizado def") {
+
+// sobrescrevendo função
+ function z() {
+ if (msg.sender == dono) {
+ def.z(); // chama função sobrescrita de def
+ super.z(); // chama função do pai imeadiato
+ }
+ }
+}
+
+// função abstrata
+function umaFuncaoAbstrata(uint x);
+// não pode ser compilada, usada em contratos base/abstratos que
+// então, a implementam
+
+// C. Import
+
+import "filename";
+import "github.com/ethereum/dapp-bin/library/iterable_mapping.sol";
+
+// 'Import' está sobre desenvolvimento
+// Atualmente não pode ser usada na linha de comando
+
+
+// 8.OUTRAS PALAVRAS-CHAVE
+
+// A. Throwing
+// Throwing
+throw; // reverte estado e dinheiro NÃO-USADO é devolvido ao usuários
+// Atualmente não pode ser capturado
+
+// Um padrão de design comum é:
+if (!endereco.send(123)) {
+ throw;
+}
+
+// B. Selfdestruct
+// auto-destroe o contrato corrente, enviando fundos para o endereço
+// (geralmente o criador)
+selfdestruct(ALGUM_ENDERECO);
+
+// remove disco/código dos blocos corrente e futuros
+// ajuda clientes leves, mas dados persistidos continuam no blockchain
+
+// Padrão comum, permite ao dono finalizar o contrato e receber fundos
+// restantes
+function remover() {
+ if(msg.sender == criador) { // Apenas o criador do contrato pode
+ // fazer isso
+ selfdestruct(criador); // Inativa o contrato e retorna os fundos
+ }
+}
+
+// Talvez queria desativar o contrato manualmente, ao invés de usar
+// selfdestruct (ether enviado para contratos selfdestructed é perdido)
+
+
+// 9. NOTAS SOBRE DESIGN DE CONTRATOS
+
+// A. Obfuscação
+// Todas as variáveis são publicamente visíveis na blockchain, então
+// qualquer coisa privada precisa ser obfuscada (e.g., hash com segredo)
+
+// Passo-a-pass: 1. Comprometa-se com algo, 2. Revele compromisso
+sha3("quantidade_de_lance", "algum segredo"); // compromisso
+
+// chame a função reveal (revelar) do contrato no futuros
+// mostrando o lance mais o segredo para foi hasheado com SHA3
+reveal(100, "meuSegredo");
+
+// B. Otimização de disco
+// Escrever na blockchain pode ser caro, dado que os dados são guardados
+// para sempre. É encorajado que contratos inteligentes usem memória (
+// enventualmente, compilação será melhor, mas por enquanto é benéfico
+// usar estruturas de dados simples - armazenando minimamente na
+// blockchain)
+
+// Custo pode ser alto para item como arrays multidimensionais
+// (custo para guardar os dados - não declarar variáveis)
+
+// C. Acesso de dados da blockchain
+
+// Não pode restringir humanos ou computadores de ler os conteúdos
+// de transações ou estado de transações
+
+// Enquanto 'private' previne outros *contratos* de ler dados ]
+// diretamente - qualquer outra parte ainda pode ler dados da blockchain
+
+// Todos os dados são armazedos na blockchain, para que qualquer um
+// possa observar dados antigos e mudanças
+
+// D. Jobs Cron
+// Contratos deve ser manualmente chamados para lidar com agendamentos
+// baseados em tempo; podendo criar código externo para pingar
+// regularmente ou prover incentivos (ether) para outros fazê-lo
+
+// E. Padrão Observador
+// O Padrão Observador permite que você registre um inscritor e
+// registre uma função a ser chamada pelo Oráculo (nota, Oráculos pagam
+// pela ação executada). Similarmente à subscrição em Pub/sub
+
+// Este é um contrato abstrato, tanto as classes cliente como a
+// servidor importam o cliente que deve ser implementado
+contract AlgumOraculoCallback {
+ function OraculoCallback(int _valor, uint _tempo, bytes32 info) external;
+}
+
+contract AlgumOráculo {
+ AlgumOraculoCallback[] callbacks; // array com todos os inscritos
+
+ // Registra inscrito
+ function addInscrito(AlgumOraculoCallback a) {
+ callbacks.push(a);
+ }
+
+ function notificar(valor, tempo, info) private {
+ for(uint i = 0;i < callbacks.length; i++) {
+ // todos os inscritos precisam implementar AlgumOraculoCallback
+ callbacks[i].OraculoCallback(valor, tempo, info);
+ }
+ }
+
+ function facaAlgo() public {
+ // Código para fazer algo
+
+ // Notifica todos os inscrito
+ notificar(_valor, _tempo, _info);
+ }
+}
+
+// Agora, seu contrato cliente pode addInscrito importando
+// AlgumOraculoCallback e registrando algum Oráculo
+
+// F. Máquinas de estado
+// veja o exemplo abaixo para o enum Estado e o modificador noEstado
+
+// *** EXEMPLO: Um exemplo de crowdfunding example (similar ao
+// Kickstarter) ***
+// ** INCIO DO EXEMPLO **
+
+// FundadorDoCrowdFunding.sol
+
+/// @title FundadorDoCrowdFunding
+/// @author nemild
+contract FundadorDoCrowdFunding {
+ // Variáveis assinaladas na crição pelo criador
+ address public criador;
+ address public recipiente; // criador pode ser diferente do Recipiente
+ uint public minALevantar; // requisito para pagar, pelo contrário
+ // os doadores recebem o dinheiro de volta
+ string urlDaCampanha;
+ byte constant versao = 1;
+
+ // Estruturas de dados
+ enum Estado {
+ LevantandoFundos,
+ RefundoExpirado,
+ Sucesso
+ }
+ struct Contribuicao {
+ uint quantidade;
+ address contribuidor;
+ }
+
+ // Variáveis de Estado
+ State public estado = Estado.LevantandoFundos; // incializado na criação
+ uint public totalLevantado;
+ uint public levantadoPor;
+ uint public completadoEm;
+ Contribution[] contribuidores;
+
+ event LogRecebimentoDeFundos(address endereco,
+ uint quantidade,
+ uint totalAtual);
+ event LogFundosPagos(address enderecoDoRecebedor);
+
+ modifier noEstado(Estado _estado) {
+ if (estado != _estado) throw;
+ _
+ }
+
+ modifier eOCriador() {
+ if (msg.sender != criador) throw;
+ _
+ }
+
+ // Aguarda 6 meses após o final do contrato para destruí-lo
+ modifier noFimDoContrato() {
+ if(!((estado == Estado.RefundoExpirado || estado == Estado.Sucesso) &&
+ completadoEm + 6 months < now)) {
+ throw;
+ }
+ _
+ }
+
+ function FundadorDoCrowdFunding(
+ uint tempoEmHorasParaFundraising,
+ string _urlDaCampanha,
+ address _recipiente,
+ uint _minALevantar)
+ {
+ criador = msg.sender;
+ recipiente = _recipiente;
+ urlDaCampanha = _urlDaCampanha;
+ minALevantar = _minALevantar;
+ levantadoPor = now + (tempoEmHorasParaFundraising * 1 hours);
+ }
+
+ function contribuir()
+ public
+ noEstado(Estado.LevantandoFundos)
+ {
+ contribuidores.push(
+ Contribuicao({
+ quantidade: msg.value,
+ contribuidor: msg.sender
+ }) // use array, para podermos iterar
+ );
+ totalLevantado += msg.value;
+
+ LogRecebimentoDeFundos(msg.sender, msg.value, totalRaised);
+
+ verifiqueSeLevantamentoFoiCompletadoOuExpirado();
+ return contribuicoes.length - 1; // retorna id
+ }
+
+ function verifiqueSeLevantamentoFoiCompletadoOuExpirado() {
+ if (totalLevantado > minALevantar) {
+ estado = Estado.Sucesso;
+ pagar();
+
+ // pode incentivar enviador que iniciou a mudanção de estado
+ } else if ( now > levantadoPor ) {
+ estado = Estado.RefundoExpirado; // backers podem coletar
+ // o fundo chamando receberRefundo(id)
+ }
+ completadoEm = now;
+ }
+
+ function pagar()
+ public
+ emEstado(Estado.Sucesso)
+ {
+ if(!recipiente.send(this.balance)) {
+ throw;
+ }
+
+
+ LogFundosPagos(fundRecipient);
+ }
+
+ function receberRefundo(id)
+ public
+ emEstado(Estado.RefundoExpirado)
+ {
+ if (contribuicoes.length <= id || id < 0 || contribuicoes[id].amount == 0 ) {
+ throw;
+ }
+
+ uint quantidadeDeRefundo = contribuicoes[id].amount;
+ contribuicoes[id].amount = 0;
+
+ if(!contribuicoes[id].contribuidor.send(quantidadeParaEnviar)) {
+ contribuicoes[id].amount = quantidadeParaEnviar;
+ return false;
+ }
+
+ return true;
+ }
+
+ function removerContrato()
+ public
+ eOCriador()
+ noFimDoContrato()
+ {
+ selfdestruct(msg.sender);
+ // criador recebe todo o dinheiro restante{
+
+ }
+
+ function () { throw; }
+}
+// ** FIM DO EXEMPLO **
+
+// 10. OUTRAS FUNÇÕES NATIVAS
+
+// Unidades monetárias
+// Moeda é definida usando wei, menor quantidade de ether
+uint quantidadeMin = 1 wei;
+uint a = 1 finney; // 1 ether == 1000 finney
+// Para outras unidades, veja: http://ether.fund/tool/converter
+
+// Unidades temporais
+1 == 1 second // segundos
+1 minutes == 60 seconds // Minutos
+
+// Pode multiplicar uma variável de tempo, dado que unidades não são guardadas
+// na variável
+uint x = 5;
+(x * 1 days); // 5 dias
+
+// Cuidado com o salto de segundos / anos com declarações de igualdade para o tempo
+// (em vez disso, prefira maior que / menor que)
+
+// Criptografia
+// Todas as string passadas são concatenadas antes de realizar hashing
+sha3("ab", "cd");
+ripemd160("abc");
+sha256("def");
+
+// 11. Segurança
+
+// Bugs são desastrosos para contratos Ethereum - até padrões Solidity populares
+// podem ser considerados anti-padrões
+
+// Veja links para segurança no final deste documento
+
+// 12. FUNÇÕES DE BAIXO NÍVELS
+// call - baixo nível, geralmente não usada, não tem segurança de tipos
+booleanSucesso = algumEnderecoDeContrato.call('nome_da_funcao', 'arg1', 'arg2');
+
+// callcode - Código no endereço alvo executado no *contexto* do contrato
+// de chamada. Fornece funcionalidade de biblioteca
+algumEnderecoDeContrato.callcode('nome_da_funcao');
+
+
+// 13. NOTAS DE ESTILO
+// Baseado no guia de estilo PEP8 do Python
+
+// Resumo rápido:
+// 4 espaços para identação
+// Duas linhas separam declaração de contratos (e outras declarações de alto nível)
+// Evite espaços estranhos entre parênteses
+// Pode omitir chaves curly para uma declaração de linha(if, for, etc)
+// else deve ser colocado na própria linha
+
+
+// 14. COMENTÁRIOS NATSPEC
+// usado para documentação, comentários e UIs externos
+
+// Contrato natspec - sempre acima da definição do contrato
+/// @title Título do Contrato
+/// @author Nome do autor
+
+// Função natspec
+/// @notice informações sobre o que funciona; mostrado quando a função é executada
+/// @dev Documentação de função para desenvolvedor
+
+// Parâmetro de função / valor de retorno natspec
+/// @param algumParametro Alguma descrição do que o parametro faz
+/// @return Descrição do valor de retorno
+```
+
+## Recursos adicionais
+- [Documetanção Solidity](https://solidity.readthedocs.org/en/latest/)
+- [Guia de Estilo do Solidity](https://ethereum.github.io/solidity//docs/style-guide/):
+ O guia de estilo Ethereum é derivado do guia de estilo do Python [pep8](https://www.python.org/dev/peps/pep-0008/).
+- [Editor de Browser Solidity](http://chriseth.github.io/browser-solidity/)
+- [Gitter Solidity Chat room](https://gitter.im/ethereum/solidity)
+- [Estratégias de projeto modular para contratos Ethereum](https://docs.erisindustries.com/tutorials/solidity/)
+
+## Contratos de Exemplo
+- [Dapp Bin](https://github.com/ethereum/dapp-bin)
+- [Solidity Baby Step Contracts](https://github.com/fivedogit/solidity-baby-steps/tree/master/contracts)
+- [ConsenSys Contracts](https://github.com/ConsenSys/dapp-store-contracts)
+- [State of Dapps](http://dapps.ethercasts.com/)
+
+## Segurança
+- [Thinking About Smart Contract Security](https://blog.ethereum.org/2016/06/19/thinking-smart-contract-security/)
+- [Smart Contract Security](https://blog.ethereum.org/2016/06/10/smart-contract-security/)
+- [Hacking Distributed Blog](http://hackingdistributed.com/)
+
+## Informação excluída intencionalmente
+- Libraries
+
+## Estilo
+- [PEP8](https://www.python.org/dev/peps/pep-0008/) é usado como guia de estilo,
+ incluindo sua filosofia geral
+
+## Editores
+- [Vim Solidity](https://github.com/tomlion/vim-solidity)
+- Snippets de Editores ([Ultisnips format](https://gist.github.com/nemild/98343ce6b16b747788bc))
+
+## Trabalhos Futuros
+- Novas palavras-chave: protected, inheritable
+- Lista de padrões de design comuns (throttling, RNG, atualização de versão)
+- Padrões anti-segurança comuns
+
+
+Sinta-se a vontade para enviar um pull request com quaisquer edições - ou email
+para nemild - / at- / gmail
diff --git a/pt-br/swift-pt.html.markdown b/pt-br/swift-pt.html.markdown
index 4ad67a06..ebf74b6f 100644
--- a/pt-br/swift-pt.html.markdown
+++ b/pt-br/swift-pt.html.markdown
@@ -1,12 +1,13 @@
---
language: swift
+filename: learnswift-pt.swift
contributors:
- ["Grant Timmerman", "http://github.com/grant"]
- ["Christopher Bess", "http://github.com/cbess"]
translators:
- ["Mariane Siqueira Machado", "https://twitter.com/mariane_sm"]
lang: pt-br
-filename: learnswift.swift
+
---
Swift é uma linguagem de programação para desenvolvimento de aplicações no iOS e OS X criada pela Apple. Criada para
diff --git a/pt-pt/bf.html.markdown b/pt-pt/bf.html.markdown
index da4c787f..13c22387 100644
--- a/pt-pt/bf.html.markdown
+++ b/pt-pt/bf.html.markdown
@@ -1,5 +1,6 @@
---
language: brainfuck
+filename: brainfuck-pt.bf
contributors:
- ["Prajit Ramachandran", "http://prajitr.github.io/"]
- ["Mathias Bynens", "http://mathiasbynens.be/"]
diff --git a/purescript.html.markdown b/purescript.html.markdown
index 9ea84d5b..df0cb66e 100644
--- a/purescript.html.markdown
+++ b/purescript.html.markdown
@@ -1,5 +1,6 @@
---
language: purescript
+filename: purescript.purs
contributors:
- ["Fredrik Dyrkell", "http://www.lexicallyscoped.com"]
- ["Thimoteus", "https://github.com/Thimoteus"]
diff --git a/python3.html.markdown b/python3.html.markdown
index f25d9228..5aa61b65 100644
--- a/python3.html.markdown
+++ b/python3.html.markdown
@@ -345,6 +345,7 @@ invalid_set = {[1], 1} # => Raises a TypeError: unhashable type: 'list'
valid_set = {(1,), 1}
# Add one more item to the set
+filled_set = some_set
filled_set.add(5) # filled_set is now {1, 2, 3, 4, 5}
# Do set intersection with &
diff --git a/pythonstatcomp.html.markdown b/pythonstatcomp.html.markdown
index 8ee3aa64..79bbcd8d 100644
--- a/pythonstatcomp.html.markdown
+++ b/pythonstatcomp.html.markdown
@@ -104,7 +104,7 @@ import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline
-# To do data vizualization in Python, use matplotlib
+# To do data visualization in Python, use matplotlib
plt.hist(pets.age);
diff --git a/qt.html.markdown b/qt.html.markdown
index a9c855a6..0db75726 100644
--- a/qt.html.markdown
+++ b/qt.html.markdown
@@ -5,7 +5,7 @@ language: c++
filename: learnqt.cpp
contributors:
- ["Aleksey Kholovchuk", "https://github.com/vortexxx192"]
-lang: en
+
---
**Qt** is a widely-known framework for developing cross-platform software that can be run on various software and hardware platforms with little or no change in the code, while having the power and speed of native applications. Though **Qt** was originally written in *C++*, there are its ports to other languages: *[PyQt](https://learnxinyminutes.com/docs/pyqt/)*, *QtRuby*, *PHP-Qt*, etc.
@@ -14,7 +14,7 @@ lang: en
```c++
/*
- * Let's start clasically
+ * Let's start classically
*/
// all headers from Qt framework start with capital letter 'Q'
@@ -79,7 +79,7 @@ int main(int argc, char *argv[]) {
Notice that *QObject::connect* part. This method is used to connect *SIGNALS* of one objects to *SLOTS* of another.
-**Signals** are being emited when certain things happen with objects, like *pressed* signal is emited when user presses on QPushButton object.
+**Signals** are being emitted when certain things happen with objects, like *pressed* signal is emitted when user presses on QPushButton object.
**Slots** are *actions* that might be performed in response to received signals.
diff --git a/r.html.markdown b/r.html.markdown
index 8539b10e..7a94ba05 100644
--- a/r.html.markdown
+++ b/r.html.markdown
@@ -192,7 +192,7 @@ class(-Inf) # "numeric"
2.0 * 2L # 4 # numeric times integer gives numeric
3L / 4 # 0.75 # integer over numeric gives numeric
3 %% 2 # 1 # the remainder of two numerics is another numeric
-# Illegal arithmetic yeilds you a "not-a-number":
+# Illegal arithmetic yields you a "not-a-number":
0 / 0 # NaN
class(NaN) # "numeric"
# You can do arithmetic on two vectors with length greater than 1,
@@ -662,7 +662,7 @@ require(plyr)
#########################
# "pets.csv" is a file on the internet
-# (but it could just as easily be be a file on your own computer)
+# (but it could just as easily be a file on your own computer)
pets <- read.csv("http://learnxinyminutes.com/docs/pets.csv")
pets
head(pets, 2) # first two rows
diff --git a/red.html.markdown b/red.html.markdown
index 0c979ce1..3575032f 100644
--- a/red.html.markdown
+++ b/red.html.markdown
@@ -51,7 +51,7 @@ comment {
; no need to restrict this to a 'main' function.
; Valid variable names start with a letter and can contain numbers,
-; variables containing only capital A thru F and numbers and ending with 'h'
+; variables containing only capital A through F and numbers and ending with 'h'
; are forbidden, because that is how hexadecimal numbers are expressed in Red
; and Red/System.
@@ -136,14 +136,14 @@ if a < 0 [print "a is negative"]
; Evaluate a block of code if a given condition is true, else evaluate an
; alternative block of code. If the last expressions in both blocks have the
; same type, EITHER can be used inside an expression.
-either a < 0 [
+either a > 0 [
+ msg: "positive"
+][
either a = 0 [
msg: "zero"
][
msg: "negative"
]
-][
- msg: "positive"
]
print ["a is " msg lf]
@@ -151,14 +151,14 @@ print ["a is " msg lf]
; There is an alternative way to write this
; (Which is allowed because all code paths return a value of the same type):
-msg: either a < 0 [
+msg: either a > 0 [
+ "positive"
+][
either a = 0 [
"zero"
][
"negative"
]
- ][
- "positive"
]
print ["a is " msg lf]
diff --git a/rst.html.markdown b/rst.html.markdown
index 1fbff015..65f848ed 100644
--- a/rst.html.markdown
+++ b/rst.html.markdown
@@ -32,7 +32,7 @@ $ pip install docutils
A simple example of the file syntax:
-```rst
+```
.. Lines starting with two dots are special commands. But if no command can be found, the line is considered as a comment
=========================================================
diff --git a/ru-ru/bf.html.markdown b/ru-ru/bf.html.markdown
index 20f0fa56..d2e74e8f 100644
--- a/ru-ru/bf.html.markdown
+++ b/ru-ru/bf.html.markdown
@@ -1,5 +1,6 @@
---
language: bf
+filename: learnbf-ru.bf
contributors:
- ["Prajit Ramachandran", "http://prajitr.github.io/"]
- ["Mathias Bynens", "http://mathiasbynens.be/"]
diff --git a/ru-ru/c++-ru.html.markdown b/ru-ru/c++-ru.html.markdown
index cef5ab7e..b9704fc3 100644
--- a/ru-ru/c++-ru.html.markdown
+++ b/ru-ru/c++-ru.html.markdown
@@ -853,7 +853,7 @@ pt2 = nullptr; // Устанавливает pt2 в null.
// '=' != '=' != '='!
// Вызывает Foo::Foo(const Foo&) или некий вариант (смотрите "move semantics")
-// копирования конструктора.
+// конструктора копирования.
Foo f2;
Foo f1 = f2;
diff --git a/ru-ru/c-ru.html.markdown b/ru-ru/c-ru.html.markdown
index 71e41ee3..44e7ad3b 100644
--- a/ru-ru/c-ru.html.markdown
+++ b/ru-ru/c-ru.html.markdown
@@ -477,7 +477,7 @@ void str_reverse_through_pointer(char *str_in) {
Очень важно использовать правильные отступы и ставить пробелы в нужных местах.
Читаемый код лучше чем красивый или быстрый код.
-Чтобы научиться писать хороший код, почитайте [Linux kernel coding stlye](https://www.kernel.org/doc/Documentation/CodingStyle).
+Чтобы научиться писать хороший код, почитайте [Linux kernel coding style](https://www.kernel.org/doc/Documentation/CodingStyle).
Также не забывайте, что [Google](http://google.com) и [Яндекс](http://yandex.ru) – ваши хорошие друзья.
diff --git a/ru-ru/elixir-ru.html.markdown b/ru-ru/elixir-ru.html.markdown
new file mode 100644
index 00000000..c8c2c060
--- /dev/null
+++ b/ru-ru/elixir-ru.html.markdown
@@ -0,0 +1,467 @@
+---
+language: elixir
+contributors:
+ - ["Joao Marques", "http://github.com/mrshankly"]
+ - ["Dzianis Dashkevich", "https://github.com/dskecse"]
+ - ["Ryan Plant", "https://github.com/ryanplant-au"]
+translator:
+ - ["Ev Bogdanov", "https://github.com/evbogdanov"]
+filename: learnelixir-ru.ex
+lang: ru-ru
+---
+
+Elixir — современный функциональный язык программирования, который работает на
+виртуальной машине Erlang. Elixir полностью совместим с Erlang, но обладает
+дружелюбным синтаксисом и предлагает больше возможностей.
+
+```elixir
+
+# Однострочные комментарии начинаются с символа решётки.
+
+# Для многострочных комментариев отдельного синтаксиса нет,
+# поэтому просто используйте несколько однострочных комментариев.
+
+# Запустить интерактивную Elixir-консоль (аналог `irb` в Ruby) можно
+# при помощи команды `iex`.
+# Чтобы скомпилировать модуль, воспользуйтесь командой `elixirc`.
+
+# Обе команды будут работать из терминала, если вы правильно установили Elixir.
+
+## ---------------------------
+## -- Базовые типы
+## ---------------------------
+
+# Числа
+3 # целое число
+0x1F # целое число
+3.0 # число с плавающей запятой
+
+# Атомы, которые являются нечисловыми константами. Они начинаются с символа `:`.
+:hello # атом
+
+# Кортежи, которые хранятся в памяти последовательно.
+{1,2,3} # кортеж
+
+# Получить доступ к элементу кортежа мы можем с помощью функции `elem`:
+elem({1, 2, 3}, 0) #=> 1
+
+# Списки, которые реализованы как связные списки.
+[1,2,3] # список
+
+# У каждого непустого списка есть голова (первый элемент списка)
+# и хвост (все остальные элементы списка):
+[head | tail] = [1,2,3]
+head #=> 1
+tail #=> [2,3]
+
+# В Elixir, как и в Erlang, знак `=` служит для сопоставления с образцом,
+# а не для операции присваивания.
+#
+# Это означает, что выражение слева от знака `=` (образец) сопоставляется с
+# выражением справа.
+#
+# Сопоставление с образцом позволило нам получить голову и хвост списка
+# в примере выше.
+
+# Если выражения слева и справа от знака `=` не удаётся сопоставить, будет
+# брошена ошибка. Например, если кортежи разных размеров.
+{a, b, c} = {1, 2} #=> ** (MatchError)
+
+# Бинарные данные
+<<1,2,3>>
+
+# Вы столкнётесь с двумя видами строк:
+"hello" # Elixir-строка (заключена в двойные кавычки)
+'hello' # Erlang-строка (заключена в одинарные кавычки)
+
+# Все строки представлены в кодировке UTF-8:
+"привет" #=> "привет"
+
+# Многострочный текст
+"""
+Я текст на несколько
+строк.
+"""
+#=> "Я текст на несколько\nстрок.\n"
+
+# Чем Elixir-строки отличаются от Erlang-строк? Elixir-строки являются бинарными
+# данными.
+<<?a, ?b, ?c>> #=> "abc"
+# Erlang-строка — это на самом деле список.
+[?a, ?b, ?c] #=> 'abc'
+
+# Оператор `?` возвращает целое число, соответствующее данному символу.
+?a #=> 97
+
+# Для объединения бинарных данных (и Elixir-строк) используйте `<>`
+<<1,2,3>> <> <<4,5>> #=> <<1,2,3,4,5>>
+"hello " <> "world" #=> "hello world"
+
+# Для объединения списков (и Erlang-строк) используйте `++`
+[1,2,3] ++ [4,5] #=> [1,2,3,4,5]
+'hello ' ++ 'world' #=> 'hello world'
+
+# Диапазоны записываются как `начало..конец` (оба включительно)
+1..10 #=> 1..10
+
+# Сопоставление с образцом применимо и для диапазонов:
+lower..upper = 1..10
+[lower, upper] #=> [1, 10]
+
+# Карты (известны вам по другим языкам как ассоциативные массивы, словари, хэши)
+genders = %{"david" => "male", "gillian" => "female"}
+genders["david"] #=> "male"
+
+# Для карт, где ключами выступают атомы, доступен специальный синтаксис
+genders = %{david: "male", gillian: "female"}
+genders.gillian #=> "female"
+
+## ---------------------------
+## -- Операторы
+## ---------------------------
+
+# Математические операции
+1 + 1 #=> 2
+10 - 5 #=> 5
+5 * 2 #=> 10
+10 / 2 #=> 5.0
+
+# В Elixir оператор `/` всегда возвращает число с плавающей запятой.
+
+# Для целочисленного деления применяйте `div`
+div(10, 2) #=> 5
+
+# Для получения остатка от деления к вашим услугам `rem`
+rem(10, 3) #=> 1
+
+# Булевые операторы: `or`, `and`, `not`.
+# В качестве первого аргумента эти операторы ожидают булевое значение.
+true and true #=> true
+false or true #=> true
+1 and true #=> ** (BadBooleanError)
+
+# Elixir также предоставляет `||`, `&&` и `!`, которые принимают аргументы
+# любого типа. Всё, кроме `false` и `nil`, считается `true`.
+1 || true #=> 1
+false && 1 #=> false
+nil && 20 #=> nil
+!true #=> false
+
+# Операторы сравнения: `==`, `!=`, `===`, `!==`, `<=`, `>=`, `<`, `>`
+1 == 1 #=> true
+1 != 1 #=> false
+1 < 2 #=> true
+
+# Операторы `===` и `!==` более строгие. Разница заметна, когда мы сравниваем
+# числа целые и с плавающей запятой:
+1 == 1.0 #=> true
+1 === 1.0 #=> false
+
+# Elixir позволяет сравнивать значения разных типов:
+1 < :hello #=> true
+
+# При сравнении разных типов руководствуйтесь следующим правилом:
+# число < атом < ссылка < функция < порт < процесс < кортеж < список < строка
+
+## ---------------------------
+## -- Порядок выполнения
+## ---------------------------
+
+# Условный оператор `if`
+if false do
+ "Вы этого никогда не увидите"
+else
+ "Вы увидите это"
+end
+
+# Противоположный ему условный оператор `unless`
+unless true do
+ "Вы этого никогда не увидите"
+else
+ "Вы увидите это"
+end
+
+# Помните сопоставление с образцом?
+# Многие конструкции в Elixir построены вокруг него.
+
+# `case` позволяет сравнить выражение с несколькими образцами:
+case {:one, :two} do
+ {:four, :five} ->
+ "Этот образец не совпадёт"
+ {:one, x} ->
+ "Этот образец совпадёт и присвоит переменной `x` значение `:two`"
+ _ ->
+ "Этот образец совпадёт с чем угодно"
+end
+
+# Символ `_` называется анонимной переменной. Используйте `_` для значений,
+# которые в текущем выражении вас не интересуют. Например, вам интересна лишь
+# голова списка, а хвост вы желаете проигнорировать:
+[head | _] = [1,2,3]
+head #=> 1
+
+# Для лучшей читаемости вы можете написать:
+[head | _tail] = [:a, :b, :c]
+head #=> :a
+
+# `cond` позволяет проверить сразу несколько условий за раз.
+# Используйте `cond` вместо множественных операторов `if`.
+cond do
+ 1 + 1 == 3 ->
+ "Вы меня никогда не увидите"
+ 2 * 5 == 12 ->
+ "И меня"
+ 1 + 2 == 3 ->
+ "Вы увидите меня"
+end
+
+# Обычно последним условием идёт `true`, которое выполнится, если все предыдущие
+# условия оказались ложны.
+cond do
+ 1 + 1 == 3 ->
+ "Вы меня никогда не увидите"
+ 2 * 5 == 12 ->
+ "И меня"
+ true ->
+ "Вы увидите меня (по сути, это `else`)"
+end
+
+# Обработка ошибок происходит в блоках `try/catch`.
+# Elixir также поддерживает блок `after`, который выполнится в любом случае.
+try do
+ throw(:hello)
+catch
+ message -> "Поймана ошибка с сообщением #{message}."
+after
+ IO.puts("Я выполнюсь всегда")
+end
+#=> Я выполнюсь всегда
+# "Поймана ошибка с сообщением hello."
+
+## ---------------------------
+## -- Модули и функции
+## ---------------------------
+
+# Анонимные функции (обратите внимание на точку при вызове функции)
+square = fn(x) -> x * x end
+square.(5) #=> 25
+
+# Анонимные функции принимают клозы и гарды.
+#
+# Клозы (от англ. clause) — варианты исполнения функции.
+#
+# Гарды (от англ. guard) — охранные выражения, уточняющие сопоставление с
+# образцом в функциях. Гарды следуют после ключевого слова `when`.
+f = fn
+ x, y when x > 0 -> x + y
+ x, y -> x * y
+end
+
+f.(1, 3) #=> 4
+f.(-1, 3) #=> -3
+
+# В Elixir много встроенных функций.
+# Они доступны в текущей области видимости.
+is_number(10) #=> true
+is_list("hello") #=> false
+elem({1,2,3}, 0) #=> 1
+
+# Вы можете объединить несколько функций в модуль. Внутри модуля используйте `def`,
+# чтобы определить свои функции.
+defmodule Math do
+ def sum(a, b) do
+ a + b
+ end
+
+ def square(x) do
+ x * x
+ end
+end
+
+Math.sum(1, 2) #=> 3
+Math.square(3) #=> 9
+
+# Чтобы скомпилировать модуль Math, сохраните его в файле `math.ex`
+# и наберите в терминале: `elixirc math.ex`
+
+defmodule PrivateMath do
+ # Публичные функции начинаются с `def` и доступны из других модулей.
+ def sum(a, b) do
+ do_sum(a, b)
+ end
+
+ # Приватные функции начинаются с `defp` и доступны только внутри своего модуля.
+ defp do_sum(a, b) do
+ a + b
+ end
+end
+
+PrivateMath.sum(1, 2) #=> 3
+PrivateMath.do_sum(1, 2) #=> ** (UndefinedFunctionError)
+
+# Функции внутри модуля тоже принимают клозы и гарды
+defmodule Geometry do
+ def area({:rectangle, w, h}) do
+ w * h
+ end
+
+ def area({:circle, r}) when is_number(r) do
+ 3.14 * r * r
+ end
+end
+
+Geometry.area({:rectangle, 2, 3}) #=> 6
+Geometry.area({:circle, 3}) #=> 28.25999999999999801048
+Geometry.area({:circle, "not_a_number"}) #=> ** (FunctionClauseError)
+
+# Из-за неизменяемых переменных в Elixir важную роль играет рекурсия
+defmodule Recursion do
+ def sum_list([head | tail], acc) do
+ sum_list(tail, acc + head)
+ end
+
+ def sum_list([], acc) do
+ acc
+ end
+end
+
+Recursion.sum_list([1,2,3], 0) #=> 6
+
+# Модули в Elixir поддерживают атрибуты.
+# Атрибуты бывают как встроенные, так и ваши собственные.
+defmodule MyMod do
+ @moduledoc """
+ Это встроенный атрибут
+ """
+
+ @my_data 100 # А это ваш атрибут
+ IO.inspect(@my_data) #=> 100
+end
+
+# Одна из фишек языка — оператор `|>`
+# Он передаёт выражение слева в качестве первого аргумента функции справа:
+Range.new(1,10)
+|> Enum.map(fn x -> x * x end)
+|> Enum.filter(fn x -> rem(x, 2) == 0 end)
+#=> [4, 16, 36, 64, 100]
+
+## ---------------------------
+## -- Структуры и исключения
+## ---------------------------
+
+# Структуры — это расширения поверх карт, привносящие в Elixir значения по
+# умолчанию, проверки на этапе компиляции и полиморфизм.
+defmodule Person do
+ defstruct name: nil, age: 0, height: 0
+end
+
+joe_info = %Person{ name: "Joe", age: 30, height: 180 }
+#=> %Person{age: 30, height: 180, name: "Joe"}
+
+# Доступ к полю структуры
+joe_info.name #=> "Joe"
+
+# Обновление поля структуры
+older_joe_info = %{ joe_info | age: 31 }
+#=> %Person{age: 31, height: 180, name: "Joe"}
+
+# Блок `try` с ключевым словом `rescue` используется для обработки исключений
+try do
+ raise "какая-то ошибка"
+rescue
+ RuntimeError -> "перехвачена ошибка рантайма"
+ _error -> "перехват любой другой ошибки"
+end
+#=> "перехвачена ошибка рантайма"
+
+# У каждого исключения есть сообщение
+try do
+ raise "какая-то ошибка"
+rescue
+ x in [RuntimeError] ->
+ x.message
+end
+#=> "какая-то ошибка"
+
+## ---------------------------
+## -- Параллелизм
+## ---------------------------
+
+# Параллелизм в Elixir построен на модели акторов. Для написания
+# параллельной программы нам понадобятся три вещи:
+# 1. Создание процессов
+# 2. Отправка сообщений
+# 3. Приём сообщений
+
+# Новый процесс создаётся функцией `spawn`, которая принимает функцию
+# в качестве аргумента.
+f = fn -> 2 * 2 end #=> #Function<erl_eval.20.80484245>
+spawn(f) #=> #PID<0.40.0>
+
+# `spawn` возвращает идентификатор процесса (англ. process identifier, PID).
+# Вы можете использовать PID для отправки сообщений этому процессу. Сообщения
+# отправляются через оператор `send`. А для приёма сообщений используется
+# механизм `receive`:
+
+# Блок `receive do` ждёт сообщений и обработает их, как только получит. Блок
+# `receive do` обработает лишь одно полученное сообщение. Чтобы обработать
+# несколько сообщений, функция, содержащая блок `receive do`, должна рекурсивно
+# вызывать себя.
+
+defmodule Geometry do
+ def area_loop do
+ receive do
+ {:rectangle, w, h} ->
+ IO.puts("Площадь = #{w * h}")
+ area_loop()
+ {:circle, r} ->
+ IO.puts("Площадь = #{3.14 * r * r}")
+ area_loop()
+ end
+ end
+end
+
+# Скомпилируйте модуль и создайте процесс
+pid = spawn(fn -> Geometry.area_loop() end) #=> #PID<0.40.0>
+# Альтернативно
+pid = spawn(Geometry, :area_loop, [])
+
+# Отправьте сообщение процессу
+send pid, {:rectangle, 2, 3}
+#=> Площадь = 6
+# {:rectangle,2,3}
+
+send pid, {:circle, 2}
+#=> Площадь = 12.56
+# {:circle,2}
+
+# Кстати, интерактивная консоль — это тоже процесс.
+# Чтобы узнать текущий PID, воспользуйтесь встроенной функцией `self`
+self() #=> #PID<0.27.0>
+
+## ---------------------------
+## -- Агенты
+## ---------------------------
+
+# Агент — это процесс, который следит за некоторым изменяющимся значением.
+
+# Создайте агента через `Agent.start_link`, передав ему функцию.
+# Начальным состоянием агента будет значение, которое эта функция возвращает.
+{ok, my_agent} = Agent.start_link(fn -> ["красный", "зелёный"] end)
+
+# `Agent.get` принимает имя агента и анонимную функцию `fn`, которой будет
+# передано текущее состояние агента. В результате вы получите то, что вернёт
+# анонимная функция.
+Agent.get(my_agent, fn colors -> colors end) #=> ["красный", "зелёный"]
+
+# Похожим образом вы можете обновить состояние агента
+Agent.update(my_agent, fn colors -> ["синий" | colors] end)
+```
+
+## Ссылки
+
+* [Официальный сайт](http://elixir-lang.org)
+* [Шпаргалка по языку](http://media.pragprog.com/titles/elixir/ElixirCheat.pdf)
+* [Книга "Programming Elixir"](https://pragprog.com/book/elixir/programming-elixir)
+* [Книга "Learn You Some Erlang for Great Good!"](http://learnyousomeerlang.com/)
+* [Книга "Programming Erlang: Software for a Concurrent World"](https://pragprog.com/book/jaerlang2/programming-erlang)
diff --git a/ru-ru/haskell-ru.html.markdown b/ru-ru/haskell-ru.html.markdown
index fecee51b..b1b8eb79 100644
--- a/ru-ru/haskell-ru.html.markdown
+++ b/ru-ru/haskell-ru.html.markdown
@@ -1,5 +1,6 @@
---
language: Haskell
+filename: haskell-ru.hs
contributors:
- ["Adit Bhargava", "http://adit.io"]
translators:
diff --git a/ru-ru/html-ru.html.markdown b/ru-ru/html-ru.html.markdown
index 5069d77f..120981b9 100644
--- a/ru-ru/html-ru.html.markdown
+++ b/ru-ru/html-ru.html.markdown
@@ -1,6 +1,6 @@
---
language: html
-filename: learnhtml.html
+filename: learnhtml-ru.html
contributors:
- ["Christophe THOMAS", "https://github.com/WinChris"]
translators:
diff --git a/ru-ru/java-ru.html.markdown b/ru-ru/java-ru.html.markdown
index a1a5cdfc..1aff801c 100644
--- a/ru-ru/java-ru.html.markdown
+++ b/ru-ru/java-ru.html.markdown
@@ -1,12 +1,13 @@
---
language: java
+filename: LearnJava-ru.java
contributors:
- ["Jake Prather", "http://github.com/JakeHP"]
- ["Madison Dickson", "http://github.com/mix3d"]
translators:
- ["Sergey Gaykov", "https://github.com/gaykov"]
-filename: LearnJavaRu.java
lang: ru-ru
+
---
Java - это объектно-ориентированный язык программирования общего назначения,
diff --git a/ru-ru/nim-ru.html.markdown b/ru-ru/nim-ru.html.markdown
new file mode 100644
index 00000000..d05583d7
--- /dev/null
+++ b/ru-ru/nim-ru.html.markdown
@@ -0,0 +1,279 @@
+---
+language: Nim
+filename: learnNim-ru.nim
+contributors:
+ - ["Jason J. Ayala P.", "http://JasonAyala.com"]
+ - ["Dennis Felsing", "http://felsin9.de/nnis/"]
+translators:
+ - ["Nomadic", "https://github.com/n0madic"]
+lang: ru-ru
+---
+
+Nim (ранее известный, как Nimrod) — язык программирования со статической
+типизацией, поддерживающий процедурный, объектно-ориентированный,
+функциональный и обобщённый стили программирования.
+
+Nim эффективный, выразительный и элегантный.
+
+```nim
+var # Объявление (и присваивание) переменных,
+ letter: char = 'n' # с указанием типа или без
+ lang = "N" & "im"
+ nLength : int = len(lang)
+ boat: float
+ truth: bool = false
+
+let # Используйте let *сразу* для объявления и связывания переменных.
+ legs = 400 # legs неизменяемый.
+ arms = 2_000 # Символ _ игнорируется и удобен для длинных чисел.
+ aboutPi = 3.15
+
+const # Константы вычисляются во время компиляции. Это обеспечивает
+ debug = true # производительность и полезно в выражениях этапа компиляции.
+ compileBadCode = false
+
+when compileBadCode: # `when` это `if` этапа компиляции.
+ legs = legs + 1 # Эта ошибка никогда не будет скомпилирована.
+ const input = readline(stdin) # Значения констант должны быть известны во
+ # время компиляции.
+
+discard 1 > 2 # Примечание. Компилятор будет жаловаться, если результат
+ # выражения не используется. `discard` обходит это.
+
+discard """
+Это может использоваться как многострочный комментарий.
+Или для не поддающегося синтаксическому анализу, сломанного кода
+"""
+
+#
+# Структуры данных
+#
+
+# Кортежи
+
+var
+ child: tuple[name: string, age: int] # Кортежи определяют *как* имя поля
+ today: tuple[sun: string, temp: float] # так *и* порядок полей.
+
+child = (name: "Rudiger", age: 2) # Присвоить все сразу литералом ()
+today.sun = "Overcast" # или отдельно по полям.
+today.temp = 70.1
+
+# Последовательности
+
+var
+ drinks: seq[string]
+
+drinks = @["Water", "Juice", "Chocolate"] # @[V1,..,Vn] является литералом
+ # последовательности
+
+drinks.add("Milk")
+
+if "Milk" in drinks:
+ echo "We have Milk and ", drinks.len - 1, " other drinks"
+
+let myDrink = drinks[2]
+
+#
+# Определение типов
+#
+
+# Определение собственных типов позволяет компилятору работать на вас.
+# Это то, что делает статическую типизацию мощной и полезной.
+
+type
+ Name = string # Псевдоним типа дает вам новый тип, который равнозначен
+ Age = int # старому типу, но более нагляден.
+ Person = tuple[name: Name, age: Age] # Определение структур данных.
+ AnotherSyntax = tuple
+ fieldOne: string
+ secondField: int
+
+var
+ john: Person = (name: "John B.", age: 17)
+ newage: int = 18 # Было бы лучше использовать Age, чем int
+
+john.age = newage # Но это все же работает, потому что int и Age синонимы.
+
+type
+ Cash = distinct int # `distinct` делает новый тип несовместимым с его
+ Desc = distinct string # базовым типом.
+
+var
+ money: Cash = 100.Cash # `.Cash` преобразует int в наш тип
+ description: Desc = "Interesting".Desc
+
+when compileBadCode:
+ john.age = money # Error! age is of type int and money is Cash
+ john.name = description # Компилятор говорит: "Нельзя!"
+
+#
+# Дополнительные типы и структуры данных
+#
+
+# Перечисления позволяют типу иметь одно из ограниченного числа значений
+
+type
+ Color = enum cRed, cBlue, cGreen
+ Direction = enum # Альтернативный формат
+ dNorth
+ dWest
+ dEast
+ dSouth
+var
+ orient = dNorth # `orient` имеет тип Direction, со значением `dNorth`
+ pixel = cGreen # `pixel` имеет тип Color, со значением `cGreen`
+
+discard dNorth > dEast # Перечисления обычно являются "порядковыми" типами
+
+# Поддиапазоны определяют ограниченный допустимый диапазон
+
+type
+ DieFaces = range[1..20] # Допустимым значением являются только int от 1 до 20
+var
+ my_roll: DieFaces = 13
+
+when compileBadCode:
+ my_roll = 23 # Error!
+
+# Arrays
+
+type
+ RollCounter = array[DieFaces, int] # Массивы фиксированной длины и
+ DirNames = array[Direction, string] # индексируются любым порядковым типом.
+ Truths = array[42..44, bool]
+var
+ counter: RollCounter
+ directions: DirNames
+ possible: Truths
+
+possible = [false, false, false] # Массивы создаются литералом [V1,..,Vn]
+possible[42] = true
+
+directions[dNorth] = "Ahh. The Great White North!"
+directions[dWest] = "No, don't go there."
+
+my_roll = 13
+counter[my_roll] += 1
+counter[my_roll] += 1
+
+var anotherArray = ["Default index", "starts at", "0"]
+
+# Доступны другие структуры данных, в том числе таблицы, множества,
+# списки, очереди и crit-bit деревья.
+# http://nim-lang.org/docs/lib.html#collections-and-algorithms (EN)
+
+#
+# IO и поток управления выполнением
+#
+
+# `case`, `readLine()`
+
+echo "Read any good books lately?"
+case readLine(stdin)
+of "no", "No":
+ echo "Go to your local library."
+of "yes", "Yes":
+ echo "Carry on, then."
+else:
+ echo "That's great; I assume."
+
+# `while`, `if`, `continue`, `break`
+
+import strutils as str # http://nim-lang.org/docs/strutils.html (EN)
+echo "I'm thinking of a number between 41 and 43. Guess which!"
+let number: int = 42
+var
+ raw_guess: string
+ guess: int
+while guess != number:
+ raw_guess = readLine(stdin)
+ if raw_guess == "": continue # Пропустить эту итерацию
+ guess = str.parseInt(raw_guess)
+ if guess == 1001:
+ echo("AAAAAAGGG!")
+ break
+ elif guess > number:
+ echo("Nope. Too high.")
+ elif guess < number:
+ echo(guess, " is too low")
+ else:
+ echo("Yeeeeeehaw!")
+
+#
+# Итерации (циклы)
+#
+
+for i, elem in ["Yes", "No", "Maybe so"]: # Или просто `for elem in`
+ echo(elem, " is at index: ", i)
+
+for k, v in items(@[(person: "You", power: 100), (person: "Me", power: 9000)]):
+ echo v
+
+let myString = """
+an <example>
+`string` to
+play with
+""" # Многострочная "сырая" строка
+
+for line in splitLines(myString):
+ echo(line)
+
+for i, c in myString: # Индекс и символ. Или `for j in` только для символов
+ if i mod 2 == 0: continue # Компактная форма `if`
+ elif c == 'X': break
+ else: echo(c)
+
+#
+# Процедуры
+#
+
+type Answer = enum aYes, aNo
+
+proc ask(question: string): Answer =
+ echo(question, " (y/n)")
+ while true:
+ case readLine(stdin)
+ of "y", "Y", "yes", "Yes":
+ return Answer.aYes # Перечисления могут быть квалифицированы
+ of "n", "N", "no", "No":
+ return Answer.aNo
+ else: echo("Please be clear: yes or no")
+
+proc addSugar(amount: int = 2) = # Значение поумолчанию 2, ничего не возвращает
+ assert(amount > 0 and amount < 9000, "Crazy Sugar")
+ for a in 1..amount:
+ echo(a, " sugar...")
+
+case ask("Would you like sugar in your tea?")
+of aYes:
+ addSugar(3)
+of aNo:
+ echo "Oh do take a little!"
+ addSugar()
+# Здесь нет необходимости в `else`. Возможны только `yes` и `no`.
+
+#
+# FFI (интерфейс внешних функций)
+#
+
+# Так как Nim компилируется в C, то FFI делается очень просто:
+
+proc strcmp(a, b: cstring): cint {.importc: "strcmp", nodecl.}
+
+let cmp = strcmp("C?", "Easy!")
+```
+
+Кроме того, Nim выделяется среди себе подобных метапрограммированием,
+производительностью, функциями этапа компиляции.
+
+## Дальнейшее чтение (EN)
+
+* [Домашняя страница](http://nim-lang.org)
+* [Скачать](http://nim-lang.org/download.html)
+* [Сообщество](http://nim-lang.org/community.html)
+* [FAQ](http://nim-lang.org/question.html)
+* [Документация](http://nim-lang.org/documentation.html)
+* [Руководство](http://nim-lang.org/docs/manual.html)
+* [Стандартная библиотека](http://nim-lang.org/docs/lib.html)
+* [Rosetta Code](http://rosettacode.org/wiki/Category:Nim)
diff --git a/ru-ru/objective-c-ru.html.markdown b/ru-ru/objective-c-ru.html.markdown
index d60db1d8..3baa15f8 100644
--- a/ru-ru/objective-c-ru.html.markdown
+++ b/ru-ru/objective-c-ru.html.markdown
@@ -781,7 +781,7 @@ MyClass *newVar = [classVar retain]; // Если classVar освободится
// автоматический подсчет ссылок (ARC).
// ARC - это особенность компилятора, который помещает "retain", "release"
// и "autorelease" автоматически за вас тогда, когда используется ARC,
-// вам не нужно больше обращаться к "retain", "relase" или "autorelease"
+// вам не нужно больше обращаться к "retain", "release" или "autorelease"
MyClass *arcMyClass = [[MyClass alloc] init];
// ... код, использующий объект arcMyClass
// Без ARC, вам нужно было бы вызвать: [arcMyClass release] после того, как вы
diff --git a/ru-ru/php-ru.html.markdown b/ru-ru/php-ru.html.markdown
index 181368de..014ff5d0 100644
--- a/ru-ru/php-ru.html.markdown
+++ b/ru-ru/php-ru.html.markdown
@@ -128,7 +128,7 @@ define("FOO", "something");
// Доступ к константе возможен через прямое указание её имени без знака $
echo FOO; // печатает 'something'
-echo 'This outputs ' . FOO; // печатает 'This ouputs something'
+echo 'This outputs ' . FOO; // печатает 'This outputs something'
/********************************
* Массивы
@@ -687,45 +687,6 @@ use My\Namespace as SomeOtherNamespace;
$cls = new SomeOtherNamespace\MyClass();
-*//**********************
-* Позднее статическое связывание.
-*
-*/
-
-class ParentClass
-{
- public static function who()
- {
- echo "I'm a " . __CLASS__ . "\n";
- }
-
- public static function test()
- {
- // self ссылается на класс в котором определен метод.
- self::who();
- // static ссылается на класс в котором метод вызван.
- static::who();
- }
-}
-
-ParentClass::test();
-/*
-I'm a ParentClass
-I'm a ParentClass
-*/
-
-class ChildClass extends ParentClass
-{
- public static function who()
- {
- echo "But I'm " . __CLASS__ . "\n";
- }
-}
-
-ChildClass::test();
-/*
-I'm a ParentClass
-But I'm ChildClass
/**********************
* Позднее статическое связывание.
diff --git a/ruby-ecosystem.html.markdown b/ruby-ecosystem.html.markdown
index 1fbcc752..50eedcd0 100644
--- a/ruby-ecosystem.html.markdown
+++ b/ruby-ecosystem.html.markdown
@@ -88,7 +88,7 @@ implementation.
to have stopped since Microsoft pulled their support.
Ruby implementations may have their own release version numbers, but they always
-target a specific version of MRI for compatability. Many implementations have
+target a specific version of MRI for compatibility. Many implementations have
the ability to enter different modes (for example, 1.8 or 1.9 mode) to specify
which MRI version to target.
diff --git a/ruby.html.markdown b/ruby.html.markdown
index a1532855..e0a6bb6e 100644
--- a/ruby.html.markdown
+++ b/ruby.html.markdown
@@ -359,13 +359,13 @@ ensure
puts 'This code always runs no matter what'
end
-# Functions
+# Methods
def double(x)
x * 2
end
-# Functions (and all blocks) implicitly return the value of the last statement
+# Methods (and all blocks) implicitly return the value of the last statement
double(2) #=> 4
# Parentheses are optional where the result is unambiguous
@@ -399,7 +399,7 @@ surround { puts 'hello world' }
# }
-# You can pass a block to a function
+# You can pass a block to a method
# "&" marks a reference to a passed block
def guests(&block)
block.call 'some_argument'
diff --git a/rust-pt.html.markdown b/rust-pt.html.markdown
index 79f69269..8134d3c5 100644
--- a/rust-pt.html.markdown
+++ b/rust-pt.html.markdown
@@ -3,8 +3,8 @@ language: rust
filename: rust-pt.rs
contributors:
- ["Paulo Henrique Rodrigues Pinheiro", "https://about.me/paulohrpinheiro"]
-filename: learnrust.rs
lang: pt-br
+
---
Rust é uma linguagem de programação desenvolvida pelo Mozilla Research. Rust
diff --git a/scala.html.markdown b/scala.html.markdown
index 5eb94986..78053b40 100644
--- a/scala.html.markdown
+++ b/scala.html.markdown
@@ -460,8 +460,52 @@ val otherGeorge = george.copy(phoneNumber = "9876")
// And many others. Case classes also get pattern matching for free, see below.
+// Traits
+// Similar to Java interfaces, traits define an object type and method
+// signatures. Scala allows partial implementation of those methods.
+// Constructor parameters are not allowed. Traits can inherit from other
+// traits or classes without parameters.
+
+trait Dog {
+ def breed: String
+ def color: String
+ def bark: Boolean = true
+ def bite: Boolean
+}
+class SaintBernard extends Dog {
+ val breed = "Saint Bernard"
+ val color = "brown"
+ def bite = false
+}
+
+scala> b
+res0: SaintBernard = SaintBernard@3e57cd70
+scala> b.breed
+res1: String = Saint Bernard
+scala> b.bark
+res2: Boolean = true
+scala> b.bite
+res3: Boolean = false
+
+// A trait can also be used as Mixin. The class "extends" the first trait,
+// but the keyword "with" can add additional traits.
+
+trait Bark {
+ def bark: String = "Woof"
+}
+trait Dog {
+ def breed: String
+ def color: String
+}
+class SaintBernard extends Dog with Bark {
+ val breed = "Saint Bernard"
+ val color = "brown"
+}
-// Traits coming soon!
+scala> val b = new SaintBernard
+b: SaintBernard = SaintBernard@7b69c6ba
+scala> b.bark
+res0: String = Woof
/////////////////////////////////////////////////
diff --git a/shutit.html.markdown b/shutit.html.markdown
index d16290b3..67d7a4b5 100644
--- a/shutit.html.markdown
+++ b/shutit.html.markdown
@@ -10,7 +10,7 @@ filename: learnshutit.html
ShutIt is an shell automation framework designed to be easy to use.
-It is a wrapper around a python-based expect clone (pexpect).
+It is a wrapper around a Python-based expect clone (pexpect).
You can look at it as 'expect without the pain'.
@@ -167,8 +167,8 @@ session2.logout()
Here you use the 'send\_and\_get\_output' method to retrieve the output of the
capacity command (df).
-There are much more elegant ways to do the above (eg have a dictionary of the
-servers to iterate over), but it's up to you how clever you need the python to
+There are much more elegant ways to do the above (e.g. have a dictionary of the
+servers to iterate over), but it's up to you how clever you need the Python to
be.
@@ -300,7 +300,7 @@ over a minute to complete (using the 'wait' method).
Again, this is trivial, but imagine you have hundreds of servers to manage like
this and you can see the power it can bring in a few lines of code and one
-python import.
+Python import.
## Learn More
diff --git a/smalltalk.html.markdown b/smalltalk.html.markdown
index cc7ab84c..fd40afe9 100644
--- a/smalltalk.html.markdown
+++ b/smalltalk.html.markdown
@@ -1,5 +1,6 @@
---
language: smalltalk
+filename: smalltalk.st
contributors:
- ["Jigyasa Grover", "https://github.com/jig08"]
---
@@ -907,7 +908,7 @@ b := String isWords. true if index instan
Object withAllSubclasses size. "get total number of class entries"
```
-## Debuging:
+## Debugging:
```
| a b x |
x yourself. "returns receiver"
diff --git a/solidity.html.markdown b/solidity.html.markdown
index 602d74f0..fc54d6e4 100644
--- a/solidity.html.markdown
+++ b/solidity.html.markdown
@@ -37,6 +37,9 @@ features are typically marked, and subject to change. Pull requests welcome.
// simple_bank.sol (note .sol extension)
/* **** START EXAMPLE **** */
+// Declare the source file compiler version.
+pragma solidity ^0.4.2;
+
// Start with Natspec comment (the three slashes)
// used for documentation - and as descriptive data for UI elements/actions
@@ -188,7 +191,7 @@ string n = "hello"; // stored in UTF8, note double quotes, not single
// string utility functions to be added in future
// prefer bytes32/bytes, as UTF8 uses more storage
-// Type inferrence
+// Type inference
// var does inferred typing based on first assignment,
// can't be used in functions parameters
var a = true;
@@ -484,7 +487,7 @@ contract MyContract is abc, def("a custom argument to def") {
function z() {
if (msg.sender == owner) {
def.z(); // call overridden function from def
- super.z(); // call immediate parent overriden function
+ super.z(); // call immediate parent overridden function
}
}
}
@@ -804,7 +807,7 @@ someContractAddress.callcode('function_name');
// else should be placed on own line
-// 14. NATSPEC COMENTS
+// 14. NATSPEC COMMENTS
// used for documentation, commenting, and external UIs
// Contract natspec - always above contract definition
diff --git a/standard-ml.html.markdown b/standard-ml.html.markdown
index c9eb2a2e..e1fe0d19 100644
--- a/standard-ml.html.markdown
+++ b/standard-ml.html.markdown
@@ -1,5 +1,6 @@
---
language: "Standard ML"
+filename: standardml.sml
contributors:
- ["Simon Shine", "http://shine.eu.org/"]
- ["David Pedersen", "http://lonelyproton.com/"]
@@ -351,7 +352,10 @@ val _ = print (say(Red) ^ "\n")
fun say Red = "You are red!"
| say Green = "You are green!"
| say Blue = "You are blue!"
- | say _ = raise Fail "Unknown color"
+
+(* We did not include the match arm `say _ = raise Fail "Unknown color"`
+because after specifying all three colors, the pattern is exhaustive
+and redundancy is not permitted in pattern matching *)
(* Here is a binary tree datatype *)
@@ -385,7 +389,7 @@ fun calculate_interest(n) = if n < 0.0
(* Exceptions can be caught using "handle" *)
val balance = calculate_interest ~180.0
- handle Domain => ~180.0 (* x now has the value ~180.0 *)
+ handle Domain => ~180.0 (* balance now has the value ~180.0 *)
(* Some exceptions carry extra information with them *)
(* Here are some examples of built-in exceptions *)
@@ -395,7 +399,7 @@ fun failing_function [] = raise Empty (* used for empty lists *)
| failing_function xs = raise Fail "This list is too long!"
(* We can pattern match in 'handle' to make sure
- a specfic exception was raised, or grab the message *)
+ a specific exception was raised, or grab the message *)
val err_msg = failing_function [1,2] handle Fail _ => "Fail was raised"
| Domain => "Domain was raised"
| Empty => "Empty was raised"
diff --git a/sv-se/brainfuck-sv.html.markdown b/sv-se/brainfuck-sv.html.markdown
index e9fbc436..57520955 100644
--- a/sv-se/brainfuck-sv.html.markdown
+++ b/sv-se/brainfuck-sv.html.markdown
@@ -1,5 +1,6 @@
---
language: brainfuck
+filename: brainfuck-sv.bf
contributors:
- ["Prajit Ramachandran", "http://prajitr.github.io/"]
- ["Mathias Bynens", "http://mathiasbynens.be/"]
diff --git a/swift.html.markdown b/swift.html.markdown
index c17510b6..60915d72 100644
--- a/swift.html.markdown
+++ b/swift.html.markdown
@@ -281,7 +281,7 @@ testGuard()
// Variadic Args
func setup(numbers: Int...) {
- // its an array
+ // it's an array
let _ = numbers[0]
let _ = numbers.count
}
diff --git a/ta_in/json-ta.html.markdown b/ta_in/json-ta.html.markdown
index d85e0d82..7f6559fa 100644
--- a/ta_in/json-ta.html.markdown
+++ b/ta_in/json-ta.html.markdown
@@ -1,6 +1,6 @@
---
language: json
-filename: learnjson.json
+filename: learnjson-ta.json
contributors:
- ["Anna Harren", "https://github.com/iirelu"]
- ["Marco Scannadinari", "https://github.com/marcoms"]
diff --git a/tcl.html.markdown b/tcl.html.markdown
index 1f4ca63b..40d9111a 100644
--- a/tcl.html.markdown
+++ b/tcl.html.markdown
@@ -49,7 +49,7 @@ discipline of exposing all programmatic functionality as routines, including
things like looping and mathematical operations that are usually baked into the
syntax of other languages, allows it to fade into the background of whatever
domain-specific functionality a project needs. Its syntax, which is even
-lighter that that of Lisp, just gets out of the way.
+lighter than that of Lisp, just gets out of the way.
@@ -75,7 +75,7 @@ lighter that that of Lisp, just gets out of the way.
## 2. Syntax
###############################################################################
-# A script is made up of commands delimited by newlines or semiclons. Each
+# A script is made up of commands delimited by newlines or semicolons. Each
# command is a call to a routine. The first word is the name of a routine to
# call, and subsequent words are arguments to the routine. Words are delimited
# by whitespace. Since each argument is a word in the command it is already a
@@ -99,13 +99,13 @@ set greeting $part1$part2[set part3]
# An embedded script may be composed of multiple commands, the last of which provides
-# the result for the substtution:
+# the result for the substitution:
set greeting $greeting[
incr i
incr i
incr i
]
-puts $greeting ;# The output is "Salutations3"
+puts $greeting ;# The output is "Salutations3"
# Every word in a command is a string, including the name of the routine, so
# substitutions can be used on it as well. Given this variable
@@ -377,7 +377,7 @@ set amount [lindex $amounts 1]
set inventory {"item 1" item\ 2 {item 3}}
-# It's generally a better idea to use list routines when modifing lists:
+# It's generally a better idea to use list routines when modifying lists:
lappend inventory {item 1} {item 2} {item 3}
@@ -422,8 +422,7 @@ eval {set name Neo}
eval [list set greeting "Hello, $name"]
-# Therefore, when using "eval", , use "list" to build
-# up the desired command:
+# Therefore, when using "eval", use "list" to build up the desired command:
set command {set name}
lappend command {Archibald Sorbisol}
eval $command
@@ -517,7 +516,7 @@ proc while {condition script} {
# and then calls that routine. "yield" suspends evaluation in that stack and
# returns control to the calling stack:
proc countdown count {
- # send something back to the creater of the coroutine, effectively pausing
+ # send something back to the creator of the coroutine, effectively pausing
# this call stack for the time being.
yield [info coroutine]
diff --git a/tcsh.html.markdown b/tcsh.html.markdown
new file mode 100644
index 00000000..80411ea6
--- /dev/null
+++ b/tcsh.html.markdown
@@ -0,0 +1,790 @@
+---
+language: tcsh
+filename: LearnTCSH.csh
+contributors:
+ - ["Nicholas Christopoulos", "https://github.com/nereusx"]
+
+---
+tcsh ("tee-see-shell") is a Unix shell based on and compatible with the C shell (csh).
+It is essentially the C shell with programmable command-line completion, command-line editing,
+and a few other features.
+It is the native root shell for BSD-based systems such as FreeBSD.
+
+Almost all Linux distros and BSD today use tcsh instead of the original csh. In
+most cases csh is a symbolic link that points to tcsh.
+This is because tcsh is backward compatible with csh, and the last
+is not maintained anymore.
+
+- [TCSH Home](http://www.tcsh.org/)
+- [TCSH Wikipedia](https://en.wikipedia.org/wiki/Tcsh)
+- [TCSH manual page](http://www.tcsh.org/tcsh.html/top.html)
+- [“An Introduction to the C shell”, William Joy](https://docs.freebsd.org/44doc/usd/04.csh/paper.html)
+- [TCSH Bug reports and/or features requests](https://bugs.gw.com/)
+
+Some more files:
+[tcsh help command (for 132x35 terminal size)](https://github.com/nereusx/dotfiles/blob/master/csh-help),
+[my ~/.tcshrc](https://github.com/nereusx/dotfiles/blob/master/.tcshrc)
+
+```tcsh
+#!/bin/tcsh
+# First line of the script is shebang which tells the system how to execute the
+# script: http://en.wikipedia.org/wiki/Shebang_(Unix)
+# TCSH emulates the shebang on systems which don't understand it.
+
+# In most cases you'll use `#!/bin/tcsh -f', because `-f' option does not load
+# any resource or start-up files, or perform any command hashing, and thus
+# starts faster.
+
+# --- the echo command --------------------------------------------------------
+# The `echo' writes each word to the shell's standard output, separated by
+# spaces and terminated with a newline. The echo_style shell variable may be
+# set to emulate (or not) the flags and escape sequences.
+
+# Display the value of echo_style
+echo $echo_style
+
+# Enable `echo' to support backslashed characters and `-n' option (no new line)
+# This is the default for tcsh, but your distro may change it. Slackware has
+# done so.
+set echo_style = both
+
+# Prints "Hello world"
+echo Hello world
+echo "Hello world"
+echo 'Hello world'
+echo `echo Hello world`
+
+# This prints "twonlines" in one line
+echo two\nlines
+
+# Prints the two lines
+echo "two\nlines"
+echo 'two\nlines'
+
+# --- Basic Syntax ------------------------------------------------------------
+
+# A special character (including a blank or tab) may be prevented from having
+# its special meaning by preceding it with a backslash `\'.
+# this will display the last history commands
+echo !!
+# this will not
+echo \!\!
+
+# Single quotes prevents expanding special characters too, but some
+# characters like `!' and backslash have higher priority
+# `$' (variable value) will not expands
+echo '$1 tip'
+# `!' (history) will expands
+echo '!!'
+
+# Strings enclosed by back-quotes will be executed and replaced by the result.
+echo `ls`
+
+# Semi-colon separate commands
+echo 'first line'; echo 'second line'
+
+# There is also conditional execution
+echo "Always executed" || echo "Only executed if first command fails"
+echo "Always executed" && echo "Only executed if first command does NOT fail"
+
+# Parenthesised commands are always executed in a subshell,
+
+# example: create a project and then informs you that it finished while
+# it does the installation.
+make && ( espeak "BOSS, compilation finished"; make install )
+
+# prints the home directory but leaving you where you were
+(cd; pwd); pwd
+
+# Read tcsh man-page documentation
+man tcsh
+
+# --- Variables ---------------------------------------------------------------
+# The shell maintains a list of variables, each of which has as value a list of
+# zero or more words. The values of shell variables can be displayed and
+# changed with the `set' and `unset' commands.
+# The system maintains its own list of ``environment'' variables.
+# These can be displayed and changed with `printenv', `setenv' and `unsetenv'.
+# The syntax of setenv is similar to POSIX sh.
+
+# Assign a value or nothing will create a variable
+# Assign nothing
+set var
+# Assign a numeric value
+# the '@' denotes the expression is arithmetic; it works similar to 'set' but
+# the right value can be a numeric expression.
+@ var = 1 + 2
+# Assign a string value
+set var = "Hello, I am the contents of 'var' variable"
+# Assign the output of a program
+set var = `ls`
+
+# Remove a variable
+unset var
+# Prints 1 (true) if the variable `var' exists otherwise prints 0 (false)
+echo $?var
+# Print all variables and their values
+set
+
+# Prints the contents of 'var'
+echo $var;
+echo "$var";
+# Prints the string `$var'
+echo \$var
+echo '$var'
+# braces can be used to separate variable from the rest when its needed
+set num = 12; echo "There ${num}th element"
+
+# Prints the number of characters of the value: 6
+set var = '123456'; echo $%var
+
+### LISTs
+# Assign a list of values
+set var = ( one two three four five )
+# Print all the elements: one two three four five
+echo $var
+echo $var[*]
+# Print the count of elements: 5
+echo $#var
+# Print indexed element; prints the second element: two
+echo $var[2]
+# Print range of elements; prints 2nd up to 3rd: two, three
+echo $var[2-3]
+# Prints all elements starting from the 3rd: three four five
+echo $var[3-]
+# Prints print all up to 3rd element: one two three
+echo $var[-3]
+
+### Special Variables
+# $argv list of command-line arguments
+# $argv[0] this file-name (the file of the script file)
+# $# $0, $n, $* are the same as $#argv, $argv[0], $argv[n], $argv[*]
+# $status, $? the exit code of the last command that executed
+# $_ the previous command line
+# $! the PID of the last background process started by this shell
+# $$ script's PID
+
+# $path, $PATH the list of directories that will search for executable to run
+# $home, $HOME user's home directory, also the `~' can be used instead
+# $uid user's login ID
+# $user user's login name
+# $gid the user's group ID
+# $group the user's group-name
+# $cwd, $PWD the Current/Print Working Directory
+# $owd the previous working directory
+# $tcsh tcsh version
+# $tty the current tty; ttyN for linux console, pts/N for terminal
+# emulators under X
+# $term the terminal type
+# $verbose if set, causes the words of each command to be printed.
+# can be set by the `-v' command line option too.
+# $loginsh if set, it is a login shell
+
+# TIP: $?0 is always false in interactive shells
+# TIP: $?prompt is always false in non-interactive shells
+# TIP: if `$?tcsh' is unset; you run the original `csh' or something else;
+# try `echo $shell'
+# TIP: $verbose this is useful to debugging scripts
+# NOTE: $PWD and $PATH are synchronised with $cwd and $pwd automatically.
+
+# --- Variable modifiers ------------------------------------------------------
+# Syntax: ${var}:m[:mN]
+# Where <m> is:
+# h : the directory t : the filenane r : remove extension e : the extension
+# u : uppercase the first lowercase letter
+# l : lowercase the first uppercase letter
+# p : print but do not execute it (hist)
+# q : quote the substituted words, preventing further substitutions
+# x : like q, but break into words at white spaces
+# g : apply the following modifier once to each word
+# a : apply the following modifier as many times as possible to single word
+# s/l/r/ : search for `l' and replace with `r', not regex; the `&' in the r is
+# replaced by l
+# & : Repeat the previous substitution
+
+# start with this file
+set f = ~/Documents/Alpha/beta.txt
+# prints ~/Documents/Alpha/beta
+echo $f:r
+# prints ~/Documents/Alpha
+echo $f:h
+# prints beta.txt
+echo $f:t
+# prints txt
+echo $f:e
+# prints beta
+echo $f:t:r
+# prints Beta
+echo $f:t:r:u
+# prints Biota
+echo $f:t:r:u:s/eta/iota/
+
+# --- Redirection -------------------------------------------------------------
+
+# Create file.txt and write the standard output to it
+echo 'this string' > file.txt
+# Create file.txt and write the standard output and standard error to it
+echo 'this string' >& file.txt
+# Append the standard output to file.txt
+echo 'this string' >> file.txt
+# Append the standard output and standard error to file.txt
+echo 'this string' >>& file.txt
+# Redirect the standard input from file.txt
+cat < file.txt
+# Input from keyboard; this stores the input line to variable `x'
+set x = $<
+# Document here;
+cat << LABEL
+...text here...
+LABEL
+
+# TIP: this is how to get standard error separated:
+(grep 'AGP' /usr/src/linux/Documentation/* > output-file.txt) >& error-file.txt
+
+# example: read a name from standard input and display a greetings message
+echo -n "Enter your name? "
+set name = $<
+echo "Greetings $name"
+
+# --- Expressions ------------------------------------------------------------
+
+# Operators:
+# == equal != not equal ! not
+# > greater than < less than >= greater or equal <= less or equal
+# && logical AND || logical OR
+
+if ( $name != $user ) then
+ echo "Your name isn't your username"
+else
+ echo "Your name is your username"
+endif
+
+# single-line form
+if ( $name != $user ) echo "Your name isn't your username"
+
+# NOTE: if $name is empty, tcsh sees the above condition as:
+# if ( != $user ) ...
+# which is invalid syntax
+# so the "safe" way to use potentially empty variables in tcsh is:
+# if ( "$name" != $user ) ...
+# which, when $name is empty, is seen by tcsh as:
+# if ( "" != $user ) ...
+# which works as expected
+
+# There is also conditional execution
+echo "Always executed" || echo "Only executed if first command fails"
+echo "Always executed" && echo "Only executed if first command does NOT fail"
+
+# To use && and || with if statements, you don't need multiple pairs of
+# square brackets:
+if ( "$name" == "Steve" && "$age" == 15 ) then
+ echo "This will run if $name is Steve AND $age is 15."
+endif
+
+if ( "$name" == "Daniya" || "$name" == "Zach" ) then
+ echo "This will run if $name is Daniya OR Zach."
+endif
+
+# String matching operators ( `=~' and `!~' )
+# The ‘==’ ‘!=’ ‘=~’ and ‘!~’ operators compare their arguments as strings;
+# all others operate on numbers. The operators ‘=~’ and ‘!~’ are like ‘!=’
+# and ‘==’ except that the right hand side is a glob-pattern against which
+# the left hand operand is matched.
+
+if ( $user =~ ni[ck]* ) echo "Greetings Mr. Nicholas."
+if ( $user !~ ni[ck]* ) echo "Hey, get out of Nicholas PC."
+
+# Arithmetic expressions are denoted with the following format:
+@ result = 10 + 5
+echo $result
+
+# Arithmetic Operators
+# +, -, *, /, %
+#
+# Arithmetic Operators which must be parenthesised
+# !, ~, |, &, ^, ~, <<, >>,
+# Compare and logical operators
+#
+# All operators are same as in C.
+
+# It is non so well documented that numeric expressions require spaces
+# in-between; Also, `@' has its own parser, it seems that work well when the
+# expression is parenthesised otherwise the primary parser seems it is active.
+# Parenthesis require spaces around, this is documented.
+
+# wrong
+@ x = $y+1
+@ x = 0644 & 022; echo $x
+@ x = (0644 & 022) +1; echo $x
+@ x = (0644 & 022)+ 1; echo $x
+@ x = ( ~077 ); echo $x
+
+# correct
+@ x = $y + 1
+@ x = ( 0644 & 022 ) + 1; echo $x
+@ x = ( ~ 077 ); echo $x
+@ x = ( ~ 077 | 022 ); echo $x
+@ x = ( ! 0 ); echo $x
+
+# C's operators ++ and -- are supported if there is not assignment
+@ result ++
+
+# None shell created to do mathematics;
+# Except for the basic operations, use an external command with backslashes.
+#
+# I suggest the calc as the best option.
+# (http://www.isthe.com/chongo/tech/comp/calc/)
+#
+# The standard Unix's bc as second option
+# (https://www.gnu.org/software/bc/manual/html_mono/bc.html)
+#
+# The standard Unix's AWK as third option
+# (https://www.gnu.org/software/gawk/manual/gawk.html)
+
+# You can also use `perl', `php' or even several BASICs, but prefer the
+# above utilities for faster load-and-run results.
+
+# real example: (that I answer in StackExchange)
+# REQ: x := 1001b OR 0110b
+
+# in `tcsh' expression (by using octal)
+@ x = ( 011 | 06 ); echo $x
+
+# the same by using `calc' (and using binary as the original req)
+set x = `calc '0b1001 | 0b110'`; echo $x
+
+# --- File Inquiry Operators --------------------------------------------------
+# NOTE: The builtin `filetest' command do the same thing.
+
+#### Boolean operators
+# -r read access -w write access -x execute access -e existence
+# -f plain file -d directory -l symbolic link -p named pipe
+# -S socket file
+# -o ownership -z zero size -s non-zero size
+# -u SUID is set -g SGID is set -k sticky is set
+# -b block device -c char device
+# -t file (digit) is an open file descriptor for a terminal device
+
+# if the file `README' exists, displays a message
+if ( -e README ) echo "I have already README file"
+
+# if the `less' program is installed, use this instead of `more'
+if ( -e `where less` ) then
+ alias more 'less'
+endif
+
+#### Non-boolean operators
+# -Z returns the file size in bytes
+# -M returns the modification time (mtime) -M: returns mtime string
+# -A returns the lass access time (atime) -A: returns atime string
+# -U returns the owners user ID -U: returns the owners user-name
+# -G returns the group ID -G: returns the group-name
+# -P returns the permissions as octal number -Pmode returns perm. AND mode
+
+# this will display the date as Unix-time integer: 1498511486
+filetest -M README.md
+
+# This will display "Tue Jun 27 00:11:26 2017"
+filetest -M: README.md
+
+# --- Basic Commands ----------------------------------------------------------
+
+# Navigate though file system with `chdir' (cd)
+cd path # change working directory
+cd # change to home directory
+cd - # change to previous directory
+cd .. # go up one directory
+
+# Examples:
+cd ~/Downloads # go to my `Downloads' directory
+
+# Use `mkdir` to create new directories.
+mkdir newdir
+# The `-p` flag causes new intermediate directories to be created as necessary.
+mkdir -p ~/.backup/saves
+
+# which & where
+# find if csh points to tcsh
+ls -lha `which csh`
+# find if csh is installed on more than one directory
+where csh
+
+# --- Pipe-lines --------------------------------------------------------------
+# A pipeline is a sequence of processes chained together by their standard
+# streams, so that the output of each process (stdout) feeds directly as input
+# (stdin) to the next one. This `pipes' are created with the `|' special
+# character and it is one of the most powerful characteristics of Unix.
+
+# example:
+ls -l | grep key | less
+# "ls -l" produces a process, the output (stdout) of which is piped to the
+# input (stdin) of the process for "grep key"; and likewise for the process
+# for "less".
+
+# the `ls', the `grep' and the `less' are programs of Unix and they have their
+# own man-page. The `pipe' mechanism is part of the kernel but the syntax
+# and the control is job of the shell, the tcsh in our case.
+
+# NOTE: `pipe' mechanism has Windows too, but it is buggy and I sign it for all
+# versions until Windows XP SP3 API32 which was the last one that I worked on.
+# Microsoft still denied it but is well known bug since it is a common method
+# for inter-process communication. For small I/O it will work well.
+# tcsh, along with grep, gcc and perl is one of the first Unix programs that
+# ported to DOS (with EMX DOS extender) and later to Windows (1998).
+
+# example: this will convert tcsh to PostScript and will show it with okular
+zcat /usr/man/man1/tcsh.1.gz | groff -Tps -man | okular -
+
+# a better version
+zcat `locate -b -n 1 '\tcsh.1.gz'` | groff -Tps -man | okular -
+
+# even better
+set page = tcsh; set loc = (locate -b -n 1 "\\\\"${page}".1.gz");
+ zcat `eval $loc` | groff -Tps -man | okular -
+
+# the same, modified to create man page pdf
+set page = tcsh; set loc = (locate -b -n 1 "\\\\"${page}".1.gz");
+ zcat `eval $loc` | groff -Tps -man | ps2pdf - ${page}.pdf
+
+# the same, but now shows the ${page}.pdf too
+set page = tcsh; set loc = (locate -b -n 1 "\\\\"${page}".1.gz");
+ zcat `eval $loc` | groff -Tps -man | ps2pdf - ${page}.pdf && okular tcsh.pdf
+
+# NOTE: `okular' is the default application of KDE environment and it shows
+# postcript and pdf files. You can replace it with your lovely pdf viewer.
+# zcat, locate, groff, are common programs in all Unices. `ps2pdf' program
+# is part of `ghostscript' package that is widely used.
+
+# --- Control Flow ------------------------------------------------------------
+
+#### IF-THEN-ELSE-ENDIF
+# Syntax:
+# if ( expr ) then
+# ...
+# [else if ( expr2 ) then
+# ...]
+# [else
+# ...]
+# endif
+#
+# If the specified expr is true then the commands to the first else are
+# executed; otherwise if expr2 is true then the commands to the second else
+# are executed, etc.
+# Any number of else-if pairs are possible; only one endif is needed.
+#
+# Single-line form:
+#
+# if ( expr ) command
+#
+# If `expr' evaluates true, then command is executed.
+# `command' must be a simple command, not an alias, a pipeline, a command list
+# or a parenthesized command list. With few words, avoid to use it.
+#
+# BUG: Input/output redirection occurs even if expr is false and command is
+# thus not executed.
+#
+
+# check if we are in non-interactive shell and quit if true
+if ( $?USER == 0 || $?prompt == 0 ) exit
+
+# check if we are a login shell
+if ( $?loginsh ) then
+ # check if you are on linux console (not X's terminal)
+ if ( $tty =~ tty* ) then
+ # enable keypad application keys (man console_codes)
+ echo '\033='
+ endif
+endif
+
+#### SWITCH-ENDSW
+# Syntax:
+# switch ( expr )
+# case pattern:
+# ...
+# [breaksw]
+# [default:
+# ...]
+# endsw
+#
+# tcsh uses a case statement that works similarly to switch in C.
+# Each case label is successively matched, against the specified string which
+# is first command and filename expanded. The file metacharacters `*', `?'
+# and `[...]' may be used in the case labels. If none of the labels match the
+# execution begins after the default label if its defined.
+# The command `breaksw' causes execution to continue after the endsw. Otherwise
+# control may fall through case labels and default labels as in C.
+
+switch ( $var )
+case *.[1-9]:
+case *.[1-9].gz:
+ echo "$var is a man-page."
+ breaksw
+case *gz:
+ echo "$var is gzipped"
+ breaksw
+default:
+ file $var
+endsw
+
+#### FOREACH-END
+# Syntax:
+# foreach name ( wordlist )
+# ...
+# [break | continue]
+# end
+#
+# Successively sets the variable `name' to each member of `wordlist' and
+# executes the sequence of commands between this command and the matching
+# `end' keyword. The `continue' keyword jump to the next element back to
+# top; and the `break' keyword terminates the loop.
+#
+# BUG: `foreach' doesn't ignore here documents when looking for its end.
+
+# example: counting 1 to 10
+foreach i ( `seq 1 10` )
+ echo $i
+end
+
+# example: type all files in the list
+foreach f ( a.txt b.txt c.txt )
+ cat $f
+end
+
+# example: convert wma to ogg
+foreach f ( *.wma )
+ ffmpeg -i "$f" "$f:r".ogg
+end
+
+#### WHILE-END
+# while ( expr )
+# ...
+# [break | continue]
+# end
+#
+# Executes the commands between the `while' and the matching `end' while `expr'
+# evaluates non-zero. `break' and `continue' may be used to terminate or
+# continue the loop prematurely.
+
+# count from 1 to 10
+set num = 1
+while ( $num <= 10 )
+ echo $num
+ @ num ++
+end
+
+# print all directories of CWD
+set lst = ( * )
+while ( $#lst )
+ if ( -d $lst[1] ) echo $lst[1] is directory
+ shift lst
+end
+
+# separate command-line arguments to options or parameters
+set options
+set params
+set lst = ( $* )
+while ( $#lst )
+ if ( "$lst[1]" =~ '-*' ) then
+ set options = ( $options $lst[1] )
+ else
+ set params = ( $params $lst[1] )
+ endif
+ shift lst
+end
+echo 'options =' $options
+echo 'parameters =' $params
+
+#### REPEAT
+# Syntax: repeat count command
+#
+# The specified command, which is subject to the same restrictions as the
+# command in the one line if statement above, is executed count times.
+# I/O redirections occur exactly once, even if count is 0.
+#
+# TIP: in most cases prefer `while'
+
+repeat 3 echo "ding dong"
+
+# --- Functions ---------------------------------------------------------------
+# tcsh has no functions but its expression syntax is advanced enough to use
+# `alias' as functions. Another method is recursion
+
+# Alias argument selectors; the ability to define an alias to take arguments
+# supplied to it and apply them to the commands that it refers to.
+# Tcsh is the only shell that provides this feature.
+#
+# \!# argument selector for all arguments, including the alias/command
+# itself; arguments need not be supplied.
+# \!* argument selector for all arguments, excluding the alias/command;
+# arguments need not be supplied.
+# \!$ argument selector for the last argument; argument need not be supplied,
+# but if none is supplied, the alias name is considered to be the
+# last argument.
+# \!^ argument selector for first argument; argument MUST be supplied.
+# \!:n argument selector for the nth argument; argument MUST be supplied;
+# n=0 refers to the alias/command name.
+# \!:m-n argument selector for the arguments from the mth to the nth;
+# arguments MUST be supplied.
+# \!:n-$ argument selector for the arguments from the nth to the last;
+# at least argument n MUST be supplied.
+
+# Alias the cd command so that when you change directories, the contents
+# are immediately displayed.
+alias cd 'cd \!* && ls'
+
+# --- Recursion method --- begin ---
+#!/bin/tcsh -f
+set todo = option1
+if ( $#argv > 0 ) then
+ set todo = $argv[1]
+endif
+
+switch ( $todo )
+case option1:
+# ...
+ $0 results
+ breaksw
+case option2:
+# ...
+ $0 results
+ breaksw
+case results:
+ echo "print the results here"
+# ...
+ breaksw
+default:
+ echo "Unknown option: $todo"
+# exit 0
+endsw
+# --- Recursion method --- end ---
+
+# --- examples ----------------------------------------------------------------
+
+# this script prints available power-states if no argument is set;
+# otherwise it set the state of the $argv[1]
+# --- power-state script --- begin --------------------------------------------
+#!/bin/tcsh -f
+# get parameter ("help" for none)
+set todo = help
+if ( $#argv > 0 ) then
+ set todo = $argv[1]
+endif
+# available options
+set opts = `cat /sys/power/state`
+# is known?
+foreach o ( $opts )
+ if ( $todo == $o ) then
+ # found; execute it
+ echo -n $todo > /sys/power/state
+ break
+ endif
+end
+# print help and exit
+echo "usage: $0 [option]"
+echo "available options on kernel: $opts"
+# --- power-state script --- end ----------------------------------------------
+
+# Guess the secret number game
+# --- secretnum.csh --- begin -------------------------------------------------
+#!/bin/tcsh -f
+set secret=`shuf -i1-100 -n1`
+echo "I have a secret number from 1 up to 100"
+while ( 1 )
+ echo -n "Guess: "
+ set guess = $<
+ if ( $secret == $guess ) then
+ echo "You found it"
+ exit 1
+ else
+ if ( $secret > $guess ) then
+ echo "its greater"
+ else if ( $secret < $guess ) then
+ echo "its lesser"
+ endif
+ endif
+ endif
+end
+# --- secretnum.csh --- end ---------------------------------------------------
+
+# -----------------------------------------------------------------------------
+# Appendices
+
+#### About [T]CSH:
+# * CSH is notorious about its bugs;
+# * It was also famous about its advanced interactive mode.
+# * TCSH is famous that have the most advanced completition subsystem.
+# * TCSH is famous that have the most advanced aliases subsystem; aliases
+# can take parameters and often used as functions!
+# * TCSH is well known that preferred by people (me too) because of better
+# syntax. All shells are using Thomson's syntax with exception of [t]csh,
+# fish and plan9's shells (rc, ex).
+# * It is smaller and consume far less memory than bash, zsh even mksh!
+# (memusage reports)
+# * TCSH still has bugs; less but have; if you write readable clean code you'll
+# find none; well almost none... This has to do with the implementation of
+# csh; that no means the other shells has good implementation.
+# * no one well known shell is capable for regular programming; if your script
+# getting big, use a programming language, or at least PHP or Perl (good
+# script languages).
+#
+# Advises:
+# 1. Do not use redirection in single-line if (it is well documented bug)
+# In most cases avoid to use single-line IFs.
+# 2. Do not mess up with other shells code, c-shell is not compatible with
+# other shells and has different abilities and priorities.
+# 3. Use spaces as you'll use them to write readable code in any language.
+# A bug of csh was `set x=1' worked, `set x = 1' worked, `set x =1' did not!
+# 4. It is well documented that numeric expressions require spaces in-between;
+# also parenthesise all bit-wise and unary operators.
+# 5. Do not write a huge weird expression with several quotes, backslashes etc
+# It is bad practice for generic programming, it is dangerous in any shell.
+# 6. Help tcsh, report the bug here <https://bugs.gw.com/>
+# 7. Read the man page, `tcsh' has huge number of options, and variables.
+#
+# I suggest the following options enabled by default
+# --------------------------------------------------
+# Even in non-interactive shells
+# set echo_style=both
+# set backslash_quote
+# set parseoctal
+# unset noclobber
+#
+# Whatever...
+# set inputmode=insert
+# set autolist
+# set listjobs
+# set padhour
+# set color
+# set colorcat
+# set nobeep
+# set cdtohome
+#
+# set histdup
+# set histlit
+# set nohistclop
+#
+# unset compat_expr
+# unset noglob
+# unset autologout
+# unset time
+# unset tperiod
+#
+# NOTE: If the `backslash_quote' is set, it may create compatibility issues
+# with other tcsh scripts which was written without it.
+#
+# NOTE: The same for `parseoctal', but it is better to fix the problematic
+# scripts.
+#
+# NOTE: **for beginners only**
+# This enable automatically rescan `path' directories if need to. (like bash)
+# set autorehash
+
+#### common aliases
+# alias hist 'history 20'
+# alias ll 'ls --color -lha'
+# alias today "date '+%d%h%y'
+# alias ff 'find . -name '
+
+#### a nice prompt
+# set prompt = "%B%{\033[35m%}%t %{\033[32m%}%n@%m%b %C4 %# "
+```
diff --git a/tr-tr/c-tr.html.markdown b/tr-tr/c-tr.html.markdown
index 33544765..6042a609 100644
--- a/tr-tr/c-tr.html.markdown
+++ b/tr-tr/c-tr.html.markdown
@@ -481,7 +481,7 @@ Diğer bir iyi kaynak ise [Learn C the hard way](http://c.learncodethehardway.or
It's very important to use proper spacing, indentation and to be consistent with your coding style in general.
Readable code is better than clever code and fast code. For a good, sane coding style to adopt, see the
-[Linux kernel coding stlye](https://www.kernel.org/doc/Documentation/CodingStyle).
+[Linux kernel coding style](https://www.kernel.org/doc/Documentation/CodingStyle).
Diğer taraftan google sizin için bir arkadaş olabilir.
diff --git a/tr-tr/dynamic-programming-tr.html.markdown b/tr-tr/dynamic-programming-tr.html.markdown
index 1900ee93..606ecf04 100644
--- a/tr-tr/dynamic-programming-tr.html.markdown
+++ b/tr-tr/dynamic-programming-tr.html.markdown
@@ -1,5 +1,6 @@
---
language: Dynamic Programming
+filename: dynamic-tr.txt
contributors:
- ["Akashdeep Goel", "https://github.com/akashdeepgoel"]
translators:
@@ -27,6 +28,8 @@ En Uzun Artan Subsequence problemi belirli bir dizinin en uzun artan alt dizini
En uzun artan alt dizinin uzunluğunu bulmak için sözde kod: Bu algoritmaların karmaşıklığı dizi yerine daha iyi veri yapısı kullanılarak azaltılabilir. Büyük dizin ve dizin gibi selefi dizi ve değişkeni saklama çok zaman kazandıracaktır.
Yönlendirilmiş asiklik grafiğinde en uzun yolu bulmak için benzer bir kavram uygulanabilir.
+
+```python
for i=0 to n-1
LS[i]=1
for j=0 to i-1
@@ -35,6 +38,8 @@ for i=0 to n-1
for i=0 to n-1
if (largest < LS[i])
+```
+
Bazı Ünlü Dinamik Programlama Problemleri
-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
-Integer Knapsack Problem - Tutorial and C Program source code: http://www.thelearningpoint.net/computer-science/algorithms-dynamic-programming—the-integer-knapsack-problem
diff --git a/tr-tr/kotlin-tr.html.markdown b/tr-tr/kotlin-tr.html.markdown
new file mode 100644
index 00000000..4d2dd291
--- /dev/null
+++ b/tr-tr/kotlin-tr.html.markdown
@@ -0,0 +1,474 @@
+---
+language: kotlin
+filename: kotlin-tr.kt
+contributors:
+ - ["Baha Can Aydın", "https://github.com/bahacan19"]
+lang: tr-tr
+---
+Kotlin, JVM, Android ve tarayıcı için statik olarak yazılmış bir programlama dilidir.
+Java %100 birlikte çalışabilir.
+[Daha:](https://kotlinlang.org/)
+
+```kotlin
+
+// Tek satır yoruma almak için : //
+/*
+ Birkaç satırı yoruma almak için
+*/
+
+// "package" anahtar kelimesi tıpkı Java'da olduğu gibidir.
+package com.learnxinyminutes.kotlin
+
+/*
+Bir Kotlin programının başlama noktası (Java'da olduğu gibi) "com.learnxinyminutes.kotlin.main" metodudur.
+Bu metoda komut satırından bir 'Array' gönderilebilir.
+*/
+fun main(args: Array<String>) {
+ /*
+ Bir değer tanımlamak için "var" ya da "val" anahtar kelimeleri kullanılıyor.
+ "val" tanımlananlar tekrar atanamazken "var" tanımlananlar atanabilir.
+ */
+ val fooVal = 10 // fooVal değerini daha sonra tekrar atayamıyoruz
+ var fooVar = 10
+ fooVar = 20 // fooVar tekrar atanabilir.
+
+ /*
+ Çoğu zaman, Kotlin bir değişkenin tipini anlayabilir,
+ bu yüzden her zaman belirtmeye gerek yoktur.
+ Bir değişkenin tipini şöyle belirtebiliriz:
+ */
+ val foo: Int = 7
+
+ /*
+ String değerler Java'da olduğu gibi tanımlanır.
+ */
+ val fooString = "İşte String bu!"
+ val barString = "Yeni satıra geçiyorum...?\nGeçtim!"
+ val bazString = "Tab mı istedin?\tAl bakalım!"
+ println(fooString)
+ println(barString)
+ println(bazString)
+
+ /*
+ Raw string, üçlü çift-tırnak sınırlandırılan String bloklarıdır.
+ Tıpkı bir text editör gibi String tanımlamaya izin verir.
+ */
+ val fooRawString = """
+fun helloWorld(val name : String) {
+ println("Merhaba, dünya!")
+}
+"""
+ println(fooRawString)
+
+ /*
+ String değerler, ($) işareti ile birtakım deyimler ve değerler içererbilir
+ */
+ val fooTemplateString = "$fooString değerinin ${fooString.length} adet karakteri vardır."
+ println(fooTemplateString)
+
+ /*
+ Null atanabilen bir değişken nullable olarak tanımlanmalıdır.
+ Bu, deişken tipinin sonuna ? eklenerek yapılabilir.
+ Erişim ise '?.' operatörü ile yapılır.
+ Bir değişken null ise, yerine kullaılacak alternatif bir değer belirtmek için
+ '?:' operatörünü kullanırız.
+ */
+ var fooNullable: String? = "abc"
+ println(fooNullable?.length) // => 3
+ println(fooNullable?.length ?: -1) // => 3
+ fooNullable = null
+ println(fooNullable?.length) // => null
+ println(fooNullable?.length ?: -1) // => -1
+
+ /*
+ Metodlar "fun" anahtar kelimesi ile tanımlanır.
+ Metod argümanları, Metod adından sonra parantez içinde belirtilir.
+ Metod argümanlarının opsiyonel olarak default (varsayılan) değerleri olabilir.
+ Metodun dönüş tipi, gerekirse, metod parentezinden sonra ':' operatörü ile belirtilir.
+ */
+ fun hello(name: String = "dünya"): String {
+ return "Merhaba, $name!"
+ }
+ println(hello("foo")) // => Merhaba, foo!
+ println(hello(name = "bar")) // => Merhaba, bar!
+ println(hello()) // => Merhaba, dünya!
+
+ /*
+ Bir metoda çokca argüman göndermek için 'vararg' anahtar kelimesi
+ kullanılır.
+ */
+ fun varargExample(vararg names: Int) {
+ println("${names.size} adet arguman paslanmıştır")
+ }
+ varargExample() // => 0 adet arguman paslanmıştır
+ varargExample(1) // => 1 adet arguman paslanmıştır
+ varargExample(1, 2, 3) // => 3 adet arguman paslanmıştır
+
+ /*
+ Bir metod tek bir ifadeden oluşuyorsa
+ süslü parantezler yerine '=' kullanılabilir.
+ */
+ fun odd(x: Int): Boolean = x % 2 == 1
+ println(odd(6)) // => false
+ println(odd(7)) // => true
+
+ // Eğer dönüş tipi anlaşılabiliyorsa ayrıca belirtmemize gerek yoktur.
+ fun even(x: Int) = x % 2 == 0
+ println(even(6)) // => true
+ println(even(7)) // => false
+
+ // Metodlar, metodları arguman ve dönüş tipi olarak alabilir
+ fun not(f: (Int) -> Boolean): (Int) -> Boolean {
+ return {n -> !f.invoke(n)} // bu satırdaki !f.invoke(n) metodu !f(n) şeklinde sadeleştirilebilir.
+ }
+
+
+ // Bir metodu sadece '::' ön eki ile de arguman olarak çağırabiliriz
+ println(not(::odd)(4)) // ==> true
+
+ // Metodlar değişken gibi atanabilir.
+ val notOdd = not(::odd)
+ val notEven = not(::even)
+
+ // Lambda ifadeleri arguman olarak paslanabilir.
+ val notZero = not {n -> n == 0}
+ /*
+ Eğer bir lambda fonksiyonu sadece bir arguman alıyorsa,
+ '->' ifadesi atlanabilir, 'it' ifadesi ile belirtilebilir.
+ */
+ val notPositive = not { it > 0} // not(n -> n > 0) ifadesi ile aynı
+
+ for (i in 0..4) {
+ println("${notOdd(i)} ${notEven(i)} ${notZero(i)} ${notPositive(i)}")
+ }
+
+ /*
+ * Diğer for döngüleri
+ * */
+ val myInt = 3
+ for (i in 1..100) { } // kapalı aralık. 100 dahil.
+ for (i in 1 until 100) { } // 100 dahil değil
+ for (x in 2..10 step 2) { } // ikişer adımlı
+ for (x in 10 downTo 1) { } // Ondan geriye doğru. 1 dahil.
+ if (myInt in 1..10) { }
+
+
+
+ /*
+ Bir sınıf tanımlamak için 'class' anahtar kelimesi kullanılır.
+ Kotlin'de bütün sınıflar varsayılan olarak 'final' tanımlanırlar.
+ * */
+ class ExampleClass(val x: Int) {
+
+ fun memberFunction(y: Int): Int {
+ return x + y
+ }
+
+ infix fun yTimes(y: Int): Int {
+ return x * y
+ }
+ }
+ /*
+ * Bir sınıfı türetilebilir yapmak için 'open' anahtar kelimesi kullanılır.
+ * */
+ open class A
+
+ class B : A()
+
+
+ /*
+ Yeni bir instance oluşturmak için doğrudan constructor çağırılır.
+ Kotlinde 'new' anahtar kelimesi yoktur.
+ */
+ val fooExampleClass = ExampleClass(7)
+ // Bir sınıfa üye metodları . (nokta) ile çağırabiliriz.
+ println(fooExampleClass.memberFunction(4)) // => 11
+ /*
+ 'infix' ön eki ile tanımlanan metodlar
+ alışılan metod çağrısını daha kolay bir söz dizimine dönüştürür.
+ */
+ println(fooExampleClass yTimes 4) // => 28
+
+ /*
+ Data class lar sadece veri tutan sınıflar için uygun bir çözümdür.
+ Bu şekilde tanımlanan sınıfların "hashCode"/"equals" ve "toString" metodları
+ otomatik olarak oluşur.
+ */
+ data class DataClassExample (val x: Int, val y: Int, val z: Int)
+ val fooData = DataClassExample(1, 2, 4)
+ println(fooData) // => DataClassExample(x=1, y=2, z=4)
+
+ // Data class ların copy metodları olur.
+ val fooCopy = fooData.copy(y = 100)
+ println(fooCopy) // => DataClassExample(x=1, y=100, z=4)
+
+ // Destructuring Declarations, bir objeyi çoklu değişkenler ile ifade etme yöntemidir.
+ val (a, b, c) = fooCopy
+ println("$a $b $c") // => 1 100 4
+
+ // bir 'for' döngüsü içinde 'Destructuring' :
+ for ((a, b, c) in listOf(fooData)) {
+ println("$a $b $c") // => 1 100 4
+ }
+
+ val mapData = mapOf("a" to 1, "b" to 2)
+ // Map.Entry de destructurable gösterilebilir.
+ for ((key, value) in mapData) {
+ println("$key -> $value")
+ }
+
+ // 'with' metodu ile bir objeye bir lamda metodu uygulayabiliriz.
+ data class MutableDataClassExample (var x: Int, var y: Int, var z: Int)
+ val fooMutableData = MutableDataClassExample(7, 4, 9)
+ with (fooMutableData) {
+ x -= 2
+ y += 2
+ z--
+ }
+
+ println(fooMutableData) // => MutableDataClassExample(x=5, y=6, z=8)
+
+ /*
+ 'listOf' metodu ile bir liste oluşturulabilir.
+ Oluşan liste immutable olacaktır, yani elaman eklenemez ve çıkarılamaz.
+ */
+ val fooList = listOf("a", "b", "c")
+ println(fooList.size) // => 3
+ println(fooList.first()) // => a
+ println(fooList.last()) // => c
+ // Elemanlara indexleri ile erişilebilir.
+ println(fooList[1]) // => b
+
+ // Mutable bir liste ise 'mutableListOf' metodu ile oluşturabilir.
+ val fooMutableList = mutableListOf("a", "b", "c")
+ fooMutableList.add("d")
+ println(fooMutableList.last()) // => d
+ println(fooMutableList.size) // => 4
+
+ // Bir 'set' oluşturmak için 'setOf' metodunu kullanabiliriz.
+ val fooSet = setOf("a", "b", "c")
+ println(fooSet.contains("a")) // => true
+ println(fooSet.contains("z")) // => false
+
+ // 'mapOf' metodu ile 'map' oluşturabiliriz.
+ val fooMap = mapOf("a" to 8, "b" to 7, "c" to 9)
+ // Map değerlerine ulaşmak için :
+ println(fooMap["a"]) // => 8
+
+ /*
+ Sequence, Kotlin dilinde lazy-hesaplanan collection ları temsil eder.
+ Bunun için 'generateSequence' metodunu kullanabiliriz. Bu metod bir önceki değerden
+ bir sonraki değeri hesaplamak için gerekli bir lamda metodunu arguman olarak alır.
+ */
+ val fooSequence = generateSequence(1, { it + 1 })
+
+ val x = fooSequence.take(10).toList()
+ println(x) // => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+
+ // Örneğin fibonacci serisi oluşturabilen bir 'Sequence' oluşturmak için:
+ fun fibonacciSequence(): Sequence<Long> {
+ var a = 0L
+ var b = 1L
+
+ fun next(): Long {
+ val result = a + b
+ a = b
+ b = result
+ return a
+ }
+
+ return generateSequence(::next)
+ }
+ val y = fibonacciSequence().take(10).toList()
+ println(y) // => [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
+
+
+ // Kotlin Collection lar ile çalışmak için higher-order metodlar sağlar.
+ val z = (1..9)
+ .map {it * 3} // her bir elamanı 3 ile çarp
+ .filter {it < 20} // 20 den küçük değerleri ele
+ .groupBy {it % 2 == 0} // ikiye tam bölünen ve bölünmeyen şeklinde grupla (Map)
+ .mapKeys {if (it.key) "even" else "odd"} // oluşan map in boolen 'key' lerini String bir değere dönüştür.
+ println(z) // => {odd=[3, 9, 15], even=[6, 12, 18]}
+
+ // Bir 'for' döngüsü 'itearator' sağlayan her objeye uygulanabilir.
+ for (c in "merhaba") {
+ println(c)
+ }
+
+ // 'while' döngüsü diğer dillere benzer şekilde çalışır.
+ var ctr = 0
+ while (ctr < 5) {
+ println(ctr)
+ ctr++
+ }
+ do {
+ println(ctr)
+ ctr++
+ } while (ctr < 10)
+
+ /*
+ 'if' bir dönüş değeri olan deyim gibi de kullanılabilir.
+ Bu sebepten Kotlin, Java'da bulunan '?:' ifadesi içermez.
+ */
+ val num = 5
+ val message = if (num % 2 == 0) "even" else "odd"
+ println("$num is $message") // => 5 is odd
+
+ // 'if-else if' yapıları için 'when' kullanılabilir.
+ val i = 10
+ when {
+ i < 7 -> println("first block")
+ fooString.startsWith("hello") -> println("second block")
+ else -> println("else block")
+ }
+
+ // 'when' bir parametre ile de kullanılabilir.
+ when (i) {
+ 0, 21 -> println("0 or 21")
+ in 1..20 -> println("in the range 1 to 20")
+ else -> println("none of the above")
+ }
+
+ // 'when' dönüş değeri olan bir metod gibi de davranabilir.
+ var result = when (i) {
+ 0, 21 -> "0 or 21"
+ in 1..20 -> "in the range 1 to 20"
+ else -> "none of the above"
+ }
+ println(result)
+
+
+ /*
+ Bir objenin tipini 'is' operatörü ile tayin edebiliriz.
+ Eğer obje tip kontrolünü geçerse, cast etmeden doğrudan
+ o tipteymiş gibi kullanılabilir.
+ */
+ fun smartCastExample(x: Any) : Boolean {
+ if (x is Boolean) {
+ // x otomatik olarak Boolean'a cast edilir.
+ return x
+ } else if (x is Int) {
+ // x otomatik olarak Int tipine cast edilir.
+ return x > 0
+ } else if (x is String) {
+ // x otomatik olarak String tipine cast edilir.
+ return x.isNotEmpty()
+ } else {
+ return false
+ }
+ }
+ println(smartCastExample("Merhaba, dünya!")) // => true
+ println(smartCastExample("")) // => false
+ println(smartCastExample(5)) // => true
+ println(smartCastExample(0)) // => false
+ println(smartCastExample(true)) // => true
+
+ // Smartcast 'when' bloğu ile de çalışır.
+ fun smartCastWhenExample(x: Any) = when (x) {
+ is Boolean -> x
+ is Int -> x > 0
+ is String -> x.isNotEmpty()
+ else -> false
+ }
+
+ /*
+ Extension lar, bir sınıfa fonksinolalite eklemenin bir yoludur.
+ */
+ fun String.remove(c: Char): String {
+ return this.filter {it != c}
+ }
+ println("Merhaba, dünya!".remove('a')) // => Merhb, düny!
+
+
+
+ //Biraz detaylı Kotlin
+
+
+ /*
+ * Delegated Properties, bir değişken tanımlarken kullanılan birkaç standart yöntemler içerir.
+ * https://kotlinlang.org/docs/reference/delegated-properties.html
+ * En bilinen delegate property metodları: lazy(), observable()
+ * */
+
+ /*
+ * Lazy, bir değişkeni ilk erişimde çalıştırılacak olan bir lambda ile tanımlama metodudur.
+ * Sonraki erişimlerde değişkene atanan değer hatırlanır.
+ * Lazy, synchronized bir delegation yöntemidir; değer sadece bir thread içinde hesaplanır,
+ * tüm thread ler aynı değere erişir. Eğer senkronizasyon gerekli değilse, lazy metodu içine
+ * LazyThreadSafetyMode.PUBLICATION paslanabilir.
+ * */
+
+ val lazyValue: String by lazy( {
+ println("bi sn... hesaplıyorum....")
+ "Selam!"
+ })
+
+ println(lazyValue)// bi sn... hesaplıyorum.... Selam!
+ println(lazyValue) // Selam!
+ /*
+ * Observable, bir değişkende olabilecek yeniden atama değişikliklerini dinleme yöntemidir.
+ * İki arguman alır; değişkenin ilk değeri, değiştiğinde çağrılan bir handler metodu. Handler
+ * metodu değişken her değiştiğinde çağırılır.
+ * */
+ var myObservableName: String by Delegates.observable("<isim yok>") {
+ prop, old, new ->
+ println("$old -> $new")
+ }
+ myObservableName = "Baha" //<isim yok> -> Baha
+ myObservableName = "Can" //Baha -> Can
+
+
+ /*
+ * Eğer değişkenin yeniden atanmasını denetlemek isterek vetoable()
+ * metodunu kullanabiliriz.
+ * */
+
+ var myVetoableName : String by Delegates.vetoable("<isim yok>"){
+ property, oldValue, newValue ->
+ if (newValue.length < 2) {
+ println("Tek harfli isim kabul etmiyoruz!")
+ false
+ } else {
+ println("$oldValue -> $newValue")
+ true
+ }
+ }
+
+ myVetoableName = "Baha" //<isim yok> -> Baha
+ myVetoableName = "C" //Tek harfli isim kabul etmiyoruz!
+ println(myVetoableName) //Baha
+
+
+ //singleton değişkene ulaşmak:
+ println(ObjectExample.hello()) // => Merhaba
+}
+
+// Enum class lar Java'daki enum lara benzerdir.
+enum class EnumExample {
+ A, B, C
+}
+
+/*
+'object' anahtar kelimesi ile singleton nesneler oluşturulabilir.
+Bu şekilde tanımlanan sınıflardan yeni nesneler oluşturulamaz, sadece adı ile refere edilebilir.
+*/
+object ObjectExample {
+ fun hello(): String {
+ return "Merhaba"
+ }
+}
+
+fun useObject() {
+ ObjectExample.hello()
+ val someRef: Any = ObjectExample
+}
+
+```
+
+### İlerisi için:
+
+* [Kotlin tutorials](https://kotlinlang.org/docs/tutorials/)
+* [Try Kotlin in your browser](http://try.kotlinlang.org/)
+* [A list of Kotlin resources](http://kotlin.link/)
+* [Kotlin Koans in your IDE](https://kotlinlang.org/docs/tutorials/koans.html/)
diff --git a/typescript.html.markdown b/typescript.html.markdown
index ef37182d..44fd791a 100644
--- a/typescript.html.markdown
+++ b/typescript.html.markdown
@@ -50,7 +50,7 @@ function bigHorribleAlert(): void {
// Functions are first class citizens, support the lambda "fat arrow" syntax and
// use type inference
-// The following are equivalent, the same signature will be infered by the
+// The following are equivalent, the same signature will be inferred by the
// compiler, and same JavaScript will be emitted
let f1 = function (i: number): number { return i * i; }
// Return type inferred
diff --git a/uk-ua/java-ua.html.markdown b/uk-ua/java-ua.html.markdown
index 1ea30f3d..1d600400 100644
--- a/uk-ua/java-ua.html.markdown
+++ b/uk-ua/java-ua.html.markdown
@@ -1,5 +1,6 @@
---
language: java
+filename: LearnJava-ua.java
contributors:
- ["Jake Prather", "http://github.com/JakeHP"]
- ["Jakukyo Friel", "http://weakish.github.io"]
@@ -11,8 +12,8 @@ contributors:
translators:
- ["Oleksandr Tatarchuk", "https://github.com/tatarchuk"]
- ["Andre Polykanine", "https://github.com/Oire"]
-filename: LearnJavaUa.java
lang: uk-ua
+
---
Java є об’єктно-орієнтованою мовою програмування загального призначення з підтримкою паралельного програмування, яка базується на класах.
diff --git a/vala.html.markdown b/vala.html.markdown
new file mode 100755
index 00000000..393578b0
--- /dev/null
+++ b/vala.html.markdown
@@ -0,0 +1,503 @@
+---
+language: vala
+contributors:
+ - ["Milo Gilad", "https://github.com/Myl0g"]
+filename: LearnVala.vala
+---
+
+In GNOME's own words, "Vala is a programming language that aims to bring modern programming language features to GNOME developers without imposing any additional runtime requirements and without using a different ABI compared to applications and libraries written in C."
+
+Vala has aspects of Java and C#, so it'll be natural to those who know either.
+
+[Read more here.](https://wiki.gnome.org/Projects/Vala)
+
+```vala
+
+// Single line comment
+
+/* Multiline
+Comment */
+
+/**
+* Documentation comment
+*/
+
+/* Data Types */
+
+char character = 'a'
+unichar unicode_character = 'u' // 32-bit unicode character
+
+int i = 2; // ints can also have guaranteed sizes (e.g. int64, uint64)
+uint j = -6; // Won't compile; unsigned ints can only be positive
+
+long k;
+
+short l;
+ushort m;
+
+string text = "Hello,"; // Note that the == operator will check string content
+
+string verbatim = """This is a verbatim (a.k.a. raw) string. Special characters
+(e.g. \n and "") are not interpreted. They may also be multiple lines long.""";
+
+// String Templates allow for easy string formatting
+string string_template = @"$text world"; // "$text" evaluates to "Hello,"
+
+int test = 5;
+int test2 = 10;
+string template2 = @"$(test * test2) is a number."; // Expression evaluation
+
+string template_slice = string_template[7:12]; // => "world"
+
+// Most data types have methods for parsing.
+
+bool parse_bool = bool.parse("false"); // => false
+int parse_int = int.parse("-52"); // => -52
+string parse_string = parse_int.to_string(); // => "-52"
+
+/* Basic I/O */
+
+stdout.printf(parse_string); // Prints to console
+string input = stdin.read_line(); // Gets input from console
+
+stderr.printf("Error message"); // Error printing
+
+/* Arrays */
+
+int[] int_array = new int[10]; // Array of ints with 10 slots
+int better_int_array[10]; // Above expression, shortened
+int_array.length; // => 10;
+
+int[] int_array2 = {5, 10, 15, 20}; // Can be created on-the-fly
+
+int[] array_slice = int_array2[1:3]; // Slice (copy of data)
+unowned int[] array_slice_ref = int_array2[1:3]; // Reference to data
+
+// Multi-dimensional Arrays (defined with a number of commas in the brackets)
+
+int[,] multi_array = new int[6,4]; // 6 is the number of arrays, 4 is their size
+int[,] multi_array2 = {{7, 4, 6, 4},
+ {3, 2, 4, 6},
+ {5, 9, 5, 1}}; // new int[3,4]
+multi_array2[2,3] = 12; // 2 is the array, 3 is the index in the array
+int first_d = multi_array2.length[0] // => 3
+int second_d = multi_array2.length[1] // => 4
+
+// Stacked arrays (e.g. int[][]) where array lengths vary are not supported.
+
+// Multi-dimensional arrays cannot be sliced, nor can they be converted to one-
+// dimensional.
+
+int[] add_to_array = {};
+add_to_array += 12; // Arrays can be dynamically added to
+
+add_to_array.resize(20); // Array now has 20 slots
+
+uint8[] chars = "test message".data;
+chars.move(5, 0, 7);
+stdout.printf((string) chars); // Casts the array to a string and prints it
+
+/* Control Flow */
+
+int a = 1;
+int b = 2;
+int[] foreach_demo = {2, 4, 6, 8};
+
+while (b > a) { // While loop; checks if expression is true before executing
+ b--;
+}
+
+do {
+ b--;
+}
+while (b > a); // Do While loop; executes the code in "do" before while (b > a)
+
+for (a = 0; a < 10; a++) { stdout.printf("%d\n", a); } // for loop
+
+foreach (int foreach_demo_var in foreach_demo) {
+ stdout.printf("%d\n", foreach_demo_var);
+} // foreach works on any iterable collection
+
+if (a == 0) {
+ stdout.printf("%d\n", a);
+} else if (a > 1) {
+ stdout.printf("%d\n", a);
+} else {
+ stdout.printf("A is less than 0");
+} // if-then-else
+
+switch (a) {
+ case 1:
+ stdout.printf("A is 1\n");
+ break;
+ case 5:
+ case 10:
+ stdout.printf("A is 5 or 10\n");
+ break;
+ default:
+ stdout.printf("???\n")
+ break;
+} // switch statement
+
+/* Type Casting and Inference */
+
+int cast_to_float = 10;
+float casted_float = (float) cast_to_float; // static casting; no runtime checks
+
+// For runtime checks, use dynamic casting.
+// Dynamically casted objects must be the following:
+// - Object's class is the same class as the desired type
+// - Object's class is a subclass of the desired type
+// - Desired class is an interface implemented by the object's class
+
+float dyna_casted_float = cast_to_float as float // Won't compile
+
+var inferred_string = "hello"; // Type inference
+
+/* Methods (a.k.a. functions) */
+
+int method_demo(string arg1, Object arg2) { // Returns int and takes args
+ return 1;
+}
+
+// Vala methods cannot be overloaded.
+
+void some_method(string text) { }
+void some_method(int number) { } // Won't compile
+
+// To achieve similar functionality, use default argument values.
+
+void some_better_method(string text, int number = 0) { }
+
+some_better_method("text");
+some_better_method("text", 12);
+
+// varargs (variable-length argument lists) are also supported.
+
+void method_with_varargs(int arg1, ...) {
+ var varargs_list = va_list(); // gets the varargs list
+
+ string arg_string = varargs_list.arg(); // gets arguments, one after another
+ int int_vararg = varargs_list.arg();
+
+ stdout.printf("%s, %d\n", arg_string, int_vararg)
+}
+
+string? ok_to_be_null(int? test_int) { } // "?" denotes possible null value
+
+// Delegates
+
+delegate void DelegateDemo(char char_a);
+
+void delegate_match(char char_a) { // Matches DelegateDemo's signature
+ stdout.printf("%d\n");
+}
+
+void call_delegate(DelegateDemo d, char char_b) { // Takes a delegate arg
+ d(char_b) // calls delegate
+}
+
+void final_delegate_demo() {
+ call_delegate(delegate_match); // Passes matching method as argument
+}
+
+// Lambdas (a.k.a. Anonymous Methods) are defined with "=>"
+
+(a) => { stdout.printf("%d\n", a); } // Prints "a"
+
+/* Namespaces */
+
+namespace NamespaceDemo {
+ // Allows you to organize variable names
+ int namespace_int = 12;
+}
+namespace_int += 5; // Won't compile
+
+using NamespaceDemo;
+namespace_int += 5; // Valid
+
+/* Structs and Enums */
+
+struct Closet {
+ public uint shirts; // Default access modifier is private
+ public uint jackets;
+}
+
+Closet struct_init_1 = Closet(); // or Closet struct_init_1 = {};
+Closet struct_init_2 = {15, 3};
+var struct_init_3 = Closet() { // Type inference also works
+ shirts = 15;
+ jackets = 3;
+}
+
+enum HouseSize { // An example of an enum
+ SMALL,
+ MODERATE,
+ BIG
+}
+
+/* Classes and Object-Oriented Programming */
+
+class Message : GLib.Object { // Class Message extends GLib's Object
+ private string sender; // a private field
+ public string text {get; set;} // a public property (more on that later)
+ protected bool is_digital = true; // protected (this class and subclasses)
+ internal bool sent = false; // internal (classes in same package)
+
+ public void send(string sender) { // public method
+ this.sender = sender;
+ sent = true;
+ }
+
+ public Message() { // Constructor
+ // ...
+ }
+
+}
+
+// Since method overloading isn't possible, you can't overload constructors.
+// However, you can use named constructors to achieve the same functionality.
+
+public class Calculator : GLib.Object {
+
+ public Calculator() {
+ }
+
+ public Calculator.with_name(string name) {
+ }
+
+ public Calculator.model(string model_id, string name = "") {
+ this.with_name(@"$model_id $name"); // Chained constructors with "this"
+ }
+ ~Calculator() { } // Only needed if you're using manual memory management
+}
+
+var calc1 = new Calculator.with_name("Temp");
+var calc2 = new Calculator.model("TI-84");
+
+// Signals (a.k.a. events or event listeners) are a way to execute multiple
+// methods with the same signature at the same time.
+
+public class SignalDemo : GLib.Object {
+ public signal void sig_demo(int sig_demo_int); // Must be public
+
+ public static int main(string[] args) {
+ // main method; program does not compile without it
+
+ var sig_demo_class = new SignalDemo(); // New instance of class
+
+ sig_demo_class.sig_demo.connect((ob, sig_int) => { // Lambda used as handler
+ stdout.printf("%d\n", sig_int); // "ob" is object on which it is emitted
+ });
+
+ sig_demo_class.sig_demo(27); // Signal is emitted
+
+ return 0;
+ }
+}
+
+// You may use the connect() method and attach as many handlers as you'd like.
+// They'll all run at around the same time when the signal is emitted.
+
+// Properties (getters and setters)
+
+class Animal : GLib.Object {
+ private int _legs; // prefixed with underscore to prevent name clashes
+
+ public int legs {
+ get { return _legs; }
+ set { _legs = value; }
+ }
+
+ public int eyes { get; set; default = 5; } // Shorter way
+ public int kingdom { get; private set; default = "Animalia"} // Read-only
+
+ public static void main(string args[]) {
+ rabbit = new Animal();
+
+ // All GLib.Objects have a signal "notify" emitted when a property changes.
+
+ // If you specify a specific property, replace all underscores with dashes
+ // to conform to the GObject naming convention.
+
+ rabbit.notify["eyes"].connect((s, p) => { // Remove the ["eyes"] for all
+ stdout.printf("Property '%s' has changed!\n", p.name);
+ });
+
+ rabbit.legs = 2;
+ rabbit.legs += 2;
+ rabbit.eyes = 2;
+
+ }
+}
+
+// Inheritance: Vala classes may inherit 1 class. Inheritance is not implicit.
+
+class SuperDemo : GLib.Object {
+ public int data1;
+ protected int data2;
+ internal int data3;
+ private int data4;
+
+ public static void test_method { } // Statics can be called w/out an object
+}
+class SubDemo : SuperDemo {
+ public static void main(string args[]) {
+ stdout.printf((string) data1); // Will compile
+ stdout.printf((string) data2); // Protected can be accessed by subclasses
+ stdout.printf((string) data3); // Internal is accessible to package
+ stdout.printf((string) data4); // Won't compile
+ }
+}
+
+// Abstract Classes and Methods
+
+public abstract class OperatingSystem : GLib.Object {
+ public void turn_on() {
+ stdout.printf("Booted successfully.\n");
+ }
+ public abstract void use_computer();
+}
+
+public class Linux : OperatingSystem {
+ public override void use_computer() { // Abstract methods must be overridden
+ stdout.printf("Beep boop\n");
+ }
+}
+
+// Add default behavior to an abstract method by making it "virtual".
+
+public abstract class HardDrive : GLib.Object {
+ public virtual void die() {
+ stdout.printf("CLICK-CLICK-CLICK\n");
+ }
+}
+public class MyHD : HardDrive {
+ public override void die() {
+ return;
+ }
+}
+
+// Interfaces: classes can implement any number of these.
+
+interface Laptop { // May only contain abstracts or virtuals
+ public abstract void turn_on();
+ public abstract void turn_off();
+
+ public abstract int cores; // Won't compile; fields cannot be abstract
+ public abstract int cores {get; set;} // Will compile
+
+ public virtual void keyboard() { // Virtuals are allowed (unlike Java/C#)
+ stdout.printf("Clickity-clack\n");
+ }
+}
+
+// The ability to use virtuals in Vala means that multiple inheritance is
+// possible (albeit somewhat confined)
+
+// Interfaces cannot implement interfaces, but they may specify that certain
+// interfaces or classes must be also implemented (pre-requisites).
+
+public interface CellPhone : Collection, GLib.Object {}
+
+// You can get the type info of a class at runtime dynamically.
+
+bool type_info = object is TypeName; // uses "is" to get a bool
+
+Type type_info2 = object.get_type();
+var type_name = type_info2.name();
+
+Type type_info3 = typeof(Linux);
+Linux type_demo = (Linux) Object.new(type_info3);
+
+// Generics
+
+class Computer<OperatingSystem> : GLib.Object {
+ private OperatingSystem os;
+
+ public void install_os(OperatingSystem os) {
+ this.os = os;
+ }
+ public OperatingSystem retrieve_os() {
+ return this.os;
+ }
+}
+
+var new_computer = new Computer<Linux>();
+
+/* Other Features */
+
+// Assertions: crash if a statement is not true (at runtime)
+
+bool is_true = true;
+assert(is_true);
+
+// Contract Programming
+
+int contract_demo(int arg1, int arg2) {
+ requires(arg1 > 0 && arg1 < 10) // Notice the lack of semicolon
+ requires(arg2 >= 12)
+ ensures(result >= 0)
+}
+
+// Error Handling
+
+void error_demo(int int_ex) throws GError {
+ if (int_ex != 1) {
+ throw new GError("TEST MESSAGE");
+ }
+}
+void error_demo2() {
+ try {
+ error_demo(0);
+ } catch (GError ge) {
+ stdout.printf("%s\n", ge.message);
+ }
+}
+
+// Main Loop
+
+void main() {
+
+ var main_loop = new MainLoop();
+ var time = new TimeoutSource(2000);
+
+ time.set_callback(() => { // Executes the following lambda after 2000ms
+ stdout.printf("2000ms have passed\n");
+ main_loop.quit();
+ return false;
+ });
+
+ time.attach(main_loop.get_context());
+
+ loop.run();
+}
+
+// Pointers (manual memory management)
+
+Object* pointer_obj = new Object(); // Creates Object instance and gives pointer
+
+pointer_obj->some_method(); // Executes some_method
+pointer_obj->some_data; // Returns some_data
+
+delete pointer_obj;
+
+int more = 57;
+int* more_pointer = &i; // & = address-of
+int indirection_demo = more_pointer*; // indirection
+
+// Profiles: affect which Vala features are avaliable and which libraries the
+// C-code will use.
+// - gobject (default)
+// posix
+// dova
+// Use "--profile=whatever" when compiling.
+
+```
+* More Vala documentation can be found [here](https://valadoc.org/).
+* [Alternate construction syntax](https://wiki.gnome.org/Projects/Vala/Tutorial#GObject-Style_Construction) similar to GObject
+* More on contract programming [here](http://en.wikipedia.org/wiki/Contract_programming)
+* Collections library can be found [here](https://wiki.gnome.org/Projects/Vala/Tutorial#Collections)
+* [Multithreading](https://wiki.gnome.org/Projects/Vala/Tutorial#Multi-Threading)
+* Read about building GUIs with GTK+ and Vala [here](http://archive.is/7C7bw).
+* D-Bus [integration](https://wiki.gnome.org/Projects/Vala/Tutorial#D-Bus_Integration)
diff --git a/vi-vn/html-vi.html.markdown b/vi-vn/html-vi.html.markdown
index 4897649f..ca591174 100644
--- a/vi-vn/html-vi.html.markdown
+++ b/vi-vn/html-vi.html.markdown
@@ -1,6 +1,6 @@
---
language: html
-filename: learnhtml.html
+filename: learnhtml-vi.html
contributors:
- ["Christophe THOMAS", "https://github.com/WinChris"]
translators:
diff --git a/vi-vn/python3-vi.html.markdown b/vi-vn/python3-vi.html.markdown
index 16238b35..f6cce1a3 100644
--- a/vi-vn/python3-vi.html.markdown
+++ b/vi-vn/python3-vi.html.markdown
@@ -1,5 +1,6 @@
---
language: python3
+filename: learnpython3-vi.py
contributors:
- ["Louie Dinh", "http://pythonpracticeprojects.com"]
- ["Steven Basart", "http://github.com/xksteven"]
@@ -8,8 +9,8 @@ contributors:
- ["evuez", "http://github.com/evuez"]
translators:
- ["Xuan (Sean) Luong, https://github.com/xuanluong"]
-filename: learnpython3.py
lang: vi-vn
+
---
Python được tạo ra bởi Guido van Rossum vào đầu những năm 90s. Ngày nay nó là một trong những ngôn ngữ phổ biến
diff --git a/vi-vn/ruby-vi.html.markdown b/vi-vn/ruby-vi.html.markdown
index 73382100..1e198205 100644
--- a/vi-vn/ruby-vi.html.markdown
+++ b/vi-vn/ruby-vi.html.markdown
@@ -1,6 +1,6 @@
---
language: ruby
-filename: learnruby.rb
+filename: learnruby-vi.rb
contributors:
- ["David Underwood", "http://theflyingdeveloper.com"]
- ["Joel Walden", "http://joelwalden.net"]
diff --git a/vim.html.markdown b/vim.html.markdown
index 70f43be1..7723136f 100644
--- a/vim.html.markdown
+++ b/vim.html.markdown
@@ -40,9 +40,9 @@ specific points in the file, and for fast editing.
# Searching in the text
- /word # Highlights all occurences of word after cursor
- ?word # Highlights all occurences of word before cursor
- n # Moves cursor to next occurence of word after search
+ /word # Highlights all occurrences of word after cursor
+ ?word # Highlights all occurrences of word before cursor
+ n # Moves cursor to next occurrence of word after search
N # Moves cursor to previous occerence of word
:%s/foo/bar/g # Change 'foo' to 'bar' on every line in the file
diff --git a/visualbasic.html.markdown b/visualbasic.html.markdown
index f081b907..cbeb36b5 100644
--- a/visualbasic.html.markdown
+++ b/visualbasic.html.markdown
@@ -12,7 +12,7 @@ Module Module1
'A Quick Overview of Visual Basic Console Applications before we dive
'in to the deep end.
'Apostrophe starts comments.
- 'To Navigate this tutorial within the Visual Basic Complier, I've put
+ 'To Navigate this tutorial within the Visual Basic Compiler, I've put
'together a navigation system.
'This navigation system is explained however as we go deeper into this
'tutorial, you'll understand what it all means.
diff --git a/yaml.html.markdown b/yaml.html.markdown
index 95adbd83..3b32a069 100644
--- a/yaml.html.markdown
+++ b/yaml.html.markdown
@@ -27,7 +27,7 @@ another_key: Another value goes here.
a_number_value: 100
scientific_notation: 1e+12
# The number 1 will be interpreted as a number, not a boolean. if you want
-# it to be intepreted as a boolean, use true
+# it to be interpreted as a boolean, use true
boolean: true
null_value: null
key with spaces: value
@@ -132,7 +132,7 @@ python_complex_number: !!python/complex 1+2j
# We can also use yaml complex keys with language specific tags
? !!python/tuple [5, 7]
: Fifty Seven
-# Would be {(5, 7): 'Fifty Seven'} in python
+# Would be {(5, 7): 'Fifty Seven'} in Python
####################
# EXTRA YAML TYPES #
diff --git a/zh-cn/bf-cn.html.markdown b/zh-cn/bf-cn.html.markdown
index 6cea3012..2d2a114a 100644
--- a/zh-cn/bf-cn.html.markdown
+++ b/zh-cn/bf-cn.html.markdown
@@ -1,11 +1,13 @@
---
language: bf
-lang: zh-cn
+filename: brainfuck-cn.bf
contributors:
- ["Prajit Ramachandran", "http://prajitr.github.io/"]
- ["Mathias Bynens", "http://mathiasbynens.be/"]
translators:
- ["lyuehh", "https://github.com/lyuehh"]
+lang: zh-cn
+
---
Brainfuck 是一个极小的只有8个指令的图灵完全的编程语言。
diff --git a/zh-cn/java-cn.html.markdown b/zh-cn/java-cn.html.markdown
index 1e9c38f6..27003f3e 100644
--- a/zh-cn/java-cn.html.markdown
+++ b/zh-cn/java-cn.html.markdown
@@ -108,7 +108,7 @@ public class LearnJava {
boolean [] booleanArray = new boolean[100];
// 声明并初始化数组也可以这样:
- int [] y = {9000, 1000, 1337};
+ int [] intArray = {9000, 1000, 1337};
// 随机访问数组中的元素
System.out.println("intArray @ 0: " + intArray[0]);
@@ -309,7 +309,7 @@ class Bicycle {
name = "Bontrager";
}
- // 一下是一个含有参数的构造函数
+ // 以下是一个含有参数的构造函数
public Bicycle(int startCadence, int startSpeed, int startGear, String name) {
this.gear = startGear;
this.cadence = startCadence;
diff --git a/zh-cn/livescript-cn.html.markdown b/zh-cn/livescript-cn.html.markdown
index fea00bc1..cc7daab1 100644
--- a/zh-cn/livescript-cn.html.markdown
+++ b/zh-cn/livescript-cn.html.markdown
@@ -1,6 +1,6 @@
---
language: LiveScript
-filename: learnLivescript.ls
+filename: learnLivescript-cn.ls
contributors:
- ["Christina Whyte", "http://github.com/kurisuwhyte/"]
translators:
diff --git a/zh-cn/matlab-cn.html.markdown b/zh-cn/matlab-cn.html.markdown
index 77ba765a..2fbccfc4 100644
--- a/zh-cn/matlab-cn.html.markdown
+++ b/zh-cn/matlab-cn.html.markdown
@@ -1,11 +1,13 @@
---
language: Matlab
+filename: matlab-cn.m
contributors:
- ["mendozao", "http://github.com/mendozao"]
- ["jamesscottbrown", "http://jamesscottbrown.com"]
translators:
- ["sunxb10", "https://github.com/sunxb10"]
lang: zh-cn
+
---
MATLAB 是 MATrix LABoratory (矩阵实验室)的缩写,它是一种功能强大的数值计算语言,在工程和数学领域中应用广泛。
diff --git a/zh-cn/red-cn.html.markdown b/zh-cn/red-cn.html.markdown
new file mode 100644
index 00000000..85812990
--- /dev/null
+++ b/zh-cn/red-cn.html.markdown
@@ -0,0 +1,208 @@
+---
+name: Red
+category: language
+language: Red
+filename: LearnRed-zh.red
+contributors:
+ - ["Arnold van Hofwegen", "https://github.com/iArnold"]
+translators:
+ - ["Limo Saplf", "https://github.com/saplf"]
+lang: zh-cn
+---
+
+Red 的编写是出于工作需要,该语言的作者想要使用 REBOL,但它有许多缺陷。
+当时 REBOL 还没有开源,由于它是一门解释型语言,这就意味着它比编译型语言效率低。
+
+Red 使用 C 语言级别的 Red/System,是一门涉及所有编程领域的语言。
+Red 基于 REBOL 编写,它继承了 REBOL 的灵活性,同时也包含了许多 C 语言能做的底层实现。
+
+Red 将会成为世界上第一门全栈式编程语言,这意味着它可以完成几乎所有的编程任务,从底层到抽象,无需其他工具的参与。
+而且,Red 支持交叉编译,任意两个平台之间,不需要任何 GCC 之类的工具链的支持。
+所有的工作,仅仅需要一个不到 1 MB 的二进制可执行文件。
+
+准备好你的 Red 第一课了吗?
+
+```red
+所有 header 之前的文字都是注释,只要你不使用 "red" 关键字,其中的 "r" 大写。
+这是词法分析器的一个缺陷,所以大多数时候,你都应该直接以 header 开始程序或者脚本的编写。
+
+red 脚本的 header 由关键字,首字母大写的 "red" 开始,后跟一个空格,再跟一对方括号 []。
+方括号里可以写上一些关于这段脚本或者程序的相关信息:
+作者,文件名,版本号,license,程序功能的简介,它依赖的其他文件。
+red/System 的 header 和 red header 类似,仅仅是说明 "red/System" 而非 "red"。
+
+
+Red []
+
+; 这是一条行注释
+
+print "Hello Red World" ; 另一条注释
+
+comment {
+ 这是多行注释。
+ 你刚刚看到的就是 Red 版的 Hello World。
+}
+
+; 程序的入口就是第一句可执行的代码
+; 不需要把它放在 'main' 函数里
+
+; 变量名以一个字母开始,可以包含数字,
+; 只包含 A ~ F 字符和数字的变量名不能以 'h' 结尾,
+; 因为这是 Red 和 Red/System 中十六进制数字的表达方式。
+
+; 给变量赋值使用冒号 ":"
+my-name: "Red"
+reason-for-using-the-colon: {使用冒号作为赋值符号
+ 是为了能够让 "=" 能够用来作为比较符号,这本来就是 "="
+ 存在的意义!还记得上学时学的,y = x + 1 、 x = 1,
+ 以及推导出的 y = 2 吗?
+}
+is-this-name-valid?: true
+
+; 用 print 打印输出,prin 打印不带换行的输出
+
+prin "我的名字是 " print my-name
+; 我的名字是 Red
+
+print ["我的名字是 " my-name lf]
+; 我的名字是 Red
+
+; 注意到了吗:语句没有以分号结尾 ;-)
+
+;
+; 数据类型
+;
+; 如果你了解 Rebol,你可能就会注意到它有许多数据类型。
+; Red 并没有囊括它所有的类型,但由于 Red 想要尽可能的
+; 接近 Rebol,所以它也会有很多数据类型。
+; 类型以叹号结尾,但要注意,变量名也是可以以叹号结尾的。
+; 一些内置类型有 integer! string! block!
+
+; 使用变量前需要声明吗?
+; Red 能够分辨什么时候使用什么变量,变量声明并非必要的。
+; 一般认为,声明变量是较好的编码实践,但 Red 并不会强制这点。
+; 你可以声明一个变量然后指定它的类型,而一个变量的类型就
+; 指定了它的字节大小。
+
+; integer! 类型的变量通常是 4 字节,32位
+my-integer: 0
+; Red 的整型包含符号,暂时不支持无符号类型,但以后会支持的。
+
+; 怎样判断一个变量的类型?
+type? my-integer
+; integer!
+
+; 一个变量的初始化可以使用另一个同样刚刚初始化的变量:
+i2: 1 + i1: 1
+
+; 算数运算符
+i1 + i2 ; 3
+i2 - i1 ; 1
+i2 * i1 ; 2
+i1 / i2 ; 0 (0.5,但截取为 0)
+
+; 比较运算符都差不多,但和其他语言不一样的是相等的比较,
+; Red 使用单个的 '='。
+; Red 有一个类似 boolean 的类型,它的值是 true 和 false,
+; 但也可以使用 on/off 或者 yes/on
+
+3 = 2 ; false
+3 != 2 ; true
+3 > 2 ; true
+3 < 2 ; false
+2 <= 2 ; true
+2 >= 2 ; true
+
+;
+; 控制流
+;
+; if
+; 如果给定的条件为 true 则执行一段代码块。
+; if 没有返回值,所以不能用作表达式。
+if a < 0 [print "a 是负值"]
+
+; either
+; 如果给定的条件为 true 则执行一段代码块,否则就
+; 执行另一段可选的代码块。如果两个代码块中最后一个表达式
+; 的类型相同, either 就可以用作表达式。
+either a > 0 [
+ msg: "正值"
+][
+ either a = 0 [
+ msg: "零"
+ ][
+ msg: "负值"
+ ]
+]
+print ["a 是 " msg lf]
+
+; 还可以有另一种写法
+; (因为两条路径的返回值相同,所以可以这么写):
+
+msg: either a > 0 [
+ "正值"
+][
+ either a = 0 [
+ "零"
+ ][
+ "负值"
+ ]
+]
+print ["a 是 " msg lf]
+
+; util
+; 循环执行一段代码块,直到满足给定的条件为止。
+; util 没有返回值,所以它不能用在表示式中。
+c: 5
+util [
+ prin "o"
+ c: c - 1
+ c = 0 ; 终止循环的条件
+]
+; 输出:ooooo
+; 需要注意的是,即使条件从一开始就不满足,
+; 这个循环也至少会执行一次。
+
+; while
+; 当满足给定的条件,就执行一段代码。
+; while 没有返回值,不能用在表达式中。
+c: 5
+while [c > 0][
+ prin "o"
+ c: c - 1
+]
+; 输出:ooooo
+
+;
+; 函数
+;
+; 函数示例
+twice: function [a [integer!] /one return: [integer!]][
+ c: 2
+ a: a * c
+ either one [a + 1][a]
+]
+b: 3
+print twice b ; 输出 6
+
+; 使用 #include 和 %文件名 来导入外部文件
+#include %includefile.red
+; 现在就可以使用 includefile.red 中的函数了。
+
+```
+
+## 更进一步
+
+Red 相关的源码信息在 [Red 语言主页](http://www.red-lang.org)。
+
+源代码的 [github 库](https://github.com/red/red)。
+
+Red/System 特性在 [这里](http://static.red-lang.org/red-system-specs-light.html)。
+
+想要了解更多关于 Rebol 和 Red 的信息,加入 [Gitter 聊天室](https://gitter.im/red/red)。如果你无法加入,也可以给我们发[邮件](mailto:red-langNO_SPAM@googlegroups.com)。
+
+也可以在 [Stack Overflow](stackoverflow.com/questions/tagged/red) 上查阅、提交问题。
+
+也许你现在就要试一试 Red ?可以在线尝试 [try Rebol and Red site](http://tryrebol.esperconsultancy.nl)。
+
+你也可以通过学习一些 [Rebol](http://www.rebol.com/docs.html) 来学习 Red。
diff --git a/zh-cn/visualbasic-cn.html.markdown b/zh-cn/visualbasic-cn.html.markdown
index 59f18fe2..8bdfabc6 100644
--- a/zh-cn/visualbasic-cn.html.markdown
+++ b/zh-cn/visualbasic-cn.html.markdown
@@ -77,7 +77,7 @@ Module Module1
' 使用 private subs 声明函数。
Private Sub HelloWorldOutput()
' 程序名
- Console.Title = "Hello World Ouput | Learn X in Y Minutes"
+ Console.Title = "Hello World Output | Learn X in Y Minutes"
' 使用 Console.Write("") 或者 Console.WriteLine("") 来输出文本到屏幕上
' 对应的 Console.Read() 或 Console.Readline() 用来读取键盘输入
Console.WriteLine("Hello World")