summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ansible.html.markdown24
-rw-r--r--clojure-macros.html.markdown9
-rw-r--r--de-de/asciidoc-de.html.markdown2
-rw-r--r--de-de/dynamic-programming-de.html.markdown6
-rw-r--r--de-de/git-de.html.markdown2
-rw-r--r--dynamic-programming.html.markdown6
-rw-r--r--es-es/lambda-calculus-es.html.markdown216
-rw-r--r--es-es/pyqt-es.html.markdown82
-rw-r--r--fr-fr/dynamic-programming-fr.html.markdown6
-rw-r--r--kotlin.html.markdown4
-rw-r--r--mercurial.html.markdown36
-rw-r--r--ms-my/clojure-macros-my.html.markdown9
-rw-r--r--nl-nl/dynamic-programming-nl.html.markdown6
-rw-r--r--php.html.markdown7
-rw-r--r--pt-br/csharp-pt.html.markdown42
-rw-r--r--pt-br/dynamic-programming-pt.html.markdown6
-rw-r--r--pt-br/haxe-pt.html.markdown795
-rw-r--r--pt-br/paren-pt.html.markdown8
-rw-r--r--pt-br/python3-pt.html.markdown6
-rw-r--r--pt-br/ruby-pt.html.markdown2
-rw-r--r--pt-br/typescript-pt.html.markdown7
-rw-r--r--pt-br/whip-pt.html.markdown10
-rw-r--r--pt-br/xml-pt.html.markdown3
-rw-r--r--pt-br/yaml-pt.html.markdown4
-rw-r--r--r.html.markdown2
-rw-r--r--sql.html.markdown105
-rw-r--r--typescript.html.markdown21
-rw-r--r--zh-cn/clojure-macro-cn.html.markdown10
-rw-r--r--zh-cn/markdown-cn.html.markdown238
29 files changed, 1475 insertions, 199 deletions
diff --git a/ansible.html.markdown b/ansible.html.markdown
index a319a89d..cb365e0f 100644
--- a/ansible.html.markdown
+++ b/ansible.html.markdown
@@ -6,7 +6,7 @@ contributors:
filename: LearnAnsible.txt
---
-```yml
+```yaml
---
"{{ Ansible }}" is an orchestration tool written in Python.
@@ -14,7 +14,7 @@ filename: LearnAnsible.txt
## Example
An example playbook to install apache and configure log level
-```yml
+```yaml
---
- hosts: apache
@@ -163,7 +163,7 @@ This example-playbook would execute (on all hosts defined in the inventory) two
* `ping` that would return message *pong*
* `shell` that execute three commands and return the output to our terminal
-```yml
+```yaml
- hosts: all
tasks:
@@ -213,7 +213,7 @@ It is a great way to introduce `object oriented` management for your application
Role can be included in your playbook (executed via your playbook).
-```yml
+```yaml
- hosts: all
tasks:
@@ -427,7 +427,7 @@ You can use the jinja in the CLI too
ansible -m shell -a 'echo {{ my_variable }}` -e 'my_variable=something, playbook_parameter=twentytwo" localhost
```
In fact - jinja is used to template parts of the playbooks too
-```yml
+```yaml
#check part of this playbook: playbooks/roles/sys_debug/tasks/debug_time.yml
- local_action: shell date +'%F %T'
register: ts
@@ -638,18 +638,19 @@ But ansible is way more! It provides an execution plans, an API, library, callba
It is an agent-less tool - every agent consumes up to 16MB ram - in some environments, it may be noticable amount.
It is agent-less - you have to verify your environment consistency 'on-demand' - there is no built-in mechanism that would warn you about some change automatically (this can be achieved with reasonable effort)
-Official GUI Tool (web inferface) - Ansible Tower - is great, but it is expensive. There is no 'small enterprice' payment plan. Easy workaround with Rundeck or Jenkins is possible with reasonable workload.
+Official GUI Tool (web inferface) - Ansible Tower - is great, but it is expensive. There is no 'small enterprice' payment plan, however Ansible AWX is the free open source version we were all waiting for.
#### Pros
-It is an agent-less tools In most scenarios, it use ssh as a transport layer.
+It is an agent-less tools In most scenarios, it use ssh as a transport layer.
In some way you can use it as 'bash on steroids'.
It is very-very-very easy to start. If you are familiar with ssh concept - you already know Ansible (ALMOST). My personal record is: 'I did show "how to install and use ansible" (for simple raspberry pi cluster management) - it took me 30 seconds to deliver a complete working example !!!)'
I do provide a training services - I'm able to teach a production-ready person - in 8 hours (1 training day)! It covers all needed to work aspects! No other tool can match this ease of use!
It executes 'as is' - other tools (salt, puppet, chef - might execute in different scenario than you would expect)
Documentation is at the world-class standard!
The comunity (github, stackOverflow) would help you very fast.
-Writing own modules and extension is fairly easy.
+Writing own modules and extension is fairly easy.
+Ansible AWX is the open source version of Ansible Tower we have been waiting for, which provides an excellent UI.
#### Neutral
Migration Ansible<->Salt is failrly easy - so if you would need an event-driven agent environment - it would be a good choice to start quick with Ansible, and convert to salt when needed.
@@ -657,7 +658,12 @@ Migration Ansible<->Salt is failrly easy - so if you would need an event-driven
#### Some concepts
Ansible uses ssh or paramiko as a transport layer. In a way you can imagine that you are using a ssh with API to perform your action.
-The simplest way is to execute remote command in more controlled way (still using ssh).
+The simplest way is to execute remote command in more controlled way (still using ssh).
On the other hand - in advanced scope - you can wrap Ansible (use python Ansible code as a library) with your own Python scrips! This is awesome! It would act a bit like Fabric then.
+## Additional Resources
+* [Servers For Hackers: An Ansible Tutorial](https://serversforhackers.com/c/an-ansible-tutorial)
+* [A system administrator's guide to getting started with Ansible - FAST!](https://www.redhat.com/en/blog/system-administrators-guide-getting-started-ansible-fast)
+* [Ansible Tower](https://www.ansible.com/products/tower) - Ansible Tower provides a web UI, dashboard and rest interface to ansible.
+* [Ansible AWX](https://github.com/ansible/awx) - The Open Sourc version of Ansible Tower. \ No newline at end of file
diff --git a/clojure-macros.html.markdown b/clojure-macros.html.markdown
index 3864f676..6154d570 100644
--- a/clojure-macros.html.markdown
+++ b/clojure-macros.html.markdown
@@ -142,11 +142,8 @@ You'll want to be familiar with Clojure. Make sure you understand everything in
### Further Reading
-Writing Macros from [Clojure for the Brave and True](http://www.braveclojure.com/)
-[http://www.braveclojure.com/writing-macros/](http://www.braveclojure.com/writing-macros/)
+[Writing Macros](http://www.braveclojure.com/writing-macros/)
-Official docs
-[http://clojure.org/macros](http://clojure.org/macros)
+[Official docs](http://clojure.org/macros)
-When to use macros?
-[http://dunsmor.com/lisp/onlisp/onlisp_12.html](http://dunsmor.com/lisp/onlisp/onlisp_12.html)
+[When to use macros?](https://lispcast.com/when-to-use-a-macro/)
diff --git a/de-de/asciidoc-de.html.markdown b/de-de/asciidoc-de.html.markdown
index 60f8fa61..24100e0b 100644
--- a/de-de/asciidoc-de.html.markdown
+++ b/de-de/asciidoc-de.html.markdown
@@ -104,7 +104,7 @@ Um eine nummerierte Liste zu erstellen verwendest du Punkte.
. item 3
```
-Um Listen zu verschachteln musst du zusätzliche Sternchen und Punkte hinzufügen. Dies ist bis zu fünf Mal möglich.
+Um Listen zu verschachteln musst du zusätzliche Sternchen beziehungsweise Punkte hinzufügen. Dies ist bis zu fünf Mal möglich.
```
* foo 1
diff --git a/de-de/dynamic-programming-de.html.markdown b/de-de/dynamic-programming-de.html.markdown
index afa9a17c..58568b3b 100644
--- a/de-de/dynamic-programming-de.html.markdown
+++ b/de-de/dynamic-programming-de.html.markdown
@@ -68,9 +68,9 @@ for i=0 to n-1
### Einige bekannte DP Probleme
-- 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]()
-- Longest Common Subsequence - Tutorial and C Program source code : [http://www.thelearningpoint.net/computer-science/algorithms-dynamic-programming---longest-common-subsequence]()
+- [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)
+- [Longest Common Subsequence - Tutorial and C Program source code](http://www.thelearningpoint.net/computer-science/algorithms-dynamic-programming---longest-common-subsequence)
## Online Ressourcen
diff --git a/de-de/git-de.html.markdown b/de-de/git-de.html.markdown
index d2222d2c..7c68d785 100644
--- a/de-de/git-de.html.markdown
+++ b/de-de/git-de.html.markdown
@@ -20,7 +20,7 @@ Anmerkung des Übersetzers: Einige englische Begriffe wie *Repository*, *Commit*
Eine Versionsverwaltung erfasst die Änderungen einer Datei oder eines Verzeichnisses im Verlauf der Zeit.
-### Zentrale im Vergleich mit verteilter Versionverwaltung
+### Vergleich zwischen Zentraler und verteilter Versionverwaltung
* Zentrale Versionsverwaltung konzentriert sich auf das Synchronisieren, Verfolgen und Sichern von Dateien.
* Verteilte Versionsverwaltung konzentriert sich auf das Teilen der Änderungen. Jede Änderung hat eine eindeutige ID.
diff --git a/dynamic-programming.html.markdown b/dynamic-programming.html.markdown
index aed169fc..f5f1743c 100644
--- a/dynamic-programming.html.markdown
+++ b/dynamic-programming.html.markdown
@@ -42,9 +42,9 @@ for i=0 to n-1
### Some Famous DP Problems
-- 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]()
-- Longest Common Subsequence - Tutorial and C Program source code : [http://www.thelearningpoint.net/computer-science/algorithms-dynamic-programming---longest-common-subsequence]()
+- [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)
+- [Longest Common Subsequence - Tutorial and C Program source code](http://www.thelearningpoint.net/computer-science/algorithms-dynamic-programming---longest-common-subsequence)
## Online Resources
diff --git a/es-es/lambda-calculus-es.html.markdown b/es-es/lambda-calculus-es.html.markdown
new file mode 100644
index 00000000..d49545c2
--- /dev/null
+++ b/es-es/lambda-calculus-es.html.markdown
@@ -0,0 +1,216 @@
+---
+category: Algorithms & Data Structures
+name: Lambda Calculus
+contributors:
+ - ["Max Sun", "http://github.com/maxsun"]
+ - ["Yan Hui Hang", "http://github.com/yanhh0"]
+translators:
+ - ["Ivan Alburquerque", "https://github.com/AlburIvan"]
+lang: es-es
+---
+
+# Cálculo Lambda
+
+Cálculo Lambda (Cálculo-λ), originalmente creado por
+[Alonzo Church](https://es.wikipedia.org/wiki/Alonzo_Church),
+es el lenguaje de programación más pequeño del mundo.
+A pesar de no tener números, cadenas, valores booleanos o cualquier
+tipo de datos no funcional, el cálculo lambda se puede utilizar para
+representar cualquier máquina de Turing.
+
+El cálculo lambda se compone de 3 elementos: **variables**, **funciones** y
+**aplicaciones**.
+
+| Nombre | Sintaxis | Ejemplo | Explicación |
+|-------------|------------------------------------|-----------|-----------------------------------------------|
+| Variable | `<nombre>` | `x` | una variable llamada "x" |
+| Función | `λ<parámetro>.<cuerpo>` | `λx.x` | una función con parámetro "x" y cuerpo "x" |
+| Aplicación | `<función><variable o función>` | `(λx.x)a` | llamando a la función "λx.x" con el argumento "a" |
+
+La función más básica es la función de identidad: `λx.x` que es equivalente a
+`f(x) = x`. La primera "x" es el argumento de la función y la segunda es el
+cuerpo de la función.
+
+## Variables Libres vs. Enlazadas:
+
+- En la función `λx.x`, "x" se llama una variable enlazada porque está tanto en
+ el cuerpo de la función como en el parámetro.
+- En `λx.y`, "y" se llama variable libre porque nunca se declara de antemano.
+
+## Evaluación:
+
+Evaluación se realiza a través de
+[β-Reduction](https://es.wikipedia.org/wiki/C%C3%A1lculo_lambda#%CE%B2-reducci%C3%B3n),
+que es, esencialmente, sustitución de ámbito léxico.
+
+Al evaluar la expresión `(λx.x)a`, reemplazamos todas las ocurrencias de "x"
+en el cuerpo de la función con "a".
+
+- `(λx.x)a` evalúa a: `a`
+- `(λx.y)a` evalúa a: `y`
+
+Incluso puedes crear funciones de orden superior:
+
+- `(λx.(λy.x))a` evalúa a: `λy.a`
+
+Aunque el cálculo lambda tradicionalmente solo admite funciones
+de un solo parámetro, podemos crear funciones multiparamétricas usando
+una técnica llamada [Currificación](https://es.wikipedia.org/wiki/Currificación).
+
+- `(λx.λy.λz.xyz)` es equivalente a `f(x, y, z) = ((x y) z)`
+
+Algunas veces `λxy.<cuerpo>` es usado indistintamente con: `λx.λy.<cuerpo>`
+
+----
+
+Es importante reconocer que el cálculo lambda tradicional **no tiene números,
+caracteres ni ningún tipo de datos que no sea de función.**
+
+## Lógica Booleana:
+
+No hay "Verdadero" o "Falso" en el cálculo lambda. Ni siquiera hay un 1 o un 0.
+
+En vez:
+
+`T` es representado por: `λx.λy.x`
+
+`F` es representado por: `λx.λy.y`
+
+Primero, podemos definir una función "if" `λbtf` que devuelve
+`t` si `b` es Verdadero y `f` si `b` es Falso
+
+`IF` es equivalente a: `λb.λt.λf.b t f`
+
+Usando `IF` podemos definir los operadores lógicos booleanos básicos:
+
+`a AND b` es equivalente a: `λab.IF a b F`
+
+`a OR b` es equivalente a: `λab.IF a T b`
+
+`a NOT b` es equivalente a: `λa.IF a F T`
+
+*Note: `IF a b c` es esencialmente diciendo: `IF((a b) c)`*
+
+## Números:
+
+Aunque no hay números en el cálculo lambda, podemos codificar números usando
+[Númeral de Church](https://en.wikipedia.org/wiki/Church_encoding).
+
+Para cualquier número n: <code>n = λf.f <sup> n </sup></code> así:
+
+`0 = λf.λx.x`
+
+`1 = λf.λx.f x`
+
+`2 = λf.λx.f(f x)`
+
+`3 = λf.λx.f(f(f x))`
+
+Para incrementar un númeral de Church, usamos la función sucesora
+`S(n) = n + 1` que es:
+
+`S = λn.λf.λx.f((n f) x)`
+
+Usando el sucesor, podemos definir AGREGAR:
+
+`AGREGAR = λab.(a S)n`
+
+**Desafío:** intenta definir tu propia función de multiplicación!
+
+## Vamos más pequeño: SKI, SK y Iota
+
+### Combinador de SKI
+
+Sean S, K, I las siguientes funciones:
+
+`I x = x`
+
+`K x y = x`
+
+`S x y z = x z (y z)`
+
+Podemos convertir una expresión en el cálculo lambda en una expresión
+en el cálculo del combinador de SKI:
+
+1. `λx.x = I`
+2. `λx.c = Kc`
+3. `λx.(y z) = S (λx.y) (λx.z)`
+
+Tome el número 2 de Church por ejemplo:
+
+`2 = λf.λx.f(f x)`
+
+Para la parte interior `λx.f(f x)`:
+```
+ λx.f(f x)
+= S (λx.f) (λx.(f x)) (case 3)
+= S (K f) (S (λx.f) (λx.x)) (case 2, 3)
+= S (K f) (S (K f) I) (case 2, 1)
+```
+
+Así que:
+```
+ 2
+= λf.λx.f(f x)
+= λf.(S (K f) (S (K f) I))
+= λf.((S (K f)) (S (K f) I))
+= S (λf.(S (K f))) (λf.(S (K f) I)) (case 3)
+```
+
+Para el primer argumento `λf.(S (K f))`:
+```
+ λf.(S (K f))
+= S (λf.S) (λf.(K f)) (case 3)
+= S (K S) (S (λf.K) (λf.f)) (case 2, 3)
+= S (K S) (S (K K) I) (case 2, 3)
+```
+
+Para el segundo argumento `λf.(S (K f) I)`:
+```
+ λf.(S (K f) I)
+= λf.((S (K f)) I)
+= S (λf.(S (K f))) (λf.I) (case 3)
+= S (S (λf.S) (λf.(K f))) (K I) (case 2, 3)
+= S (S (K S) (S (λf.K) (λf.f))) (K I) (case 1, 3)
+= S (S (K S) (S (K K) I)) (K I) (case 1, 2)
+```
+
+Uniéndolos:
+```
+ 2
+= S (λf.(S (K f))) (λf.(S (K f) I))
+= S (S (K S) (S (K K) I)) (S (S (K S) (S (K K) I)) (K I))
+```
+
+Al expandir esto, terminaríamos con la misma expresión para el número 2 de Church nuevamente.
+
+### Cálculo del combinador SKI
+
+El cálculo del combinador SKI puede reducirse aún más. Podemos eliminar
+el combinador I observando que `I = SKK`. Podemos sustituir
+todos los 'I' con `SKK`.
+
+### Combinador Iota
+
+El cálculo del combinador SK todavía no se encuentra en su expresión mínima.
+Definiendo:
+
+```
+ι = λf.((f S) K)
+```
+
+Tenemos que:
+
+```
+I = ιι
+K = ι(ιI) = ι(ι(ιι))
+S = ι(K) = ι(ι(ι(ιι)))
+```
+
+## Para una lectura más avanzada:
+
+1. [A Tutorial Introduction to the Lambda Calculus](http://www.inf.fu-berlin.de/lehre/WS03/alpi/lambda.pdf)
+2. [Cornell CS 312 Recitation 26: The Lambda Calculus](http://www.cs.cornell.edu/courses/cs3110/2008fa/recitations/rec26.html)
+3. [Wikipedia - Lambda Calculus](https://es.wikipedia.org/wiki/Cálculo_lambda)
+4. [Wikipedia - SKI combinator calculus](https://en.wikipedia.org/wiki/SKI_combinator_calculus)
+5. [Wikipedia - Iota and Jot](https://en.wikipedia.org/wiki/Iota_and_Jot)
diff --git a/es-es/pyqt-es.html.markdown b/es-es/pyqt-es.html.markdown
new file mode 100644
index 00000000..6d4fdde7
--- /dev/null
+++ b/es-es/pyqt-es.html.markdown
@@ -0,0 +1,82 @@
+---
+category: tool
+tool: PyQT
+filename: learnpyqt-es.py
+contributors:
+ - ["Nathan Hughes", "https://github.com/sirsharpest"]
+translators:
+ - ["Adrian Rocamora", "https://github.com/adrianrocamora"]
+lang: es-es
+---
+
+**Qt** es un sistema altamente reconocido que permite desarrollar software multiplataforma que puede correr en diferentes entornos de software y hardware con pocos o ningún cambio. Aun así conserva la velocidad y poder de una aplicación nativa. **Qt** fue originalmente escrito en *C++*.
+
+Esta es una adaptación de la introducción a QT con C++ por [Aleksey Kholovchuk](https://github.com/vortexxx192), parte del código ejemplo debería resultar en la misma funcionalidad ¡pero usando python con PyQT!
+
+```python
+import sys
+from PyQt4 import QtGui
+
+def window():
+ # Crear el objeto de la aplicación
+ app = QtGui.QApplication(sys.argv)
+ # Crear un widget en el que colocaremos nuestra etiqueta
+ w = QtGui.QWidget()
+ # Agregamos nuestra etiqueta al widget
+ b = QtGui.QLabel(w)
+ # Agregamos texto a nuestra etiqueta
+ b.setText("Hello World!")
+ # Fijemos información de posición y tamaño del widget
+ w.setGeometry(100, 100, 200, 50)
+ b.move(50, 20)
+ # Proporcionemos un título a nuestra ventana
+ w.setWindowTitle("PyQt")
+ # Mostremos todo
+ w.show()
+ # Ejecutemos lo que hayamos solicitado ya inicializado el resto
+ sys.exit(app.exec_())
+
+if __name__ == '__main__':
+ window()
+
+```
+
+Para poder hacer uso de las funciones más avanzades en **pyqt** necesitamos agregar elementos adicionales.
+Aquí mostramos cómo introducir una caja de diálogo popup, útil para permitir al usuario confirmar su decisión o para brindarnos información.
+
+```Python
+import sys
+from PyQt4.QtGui import *
+from PyQt4.QtCore import *
+
+
+def window():
+ app = QApplication(sys.argv)
+ w = QWidget()
+ # Crear un botón y adjuntarlo al widget w
+ b = QPushButton(w)
+ b.setText("Press me")
+ b.move(50, 50)
+ # Indicar al botón b que llame esta función cuando reciba un click
+ # Nótese la falta de "()" en la llamada de la función
+ b.clicked.connect(showdialog)
+ w.setWindowTitle("PyQt Dialog")
+ w.show()
+ sys.exit(app.exec_())
+
+# Esta función debería crear una ventana de diálogo con un botón
+# que espera a recibir un click y luego sale del programa
+def showdialog():
+ d = QDialog()
+ b1 = QPushButton("ok", d)
+ b1.move(50, 50)
+ d.setWindowTitle("Dialog")
+ # Esta modalidad le indica al popup que bloquee al padre mientras activo
+ d.setWindowModality(Qt.ApplicationModal)
+ # Al recibir un click me gustaría que el proceso termine
+ b1.clicked.connect(sys.exit)
+ d.exec_()
+
+if __name__ == '__main__':
+ window()
+```
diff --git a/fr-fr/dynamic-programming-fr.html.markdown b/fr-fr/dynamic-programming-fr.html.markdown
index 54cca001..ea547dae 100644
--- a/fr-fr/dynamic-programming-fr.html.markdown
+++ b/fr-fr/dynamic-programming-fr.html.markdown
@@ -42,9 +42,9 @@ Le même concept peut être appliqué pour trouver le chemin le plus long dans u
### Problèmes classiques de programmation dynamique
-- L'algorithme de Floyd Warshall(EN) - 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]()
-- Problème du sac à dos(EN) - Tutorial and C Program source code: [http://www.thelearningpoint.net/computer-science/algorithms-dynamic-programming---the-integer-knapsack-problem]()
-- Plus longue sous-chaîne commune(EN) - Tutorial and C Program source code : [http://www.thelearningpoint.net/computer-science/algorithms-dynamic-programming---longest-common-subsequence]()
+- [L'algorithme de Floyd Warshall(EN) - 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)
+- [Problème du sac à dos(EN) - Tutorial and C Program source code](http://www.thelearningpoint.net/computer-science/algorithms-dynamic-programming---the-integer-knapsack-problem)
+- [Plus longue sous-chaîne commune(EN) - Tutorial and C Program source code](http://www.thelearningpoint.net/computer-science/algorithms-dynamic-programming---longest-common-subsequence)
## Online Resources
diff --git a/kotlin.html.markdown b/kotlin.html.markdown
index 81242bac..9bc8b420 100644
--- a/kotlin.html.markdown
+++ b/kotlin.html.markdown
@@ -20,7 +20,9 @@ package com.learnxinyminutes.kotlin
/*
The entry point to a Kotlin program is a function named "main".
-The function is passed an array containing any command line arguments.
+The function is passed an array containing any command-line arguments.
+Since Kotlin 1.3 the "main" function can also be defined without
+any parameters.
*/
fun main(args: Array<String>) {
/*
diff --git a/mercurial.html.markdown b/mercurial.html.markdown
index d1cac66c..330beb35 100644
--- a/mercurial.html.markdown
+++ b/mercurial.html.markdown
@@ -1,9 +1,9 @@
---
category: tool
-tool: hg
+tool: Mercurial
contributors:
- ["Will L. Fife", "http://github.com/sarlalian"]
-filename: LearnHG.txt
+filename: LearnMercurial.txt
---
Mercurial is a free, distributed source control management tool. It offers
@@ -18,37 +18,30 @@ anyone working with versioned files.
Version control is a system that keeps track fo changes to a set of file(s)
and/or directorie(s) over time.
-### Why Use Mercurial
+### Why use Mercurial?
* Distributed Architecture - Traditionally version control systems such as CVS
and Subversion are a client server architecture with a central server to
store the revsion history of a project. Mercurial however is a truly
distributed architecture, giving each devloper a full local copy of the
entire development history. It works independently of a central server.
-
* Fast - Traditionally version control systems such as CVS and Subversion are a
client server architecture with a central server to store the revsion history
of a project. Mercurial however is a truly distributed architecture, giving
each devloper a full local copy of the entire development history. It works
independently of a central server.
-
* Platform Independent - Mercurial was written to be highly platform
independent. Much of Mercurial is written in Python, with small performance
critical parts written in portable C. Binary releases are available for all
major platforms.
-
* Extensible - The functionality of Mercurial can be increased with extensions,
either by activating the official ones which are shipped with Mercurial or
-downloading some [from the
-wiki](https://www.mercurial-scm.org/wiki/UsingExtensions) or by [writing your
-own](https://www.mercurial-scm.org/wiki/WritingExtensions). Extensions are
-written in Python and can change the workings of the basic commands, add new
-commands and access all the core functions of Mercurial.
-
+downloading some [from the wiki](https://www.mercurial-scm.org/wiki/UsingExtensions) or by [writing your own](https://www.mercurial-scm.org/wiki/WritingExtensions). Extensions are written in
+Python and can change the workings of the basic commands, add new commands and
+access all the core functions of Mercurial.
* Easy to use - The Mercurial command set is consistent with what subversion
users would expect, so they are likely to feel right at home. Most dangerous
actions are part of extensions that need to be enabled to be used.
-
* Open Source - Mercurial is free software licensed under the terms of the [GNU
General Public License Version 2](http://www.gnu.org/licenses/gpl-2.0.txt) or
any later version.
@@ -76,7 +69,7 @@ any later version.
### init
Create a new repository in the given directory, the settings and stored
-information are in a directory named ".hg"
+information are in a directory named `.hg`.
```bash
$ hg init
@@ -102,7 +95,6 @@ $ hg help init
Show the differences between what is on disk and what is committed to the current
branch or tag.
-
```bash
# Will display the status of files
$ hg status
@@ -113,7 +105,7 @@ $ hg help status
### add
-Will add the specified files to the repository on the next commit
+Will add the specified files to the repository on the next commit.
```bash
# Add a file in the current directory
@@ -128,7 +120,7 @@ $ hg add *.rb
### branch
-Set or show the current branch name
+Set or show the current branch name.
*Branch names are permanent and global. Use 'hg bookmark' to create a
light-weight bookmark instead. See 'hg help glossary' for more information
@@ -146,7 +138,7 @@ marked working directory as branch new_branch
### tag
-Add one or more tags for the current or given revision
+Add one or more tags for the current or given revision.
Tags are used to name particular revisions of the repository and are very
useful to compare different revisions, to go back to significant earlier
@@ -215,7 +207,7 @@ $ hg diff -r 30 -r 20
### grep
-Search revision history for a pattern in specified files
+Search revision history for a pattern in specified files.
```bash
# Search files for a specific phrase
@@ -242,7 +234,7 @@ $ hg log -G
### merge
-Merge another revision into working directory
+Merge another revision into working directory.
```bash
# Merge changesets to local repository
@@ -305,7 +297,7 @@ $ hg push remote2
### rebase
-Move changeset (and descendants) to a different branch
+Move changeset (and descendants) to a different branch.
Rebase uses repeated merging to graft changesets from one part of history
(the source) onto another (the destination). This can be useful for
@@ -356,7 +348,7 @@ $ hg remove go_away.txt
$ hg remove *.txt
```
-## Further Information
+## Further information
* [Learning Mercurial in Workflows](https://www.mercurial-scm.org/guid)
* [Mercurial Quick Start](https://www.mercurial-scm.org/wiki/QuickStart)
diff --git a/ms-my/clojure-macros-my.html.markdown b/ms-my/clojure-macros-my.html.markdown
index 099f376e..325f92e0 100644
--- a/ms-my/clojure-macros-my.html.markdown
+++ b/ms-my/clojure-macros-my.html.markdown
@@ -144,11 +144,8 @@ Biasakan diri dengan Clojure terlebih dahulu. Pastikan anda memahami semuanya di
### Bacaaan Lanjut
-Writing Macros daripada [Clojure for the Brave and True](http://www.braveclojure.com/)
-[http://www.braveclojure.com/writing-macros/](http://www.braveclojure.com/writing-macros/)
+[Writing Macros daripada](http://www.braveclojure.com/writing-macros/)
-Dokumen rasmi
-[http://clojure.org/macros](http://clojure.org/macros)
+[Dokumen rasmi](http://clojure.org/macros)
-Bila perlu guna macro?
-[http://dunsmor.com/lisp/onlisp/onlisp_12.html](http://dunsmor.com/lisp/onlisp/onlisp_12.html)
+[Bila perlu guna macro?](https://lispcast.com/when-to-use-a-macro/)
diff --git a/nl-nl/dynamic-programming-nl.html.markdown b/nl-nl/dynamic-programming-nl.html.markdown
index 5186a3bf..e56a9774 100644
--- a/nl-nl/dynamic-programming-nl.html.markdown
+++ b/nl-nl/dynamic-programming-nl.html.markdown
@@ -46,9 +46,9 @@ for i=0 to n-1
### Enkele beroemde DP problemen
-- 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]()
-- Longest Common Subsequence - Tutorial and C Program source code : [http://www.thelearningpoint.net/computer-science/algorithms-dynamic-programming---longest-common-subsequence]()
+- [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)
+- [Longest Common Subsequence - Tutorial and C Program source code](http://www.thelearningpoint.net/computer-science/algorithms-dynamic-programming---longest-common-subsequence)
## Online Bronnen
diff --git a/php.html.markdown b/php.html.markdown
index 3b18aa60..40c9dd01 100644
--- a/php.html.markdown
+++ b/php.html.markdown
@@ -837,11 +837,14 @@ try {
// Handle exception
}
-// When using try catch blocks in a namespaced environment use the following
+// When using try catch blocks in a namespaced environment it is important to
+// escape to the global namespace, because Exceptions are classes, and the
+// Exception class exists in the global namespace. This can be done using a
+// leading backslash to catch the Exception.
try {
// Do something
-} catch (Exception $e) {
+} catch (\Exception $e) {
// Handle exception
}
diff --git a/pt-br/csharp-pt.html.markdown b/pt-br/csharp-pt.html.markdown
index be14a1c8..2ff59296 100644
--- a/pt-br/csharp-pt.html.markdown
+++ b/pt-br/csharp-pt.html.markdown
@@ -59,7 +59,7 @@ namespace Learning.CSharp
Console.Write("World");
///////////////////////////////////////////////////
- // Tpos e Variáveis
+ // Tipos e Variáveis
//
// Declare uma variável usando <tipo> <nome>
///////////////////////////////////////////////////
@@ -95,8 +95,8 @@ namespace Learning.CSharp
float fooFloat = 234.5f; // Precision: 7 digits
// f is used to denote that this variable value is of type float
- // Decimal - a 128-bits data type, with more precision than other floating-point types,
- // suited for financial and monetary calculations
+ // Decimal - um tipo de dados de 128 bits, com mais precisão do que outros tipos de ponto flutuante,
+ // adequado para cálculos financeiros e monetários
decimal fooDecimal = 150.3m;
// Boolean - true & false
@@ -294,9 +294,9 @@ on a new line! ""Wow!"", the masses cried";
case 3:
monthString = "March";
break;
- // You can assign more than one case to an action
- // But you can't add an action without a break before another case
- // (if you want to do this, you would have to explicitly add a goto case x
+ // Você pode declarar mais de um "case" para uma ação
+ // Mas você não pode adicionar uma ação sem um "break" antes de outro "case"
+ // (se você quiser fazer isso, você tem que explicitamente adicionar um "goto case x")
case 6:
case 7:
case 8:
@@ -336,28 +336,28 @@ on a new line! ""Wow!"", the masses cried";
}
///////////////////////////////////////
- // CLASSES - see definitions at end of file
+ // CLASSES - Veja definições no fim do arquivo
///////////////////////////////////////
public static void Classes()
{
- // See Declaration of objects at end of file
+ // Veja Declaração de objetos no fim do arquivo
- // Use new to instantiate a class
+ // Use new para instanciar uma classe
Bicycle trek = new Bicycle();
- // Call object methods
- trek.SpeedUp(3); // You should always use setter and getter methods
+ // Chame métodos do objeto
+ trek.SpeedUp(3); // Você deve sempre usar métodos setter e getter
trek.Cadence = 100;
- // ToString is a convention to display the value of this Object.
+ // ToString é uma convenção para exibir o valor desse Objeto.
Console.WriteLine("trek info: " + trek.Info());
- // Instantiate a new Penny Farthing
+ // Instancie um novo Penny Farthing
PennyFarthing funbike = new PennyFarthing(1, 10);
Console.WriteLine("funbike info: " + funbike.Info());
Console.Read();
- } // End main method
+ } // Fim do método principal
// CONSOLE ENTRY A console application must have a main method as an entry point
public static void Main(string[] args)
@@ -522,7 +522,7 @@ on a new line! ""Wow!"", the masses cried";
foreach (var key in responses.Keys)
Console.WriteLine("{0}:{1}", key, responses[key]);
- // DYNAMIC OBJECTS (great for working with other languages)
+ // OBJETOS DINÂMICOS (ótimo para trabalhar com outros idiomas)
dynamic student = new ExpandoObject();
student.FirstName = "First Name"; // No need to define class first!
@@ -730,10 +730,10 @@ on a new line! ""Wow!"", the masses cried";
set { _hasTassles = value; }
}
- // You can also define an automatic property in one line
- // this syntax will create a backing field automatically.
- // You can set an access modifier on either the getter or the setter (or both)
- // to restrict its access:
+ // Você também pode definir uma propriedade automática em uma linha
+        // Esta sintaxe criará um campo de apoio automaticamente.
+        // Você pode definir um modificador de acesso no getter ou no setter (ou ambos)
+        // para restringir seu acesso:
public bool IsBroken { get; private set; }
// Properties can be auto-implemented
@@ -854,8 +854,8 @@ on a new line! ""Wow!"", the masses cried";
}
/// <summary>
- /// Used to connect to DB for LinqToSql example.
- /// EntityFramework Code First is awesome (similar to Ruby's ActiveRecord, but bidirectional)
+ /// Exemplo de como conectar-se ao DB via LinqToSql.
+    /// EntityFramework First Code é impressionante (semelhante ao ActiveRecord de Ruby, mas bidirecional)
/// http://msdn.microsoft.com/en-us/data/jj193542.aspx
/// </summary>
public class BikeRepository : DbContext
diff --git a/pt-br/dynamic-programming-pt.html.markdown b/pt-br/dynamic-programming-pt.html.markdown
index 518660a3..93171955 100644
--- a/pt-br/dynamic-programming-pt.html.markdown
+++ b/pt-br/dynamic-programming-pt.html.markdown
@@ -64,9 +64,9 @@ grafo acíclico dirigido.
## Alguns Problemas Famosos de Programação Dinâmica
-- Floyd Warshall Algorithm - Tutorial and C Program source code: [http://www.thelearningpoint.net/computer-science/algorithms-all-to-all-shortest-paths-in-graphs---floyd-warshall-algorithm-with-c-program-source-code]()
-- Integer Knapsack Problem - Tutorial and C Program source code: [http://www.thelearningpoint.net/computer-science/algorithms-dynamic-programming---the-integer-knapsack-problem]()
-- Longest Common Subsequence - Tutorial and C Program source code : [http://www.thelearningpoint.net/computer-science/algorithms-dynamic-programming---longest-common-subsequence]()
+- [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)
+- [Longest Common Subsequence - Tutorial and C Program source code](http://www.thelearningpoint.net/computer-science/algorithms-dynamic-programming---longest-common-subsequence)
## Recursos Online (EN)
diff --git a/pt-br/haxe-pt.html.markdown b/pt-br/haxe-pt.html.markdown
new file mode 100644
index 00000000..13264dec
--- /dev/null
+++ b/pt-br/haxe-pt.html.markdown
@@ -0,0 +1,795 @@
+---
+language: haxe
+filename: LearnHaxe3-br.hx
+contributors:
+ - ["Justin Donaldson", "https://github.com/jdonaldson/"]
+ - ["Dan Korostelev", "https://github.com/nadako/"]
+translators:
+ - ["David Lima", "https://github.com/davelima/"]
+lang: pt-br
+---
+
+Haxe é uma linguagem baseada na web que provê suporte a C++, C#, SWF/ActionScript,
+Java e Neko byte code (também desenvolvida pelo autor de Haxe). Observe que
+este guia é para a versão 3 de Haxe. Alguns pontos do guia são aplicáveis
+para versões anteriores, mas é recomendado que você busque outras referências
+para essas versões.
+
+
+```csharp
+/*
+ Bem vindo ao Aprenda Haxe 3 em 15 minutos. http://www.haxe.org
+ Este é um tutorial executável. Você pode compilar e rodar este tutorial
+ usando o compilador haxe, estando no mesmo diretório de LearnHaxe.hx:
+ $> haxe -main LearnHaxe3 -x out
+
+ Olhe para os sinais de /* e */ em volta desses parágrafos. Nós estamos
+ dentro de um "Comentário multilinha". Nós podemos colocar observações aqui
+ e elas serão ignoradas pelo compilador.
+
+ Comentários multilinha também são utilizados para gerar documentação haxedoc,
+ seguindo o estilo javadoc. Eles serão usados pelo haxedoc se precerem imediatamente
+ uma classe, uma função de uma classe ou uma variável de uma classe.
+
+ */
+
+// Duas barras, como as dessa linha, farão um comentário de linha única.
+
+
+/*
+ Este será o primeiro código haxe de verdade, e está declarando um pacote vazio.
+ Não é necessário usar um pacote, mas ele será útil se você quiser criar
+ um namespace para o seu código (exemplo: org.seuapp.SuaClasse).
+
+ Omitir a declaração de pacote é a mesma coisa que declarar um pacote vazio.
+ */
+package; // pacote vazio, sem namespace.
+
+/*
+ Pacotes são diretórios que contém módulos. Cada módulo é um arquivo .hx que
+ contém tipos definidos em um pacote. Nomes de pacotes (ex. org.seuapp)
+ devem estar em letras minúsculas, enquanto nomes de módulos devem começar
+ com uma letra maiúscula. Um módulo contem um ou mais tipos, cujo os nomes
+ também devem começar com uma letra maiúscula.
+
+ Exemplo: a classe "org.seuapp.Foo" deve ter a estrutura de diretório org/module/Foo.hx,
+ sendo acessível do diretório do compilador ou caminho da classe.
+
+ Se você importar código de outros arquivos, isso deve ser declarado antes
+ do restante do código. Haxe disponibiliza várias classes padrões para você
+ começar:
+ */
+import haxe.ds.ArraySort;
+
+// você pode importar várias classes/módulos de uma vez usando "*"
+import haxe.ds.*;
+
+// você pode importar campos estáticos
+import Lambda.array;
+
+// você também pode usar "*" para importar todos os campos estáticos
+import Math.*;
+
+/*
+ Você também pode importar classes de uma forma diferente, habilitando-as para
+ extender a funcionalidade de outras classes, como um "mixin". Falaremos sobre
+ "using" em breve.
+ */
+using StringTools;
+
+/*
+ Typedefs são como variáveis... para tipos. Eles devem ser declarados antes
+ de qualquer código. Veremos isso em breve.
+ */
+typedef FooString = String;
+
+// Typedefs também podem referenciar tipos "estruturais". Também veremos isso em breve.
+typedef FooObject = { foo: String };
+
+/*
+ Esta é a definição da classe. É a classe principal do arquivo, visto que
+ possui o mesmo nome (LearnHaxe3)
+ */
+class LearnHaxe3{
+ /*
+ Se você quiser que um determinado código rode automaticamente, você
+ precisa colocá-lo em uma função estática "main", e especificar a classe
+ nos argumentos do compilador.
+ Nesse caso, nós especificamos a classe "LearnHaxe3" no nos argumentos
+ do compilador acima.
+ */
+ static function main(){
+
+ /*
+ Trace é o método padrão para imprimir expressões haxe na tela.
+ Temos diferentes métodos para conseguir isso em diferentes destinos.
+ Por exemplo: Java, C++, C#, etc. irão imprimir para stdout.
+ Javascript irá imprimir no console.log, e Flash irá imprimir para um
+ TextField anexado. Todos os "traces" imprimem também uma linha em branco
+ por padrão. Por fim, é possível prevenir um trace de ser exibido usando
+ o argumento "--no-traces" no compilador.
+ */
+ trace("Olá mundo, com trace()!");
+
+ /*
+ Trace pode tratar qualquer tipo de valor ou objeto. O método tentará
+ imprimir a representação de uma expressão da melhor forma. Você também
+ pode concatenar strings usando o operador "+":
+ */
+ trace( " Integer: " + 10 + " Float: " + 3.14 + " Boolean: " + true);
+
+ /*
+ Em Haxe, é obrigatório separar expressões no mesmo bloco com ';'. Mas
+ é possível colocar duas expressões na mesma linha, dessa forma:
+ */
+ trace('duas expressões..'); trace('uma linha');
+
+
+ //////////////////////////////////////////////////////////////////
+ // Tipos & Variáveis
+ //////////////////////////////////////////////////////////////////
+ trace("***Tipos & Variáveis***");
+
+ /*
+ Vcoê pode atrelar valores e referências à estruturas usando a
+ palavra-chave "var":
+ */
+ var um_inteiro:Int = 1;
+ trace(um_inteiro + " é o valor de um_inteiro");
+
+
+ /*
+ Haxe é tipada estaticamente, então "um_inteiro" temos que declarar
+ um valor do tipo "Int", e o restante da expressão atrela o valor "1"
+ a esta variável. Em muitos casos, não é necessário declarar o tipo.
+ Aqui, o compilador haxe assume que o tipo de "outro_inteiro" deve
+ ser "Int"
+ */
+ var outro_inteiro = 2;
+ trace(outro_inteiro + " é o valor de outro_inteiro");
+
+ // O método $type() imprime o tipo que o compilador assume:
+ $type(outro_inteiro);
+
+ // Você também pode representar inteiros em hexadecimal:
+ var hex_inteiro = 0xffffff;
+
+ /*
+ Haxe usa precisão de pltaforma para os tamanhos de Int e Float.
+ Ele também usa o comportamento de plataforma para sobrecarga.
+ (É possível ter outros tipos numéricos e comportamentos usando
+ bibliotecas especiais)
+ */
+
+ /*
+ Em adição a valores simples como Integers, Floats e Booleans,
+ Haxe disponibiliza implementações padrões de bibliotecas para
+ dados comuns de estrutura como strings, arrays, lists e maps:
+ */
+
+ var uma_string = "alguma" + 'string'; // strings podem estar entre aspas simples ou duplas
+ trace(uma_string + " é o valor de uma_string");
+
+ /*
+ Strings podem ser "interpoladas" se inserirmos variáveis em
+ posições específicas. A string deve estar entre aspas simples, e as
+ variáveis devem ser precedidas por "$". Expressões podem estar entre
+ ${...}.
+ */
+ var x = 1;
+ var uma_string_interpolada = 'o valor de x é $x';
+ var outra_string_interpolada = 'o valor de x + 1 é ${x + 1}';
+
+ /*
+ Strings são imutáveis, métodos retornarão uma cópia de partes
+ ou de toda a string. (Veja também a classe StringBuf)
+ */
+ var uma_sub_string = a_string.substr(0,4);
+ trace(uma_sub_string + " é o valor de a_sub_string");
+
+ /*
+ Regex também são suportadas, mas não temos espaço suficiente para
+ entrar em muitos detalhes.
+ */
+ var re = ~/foobar/;
+ trace(re.match('foo') + " é o valor de (~/foobar/.match('foo')))");
+
+ /*
+ Arrays são indexadas a partir de zero, dinâmicas e mutáveis. Valores
+ faltando são definidos como null.
+ */
+ var a = new Array<String>(); // um array que contém Strings
+ a[0] = 'foo';
+ trace(a.length + " é o valor de a.length");
+ a[9] = 'bar';
+ trace(a.length + " é o valor de a.length (depois da modificação)");
+ trace(a[3] + " é o valor de a[3]"); // null
+
+ /*
+ Arrays são *genéricas*, então você pode indicar quais valores elas
+ contém usando um parâmetro de tipo:
+ */
+ var a2 = new Array<Int>(); // um Array de Ints
+ var a3 = new Array<Array<String>>(); // um Array de Arrays (de Strings).
+
+ /*
+ Mapas são estruturas simples de chave/valor. A chave e o valor podem
+ ser de qualquer tipo.
+ */
+ var m = new Map<String, Int>(); // As chaves são strings, os valores são Ints.
+ m.set('foo', 4);
+ // Você também pode usar a notação de array;
+ m['bar'] = 5;
+ trace(m.exists('bar') + " é o valor de m.exists('bar')");
+ trace(m.get('bar') + " é o valor de m.get('bar')");
+ trace(m['bar'] + " é o valor de m['bar']");
+
+ var m2 = ['foo' => 4, 'baz' => 6]; // Syntaxe alternativa de map
+ trace(m2 + " é o valor de m2");
+
+ /*
+ Lembre-se, você pode usar descoberta de tipo. O compilador
+ Haxe irá decidir o tipo da variável assim que você passar um
+ argumento que define um parâmetro de tipo.
+ */
+ var m3 = new Map();
+ m3.set(6, 'baz'); // m3 agora é Map<Int,String>
+ trace(m3 + " é o valor de m3");
+
+ /*
+ Haxe possui mais algumas estruturas de dados padrões no módulo haxe.ds,
+ tais como List, Stack e BalancedTree
+ */
+
+
+ //////////////////////////////////////////////////////////////////
+ // Operadores
+ //////////////////////////////////////////////////////////////////
+ trace("***OPERADORES***");
+
+ // aritmética básica
+ trace((4 + 3) + " é o valor de (4 + 3)");
+ trace((5 - 1) + " é o valor de (5 - 1)");
+ trace((2 * 4) + " é o valor de (2 * 4)");
+ trace((8 / 3) + " é o valor de (8 / 3) (divisão sempre produz Floats)");
+ trace((12 % 4) + " é o valor de (12 % 4)");
+
+
+ // comparação básica
+ trace((3 == 2) + " é o valor de 3 == 2");
+ trace((3 != 2) + " é o valor de 3 != 2");
+ trace((3 > 2) + " é o valor de 3 > 2");
+ trace((3 < 2) + " é o valor de 3 < 2");
+ trace((3 >= 2) + " é o valor de 3 >= 2");
+ trace((3 <= 2) + " é o valor de 3 <= 2");
+
+ // operadores bit-a-bit padrões
+ /*
+ ~ Complemento bit-a-bit unário
+ << Deslocamento a esquerda
+ >> Deslocamento a direita
+ >>> Deslocamento a direita com preenchimento de 0
+ & Bit-a-bit AND
+ ^ Bit-a-bit OR exclusivo
+ | Bit-a-bit OR inclusivo
+ */
+
+ // incrementos
+ var i = 0;
+ trace("Incrementos e decrementos");
+ trace(i++); //i = 1. Pós-incremento
+ trace(++i); //i = 2. Pré-incremento
+ trace(i--); //i = 1. Pós-decremento
+ trace(--i); //i = 0. Pré-decremento
+
+ //////////////////////////////////////////////////////////////////
+ // Estruturas de controle
+ //////////////////////////////////////////////////////////////////
+ trace("***ESTRUTURAS DE CONTROLE***");
+
+ // operadores if
+ var j = 10;
+ if (j == 10){
+ trace("isto é impresso");
+ } else if (j > 10){
+ trace("não é maior que 10, então não é impresso");
+ } else {
+ trace("também não é impresso.");
+ }
+
+ // temos também um if "ternário":
+ (j == 10) ? trace("igual a 10") : trace("diferente de 10");
+
+ /*
+ Por fim, temos uma outra forma de estrutura de controle que opera
+ e na hora da compilação: compilação condicional.
+ */
+#if neko
+ trace('olá de neko');
+#elseif js
+ trace('olá de js');
+#else
+ trace('olá de outra plataforma!');
+#end
+ /*
+ O código compilado irá mudar de acordo com o alvo de plataforma.
+ Se estivermos compilando para neko (-x ou -neko), só teremos a
+ saudação de neko.
+ */
+
+
+ trace("Loops e Interações");
+
+ // loop while
+ var k = 0;
+ while(k < 100){
+ // trace(counter); // irá iprimir números de 0 a 99
+ k++;
+ }
+
+ // loop do-while
+ var l = 0;
+ do{
+ trace("do sempre rodará pelo menos uma vez");
+ } while (l > 0);
+
+ // loop for
+ /*
+ Não há loop for no estilo C para Haxe, pois é propenso
+ a erros e não é necessário. Ao invés disso, Haxe possui
+ uma versão muito mais simples e segura que usa Iterators
+ (veremos isso logo mais).
+ */
+ var m = [1,2,3];
+ for (val in m){
+ trace(val + " é o valor de val no array m");
+ }
+
+ // Perceba que você pode iterar em um índice usando uma lista limitada
+ // (veremos isso em breve também)
+ var n = ['foo', 'bar', 'baz'];
+ for (val in 0...n.length){
+ trace(val + " é o valor de val (um índice de n)");
+ }
+
+
+ trace("Compreensões de array");
+
+ // Compreensões de array servem para que você posse iterar um array
+ // enquanto cria filtros e modificações
+ var n_filtrado = [for (val in n) if (val != "foo") val];
+ trace(n_filtrado + " é o valor de n_filtrado");
+
+ var n_modificado = [for (val in n) val += '!'];
+ trace(n_modificado + " é o valor de n_modificado");
+
+ var n_filtrado_e_modificado = [for (val in n) if (val != "foo") val += "!"];
+ trace(n_filtrado_e_modificado + " é o valor de n_filtrado_e_modificado");
+
+ //////////////////////////////////////////////////////////////////
+ // Blocos Switch (Tipos de valor)
+ //////////////////////////////////////////////////////////////////
+ trace("***BLOCOS SWITCH (Tipos de valor)***");
+
+ /*
+ Blocos Switch no Haxe são muito poderosos. Além de funcionar com
+ valores básicos como strings e ints, também funcionam com tipos
+ algébricos em enums (falaremos sobre enums depois).
+ Veja alguns exemplos de valor básico por enquanto:
+ */
+ var meu_cachorro = "fido";
+ var coisa_favorita = "";
+ switch(meu_cachorro){
+ case "fido" : favorite_thing = "osso";
+ case "rex" : favorite_thing = "sapato";
+ case "spot" : favorite_thing = "bola de tênis";
+ default : favorite_thing = "algum brinquedo desconhecido";
+ // case _ : favorite_thing = "algum brinquedo desconhecido"; // mesma coisa que default
+ }
+ // O case "_" acima é um valor "coringa" que
+ // que funcionará para qualquer coisa.
+
+ trace("O nome do meu cachorro é " + meu_cachorro
+ + ", e sua coisa favorita é: "
+ + coisa_favorita);
+
+ //////////////////////////////////////////////////////////////////
+ // Declarações de expressão
+ //////////////////////////////////////////////////////////////////
+ trace("***DECLARAÇÕES DE EXPRESSÃO***");
+
+ /*
+ As declarações de controle em Haxe são muito poderosas pois
+ toda declaração também é uma expressão, considere o seguinte:
+ */
+
+ // declarações if
+ var k = if (true) 10 else 20;
+
+ trace("k igual a ", k); // retorna 10
+
+ var outra_coisa_favorita = switch(meu_cachorro) {
+ case "fido" : "ursinho";
+ case "rex" : "graveto";
+ case "spot" : "bola de futebol";
+ default : "algum brinquedo desconhecido";
+ }
+
+ trace("O nome do meu cachorro é " + meu cachorro
+ + ", e sua outra coisa favorita é: "
+ + outra_coisa_favorita);
+
+ //////////////////////////////////////////////////////////////////
+ // Convertendo tipos de valores
+ //////////////////////////////////////////////////////////////////
+ trace("***CONVERTENDO TIPOS DE VALORES***");
+
+ // Você pode converter strings em ints de forma bem fácil.
+
+ // string para int
+ Std.parseInt("0"); // retorna 0
+ Std.parseFloat("0.4"); // retorna 0.4;
+
+ // int para string
+ Std.string(0); // retorna "0";
+ // concatenar com strings irá converter automaticamente em string.
+ 0 + ""; // retorna "0";
+ true + ""; // retorna "true";
+ // Veja a documentação de parseamento em Std para mais detalhes.
+
+
+ //////////////////////////////////////////////////////////////////
+ // Lidando com Tipos
+ //////////////////////////////////////////////////////////////////
+
+ /*
+ Como mencionamos anteriormente, Haxe é uma linguagem tipada
+ estaticamente. Tipagem estática é uma coisa maravilhosa. Isto
+ permite autocompletar mais preciso, e pode ser usado para checar
+ completamente o funcionamento de um programa. Além disso, o compilador
+ Haxe é super rápido.
+
+ *ENTRETANTO*, há momentos em que você espera que o compilador apenas
+ deixe algo passar, e não lance um "type error" em um determinado caso.
+
+ Para fazer isso, Haxe tem duas palavras-chave separadas. A primeira
+ é o tipo "Dynamic":
+ */
+ var din: Dynamic = "qualquer tipo de variável, assim como essa string";
+
+ /*
+ Tudo o que você sabe sobre uma variável Dynamic é que o compilador
+ não irá mais se preocupar com o tipo dela. É como uma variável
+ "coringa": você pode usar isso ao invés de qualquer tipo de variável,
+ e você pode atrelar qualquer valor a essa variável.
+
+ A outra (e mais extrema) opção é a palavra-chave "untyped":
+ */
+
+ untyped {
+ var x:Int = 'foo'; // não faz sentido!
+ var y:String = 4; // loucura!
+ }
+
+ /*
+ A palavra-chave "untyped" opera em *blocos* inteiros de código,
+ ignorando qualquer verificação de tipo que seria obrigatória em
+ outros casos. Essa palavra-chave deve ser usada com muita cautela,
+ como em situações limitadas de compilação condicional onde a
+ verificação de tipo pode ser um obstáculo.
+
+ No geral, ignorar verificações de tipo *não* é recomendado. Use
+ os modelos de enum, herança ou estrutural para garantir o correto
+ funcionamento do seu programa. Só quando você tiver certeza de que
+ nenhum desses modelos funcionam no seu caso, você deve usar "Dynamic"
+ ou "untyped".
+ */
+
+ //////////////////////////////////////////////////////////////////
+ // Programação básica orientada a objetos
+ //////////////////////////////////////////////////////////////////
+ trace("***PROGRAMAÇÃO BÁSICA ORIENTADA A OBJETOS***");
+
+
+ /*
+ Cria uma instância da FooClass. As definicções dessas classes
+ estão no final do arquivo.
+ */
+ var instancia_foo = new FooClass(3);
+
+ // lê a variável pública normalmente
+ trace(instancia_foo.variavel_publica + " é o valor de instancia_foo.variavel_publica");
+
+ // nós podemos ler essa variável
+ trace(instancia_foo.publica_leitura + " é o valor de instancia_foo.publica_leitura");
+ // mas não podemos escrever nela
+ // instancia_foo.publica_leitura = 4; // isso irá causar um erro se descomentado:
+ // trace(instancia_foo.public_escrita); // e isso também.
+
+ // chama o método toString:
+ trace(instancia_foo + " é o valor de instancia_foo");
+ // mesma coisa:
+ trace(instancia_foo.toString() + " é o valor de instancia_foo.toString()");
+
+
+ /*
+ A instancia_foo é do tipo "FooClass", enquanto acceptBarInstance
+ é do tipo BarClass. Entretanto, como FooClass extende BarClass,
+ ela é aceita.
+ */
+ BarClass.acceptBarInstance(instancia_foo);
+
+ /*
+ As classes abaixo têm mais alguns exemplos avançados, o método
+ "example()" executará esses exemplos aqui:
+ */
+ SimpleEnumTest.example();
+ ComplexEnumTest.example();
+ TypedefsAndStructuralTypes.example();
+ UsingExample.example();
+
+ }
+
+}
+
+/*
+ Essa é a "classe filha" do classe principal LearnHaxe3
+ */
+class FooClass extends BarClass implements BarInterface{
+ public var variavel_publica:Int; // variáveis públicas são acessíveis de qualquer lugar
+ public var publica_leitura (default, null): Int; // somente leitura pública habilitada
+ public var publica_escrita (null, default): Int; // somente escrita pública habilitada
+ public var property (get, set): Int; // use este estilo para habilitar getters e setters
+
+ // variáveis privadas não estão disponíveis fora da classe.
+ // veja @:allow para formas de fazer isso.
+ var _private:Int; // variáveis são privadas se não forem marcadas como públicas
+
+ // um construtor público
+ public function new(arg:Int){
+ // chama o construtor do objeto pai, já que nós extendemos a BarClass:
+ super();
+
+ this.variavel_publica = 0;
+ this._private = arg;
+
+ }
+
+ // getter para _private
+ function get_property() : Int {
+ return _private;
+ }
+
+ // setter para _private
+ function set_property(val:Int) : Int {
+ _private = val;
+ return val;
+ }
+
+ // função especial que é chamada sempre que uma instância é convertida em string.
+ public function toString(){
+ return _private + " com o método toString()!";
+ }
+
+ // essa classe precisa ter essa função definida, pois ela implementa
+ // a interface BarInterface
+ public function baseFunction(x: Int) : String{
+ // converte o int em string automaticamente
+ return x + " foi passado pela baseFunction!";
+ }
+}
+
+/*
+ Uma classe simples para extendermos
+*/
+class BarClass {
+ var base_variable:Int;
+ public function new(){
+ base_variable = 4;
+ }
+ public static function acceptBarInstance(b:BarClass){
+ }
+}
+
+/*
+ Uma interface simples para implementarmos
+*/
+interface BarInterface{
+ public function baseFunction(x:Int):String;
+}
+
+//////////////////////////////////////////////////////////////////
+// Declarações Enum e Switch
+//////////////////////////////////////////////////////////////////
+
+/*
+ Enums no Haxe são muito poderosos. Resumidamente, enums são
+ um tipo com um número limitado de estados:
+ */
+
+enum SimpleEnum {
+ Foo;
+ Bar;
+ Baz;
+}
+
+// Uma classe que faz uso desse enum:
+
+class SimpleEnumTest{
+ public static function example(){
+ var e_explicit:SimpleEnum = SimpleEnum.Foo; // você pode especificar o nome "completo"
+ var e = Foo; // bas descoberta de tipo também funciona.
+ switch(e){
+ case Foo: trace("e era Foo");
+ case Bar: trace("e era Bar");
+ case Baz: trace("e era Baz"); // comente esta linha e teremos um erro.
+ }
+
+ /*
+ Isso não parece tão diferente de uma alteração simples de valor em strings.
+ Entretanto, se nós não incluirmos *todos* os estados, o compilador
+ reclamará. Você pode testar isso comentando a linha mencionada acima.
+
+ Você também pode especificar um valor padrão (default) para enums:
+ */
+ switch(e){
+ case Foo: trace("e é Foo outra vez");
+ default : trace("default funciona aqui também");
+ }
+ }
+}
+
+/*
+ Enums vão muito mais além que estados simples, nós também
+ podemos enumerar *construtores*, mas nós precisaremos de um
+ exemplo mais complexo de enum:
+ */
+enum ComplexEnum{
+ IntEnum(i:Int);
+ MultiEnum(i:Int, j:String, k:Float);
+ SimpleEnumEnum(s:SimpleEnum);
+ ComplexEnumEnum(c:ComplexEnum);
+}
+// Observação: O enum acima pode incluir *outros* enums também, incluindo ele mesmo!
+// Observação: Isto é o que chamamos de *Tipos de dado algébricos* em algumas outras linguagens.
+
+class ComplexEnumTest{
+ public static function example(){
+ var e1:ComplexEnum = IntEnum(4); // especificando o parâmetro enum
+ /*
+ Agora nós podemos usar switch no enum, assim como extrair qualquer
+ parâmetros que ele possa ter.
+ */
+ switch(e1){
+ case IntEnum(x) : trace('$x foi o parâmetro passado para e1');
+ default: trace("Isso não deve ser impresso");
+ }
+
+ // outro parâmetro aqui que também é um enum... um enum enum?
+ var e2 = SimpleEnumEnum(Foo);
+ switch(e2){
+ case SimpleEnumEnum(s): trace('$s foi o parâmetro passado para e2');
+ default: trace("Isso não deve ser impresso");
+ }
+
+ // enum dentro de enum dentro de enum
+ var e3 = ComplexEnumEnum(ComplexEnumEnum(MultiEnum(4, 'hi', 4.3)));
+ switch(e3){
+ // Você pode buscar por certos enums aninhados especificando-os
+ // explicitamente:
+ case ComplexEnumEnum(ComplexEnumEnum(MultiEnum(i,j,k))) : {
+ trace('$i, $j, e $k foram passados dentro desse monstro aninhado.');
+ }
+ default: trace("Isso não deve ser impresso");
+ }
+ /*
+ Veja outros "tipos de dado algébricos" (GADT, do inglês) para mais
+ detalhes sobre o porque eles são tão úteis.
+ */
+ }
+}
+
+class TypedefsAndStructuralTypes {
+ public static function example(){
+ /*
+ Aqui nós usaremos tipos typedef, ao invés de tipos base.
+ Lá no começo, nós definimos que o tipo "FooString" é um tipo "String".
+ */
+ var t1:FooString = "alguma string";
+
+ /*
+ Aqui nós usamos typedefs para "tipos estruturais" também. Esses tipos
+ são definidos pela sua estrutura de campos, não por herança de classe.
+ Aqui temos um objeto anônimo com um campo String chamado "foo":
+ */
+
+ var anon_obj = { foo: 'hi' };
+
+ /*
+ A variável anon_obj não tem um tipo declarado, e é um objeto anônimo
+ de acordo com o compilador. Entretanto, lembra que lá no início nós
+ declaramos a typedef FooObj? Visto que o anon_obj tem a mesma estrutura,
+ nós podemos usar ele em qualquer lugar que um "FooObject" é esperado.
+ */
+
+ var f = function(fo:FooObject){
+ trace('$fo foi passado para esta função');
+ }
+ f(anon_obj); // chama a assinatura de FooObject com anon_obj.
+
+ /*
+ Note que typedefs podem ter campos opcionais também, marcados com "?"
+
+ typedef OptionalFooObj = {
+ ?optionalString: String,
+ requiredInt: Int
+ }
+ */
+
+ /*
+ Typedefs também funcionam com compilação condicional. Por exemplo,
+ nós poderíamos ter incluído isso no topo deste arquivo:
+
+#if( js )
+ typedef Surface = js.html.CanvasRenderingContext2D;
+#elseif( nme )
+ typedef Surface = nme.display.Graphics;
+#elseif( !flash9 )
+ typedef Surface = flash8.MovieClip;
+#elseif( java )
+ typedef Surface = java.awt.geom.GeneralPath;
+#end
+
+ E teríamos apenas um tipo "Surface" para funcionar em todas
+ essas plataformas.
+ */
+ }
+}
+
+class UsingExample {
+ public static function example() {
+
+ /*
+ A palavra-chave "using" é um tipo especial de import de classe que
+ altera o comportamento de qualquer método estático na classe.
+
+ Neste arquivo, nós aplicamos "using" em "StringTools", que contém
+ alguns métodos estáticos para tratar tipos String.
+ */
+ trace(StringTools.endsWith("foobar", "bar") + " deve ser verdadeiro!");
+
+ /*
+ Com um import "using", o primeiro argumento é extendido com o método.
+ O que isso significa? Bem, como "endsWith" tem um primeiro argumento
+ de tipo "String", isso significa que todos os tipos "String" agora
+ possuem o método "endsWith":
+ */
+ trace("foobar".endsWith("bar") + " deve ser verdadeiro!");
+
+ /*
+ Essa técnica habilita uma grande quantidade de expressões para certos
+ tipos, e limita o escopo de modificações para um único arquivo.
+
+ Note que a instância String *não* é modificada em tempo de execução.
+ O novo método adicionado não é uma parte da instância anexada, e o
+ compilador ainda irá gerar o código equivalente ao método estático.
+ */
+ }
+
+}
+
+```
+Isso foi apenas o começo do que Haxe pode fazer. Para uma documentação de todos
+os recursos de Haxe, veja o [manual](https://haxe.org/manual) e a
+[documentação de API](https://api.haxe.org/). Para um diretório de bibliotecas de terceiros
+disponíveis, veja a [Haxelib](https://lib.haxe.org/)
+
+Para tópicos mais avançados, dê uma olhada em:
+
+* [Tipos abstratos](https://haxe.org/manual/types-abstract.html)
+* [Macros](https://haxe.org/manual/macro.html)
+* [Recursos do compilador](https://haxe.org/manual/cr-features.html)
+
+Por fim, participe do [forum Haxe](https://community.haxe.org/),
+ou no IRC [#haxe onfreenode](http://webchat.freenode.net/), ou no
+[Chat Gitter](https://gitter.im/HaxeFoundation/haxe).
diff --git a/pt-br/paren-pt.html.markdown b/pt-br/paren-pt.html.markdown
index 464a69d2..92414ba3 100644
--- a/pt-br/paren-pt.html.markdown
+++ b/pt-br/paren-pt.html.markdown
@@ -182,8 +182,8 @@ a ; => (3 2)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Macros lhe permitem estender a sintaxe da linguagem.
-;; Os macros no Paren são fáceis.
-;; Na verdade, (defn) é um macro.
+;; As macros no Paren são fáceis.
+;; Na verdade, (defn) é uma macro.
(defmacro setfn (nome ...) (set nome (fn ...)))
(defmacro defn (nome ...) (def nome (fn ...)))
@@ -191,6 +191,6 @@ a ; => (3 2)
(defmacro infix (a op ...) (op a ...))
(infix 1 + 2 (infix 3 * 4)) ; => 15
-;; Macros não são higiênicos, você pode sobrescrever as variáveis já existentes!
-;; Eles são transformações de códigos.
+;; Macros não são higiênicas, você pode sobrescrever as variáveis já existentes!
+;; Elas são transformações de códigos.
```
diff --git a/pt-br/python3-pt.html.markdown b/pt-br/python3-pt.html.markdown
index 9b6bd1b6..ea0617f4 100644
--- a/pt-br/python3-pt.html.markdown
+++ b/pt-br/python3-pt.html.markdown
@@ -105,9 +105,9 @@ False or True # => True
1 < 2 < 3 # => True
2 < 3 < 2 # => False
-# (operador 'is' e operador '==') is verifica se duas referenciam um
-# mesmo objeto, mas == verifica se as variáveis apontam para o
-# mesmo valor.
+# (operador 'is' e operador '==') is verifica se duas variáveis
+# referenciam um mesmo objeto, mas == verifica se as variáveis
+# apontam para o mesmo valor.
a = [1, 2, 3, 4] # Referência a uma nova lista, [1, 2, 3, 4]
b = a # b referencia o que está referenciado por a
b is a # => True, a e b referenciam o mesmo objeto
diff --git a/pt-br/ruby-pt.html.markdown b/pt-br/ruby-pt.html.markdown
index 1078f6c5..7ae28ac2 100644
--- a/pt-br/ruby-pt.html.markdown
+++ b/pt-br/ruby-pt.html.markdown
@@ -71,7 +71,7 @@ false.class #=> FalseClass
2 <= 2 #=> true
2 >= 2 #=> true
-# Strings são objects
+# Strings são objetos
'Eu sou uma string'.class #=> String
"Eu também sou uma string".class #=> String
diff --git a/pt-br/typescript-pt.html.markdown b/pt-br/typescript-pt.html.markdown
index f072b257..077aa2cc 100644
--- a/pt-br/typescript-pt.html.markdown
+++ b/pt-br/typescript-pt.html.markdown
@@ -8,13 +8,6 @@ translators:
lang: pt-br
---
-TypeScript is a language that aims at easing development of large scale applications written in JavaScript.
-TypeScript adds common concepts such as classes, modules, interfaces, generics and (optional) static typing to JavaScript.
-It is a superset of JavaScript: all JavaScript code is valid TypeScript code so it can be added seamlessly to any project. The TypeScript compiler emits JavaScript.
-
-This article will focus only on TypeScript extra syntax, as opposed to [JavaScript] (../javascript/).
-
-
Typescript é uma linguagem que visa facilitar o desenvolvimento de aplicações em grande escala escritos em JavaScript.
Typescript acrescenta conceitos comuns como classes, módulos, interfaces, genéricos e (opcional) tipagem estática para JavaScript.
É um super conjunto de JavaScript: todo o código JavaScript é o código do texto dactilografado válido para que possa ser adicionados diretamente a qualquer projeto. O compilador emite typescript JavaScript.
diff --git a/pt-br/whip-pt.html.markdown b/pt-br/whip-pt.html.markdown
index 989bae05..7bdeec25 100644
--- a/pt-br/whip-pt.html.markdown
+++ b/pt-br/whip-pt.html.markdown
@@ -15,13 +15,13 @@ Whip é um dialeto de Lisp feito para construir scripts e trabalhar com
conceitos mais simples.
Ele também copia muitas funções e sintaxe de Haskell (uma linguagem não correlata)
-Esse documento foi escrito pelo próprio autor da linguagem. Então é isso.
+Esse documento foi escrito pelo próprio autor da linguagem. Então é isso.
```scheme
; Comentário são como em Lisp. Pontos-e-vírgulas...
; A maioria das declarações de primeiro nível estão dentro de "listas"
-; que nada mais são que coisas entre parêntesis separadas por espaços em branco
+; que nada mais são que coisas entre parênteses separadas por espaços em branco
nao_é_uma_lista
(uma lista)
@@ -64,7 +64,7 @@ false
(not false) ; => true
; Mas a maioria das funções não-haskell tem atalhos
-; o não atalho é um '!'.
+; o atalho para "não" é um '!'.
(! (! true)) ; => true
; Igualdade é `equal` ou `=`.
@@ -114,7 +114,7 @@ undefined ; usada para indicar que um valor não foi informado
(1 2 3) ; => [1, 2, 3] (sintaxe JavaScript)
; Dicionários em Whip são o equivalente a 'object' em JavaScript ou
-; 'dict' em python ou 'hash' em Ruby: eles s]ão uma coleção desordenada
+; 'dict' em python ou 'hash' em Ruby: eles são uma coleção desordenada
de pares chave-valor.
{"key1" "value1" "key2" 2 3 3}
@@ -222,7 +222,7 @@ linguagens imperativas.
(take 1 (1 2 3 4)) ; (1 2)
; Contrário de `take`
(drop 1 (1 2 3 4)) ; (3 4)
-; Menos valor em uma lista
+; Menor valor em uma lista
(min (1 2 3 4)) ; 1
; Maior valor em uma lista
(max (1 2 3 4)) ; 4
diff --git a/pt-br/xml-pt.html.markdown b/pt-br/xml-pt.html.markdown
index f347f8ef..6710b387 100644
--- a/pt-br/xml-pt.html.markdown
+++ b/pt-br/xml-pt.html.markdown
@@ -10,8 +10,7 @@ lang: pt-br
XML é uma linguagem de marcação projetada para armazenar e transportar dados.
-Ao contrário de HTML, XML não especifica como exibir ou formatar os dados,
-basta carregá-lo.
+Ao contrário de HTML, XML não especifica como exibir ou formatar os dados, apenas o transporta.
* Sintaxe XML
diff --git a/pt-br/yaml-pt.html.markdown b/pt-br/yaml-pt.html.markdown
index 341ae675..0b71877e 100644
--- a/pt-br/yaml-pt.html.markdown
+++ b/pt-br/yaml-pt.html.markdown
@@ -11,9 +11,7 @@ lang: pt-br
YAML é uma linguagem de serialização de dados projetado para ser diretamente gravável e
legível por seres humanos.
-É um estrito subconjunto de JSON, com a adição de sintaticamente
-novas linhas e recuo significativos, como Python. Ao contrário de Python, no entanto,
-YAML não permite caracteres de tabulação literais em tudo.
+É um superconjunto de JSON, com a adição de indentação e quebras de linhas sintaticamente significativas, como Python. Ao contrário de Python, entretanto, YAML não permite o caracter literal tab para identação.
```yaml
# Commentários em YAML são como este.
diff --git a/r.html.markdown b/r.html.markdown
index e7486e60..a8b04be2 100644
--- a/r.html.markdown
+++ b/r.html.markdown
@@ -789,7 +789,7 @@ install.packages("ggplot2")
require(ggplot2)
?ggplot2
pp <- ggplot(students, aes(x=house))
-pp + geom_histogram()
+pp + geom_bar()
ll <- as.data.table(list1)
pp <- ggplot(ll, aes(x=time,price))
pp + geom_point()
diff --git a/sql.html.markdown b/sql.html.markdown
new file mode 100644
index 00000000..2bece208
--- /dev/null
+++ b/sql.html.markdown
@@ -0,0 +1,105 @@
+---
+language: SQL
+filename: learnsql.sql
+contributors:
+ - ["Bob DuCharme", "http://bobdc.com/"]
+---
+
+Structured Query Language (SQL) is an ISO standard language for creating and working with databases stored in a set of tables. Implementations usually add their own extensions to the language; [Comparison of different SQL implementations](http://troels.arvin.dk/db/rdbms/) is a good reference on product differences.
+
+Implementations typically provide a command line prompt where you can enter the commands shown here interactively, and they also offer a way to execute a series of these commands stored in a script file. (Showing that you’re done with the interactive prompt is a good example of something that isn’t standardized--most SQL implementations support the keywords QUIT, EXIT, or both.)
+
+Several of these sample commands assume that the [MySQL employee sample database](https://dev.mysql.com/doc/employee/en/) available on [github](https://github.com/datacharmer/test_db) has already been loaded. The github files are scripts of commands, similar to the relevant commands below, that create and populate tables of data about a fictional company’s employees. The syntax for running these scripts will depend on the SQL implementation you are using. A utility that you run from the operating system prompt is typical.
+
+
+```sql
+-- Comments start with two hyphens. End each command with a semicolon.
+
+-- SQL is not case-sensitive about keywords. The sample commands here
+-- follow the convention of spelling them in upper-case because it makes
+-- it easier to distinguish them from database, table, and column names.
+
+-- Create and delete a database. Database and table names are case-sensitive.
+CREATE DATABASE someDatabase;
+DROP DATABASE someDatabase;
+
+-- List available databases.
+SHOW DATABASES;
+
+-- Use a particular existing database.
+USE employees;
+
+-- Select all rows and columns from the current database's departments table.
+-- Default activity is for the interpreter to scroll the results on your screen.
+SELECT * FROM departments;
+
+-- Retrieve all rows from the departments table,
+-- but only the dept_no and dept_name columns.
+-- Splitting up commands across lines is OK.
+SELECT dept_no,
+ dept_name FROM departments;
+
+-- Retrieve all departments columns, but just 5 rows.
+SELECT * FROM departments LIMIT 5;
+
+-- Retrieve dept_name column values from the departments
+-- table where the dept_name value has the substring 'en'.
+SELECT dept_name FROM departments WHERE dept_name LIKE '%en%';
+
+-- Retrieve all columns from the departments table where the dept_name
+-- column starts with an 'S' and has exactly 4 characters after it.
+SELECT * FROM departments WHERE dept_name LIKE 'S____';
+
+-- Select title values from the titles table but don't show duplicates.
+SELECT DISTINCT title FROM titles;
+
+-- Same as above, but sorted (case-sensitive) by the title values.
+SELECT DISTINCT title FROM titles ORDER BY title;
+
+-- Show the number of rows in the departments table.
+SELECT COUNT(*) FROM departments;
+
+-- Show the number of rows in the departments table that
+-- have 'en' as a substring of the dept_name value.
+SELECT COUNT(*) FROM departments WHERE dept_name LIKE '%en%';
+
+-- A JOIN of information from multiple tables: the titles table shows
+-- who had what job titles, by their employee numbers, from what
+-- date to what date. Retrieve this information, but instead of the
+-- employee number, use the employee number as a cross-reference to
+-- the employees table to get each employee's first and last name
+-- instead. (And only get 10 rows.)
+
+SELECT employees.first_name, employees.last_name,
+ titles.title, titles.from_date, titles.to_date
+FROM titles INNER JOIN employees ON
+ employees.emp_no = titles.emp_no LIMIT 10;
+
+-- List all the tables in all the databases. Implementations typically provide
+-- their own shortcut command to do this with the database currently in use.
+SELECT * FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_TYPE='BASE TABLE';
+
+-- Create a table called tablename1, with the two columns shown, for
+-- the database currently in use. Lots of other options are available
+-- for how you specify the columns, such as their datatypes.
+CREATE TABLE tablename1 (fname VARCHAR(20), lname VARCHAR(20));
+
+-- Insert a row of data into the table tablename1. This assumes that the
+-- table has been defined to accept these values as appropriate for it.
+INSERT INTO tablename1 VALUES('Richard','Mutt');
+
+-- In tablename1, change the fname value to 'John'
+-- for all rows that have an lname value of 'Mutt'.
+UPDATE tablename1 SET fname='John' WHERE lname='Mutt';
+
+-- Delete rows from the tablename1 table
+-- where the lname value begins with 'M'.
+DELETE FROM tablename1 WHERE lname like 'M%';
+
+-- Delete all rows from the tablename1 table, leaving the empty table.
+DELETE FROM tablename1;
+
+-- Remove the entire tablename1 table.
+DROP TABLE tablename1;
+```
diff --git a/typescript.html.markdown b/typescript.html.markdown
index 9158f123..6feaca45 100644
--- a/typescript.html.markdown
+++ b/typescript.html.markdown
@@ -5,13 +5,19 @@ contributors:
filename: learntypescript.ts
---
-TypeScript is a language that aims at easing development of large scale applications written in JavaScript.
-TypeScript adds common concepts such as classes, modules, interfaces, generics and (optional) static typing to JavaScript.
-It is a superset of JavaScript: all JavaScript code is valid TypeScript code so it can be added seamlessly to any project. The TypeScript compiler emits JavaScript.
+TypeScript is a language that aims at easing development of large scale
+applications written in JavaScript. TypeScript adds common concepts such as
+classes, modules, interfaces, generics and (optional) static typing to
+JavaScript. It is a superset of JavaScript: all JavaScript code is valid
+TypeScript code so it can be added seamlessly to any project. The TypeScript
+compiler emits JavaScript.
-This article will focus only on TypeScript extra syntax, as opposed to [JavaScript](/docs/javascript).
+This article will focus only on TypeScript extra syntax, as opposed to
+[JavaScript](/docs/javascript).
-To test TypeScript's compiler, head to the [Playground] (http://www.typescriptlang.org/Playground) where you will be able to type code, have auto completion and directly see the emitted JavaScript.
+To test TypeScript's compiler, head to the
+[Playground] (http://www.typescriptlang.org/Playground) where you will be able
+to type code, have auto completion and directly see the emitted JavaScript.
```ts
// There are 3 basic types in TypeScript
@@ -19,7 +25,8 @@ let isDone: boolean = false;
let lines: number = 42;
let name: string = "Anders";
-// But you can omit the type annotation if the variables are derived from explicit literals
+// But you can omit the type annotation if the variables are derived
+// from explicit literals
let isDone = false;
let lines = 42;
let name = "Anders";
@@ -114,7 +121,7 @@ class Point {
}
// Classes can be explicitly marked as implementing an interface.
-// Any missing properties will then cause an error at compile-time.
+// Any missing properties will then cause an error at compile-time.
class PointPerson implements Person {
name: string
move() {}
diff --git a/zh-cn/clojure-macro-cn.html.markdown b/zh-cn/clojure-macro-cn.html.markdown
index 9324841e..23b2f203 100644
--- a/zh-cn/clojure-macro-cn.html.markdown
+++ b/zh-cn/clojure-macro-cn.html.markdown
@@ -142,11 +142,9 @@ lang: zh-cn
## 扩展阅读
-[Clojure for the Brave and True](http://www.braveclojure.com/)系列的编写宏
-http://www.braveclojure.com/writing-macros/
+[Clojure for the Brave and True](http://www.braveclojure.com/)
+[系列的编写宏](http://www.braveclojure.com/writing-macros/)
-官方文档
-http://clojure.org/macros
+[官方文档](http://clojure.org/macros)
-何时使用宏?
-http://dunsmor.com/lisp/onlisp/onlisp_12.html
+[何时使用宏?](https://lispcast.com/when-to-use-a-macro/)
diff --git a/zh-cn/markdown-cn.html.markdown b/zh-cn/markdown-cn.html.markdown
index e9a8aeb2..2bd8d11a 100644
--- a/zh-cn/markdown-cn.html.markdown
+++ b/zh-cn/markdown-cn.html.markdown
@@ -4,45 +4,63 @@ contributors:
- ["Dan Turkel", "http://danturkel.com/"]
translators:
- ["Fangzhou Chen","https://github.com/FZSS"]
+ - ["Luffy Zhong", "https://github.com/mengzhongshi"]
filename: learnmarkdown-cn.md
lang: zh-cn
---
Markdown 由 John Gruber 于 2004年创立. 它旨在成为一门容易读写的语法结构,并可以便利地转换成 HTML(以及其他很多)格式。
-欢迎您多多反馈以及分支和请求合并。
+在不同的解析器中,Markdown 的实现方法有所不同。
+此教程会指出哪些特征是通用,哪一些只对某一解析器有效。
+- [HTML标签](#HTML标签)
+- [标题](#标题)
+- [文本样式](#文本样式)
+- [段落](#段落)
+- [列表](#列表)
+- [代码块](#代码块)
+- [水平线分隔](#水平线分隔)
+- [链接](#链接)
+- [图片](#图片)
+- [杂项](#杂项)
+
+## HTML标签
+Markdown 是 HTML 的父集,所以任何 HTML 文件都是有效的 Markdown。
```md
-<!-- Markdown 是 HTML 的父集,所以任何 HTML 文件都是有效的 Markdown。
-这意味着我们可以在 Markdown 里使用任何 HTML 元素,比如注释元素,
+<!--这意味着我们可以在 Markdown 里使用任何 HTML 元素,比如注释元素,
且不会被 Markdown 解析器所影响。不过如果你在 Markdown 文件内创建了 HTML 元素,
你将无法在 HTML 元素的内容中使用 Markdown 语法。-->
+```
-<!-- 在不同的解析器中,Markdown 的实现方法有所不同。
-此教程会指出当某功能是否通用及是否只对某一解析器有效。 -->
+## 标题
-<!-- 标头 -->
-<!-- 通过在文本前加上不同数量的hash(#), 你可以创建相对应的 <h1>
-到 <h6> HTML元素。-->
+通过在文本前加上不同数量的hash(#), 你可以创建相对应的 `<h1>` 到 `<h6>` HTML元素。
+```md
# 这是一个 <h1>
## 这是一个 <h2>
### 这是一个 <h3>
#### 这是一个 <h4>
##### 这是一个 <h5>
###### 这是一个 <h6>
+```
+对于 `<h1>` 和 `<h2>` 元素,Markdown 额外提供了两种添加方式。
-<!-- 对于 <h1> 和 <h2> 元素,Markdown 额外提供了两种添加方式。 -->
+```md
这是一个 h1
=============
这是一个 h2
-------------
+```
+
+## 文本样式
-<!-- 简易文本样式 -->
-<!-- 文本的斜体,粗体,和删除线在 Markdown 中可以轻易地被实现。-->
+文本的斜体,粗体在 Markdown 中可以轻易实现。
+```md
*此文本为斜体。*
_此文本也是。_
@@ -52,40 +70,52 @@ __此文本也是__
***此文本是斜体加粗体。***
**_或者这样。_**
*__这个也是!__*
+```
-<!-- 在 GitHub 采用的 Markdown 中 -->
+GitHub 也支持 Markdown,在 GitHub 的 Markdown 解析器中,我们可以使用删除线:
+```md
~~此文本为删除线效果。~~
+```
+## 段落
-<!-- 单个段落由一句或多句邻近的句子组成,这些句子由一个或多个空格分隔。-->
+段落由一个句子或是多个中间没有空行的句子组成,每个段落由一个或是多个空行分隔开来。
+```md
这是第一段落. 这句话在同一个段落里,好玩么?
现在我是第二段落。
这句话也在第二段落!
+
这句话在第三段落!
+```
-<!-- 如果你插入一个 HTML中的<br />标签,你可以在段末加入两个以上的空格,
-然后另起一段。-->
+如果你想插入一个 `<br />` 标签,你可以在段末加入两个以上的空格,然后另起一
+段。(译者注:试了一下,很多解析器,并不需要空两个空格,直接换行就会添加一个`<br />`)
+```md
此段落结尾有两个空格(选中以显示)。
上文有一个 <br /> !
+```
-<!-- 段落引用可由 > 字符轻松实现。-->
+段落引用可由 `>` 字符轻松实现。
-> 这是一个段落引用. 你可以
-> 手动断开你的句子,然后在每句句子前面添加 “>” 字符。或者让你的句子变得很长,以至于他们自动得断开。
-> 只要你的文字以“>” 字符开头,两种方式无异。
+```md
+> 这是一个段落引用。 你可以
+> 手动断开你的句子,然后在每句句子前面添加 `>` 字符。或者让你的句子变得很长,以至于他们自动得换行。
+> 只要你的文字以 `>` 字符开头,两种方式无异。
-> 你也对文本进行
+> 你也可以对文本进行
>> 多层引用
> 这多机智啊!
+```
-<!-- 序列 -->
-<!-- 无序序列可由星号,加号或者减号来建立 -->
+## 列表
+无序列表可由星号,加号或者减号来创建
+```md
* 项目
* 项目
* 另一个项目
@@ -102,139 +132,195 @@ __此文本也是__
- 项目
- 最后一个项目
-<!-- 有序序列可由数字加点来实现 -->
+```
+有序序列可由数字加上点 `.` 来实现
+
+```md
1. 项目一
2. 项目二
3. 项目三
+```
-<!-- 即使你的标签数字有误,Markdown 依旧会呈现出正确的序号,
-不过这并不是一个好主意-->
+即使你的数字标签有误,Markdown 依旧会呈现出正确的序号,
+不过这并不是一个好主意
+```md
1. 项目一
1. 项目二
1. 项目三
-<!-- (此段与前例一模一样) -->
+```
+(此段与上面效果一模一样)
-<!-- 你也可以使用子序列 -->
+你也可以使用子列表
+```md
1. 项目一
2. 项目二
3. 项目三
* 子项目
* 子项目
4. 项目四
+```
+
+你甚至可以使用任务列表,它将会生成 HTML 的选择框(checkboxes)标签。
-<!-- 代码段落 -->
-<!-- 代码段落(HTML中 <code>标签)可以由缩进四格(spaces)
-或者一个制表符(tab)实现-->
+```md
+下面方框里包含 'x' 的列表,将会生成选中效果的选择框。
+- [ ] 任务一需要完成
+- [ ] 任务二需要完成
+下面这个选择框将会是选中状态
+- [x] 这个任务已经完成
+```
+## 代码块
+
+代码块(HTML中 `<code>` 标签)可以由缩进四格(spaces)
+或者一个制表符(tab)实现
+
+```md
This is code
- So is this
+ So is this
+```
-<!-- 在你的代码中,你仍然使用tab可以进行缩进操作 -->
+在你的代码中,你仍然使用tab(或者四个空格)可以进行缩进操作
+```md
my_array.each do |item|
puts item
end
+```
-<!-- 内联代码可由反引号 ` 实现 -->
+内联代码可由反引号 ` 实现
+```md
John 甚至不知道 `go_to()` 方程是干嘛的!
+```
-<!-- 在GitHub的 Markdown中,对于代码你可以使用特殊的语法 -->
+在GitHub的 Markdown(GitHub Flavored Markdown)解析器中,你可以使用特殊的语法表示代码块
-\`\`\`ruby <!-- 插入时记得移除反斜线, 仅留```ruby ! -->
+<pre>
+<code class="highlight">&#x60;&#x60;&#x60;ruby
def foobar
puts "Hello world!"
end
-\`\`\` <!-- 这里也是,移除反斜线,仅留 ``` -->
+&#x60;&#x60;&#x60;</code></pre>
+
+以上代码不需要缩进,而且 GitHub 会根据\`\`\`后指定的语言来进行语法高亮显示
-<!-- 以上代码不需要缩进,而且 GitHub 会根据```后表明的语言来进行语法高亮 -->
+## 水平线分隔
-<!-- 水平线 (<hr />) -->
-<!-- 水平线可由三个或以上的星号或者减号创建,可带可不带空格。 -->
+水平线(`<hr/>`)可由三个或以上的星号或是减号创建,它们之间可以带或不带空格
+```md
***
---
- - -
****************
+```
+
+## 链接
-<!-- 链接 -->
-<!-- Markdown 最棒的地方就是简易的链接制作。链接文字放在中括号[]内,
-在随后的括弧()内加入url。-->
+Markdown 最棒的地方就是便捷的书写链接。把链接文字放在中括号[]内,
+在随后的括弧()内加入url就可以了。
+```md
[点我点我!](http://test.com/)
-<!-- 你也可以为链接加入一个标题:在括弧内使用引号 -->
+```
+
+你也可以在小括号内使用引号,为链接加上一个标题(title)
+```md
[点我点我!](http://test.com/ "连接到Test.com")
+```
+相对路径也可以有
-<!-- 相对路径也可以有 -->
-
+```md
[去 music](/music/).
+```
-<!-- Markdown同样支持引用样式的链接 -->
-
-[点此链接][link1]以获取更多信息!
-[看一看这个链接][foobar] 如果你愿意的话.
+Markdown同样支持引用形式的链接
-[link1]: http://test.com/ "Cool!"
-[foobar]: http://foobar.biz/ "Alright!"
+```md
+[点此链接][link1] 以获取更多信息!
+[看一看这个链接][foobar] 如果你愿意的话。
+[link1]: http://test.com/
+[foobar]: http://foobar.biz/
+```
-<!-- 链接的标题可以处于单引号中,括弧中或是被忽略。引用名可以在文档的任意何处,
-并且可以随意命名,只要名称不重复。-->
+对于引用形式,链接的标题可以处于单引号中,括弧中或是忽略。引用名可以在文档的任何地方,并且可以随意命名,只要名称不重复。
-<!-- “隐含式命名” 的功能可以让链接文字作为引用名 -->
+“隐含式命名” 的功能可以让链接文字作为引用名
+```md
[This][] is a link.
+[This]: http://thisisalink.com/
+```
-[this]: http://thisisalink.com/
-
-<!-- 但这并不常用 -->
-
-<!-- 图像 -->
-<!-- 图像与链接相似,只需在前添加一个感叹号 -->
+但这并不常用
-![这是我图像的悬停文本(alt text)](http://imgur.com/myimage.jpg "可选命名")
+## 图片
+图片与链接相似,只需在前添加一个感叹号
-<!-- 引用样式也同样起作用 -->
+```md
+![这是alt,请把鼠标放在图片上](http://imgur.com/myimage.jpg "这是title")
+```
-![这是我的悬停文本.][myimage]
+引用形式也同样起作用
-[myimage]: relative/urls/cool/image.jpg "在此输入标题"
+```md
+![这是alt][myimage]
+[myimage]: relative/urls/cool/image.jpg
+```
-<!-- 杂项 -->
-<!-- 自动链接 -->
+## 杂项
+### 自动链接
+```md
<http://testwebsite.com/> 与
[http://testwebsite.com/](http://testwebsite.com/) 等同
+```
-<!-- 电子邮件的自动链接 -->
+### 电子邮件的自动链接
+```md
<foo@bar.com>
+```
-<!-- 转义字符 -->
+### 转义字符
+```md
我希望 *将这段文字置于星号之间* 但是我不希望它被
-斜体化, 所以我就: \*这段置文字于星号之间\*。
+斜体化, 这么做: \*这段置文字于星号之间\*。
+```
+
+### 键盘上的功能键
-<!-- 表格 -->
-<!-- 表格只被 GitHub 的 Markdown 支持,并且有一点笨重,但如果你真的要用的话: -->
+在 GitHub 的 Markdown中,你可以使用 `<kbd>` 标签来表示功能键。
+```md
+你的电脑死机了?试试
+<kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Del</kbd>
+```
+<kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Del</kbd>
+### 表格
+
+表格只被 GitHub 的 Markdown 支持,并且有一点笨重,但如果你真的要用的话: (译者注:其实现在大部分markdown都已经支持)
+
+```md
| 第一列 | 第二列 | 第三列 |
-| :---------- | :------: | ----------: |
+| :--------- | :------: | ----------: |
| 左对齐 | 居个中 | 右对齐 |
| 某某某 | 某某某 | 某某某 |
+```
-<!-- 或者, 同样的 -->
+或者, 同样的
+```md
第一列 | 第二列 | 第三列
:-- | :-: | --:
这太丑了 | 药不能 | 停
-
-<!-- 结束! -->
-
```
更多信息, 请于[此处](http://daringfireball.net/projects/Markdown/syntax)参见 John Gruber 关于语法的官方帖子,及于[此处](https://github.com/adam-p/Markdown-here/wiki/Markdown-Cheatsheet) 参见 Adam Pritchard 的摘要笔记。