vertexDeclDesc {
0, // byte offset from the struct beginning
D3DDECLTYPE_FLOAT3, // data type (3d float vector)
D3DDECLMETHOD_DEFAULT, // tessellator operation
- D3DDECLUSAGE_POSTION, // usage of the data
+ D3DDECLUSAGE_POSITION, // usage of the data
0 }, // index (multiples usage of the same type)
{ 0,
12, // byte offset (3 * sizeof(float) bytes)
diff --git a/docker.html.markdown b/docker.html.markdown
index 1df49cc3..0e61151e 100644
--- a/docker.html.markdown
+++ b/docker.html.markdown
@@ -5,144 +5,277 @@ filename: docker.bat
contributors:
- ["Ruslan López", "http://javapro.org/"]
- ["Michael Chen", "https://github.com/ML-Chen"]
+ - ["Akshita Dixit", "https://github.com/akshitadixit"]
+ - ["Marcel Ribeiro-Dantas", "https://github.com/mribeirodantas"]
---
-```bat
-:: download, install and run hello-world image
-docker run hello-world
+Docker is a tool that helps you build, test, ship and run applications
+seamlessly across various machines. It replicates the environment our software
+needs on any machine. You can get Docker for your machine from
+https://docs.docker.com/get-docker/
-:: if this is the first time you should be able to see the message
-:: Unable to find image 'hello-world:latest' locally
-:: latest: Pulling from library/hello-world
-:: 1b930d010525: Pull complete
-:: Digest: sha256:4fe721ccc2e8dc7362278a29dc660d833570ec2682f4e4194f4ee23e415e1064
-:: Status: Downloaded newer image for hello-world:latest
-::
-:: Hello from Docker!
-:: This message shows that your installation appears to be working correctly.
-::
-:: To generate this message, Docker took the following steps:
-:: 1. The Docker client contacted the Docker daemon.
-:: 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
-:: (amd64)
-:: 3. The Docker daemon created a new container from that image which runs the
-:: executable that produces the output you are currently reading.
-:: 4. The Docker daemon streamed that output to the Docker client, which sent it
-:: to your terminal.
-::
-:: To try something more ambitious, you can run an Ubuntu container with:
-:: $ docker run -it ubuntu bash
-::
-:: Share images, automate workflows, and more with a free Docker ID:
-:: https://hub.docker.com/
-::
-:: For more examples and ideas, visit:
-:: https://docs.docker.com/get-started/
+It has grown in popularity over the last decade due to being lightweight and
+fast as compared to virtual-machines that are bulky and slow. Unlike VMs, docker
+does not need a full blown OS of its own to be loaded to start and does not
+compete for resources other than what the application it is running will use.
+VMs on the other hand are pretty resource intensive on our processors, disks and
+memory hence running multiple VMs for various applications becomes a challenge
+in a limited capacity architecture.
-:: now let's see currently running images
-docker ps
-:: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
-:: NAMES
+
+┌────────────────────────┐ ┌───────────────────────┐
+│ ┌───────────┐ │ │ ┌───────────┐ │
+│ │ App │ │ │ │ App │ │
+│ └───────────┘ │ │ └───────────┘ │
+│ ┌────────┐ ┌────────┐ │ │ ┌────────┐ ┌───────┐ │
+│ │ Libs │ │ Deps │ │ │ │ Libs │ │ Deps │ │
+│ └────────┘ └────────┘ │ │ └────────┘ └───────┘ │
+│ ┌───────────────────┐ │ │ ┌──────────────────┐ │
+│ │ Guest OS │ │ │ │ Guest OS │ │
+│ └───────────────────┘ │ │ └──────────────────┘ │
+│ VM1 │ │ VM2 │
+└────────────────────────┘ └───────────────────────┘
+┌──────────────────────────────────────────────────┐
+│ Hypervisor │
+└──────────────────────────────────────────────────┘
+┌──────────────────────────────────────────────────┐
+│ Host OS │
+└──────────────────────────────────────────────────┘
+┌──────────────────────────────────────────────────┐
+│ Hardware Infrastructure │
+└──────────────────────────────────────────────────┘
+ (VM based architecture)
-:: let's see the images we have ran previously
-docker ps -a
+┌────────────────────────┐ ┌───────────────────────┐
+│ ┌───────────┐ │ │ ┌───────────┐ │
+│ │ App │ │ │ │ App │ │
+│ └───────────┘ │ │ └───────────┘ │
+│ ┌────────┐ ┌────────┐ │ │ ┌────────┐ ┌───────┐ │
+│ │ Libs │ │ Deps │ │ │ │ Libs │ │ Deps │ │
+│ └────────┘ └────────┘ │ │ └────────┘ └───────┘ │
+│ Container1 │ │ Container2 │
+└────────────────────────┘ └───────────────────────┘
+┌──────────────────────────────────────────────────┐
+│ Docker │
+└──────────────────────────────────────────────────┘
+┌──────────────────────────────────────────────────┐
+│ OS │
+└──────────────────────────────────────────────────┘
+┌──────────────────────────────────────────────────┐
+│ Hardware Infrastructure │
+└──────────────────────────────────────────────────┘
+ (Docker based architecture)
-:: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
-:: NAMES
-:: 4a76281f9c53 hello-world "/hello" 2 minutes ago Exited (0) 2 minutes ago
-:: happy_poincare
-:: the name part is generated automatically so it probably will be different for you
+
-:: let's remove our previously generated image
-docker rm happy_poincare
+Couple of terms we will encounter frequently are Docker Images and Docker
+Containers. Images are packages or templates of containers all stored in a
+container registry such as [Docker Hub](https://hub.docker.com/). Containers
+are standalone, executable instances of these images which include code,
+runtime, system tools, system libraries and settings - everything required to
+get the software up and running. Coming to Docker, it follows a client-server
+architecture wherein the CLI client communicates with the server component,
+which here is, the Docker Engine using RESTful API to issue commands.
-:: let's test if it was really deleted
-docker ps -a
-:: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
-:: NAMES
+## The Docker CLI
+```bash
+# after installing Docker from https://docs.docker.com/get-docker/
+# To list available commands, either run `docker` with no parameters or execute
+# `docker help`
+$ docker
-:: specify a custom name for the container
-docker run --name test_container hello-world
-:: Hello from Docker!
-:: This message shows that your installation appears to be working correctly.
-::
-:: To generate this message, Docker took the following steps:
-:: 1. The Docker client contacted the Docker daemon.
-:: 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
-:: (amd64)
-:: 3. The Docker daemon created a new container from that image which runs the
-:: executable that produces the output you are currently reading.
-:: 4. The Docker daemon streamed that output to the Docker client, which sent it
-:: to your terminal.
-::
-:: To try something more ambitious, you can run an Ubuntu container with:
-:: $ docker run -it ubuntu bash
-::
-:: Share images, automate workflows, and more with a free Docker ID:
-:: https://hub.docker.com/
-::
-:: For more examples and ideas, visit:
-:: https://docs.docker.com/get-started/
+>>> docker [OPTIONS] COMMAND [ARG...]
+ docker [ --help | -v | --version ]
-docker ps -a
-:: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
-:: NAMES
-:: d345fe1a4f41 hello-world "/hello" About a minute ago Exited (0) About a minute ago
-:: test_container
-:: as you can see the name is now what we have specified
+ A self-sufficient runtime for containers.
-:: retrieve logs from a named container
-docker logs test_container
-:: Hello from Docker!
-:: This message shows that your installation appears to be working correctly.
-::
-:: To generate this message, Docker took the following steps:
-:: 1. The Docker client contacted the Docker daemon.
-:: 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
-:: (amd64)
-:: 3. The Docker daemon created a new container from that image which runs the
-:: executable that produces the output you are currently reading.
-:: 4. The Docker daemon streamed that output to the Docker client, which sent it
-:: to your terminal.
-::
-:: To try something more ambitious, you can run an Ubuntu container with:
-:: $ docker run -it ubuntu bash
-::
-:: Share images, automate workflows, and more with a free Docker ID:
-:: https://hub.docker.com/
-::
-:: For more examples and ideas, visit:
-:: https://docs.docker.com/get-started/
+ Options:
+ --config string Location of client config files (default "/root/.docker")
+ -c, --context string Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with "docker context use")
+ -D, --debug Enable debug mode
+ --help Print usage
+ -H, --host value Daemon socket(s) to connect to (default [])
+ -l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
+ --tls Use TLS; implied by --tlsverify
+ --tlscacert string Trust certs signed only by this CA (default "/root/.docker/ca.pem")
+ --tlscert string Path to TLS certificate file (default "/root/.docker/cert.pem")
+ --tlskey string Path to TLS key file (default "/root/.docker/key.pem")
+ --tlsverify Use TLS and verify the remote
+ -v, --version Print version information and quit
-docker rm test_container
+ Commands:
+ attach Attach to a running container
+ # […]
-docker run ubuntu
-:: Unable to find image 'ubuntu:latest' locally
-:: latest: Pulling from library/ubuntu
-:: 2746a4a261c9: Pull complete
-:: 4c1d20cdee96: Pull complete 0d3160e1d0de: Pull complete c8e37668deea: Pull complete Digest: sha256:250cc6f3f3ffc5cdaa9d8f4946ac79821aafb4d3afc93928f0de9336eba21aa4
-:: Status: Downloaded newer image for ubuntu:latest
+$ docker run hello-world
+# `docker run ` is used to run a container, it will pull the
+# images from Docker Hub if they don't already exist in your system. Here the
+# docker client connects to the daemon which in turn pulls the "hello-world"
+# image from the Docker Hub. The daemon then builds a new container from the
+# image which runs the executable that produces the output streamed back to the
+# client that we see on our terminals.
-docker ps -a
-:: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
-:: NAMES
-:: c19e9e5b000a ubuntu "/bin/bash" 5 seconds ago Exited (0) 4 seconds ago
-:: relaxed_nobel
+$ docker run -d ubuntu sleep 60s
+# The -d (or --detach) flag is when we want to run a container in the background
+# and return back to the terminal. Here we detach an ubuntu container from the
+# terminal, the output should be the id and the command exits. If we check
+# running containers, we should still see ours there:
+# CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
+# 133261b4894a ubuntu "sleep 60s" 3 seconds ago Up 2 seconds vigorous_gould
-:: running a container in an interactive mode
-docker run -it ubuntu
-:: root@e2cac48323d2:/# uname
-:: Linux
-:: root@e2cac48323d2:/# exit
-:: exit
+$ docker run -p 3000:8000
+# The -p (or --publish) flag is used to expose port 8000 inside the container to
+# port 3000 outside the container. This is because the app inside the container
+# runs in isolation, hence the port 8000 where the app runs is private to the
+# container.
-docker rm relaxed_nobel
+$ docker run -i
+# or
+$ docker run -it
+# Docker runs our containers in a non-interactive mode i.e. they do not accept
+# inputs or work dynamically while running. The -i flag keeps input open to the
+# container, and the -t flag creates a pseudo-terminal that the shell can attach
+# to (can be combined as -it)
-docker ps -a
-:: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
-:: NAMES
-:: e2cac48323d2 ubuntu "/bin/bash" 2 minutes ago Exited (0) About a minute ago
-:: nifty_goldwasser
+$ docker ps -a
+# The `docker ps` command only shows running containers by default. To see all
+# containers, use the -a (or --all) flag
+# Running the above command should output something similar in the terminal:
+# CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
+# 82f84bf6912b hello-world "/hello" 9 minutes ago Exited (0) 9 minutes ago eloquent_sammet
+
+
+$ docker stop hello-world
+# or
+$ docker start hello-world
+# The stop command simply stops one or more containers, and the start command
+# starts the container(s) up again! `docker start -a ubuntu` will attach our
+# detached container back to the terminal i.e. runs in the foreground
+
+$ docker create alpine
+# `docker create` creates a new container for us with the image specified (here,
+# alpine), the container does not auto-start unlike `docker run`. This command
+# is used to set up a container configuration and then `docker start` to shoot
+# it up when required. Note that the status is "Created":
+# CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
+# 4c71c727c73d alpine "/bin/sh" 29 seconds ago Created naughty_ritchie
+
+$ docker rm 82f84
+# Removes one or more containers using their container ID.
+# P.S.: we can use only the first few characters of the entire ID to identify
+# containers
+
+$ docker images
+# Displays all images and their information, created here means the latest image
+# tag updated on Docker Hub:
+# REPOSITORY TAG IMAGE ID CREATED SIZE
+# ubuntu latest a8780b506fa4 9 days ago 77.8MB
+# alpine latest 9c6f07244728 3 months ago 5.54MB
+# hello-world latest feb5d9fea6a5 13 months ago 13.3kB
+
+$ docker rmi
+# Removes one or more images from your system which do not have their instances
+# (or containers as we know them) running. If the image has an attached
+# container, either delete the container first or use the -f (or --force) flag
+# to forcefully delete both the container and image.
+
+$ docker pull busybox
+# The pull command downloads the specified image on our system from Docker Hub.
+
+$ docker exec -it 7b272 bash
+# This command is used to run a command in the running container's default
+# directory. Here 7b272 was our ubuntu container and the above command would
+# help us interact with the container by opening a bash session.
+
+$docker logs
+# Displays the information logged by the specified container
+# root@7b27222e4bb7:/# whoami
+# root
+# root@7b27222e4bb7:/# pwd
+# /
+# root@7b27222e4bb7:/# ls
+# bin boot dev etc home lib lib32 lib64 libx3 srv sys tmp usr var
+# root@7b27222e4bb7:/# exit
+# exit
+
+# More commands can be found at https://docs.docker.com/engine/reference/commandline/docker/
+```
+## The Dockerfile
+The Dockerfile is a blueprint of a Docker image. We can mention the artifacts
+from our application along with their configurations into this file in the
+specific syntax to let anyone create a Docker image of our application.
+
+### A few things to keep in mind:
+* It is always strictly named `Dockerfile` without any extensions
+* We have to build our custom image on top of some already available Docker base
+image. (there is an empty image called `scratch` which literally lets you build
+an image from scratch)
+* All capitalised commands are part of the syntax, they are not case-sensitive
+but used like a convention
+* Below is a sample Dockerfile but you can read in depth from the [official docs](https://docs.docker.com/engine/reference/builder/).
+
+```Dockerfile
+FROM
+# define base image
+
+ENV USERNAME='admin'\
+ PWD='****'
+# optionally define environmental variables
+
+RUN apt-get update
+# run linux commands inside container env, does not affect host env
+# This executes during the time of image creation
+
+COPY
+# executes on the host, copies files from src (usually on the host) to target
+# on the container
+
+ENTRYPOINT ["some-script.sh"]
+# executes an entire script as an entrypoint
+
+CMD [,...]
+# always part of dockerfile, introduces entry point linux command e.g.
+# `CMD node server.js`
+# This executes after image creation only when the container from the image
+# is running.
+```
+### Build your images
+Use the `docker build` command after wrapping your application into a Docker
+image to run ( or build) it.
+
+```bash
+
+$docker build
+# used to build an image from the specified Dockerfile
+# instead of path we could also specify a URL
+# -t tag is optional and used to name and tag your images for e.g.
+# `$docker build -t my-image:0.1 ./home/app`
+# rebuild images everytime you make changes in the dockerfile
+```
+
+## Push your image to DockerHub
+If you want your application's Docker image to be made publicly available for
+any Docker user, you might wanna push it to the [Docker Hub](https://hub.docker.com/) which is a
+registry of Docker images. Make sure you have an account with a username and
+password on Docker Hub.
+
+When pushing an image to Docker Hub, we must specify our Docker Hub username
+as part of the source image name. We need to create the target image with the
+tag name of username/image-name much like GitHub repositories.
+
+```bash
+$docker login
+# to login to Docker Hub using your username and password
+
+$docker tag [:] [:]
+# this tags a local src-image to a public target-image
+# e.g. `docker tag my-sample-app:1.0.0 akshitadixit/my-sample-app`
+# if tags are not specified, they're defaulted to `latest`
+
+$docker push [:]
+# uploads our image to Docker Hub
+# e.g. `docker push akshitadixit/my-sample-app`
+# this image will be accessible under your profile's repositories as
+# `https://hub.docker.com/r/username/image-name`
-docker rm nifty_goldwasser
```
diff --git a/es-es/awk-es.html.markdown b/es-es/awk-es.html.markdown
index 2f771320..725dae1d 100644
--- a/es-es/awk-es.html.markdown
+++ b/es-es/awk-es.html.markdown
@@ -11,8 +11,8 @@ lang: es-es
AWK es una herramienta estándar en cada sistema UNIX compatible con POSIX.
Es como un Perl restringido, perfecto para tareas de procesamiento de texto y
-otras necesidades de scripting. Tiene una sintaxis similar a C, pero sin
-puntos y comas, manejo manual de memoria y tipado estático. Puedes llamarlo
+otras necesidades de scripting. Tiene una sintaxis similar a C, pero sin
+puntos y comas, manejo manual de memoria y tipado estático. Puedes llamarlo
desde un script de shell o usarlo como un lenguaje stand-alone para scripting.
¿Por qué elegir AWK sobre Perl? Principalmente, porque AWK es parte de UNIX.
@@ -74,8 +74,8 @@ BEGIN {
# Bloques formados por múltiples líneas usan llaves
while (a < 10) {
- print "La concatenación de strings se hace " " con series "
- print " de" " strings separados por espacios"
+ print "La concatenación de strings se hace " " con series "
+ print " de" " strings separados por espacios"
print a
a++
@@ -153,13 +153,13 @@ function arithmetic_functions(a, b, c, localvar) {
# Todo es global. No es problema en scripts pequeños, pero sí para
# scripts más grandes.
- # Hay un work-around (mmm... hack). Los argumentos de las funciones son
+ # Hay un work-around (mmm... hack). Los argumentos de las funciones son
# locales para la función, y AWK permite definir más argumentos de función
- # de los que necesita, por lo que define las variables locales en la
+ # de los que necesita, por lo que define las variables locales en la
# declaración como en la función de arriba. Como convención, agrega
- # espacios en blanco para distinguir los parámetros de la función de las
- # variables locales. En este ejemplo, a, b y c son parámetros y localvar es una
- # variable local.
+ # espacios en blanco para distinguir los parámetros de la función de las
+ # variables locales. En este ejemplo, a, b y c son parámetros y localvar es
+ # una variable local.
# Ahora, a demostrar las funciones aritméticas
@@ -222,10 +222,10 @@ function io_functions( localvar) {
# También hay printf
printf("%s %d %d %d\n", "Testing", 1, 2, 3)
- # AWK no tiene handles de archivos en sí mismo. Automáticamente abrirá un
- # handle de archivo cuando use algo que necesite uno. El string que usaste
- # para esto puede ser tratada como un handle de archivo para propósitos de I/O.
- # Esto lo hace similar al scripting de shell:
+ # AWK no tiene handles de archivos en sí mismo. Automáticamente abrirá un
+ # handle de archivo cuando use algo que necesite uno. El string que usaste
+ # para esto puede ser tratada como un handle de archivo para propósitos
+ # de I/O. Esto lo hace similar al scripting de shell:
print "foobar" >"/tmp/foobar.txt"
@@ -247,17 +247,17 @@ function io_functions( localvar) {
close("/tmp/foobar.txt")
}
-# Como dije al inicio, los programas en AWK son una colección de patrones y
+# Como dije al inicio, los programas en AWK son una colección de patrones y
# acciones. Ya conociste el patrón BEGIN. otros patrones sólo se usan si estás
# procesando líneas desde archivos o stdin.
-# Cuando pasas argumentos a AWK, son tratados como nombres de archivos a
-# procesar. Los va a procesar todos, en orden. Imagínalos como un ciclo for
+# Cuando pasas argumentos a AWK, son tratados como nombres de archivos a
+# procesar. Los va a procesar todos, en orden. Imagínalos como un ciclo for
# implícito, iterando sobre las líneas de estos archivos. Estos patrones y
# acciones son como instrucciones switch dentro del ciclo.
/^fo+bar$/ {
-
+
# Esta acción se ejecutará por cada línea que haga match con la expresión
# regular /^fo+bar$/, y será saltada por cualquier línea que no haga match.
# Vamos a sólo mostrar la línea:
@@ -268,7 +268,7 @@ function io_functions( localvar) {
# $0 es el nombre de la línea actual que se está procesando.
# Se crea automáticamente para ti.
- # Probablemente puedas adivinar que hay otras variables $. Cada línea es
+ # Probablemente puedas adivinar que hay otras variables $. Cada línea es
# separada implícitamente antes de que se llame cada acción, justo como lo
# hace shell. Y, como shell, cada campo puede ser accesado con $.
@@ -301,7 +301,7 @@ a > 0 {
# Y ya te das una idea. Procesar archivos de texto, leyendo una línea a la vez,
# y haciendo algo con ella, particularmente separando en un deliminator, es tan
# común en UNIX que AWK es un lenguaje de scripting que hace todo eso por ti
-# sin que tengas que pedirlo. Basta con escribir los patrones y acciones
+# sin que tengas que pedirlo. Basta con escribir los patrones y acciones
# basados en lo que esperas de la entrada y lo quieras quieras hacer con ella.
# Aquí está un ejemplo de un script simple, para lo que AWK es perfecto.
@@ -343,7 +343,7 @@ $1 == name {
nlines++
}
-# Otro patrón especial es END. Va a ejecutarse después de procesar todos los
+# Otro patrón especial es END. Va a ejecutarse después de procesar todos los
# archivos de texto. A diferencia de BEGIN, sólo se ejecuta si le das dado una
# entrada a procesar. Se ejecutará después de que todos los archivos hayan sido
# leídos y procesados según las reglas y acciones que programaste. El propósito
@@ -356,8 +356,10 @@ END {
}
```
+
Más información:
* [Tutorial de AWK](http://www.grymoire.com/Unix/Awk.html)
* [Página man de AWK](https://linux.die.net/man/1/awk)
-* [La guía del usuario de GNU Awk](https://www.gnu.org/software/gawk/manual/gawk.html): GNU Awk se encuentra en la mayoría de los sistemas Linux.
+* [La guía del usuario de GNU Awk](https://www.gnu.org/software/gawk/manual/gawk.html):
+ GNU Awk se encuentra en la mayoría de los sistemas Linux.
diff --git a/es-es/clojure-es.html.markdown b/es-es/clojure-es.html.markdown
index 62935ebe..9f25425c 100644
--- a/es-es/clojure-es.html.markdown
+++ b/es-es/clojure-es.html.markdown
@@ -431,7 +431,7 @@ funciones principales (pertenecientes al core):
[http://clojuredocs.org/quickref](http://clojuredocs.org/quickref)
4Clojure es una genial forma de mejorar tus habilidades con clojure/FP:
-[http://www.4clojure.com/](http://www.4clojure.com/)
+[https://4clojure.oxal.org/](https://4clojure.oxal.org/)
Clojure-doc.org (sí, de verdad) tiene un buen número de artículos con los que
iniciarse en Clojure: [http://clojure-doc.org](http://clojure-doc.org)
diff --git a/es-es/python-es.html.markdown b/es-es/python-es.html.markdown
index 7deec286..5c95854f 100644
--- a/es-es/python-es.html.markdown
+++ b/es-es/python-es.html.markdown
@@ -388,8 +388,8 @@ keyword_args(pie="grande", lago="ness") #=> {"pie": "grande", "lago": "ness"}
# Puedes hacer ambas a la vez si quieres
def todos_los_argumentos(*args, **kwargs):
- print args
- print kwargs
+ print(args)
+ print(kwargs)
"""
todos_los_argumentos(1, 2, a=3, b=4) imprime:
(1, 2)
@@ -462,10 +462,10 @@ class Humano(object):
# Instancia una clase
i = Humano(nombre="Ian")
-print i.decir("hi") # imprime "Ian: hi"
+print(i.decir("hi")) # imprime "Ian: hi"
j = Humano("Joel")
-print j.decir("hello") #imprime "Joel: hello"
+print(j.decir("hello")) #imprime "Joel: hello"
# Llama nuestro método de clase
i.get_especie() #=> "H. sapiens"
diff --git a/fi-fi/go-fi.html.markdown b/fi-fi/go-fi.html.markdown
index af304099..15acdbae 100644
--- a/fi-fi/go-fi.html.markdown
+++ b/fi-fi/go-fi.html.markdown
@@ -33,7 +33,7 @@ Go tuo mukanaan loistavan oletuskirjaston sekä innokkaan yhteisön.
rivin kommentti */
// Package -lausekkeella aloitetaan jokainen lähdekooditiedosto.
-// Main on erityinen nimi joka ilmoittaa
+// main on erityinen nimi joka ilmoittaa
// suoritettavan tiedoston kirjaston sijasta.
package main
diff --git a/fr-fr/awk-fr.html.markdown b/fr-fr/awk-fr.html.markdown
index 9e45a89b..a5db24b2 100644
--- a/fr-fr/awk-fr.html.markdown
+++ b/fr-fr/awk-fr.html.markdown
@@ -24,14 +24,12 @@ ce qui concerne le traitement de texte simple. Notamment le traitement de ceux
qui nécessitent de lire des fichiers ligne par ligne ; chaque ligne comportant
des champs séparés par des délimiteur.
-
```awk
#!/usr/bin/awk -f
# Les commentaires commencent par un #
-
-# les programmes AWK consistent en une collection de règles et d'actions
+# Les programmes AWK consistent en une collection de règles et d'actions.
règle1 { action; }
règle2 { action; }
@@ -46,14 +44,14 @@ règle2 { action; }
# texte. Si vous ne disposez pas de fichiers texte, considérez BEGIN comme le
# point d’entrée principal du script.
# À l'opposé de BEGIN, il existe la règle END. Cette règle est présente après
-#chaque fin de fichier (EOF : End Of File).
+# chaque fin de fichier (EOF : End Of File).
BEGIN {
# Les variables sont globales. Pas besoin de les déclarer.
count = 0;
- # les opérateurs sont identiques au langage C et aux langages similaires
+ # Les opérateurs sont identiques au langage C et aux langages similaires
# (tels que C#, C++, etc.)
a = count + 1; # addition
b = count - 1; # soustraction
@@ -73,7 +71,8 @@ BEGIN {
a++;
b--;
- # En tant qu'opérateur préfixé, c'est la valeur incrémentée qui est retournée
+ # En tant qu'opérateur préfixé, c'est la valeur incrémentée qui
+ # est retournée
++a;
--b;
@@ -121,7 +120,6 @@ BEGIN {
arr[1] = "bar";
# Vous pouvez aussi initialiser un tableau avec la fonction split()
-
n = split("foo:bar:baz", arr, ":");
# Il y a aussi les tableaux associatifs
@@ -130,7 +128,6 @@ BEGIN {
# et les tableaux multi-dimensions, avec certaines limitations que l'on ne
# mentionnera pas ici
-
multidim[0,0] = "foo";
multidim[0,1] = "bar";
multidim[1,0] = "baz";
@@ -149,18 +146,16 @@ BEGIN {
for (argnum in ARGV)
print ARGV[argnum];
- # Vous pouvez supprimer des éléments d'un tableau
+ # Vous pouvez supprimer des éléments d'un tableau.
# C'est utile pour empêcher AWK de supposer que certains arguments soient
# des fichiers à traiter.
-
delete ARGV[1];
- # Le nombre d'arguments de la ligne de commande est assigné à la variable ARGC
+ # Le nombre d'arguments de la ligne de commande est assigné à
+ # la variable ARGC
print ARGC;
- # AWK inclue trois catégories de fonction.
- # On les examinera plus tard
-
+ # AWK inclue trois catégories de fonction. On les examinera plus tard.
return_value = arithmetic_functions(a, b, c);
string_functions();
io_functions();
@@ -175,13 +170,13 @@ function arithmetic_functions(a, b, c, d) {
# Il y a cependant une solution de contournement (enfin ... une bidouille).
# Les arguments d'une fonction sont locaux à cette fonction.
- # Et AWK vous permet de définir plus d'arguments à la fonction que nécessaire.
- # Il suffit donc de mettre une variable locale dans la déclaration de fonction,
- # comme ci-dessus. La convention veut que vous mettiez quelques espaces
- # supplémentaires pour faire la distinction entre les paramètres réels et
- # les variables locales.
- # Dans cet exemple, a, b et c sont des paramètres réels,
- # alors que d est simplement une variable locale.
+ # Et AWK vous permet de définir plus d'arguments à la fonction que
+ # nécessaire. Il suffit donc de mettre une variable locale dans la
+ # déclaration de fonction, comme ci-dessus. La convention veut que vous
+ # mettiez quelques espaces supplémentaires pour faire la distinction entre
+ # les paramètres réels et les variables locales.
+ # Dans cet exemple, a, b et c sont des paramètres réels, alors que d est
+ # simplement une variable locale.
# Maintenant, les fonctions arithmétiques
@@ -217,20 +212,21 @@ function string_functions( localvar, arr) {
# AWK a plusieurs fonctions pour le traitement des chaînes de caractères,
# dont beaucoup reposent sur des expressions régulières.
- # Chercher et remplacer, la première occurrence (sub) ou toutes les
- # occurrences (gsub)
+ # Chercher et remplacer, la première occurrence (sub), ou toutes les
+ # occurrences (gsub).
# Les deux renvoient le nombre de correspondances remplacées
-
localvar = "fooooobar";
sub("fo+", "Meet me at the ", localvar); # localvar => "Meet me at the bar"
gsub("e", ".", localvar); # localvar => "m..t m. at th. bar"
- # Rechercher une chaîne de caractères qui correspond à une expression régulière
- # index() fait la même chose, mais n'autorise pas les expressions régulières
+ # Rechercher une chaîne de caractères qui correspond à une expression
+ # régulière index() fait la même chose, mais n'autorise pas les expressions
+ # régulières.
match(localvar, "t"); # => 4, puisque 't' est le quatrième caractère
# Séparer par un délimiteur
- n = split("foo-bar-baz", arr, "-"); # a[1] = "foo"; a[2] = "bar"; a[3] = "baz"; n = 3
+ n = split("foo-bar-baz", arr, "-");
+ # résultat : a[1] = "foo"; a[2] = "bar"; a[3] = "baz"; n = 3
# Autre astuces utiles
sprintf("%s %d %d %d", "Testing", 1, 2, 3); # => "Testing 1 2 3"
@@ -251,23 +247,20 @@ function io_functions( localvar) {
# AWK n'a pas de descripteur de fichier en soi. Il ouvrira automatiquement
# un descripteur de fichier lorsque vous utilisez quelque chose qui en a
- # besoin.
- # La chaîne de caractères que vous avez utilisée pour cela peut être traitée
- # comme un descripteur de fichier à des fins d'entrée / sortie.
-
+ # besoin. La chaîne de caractères que vous avez utilisée pour cela peut être
+ # traitée comme un descripteur de fichier à des fins d'entrée / sortie.
outfile = "/tmp/foobar.txt";
-
print "foobar" > outfile;
- # Maintenant, la chaîne de caractères "outfile" est un descripteur de fichier.
- # Vous pouvez le fermer
+ # Maintenant, la chaîne de caractères "outfile" est un descripteur de
+ # fichier. Vous pouvez le fermer.
close(outfile);
# Voici comment exécuter quelque chose dans le shell
system("echo foobar"); # => affiche foobar
- # Lire quelque chose depuis l'entrée standard et la stocker dans une variable
- # locale
+ # Lire quelque chose depuis l'entrée standard et la stocker dans une
+ # variable locale
getline localvar;
# Lire quelque chose à partir d'un pipe (encore une fois, utilisez une
@@ -294,23 +287,24 @@ function io_functions( localvar) {
# Cette action sera exécutée pour chaque ligne qui correspond à l'expression
# régulière, /^fo+bar$/, et sera ignorée pour toute ligne qui n'y correspond
- # pas. Imprimons simplement la ligne:
+ # pas. Imprimons simplement la ligne :
print;
# Pas d'argument ! C'est parce que print a un défaut : $0.
- # $0 est le nom de la ligne en cours de traitement. Il est créé automatiquement.
+ # $0 est le nom de la ligne en cours de traitement. Il est créé
+ # automatiquement.
# Vous devinez probablement qu'il existe d'autres variables $.
- # Chaque ligne est divisée implicitement avant que chaque action soit exécutée,
- # comme le fait le shell. Et, comme le shell, chaque champ est accessible
- # avec un signe dollar
+ # Chaque ligne est divisée implicitement avant que chaque action soit
+ # exécutée, comme le fait le shell. Et, comme le shell, chaque champ est
+ # accessible avec un signe dollar.
- # Ceci affichera les deuxième et quatrième champs de la ligne.
+ # Ceci affichera les deuxième et quatrième champs de la ligne.
print $2, $4;
# AWK défini automatiquement beaucoup d'autres variables qui peuvent vous
- # aider à inspecter et traiter chaque ligne. La plus importante est NF
+ # aider à inspecter et traiter chaque ligne. La plus importante est NF.
# Affiche le nombre de champs de la ligne
print NF;
@@ -320,7 +314,6 @@ function io_functions( localvar) {
}
# Chaque règle est en réalité un test conditionnel.
-
a > 0 {
# Ceci s’exécutera une fois pour chaque ligne, tant que le test est positif
}
@@ -328,19 +321,16 @@ a > 0 {
# Les expressions régulières sont également des tests conditionnels.
# Si le test de l'expression régulières n'est pas vrais alors le bloc
# n'est pas exécuté.
-
$0 /^fobar/ {
print "la ligne commence par foobar"
}
# Dans le cas où vous voulez tester votre chaîne de caractères sur la ligne
# en cours de traitement $0 est optionnelle.
-
/^[a-zA-Z0-9]$/ {
print "La ligne courante ne contient que des caractères alphanumériques.";
}
-
# AWK peut parcourir un fichier texte ligne par ligne et exécuter des actions en
# fonction de règles établies. Cela est si courant sous UNIX qu'AWK est un
# langage de script.
@@ -349,7 +339,7 @@ $0 /^fobar/ {
# parfait. Le script lit un nom à partir de l'entrée standard, puis affiche
# l'âge moyen de toutes les personnes portant ce prénom.
# Supposons que vous fournissiez comme argument le nom d'un fichier comportant
-# ces données:
+# ces données :
#
# Bob Jones 32
# Jane Doe 22
@@ -364,22 +354,24 @@ BEGIN {
# Premièrement, on demande à l'utilisateur le prénom voulu
print "Pour quel prénom voudriez vous savoir l'age moyen ?";
- # On récupère la ligne à partir de l'entrée standard, pas de la ligne de commande
+ # On récupère la ligne à partir de l'entrée standard, pas de la ligne
+ # de commande :
getline name < "/dev/stdin";
}
# Maintenant, pour chaque ligne dont le premier champ est le prénom donné
$1 == name {
- # Ici, nous avons accès à un certain nombre de variables utiles déjà préchargées :
+ # Ici, nous avons accès à un certain nombre de variables utiles déjà
+ # préchargées :
# $0 est la ligne entière
# $3 est le troisième champ. Ici il correspond à l'age qui nous intéresse
# NF est le nombre de champs et vaut 3
# NR est le nombre d'enregistrements (lignes) vus jusqu'à présent
# FILENAME est le nom du fichier en cours de traitement
# FS est séparateur de champs, ici c'est " " (un espace)
- # ...etc. Et beaucoup d'autre que vous pouvez connaître dans le manuel de man.
- # Pour cela exécutez "man awk" dans votre terminal
+ # ...etc. Et beaucoup d'autre que vous pouvez connaître dans le manuel de
+ # man. Pour cela exécutez "man awk" dans votre terminal.
# Garder une trace du total accumulé et du nombre de lignes correspondant.
sum += $3;
@@ -390,9 +382,9 @@ $1 == name {
# les fichiers texte. Contrairement à BEGIN, il ne fonctionne que si vous lui
# donnez une entrée à traiter. Il sera exécuté une fois que tous les fichiers
# auront été lus et traités conformément aux règles et aux actions que vous
-# avez fournies. Le but est généralement de produire un rapport final
-# ou de faire quelque chose avec l'ensemble des données que vous avez
-# accumulées au cours du script.
+# avez fournies. Le but est généralement de produire un rapport final, ou de
+# faire quelque chose avec l'ensemble des données que vous avez accumulées
+# au cours du script.
END {
@@ -401,9 +393,11 @@ END {
}
```
+
Pour plus d'informations :
* [Awk tutorial](http://www.grymoire.com/Unix/Awk.html)
* [Awk man page](https://linux.die.net/man/1/awk)
-* [The GNU Awk User's Guide](https://www.gnu.org/software/gawk/manual/gawk.html) GNU Awk est dans la majorité des systèmes Linux.
+* [The GNU Awk User's Guide](https://www.gnu.org/software/gawk/manual/gawk.html)
+ GNU Awk est dans la majorité des systèmes Linux.
* [AWK one-liner collection](http://tuxgraphics.org/~guido/scripts/awk-one-liner.html)
diff --git a/fr-fr/clojure-fr.html.markdown b/fr-fr/clojure-fr.html.markdown
index 65747c0d..6215e0cf 100644
--- a/fr-fr/clojure-fr.html.markdown
+++ b/fr-fr/clojure-fr.html.markdown
@@ -427,7 +427,7 @@ plupart des fonctions principales :
4Clojure est une super manière d'augmenter vos compétences en Clojure et
en programmation fonctionnelle :
-[http://www.4clojure.com/](http://www.4clojure.com/)
+[https://4clojure.oxal.org/](https://4clojure.oxal.org/)
Clojure-doc.org a pas mal d'article pour débuter :
[http://clojure-doc.org/](http://clojure-doc.org/)
diff --git a/fr-fr/go-fr.html.markdown b/fr-fr/go-fr.html.markdown
index 9d8bef70..38cc3b52 100644
--- a/fr-fr/go-fr.html.markdown
+++ b/fr-fr/go-fr.html.markdown
@@ -32,7 +32,7 @@ communauté active.
multiligne */
// Un paquet débute avec une clause "package"
-// "Main" est un nom spécial déclarant un paquet de type exécutable plutôt
+// "main" est un nom spécial déclarant un paquet de type exécutable plutôt
// qu'une bibliothèque
package main
diff --git a/fr-fr/javascript-fr.html.markdown b/fr-fr/javascript-fr.html.markdown
index 186859ab..308f1ca8 100644
--- a/fr-fr/javascript-fr.html.markdown
+++ b/fr-fr/javascript-fr.html.markdown
@@ -94,7 +94,7 @@ let banta = "Harry", santa = "Hermione";
// L'égalité est === ou ==
// === compare la valeur exacte 2 === '2' // = false
-// == convertit la valeur pour comparer 2 === '2' // = true
+// == convertit la valeur pour comparer 2 == '2' // = true
// En général, il vaut mieux utiliser === pour ne pas faire d'erreur.
1 === 1; // = true
2 === 1; // = false
diff --git a/fr-fr/set-theory-fr.html.markdown b/fr-fr/set-theory-fr.html.markdown
index 543bd98b..d1ac2711 100644
--- a/fr-fr/set-theory-fr.html.markdown
+++ b/fr-fr/set-theory-fr.html.markdown
@@ -125,7 +125,7 @@ A △ B = (A \ B) ∪ (B \ A)
```
### Produit cartésien
-Le produit cartésien de deux ensembles `A` et `B` est l'ensemble contenant tous les couples dont la première élément appartient à `A` et la deuxième à `B`.
+Le produit cartésien de deux ensembles `A` et `B` est l'ensemble contenant tous les couples dont le premier élément appartient à `A` et le deuxième à `B`.
```
A × B = { (x, y) | x ∈ A, y ∈ B }
diff --git a/fr-fr/yaml-fr.html.markdown b/fr-fr/yaml-fr.html.markdown
index c7cb9421..36c33bd1 100644
--- a/fr-fr/yaml-fr.html.markdown
+++ b/fr-fr/yaml-fr.html.markdown
@@ -36,6 +36,7 @@ valeur_numérique: 100
notation_scientifique: 1e+12
booléen: true
valeur_null: null
+une_autre_valeur_null: ~
clé avec espaces: valeur
# Bien qu'il ne soit pas nécessaire de mettre les chaînes de caractères
# entre guillemets, cela reste possible, et parfois utile.
diff --git a/go.html.markdown b/go.html.markdown
index c040b3ee..fe69ed43 100644
--- a/go.html.markdown
+++ b/go.html.markdown
@@ -39,7 +39,7 @@ Go comes with a good standard library and a sizeable community.
// +build prod, dev, test
// A package clause starts every source file.
-// Main is a special name declaring an executable rather than a library.
+// main is a special name declaring an executable rather than a library.
package main
// Import declaration declares library packages referenced in this file.
diff --git a/hdl.html.markdown b/hdl.html.markdown
index 3c3aff66..6b9a2d80 100644
--- a/hdl.html.markdown
+++ b/hdl.html.markdown
@@ -12,7 +12,7 @@ It is used by circuit designers to simulate circuits and logic prior to wiring a
HDL allows circuit designers to simulate circuits at a high level without being connected to specific components.
## Basic building blocks & introduction to the language---
-This programming language is built by simulating hardware chips and wiring. Normal programming functions are replaced with specialized chips that are added to the current wiring desing. Every base chip must be written as it's own file and imported to be used in the current chip, though they may be reused as often as desired.
+This programming language is built by simulating hardware chips and wiring. Normal programming functions are replaced with specialized chips that are added to the current wiring design. Every base chip must be written as it's own file and imported to be used in the current chip, though they may be reused as often as desired.
```verilog
// Single line comments start with two forward slashes.
@@ -79,7 +79,7 @@ foo(in=a[0..7], out=c); // C is now a 2 bit internal bus
// Note that internally defined busses cannot be subbussed!
-// To access these elements, output or input them seperately:
+// To access these elements, output or input them separately:
foo(in[0]=false, in[1..7]=a[0..6], out[0]=out1, out[1]=out2);
// out1 and out2 can then be passed into other circuits within the design.
diff --git a/hjson.html.markdown b/hjson.html.markdown
index 2abeca1a..6b3cc3ed 100644
--- a/hjson.html.markdown
+++ b/hjson.html.markdown
@@ -15,7 +15,7 @@ to read and edit before passing the JSON data to the machine.
Let's take a look at examples to see the key syntax differences!
-```hjson
+```
{
# Comments are totally supported!
@@ -55,7 +55,7 @@ Let's take a look at examples to see the key syntax differences!
Oh wait.. there is! It's called Hjson.
'''
- # Backslashes are interpretted as an escape character ONLY in quoted strings
+ # Backslashes are interpreted as an escape character ONLY in quoted strings
slash: This will not have a new line\n
slash-quoted: "This will definitely have a new line\n"
diff --git a/hy.html.markdown b/hy.html.markdown
index 1287095f..f6bdead0 100644
--- a/hy.html.markdown
+++ b/hy.html.markdown
@@ -13,8 +13,7 @@ hy to call native python code or python to call native hy code as well
This tutorial works for hy ≥ 0.9.12, with some corrections for hy 0.11.
```clojure
-;; this gives an gentle introduction to hy for a quick trial head to
-;; http://try-hy.appspot.com
+;; this gives an gentle introduction to hy
;;
; Semicolon comments, like other LISPS
diff --git a/images/cairo/build.png b/images/cairo/build.png
new file mode 100644
index 00000000..7cadb9ad
Binary files /dev/null and b/images/cairo/build.png differ
diff --git a/images/cairo/connect.png b/images/cairo/connect.png
new file mode 100644
index 00000000..86146353
Binary files /dev/null and b/images/cairo/connect.png differ
diff --git a/images/cairo/connect2.png b/images/cairo/connect2.png
new file mode 100644
index 00000000..08b00a81
Binary files /dev/null and b/images/cairo/connect2.png differ
diff --git a/images/cairo/declare.png b/images/cairo/declare.png
new file mode 100644
index 00000000..5b5196ce
Binary files /dev/null and b/images/cairo/declare.png differ
diff --git a/images/cairo/deploy.png b/images/cairo/deploy.png
new file mode 100644
index 00000000..bdb7e53c
Binary files /dev/null and b/images/cairo/deploy.png differ
diff --git a/it-it/go-it.html.markdown b/it-it/go-it.html.markdown
index 797f6b0b..2af2468d 100644
--- a/it-it/go-it.html.markdown
+++ b/it-it/go-it.html.markdown
@@ -34,7 +34,7 @@ Go include un'ottima libreria standard e ha una community entusiasta.
su riga multipla */
// In cima ad ogni file è necessario specificare il package.
-// Main è un package speciale che identifica un eseguibile anziché una libreria.
+// main è un package speciale che identifica un eseguibile anziché una libreria.
package main
// Con import sono dichiarate tutte le librerie a cui si fa riferimento
diff --git a/javascript.html.markdown b/javascript.html.markdown
index b290b553..ec250e45 100644
--- a/javascript.html.markdown
+++ b/javascript.html.markdown
@@ -620,7 +620,7 @@ function isEven(number) {
};
// I put the word "equivalent" in double quotes because a function defined
-// using the lambda syntax cannnot be called before the definition.
+// using the lambda syntax cannot be called before the definition.
// The following is an example of invalid usage:
add(1, 8);
diff --git a/jsonnet.html.markdown b/jsonnet.html.markdown
index 241caf5f..f077c35b 100644
--- a/jsonnet.html.markdown
+++ b/jsonnet.html.markdown
@@ -131,7 +131,7 @@ assert obj5 == {};
```
## Further Reading
-There are a few but important concepts that are not touched in this exmaple, including:
+There are a few but important concepts that are not touched in this example, including:
- Passing variables from command line: [Parameterize Entire Config](https://jsonnet.org/learning/tutorial.html#parameterize-entire-config)
- Import other jsonnet libraries/files: [Imports](https://jsonnet.org/learning/tutorial.html#imports)
diff --git a/kdb+.html.markdown b/kdb+.html.markdown
index 680c01c1..db842726 100644
--- a/kdb+.html.markdown
+++ b/kdb+.html.markdown
@@ -560,7 +560,7 @@ select avg height by sex from t
/ => f | 160
/ => m | 177.5
-/ If no aggreation function is specified, last is assumed
+/ If no aggregation function is specified, last is assumed
select by sex from t
/ => sex| name age height
/ => ---| -----------------
diff --git a/ko-kr/clojure-kr.html.markdown b/ko-kr/clojure-kr.html.markdown
index 1d9e53cd..32a5baf3 100644
--- a/ko-kr/clojure-kr.html.markdown
+++ b/ko-kr/clojure-kr.html.markdown
@@ -377,7 +377,7 @@ Clojuredocs.org는 core 함수들에 대해 다양한 예제와 문서를 보유
[http://clojuredocs.org/quickref/Clojure%20Core](http://clojuredocs.org/quickref/Clojure%20Core)
4Clojure는 clojure/FP 스킬을 올릴 수 있는 좋은 길입니다:
-[http://www.4clojure.com/](http://www.4clojure.com/)
+[https://4clojure.oxal.org/](https://4clojure.oxal.org/)
Clojure-doc.org는 많고 많은 문서들을 보유하고 있습니다:
[http://clojure-doc.org/](http://clojure-doc.org/)
diff --git a/lambda-calculus.html.markdown b/lambda-calculus.html.markdown
index 958dd746..775907c2 100644
--- a/lambda-calculus.html.markdown
+++ b/lambda-calculus.html.markdown
@@ -41,7 +41,7 @@ Evaluation is done via
which is essentially lexically-scoped substitution.
When evaluating the
-expression `(λx.x)a`, we replace all occurences of "x" in the function's body
+expression `(λx.x)a`, we replace all occurrences of "x" in the function's body
with "a".
- `(λx.x)a` evaluates to: `a`
diff --git a/lbstanza.html.markdown b/lbstanza.html.markdown
index 19dc7db7..90e7b7e5 100644
--- a/lbstanza.html.markdown
+++ b/lbstanza.html.markdown
@@ -8,7 +8,7 @@ contributors:
LB Stanza (or Stanza for short) is a new optionally-typed general purpose programming language from the University of California, Berkeley. Stanza was designed to help programmers tackle the complexity of architecting large programs and significantly increase the productivity of application programmers across the entire software development life cycle.
-```stanza
+```
; this is a comment
;
This is a block comment
@@ -193,7 +193,7 @@ while condition[0]:
for i in 0 to 10 do:
vector[i] = i
-; stanza also supports named labels which can functin as break or return
+; stanza also supports named labels which can function as break or return
; statements
defn another-fn ():
label return:
@@ -218,7 +218,7 @@ for (x in xs, y in ys, z in zs) do :
println("x:%_, y:%_, z:%_" % [x, y, z])
-;xs, ys, and zs are all "Seqable" meaing they are Seq types (sequences).
+;xs, ys, and zs are all "Seqable" meaning they are Seq types (sequences).
; the `do` identifier is a special function that just applies the body of
; the for loop to each element of the sequence.
;
@@ -268,7 +268,7 @@ is-there = any?({_ == 2.0}, numbers)
doc: \
# Document Strings
- ```stanza
+ ```
val you-can = "include code snippets, too"
```
@@ -279,4 +279,4 @@ doc: \
```
\
defn docfn () : false
-```
\ No newline at end of file
+```
diff --git a/ldpl.html.markdown b/ldpl.html.markdown
index 86603d94..449c8670 100644
--- a/ldpl.html.markdown
+++ b/ldpl.html.markdown
@@ -3,6 +3,7 @@ language: LDPL
filename: learnLDPL.ldpl
contributors:
- ["Martín del Río", "https://github.com/lartu"]
+ - ["John Paul Wohlscheid", "https://github.com/JohnBlood"]
---
**LDPL** is a powerful, C++ transpiled, open-source programming language designed
@@ -68,7 +69,7 @@ else if myMap:"someIndex" is not equal to 45 then
else
display "Else!" crlf
end if
-# Valid LDPL comparisson operators are
+# Valid LDPL comparison operators are
# - IS EQUAL TO
# - IS NOT EQUAL TO
# - IS LESS THAN
@@ -123,8 +124,8 @@ get random in myNumber # get a random number between 0 and 1
# files, are divided in sections. The sections found in sub-procedures are
# the PARAMETERS section, the LOCAL DATA section and the PROCEDURE section.
# All sections except the PROCEDURE section can be skipped if they aren't
-# used. If no PARAMTERS nor LOCAL DATA sections are used, the PROCEDURE
-# keyword may be omited.
+# used. If no PARAMETERS nor LOCAL DATA sections are used, the PROCEDURE
+# keyword may be omitted.
sub myFunction
parameters:
a is number # LDPL is pass by reference
diff --git a/m.html.markdown b/m.html.markdown
index 96828ae5..87e0875e 100644
--- a/m.html.markdown
+++ b/m.html.markdown
@@ -198,7 +198,7 @@ M has an execution stack. When all levels of the stack have returned, the progra
With an argument: execute a block of code & add a level to the stack.
```
-d ^routine ;run a routine from the begining.
+d ^routine ;run a routine from the beginning.
; ;routines are identified by a caret.
d tag ;run a tag in the current routine
d tag^routine ;run a tag in different routine
diff --git a/markdown.html.markdown b/markdown.html.markdown
index a6000910..fefb60f6 100644
--- a/markdown.html.markdown
+++ b/markdown.html.markdown
@@ -40,9 +40,9 @@ specific to a certain parser.
Markdown is a superset of HTML, so any HTML file is valid Markdown.
```md
-
```
@@ -298,7 +298,7 @@ omitted though.)
- [Subchapter ](#subchapter-h3-)
```
-Nontheless, this is a feature that might not be working in all Markdown
+Nonetheless, this is a feature that might not be working in all Markdown
implementations the same way.
## Images
@@ -370,9 +370,10 @@ Ugh this is so ugly | make it | stop
## Markdownlint
In order to simplify work with Markdown and to unify its coding style,
-`Markdownlint` has been created. This tool is available also as a plugin for
-some IDEs and can be used as an utility to ensure validity and readability of
-Markdown.
+`Markdownlint` has been created. Available as a
+[separate tool](https://github.com/markdownlint/markdownlint)
+as well as a plugin for some IDEs, it can be used to ensure validity and
+readability of Markdown.
---
diff --git a/mercurial.html.markdown b/mercurial.html.markdown
index 98658f83..2c06ca77 100644
--- a/mercurial.html.markdown
+++ b/mercurial.html.markdown
@@ -22,13 +22,13 @@ and/or directorie(s) over time.
* 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
+store the revision history of a project. Mercurial however is a truly
+distributed architecture, giving each developer 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
+client server architecture with a central server to store the revision 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
+each developer 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
@@ -56,7 +56,7 @@ any later version.
| changeset | Set of changes saved as diffs |
| diff | Changes between file(s) |
| tag | A named named revision |
-| parent(s) | Immediate ancestor(s) of a revison |
+| parent(s) | Immediate ancestor(s) of a revision |
| branch | A child of a revision |
| head | A head is a changeset with no child changesets |
| merge | The process of merging two HEADS |
@@ -184,7 +184,7 @@ Commit changes to the given files into the repository.
# Commit with a message
$ hg commit -m 'This is a commit message'
-# Commit all added / removed files in the currrent tree
+# Commit all added / removed files in the current tree
$ hg commit -A 'Adding and removing all existing files in the tree'
# amend the parent of the working directory with a new commit that contains the
@@ -341,7 +341,7 @@ $ hg revert -a
Remove the specified files on the next commit.
```bash
-# Remove a spcific file
+# Remove a specific file
$ hg remove go_away.txt
# Remove a group of files by pattern
diff --git a/mips.html.markdown b/mips.html.markdown
index 0e7a7d0c..31f735b0 100644
--- a/mips.html.markdown
+++ b/mips.html.markdown
@@ -111,7 +111,7 @@ gateways and routers.
sub $t2, $t0, $t1 # $t2 = $t0 - $t1
mul $t2, $t0, $t1 # $t2 = $t0 * $t1
div $t2, $t0, $t1 # $t2 = $t0 / $t1 (Might not be
- # supported in some versons of MARS)
+ # supported in some versions of MARS)
div $t0, $t1 # Performs $t0 / $t1. Get the
# quotient using 'mflo' and
# remainder using 'mfhi'
diff --git a/montilang.html.markdown b/montilang.html.markdown
index cceb7aa1..483dc5a5 100644
--- a/montilang.html.markdown
+++ b/montilang.html.markdown
@@ -170,7 +170,7 @@ printseven
/# currently, preprocessor statements can be used to make c++-style constants #/
&DEFINE LOOPSTR 20&
-/# must have & on either side with no spaces, 'DEFINE' is case sensative. #/
+/# must have & on either side with no spaces, 'DEFINE' is case sensitive. #/
/# All statements are scanned and replaced before the program is run, regardless of where the statements are placed #/
FOR LOOPSTR 7 PRINT . ENDFOR /# Prints '7' 20 times. At run, 'LOOPSTR' in source code is replaced with '20' #/
diff --git a/ms-my/clojure-my.html.markdown b/ms-my/clojure-my.html.markdown
index e199c8f4..cfcdeb40 100644
--- a/ms-my/clojure-my.html.markdown
+++ b/ms-my/clojure-my.html.markdown
@@ -413,7 +413,7 @@ Clojuredocs.org mempunyai dokumentasi berserta contoh untuk menggunakan kebanyak
[http://clojuredocs.org/quickref/Clojure%20Core](http://clojuredocs.org/quickref/Clojure%20Core)
4Clojure ialah cara yang baik untuk mengasah skill Clojure dan functional programming:
-[http://www.4clojure.com/](http://www.4clojure.com/)
+[https://4clojure.oxal.org/](https://4clojure.oxal.org/)
Clojure-doc.org (yup, serius) juga mengandungi beberapa artikel sebagai permulaan:
[http://clojure-doc.org/](http://clojure-doc.org/)
diff --git a/opengl.html.markdown b/opengl.html.markdown
index 83ace3e8..993402f7 100644
--- a/opengl.html.markdown
+++ b/opengl.html.markdown
@@ -35,7 +35,7 @@ int main() {
context };
window.setVerticalSyncEnabled(true);
window.setActive(true);
- // After that we initialise GLEW and check if an error occured.
+ // After that we initialise GLEW and check if an error occurred.
GLenum error;
glewExperimental = GL_TRUE;
if ((err = glewInit()) != GLEW_OK)
@@ -140,7 +140,7 @@ if (logSize > 0) {
}
```
-The same is possibile after glLinkProgram()
, just replace glGetShaderiv()
with glGetProgramiv()
+The same is possible after glLinkProgram()
, just replace glGetShaderiv()
with glGetProgramiv()
and glGetShaderInfoLog()
with glGetProgramInfoLog()
.
```cpp
@@ -194,7 +194,7 @@ void main() {
out vec4 outColor;
void main() {
- // We simply set the ouput color to red.
+ // We simply set the output color to red.
// The parameters are red, green, blue and alpha.
outColor = vec4(1.0, 0.0, 0.0, 1.0);
}
@@ -233,7 +233,7 @@ glBufferData(GL_ARRAY_BUFFER, // target buffer
// After filling the VBO link it to the location 0 in our vertex shader,
// which holds the vertex position.
// ...
-// To ask for the attibute location, if you haven't set it:
+// To ask for the attribute location, if you haven't set it:
GLint posLocation = glGetAttribLocation(program, "position");
// ..
glEnableVertexAttribArray(0);
@@ -463,7 +463,7 @@ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(iboData[0]) * iboData.size(),
iboData.data(), GL_STATIC_DRAW);
// Next in our render loop, we replace glDrawArrays() with:
-glDrawElements(GL_TRIANGLES, iboData.size(), GL_UNSINGED_INT, nullptr);
+glDrawElements(GL_TRIANGLES, iboData.size(), GL_UNSIGNED_INT, nullptr);
// Remember to delete the allocated memory for the IBO.
```
@@ -535,7 +535,7 @@ glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, 0, nullptr);
// ...
glBindVertexArray(vao);
glBindTexture(GL_TEXTURE_2D, texture);
-glDrawElements(GL_TRIANGLES, iboData.size(), GL_UNSINGED_INT, nullptr);
+glDrawElements(GL_TRIANGLES, iboData.size(), GL_UNSIGNED_INT, nullptr);
// ...
```
@@ -673,7 +673,7 @@ glUniformMatrix4fv(modelLocation, 1, GL_FALSE,
## Geometry Shader
-Gemoetry shaders were introduced in OpenGL 3.2, they can produce vertices
+Geometry shaders were introduced in OpenGL 3.2, they can produce vertices
that are send to the rasterizer. They can also change the primitive type e.g.
they can take a point as an input and output other primitives.
Geometry shaders are inbetween the vertex and the fragment shader.
diff --git a/openscad.html.markdown b/openscad.html.markdown
index e09b5109..63570cbe 100644
--- a/openscad.html.markdown
+++ b/openscad.html.markdown
@@ -7,7 +7,7 @@ contributors:
Draw 3D models with code using [OpenSCAD](https://openscad.org/).
-```openscad
+```
// Comments look like this
// 3D Primitives
diff --git a/p5.html.markdown b/p5.html.markdown
index f6084b98..d36d417f 100644
--- a/p5.html.markdown
+++ b/p5.html.markdown
@@ -29,11 +29,11 @@ function setup() {
}
function draw() {
- ellipse(10, 10, 50, 50); // creates a ellipse at the 10px from the left and 10px from the top with width adn height as 50 each, so its basically a circle.
+ ellipse(10, 10, 50, 50); // creates a ellipse at the 10px from the left and 10px from the top with width and height as 50 each, so its basically a circle.
//remember in p5.js the origin is at the top-left corner of the canvas
if (mouseIsPressed) {
- // mouseIsPressed is a boolean variable that changes to true if the mouse buttton is pressed down at that instant
+ // mouseIsPressed is a boolean variable that changes to true if the mouse button is pressed down at that instant
fill(0); // fill refers to the innner color or filling color of whatever shape you are going to draw next
} else {
diff --git a/pascal.html.markdown b/pascal.html.markdown
index 9c73c456..fe00791a 100644
--- a/pascal.html.markdown
+++ b/pascal.html.markdown
@@ -131,7 +131,7 @@ Begin
str := 'apple';
bool := true;
//pascal is not a case-sensitive language
- //arithmethic operation
+ //arithmetic operation
int := 1 + 1; // int = 2 overwriting the previous assignment
int := int + 1; // int = 2 + 1 = 3;
int := 4 div 2; //int = 2 division operation where result will be floored
diff --git a/php.html.markdown b/php.html.markdown
index 821bde8f..61f1c00c 100644
--- a/php.html.markdown
+++ b/php.html.markdown
@@ -443,7 +443,7 @@ $bar('C'); // Prints "A - B - C"
// You can call named functions using strings
$function_name = 'add';
echo $function_name(1, 2); // => 3
-// Useful for programatically determining which function to run.
+// Useful for programmatically determining which function to run.
// Or, use call_user_func(callable $callback [, $parameter [, ... ]]);
diff --git a/processing.html.markdown b/processing.html.markdown
index 777c6981..63f10e88 100644
--- a/processing.html.markdown
+++ b/processing.html.markdown
@@ -2,7 +2,7 @@
language: processing
filename: learnprocessing.pde
contributors:
- - ["Phone Thant Ko", "http://github.com/phonethantko"]
+ - ["Phone Than Ko", "http://github.com/phonethantko"]
- ["Divay Prakash", "https://github.com/divayprakash"]
---
@@ -256,7 +256,7 @@ line(x1, y1, z1, x2, y2, z2); // In 3D space
// Triangle
triangle(x1, y1, x2, y2, x3, y3);
-// Draws a triangle connecting three points defined by coordinate paramters.
+// Draws a triangle connecting three points defined by coordinate parameters.
// Rectangle
rect(a, b, c, d, [r]); // With optional parameter defining the radius of all corners
@@ -375,7 +375,7 @@ texture(image); // PImage can be passed into arguments for texture-mapping the s
If you want to take things further, there are more things Processing is powered
for. Rendering models, shaders and whatnot. There's too much to cover in a
-short documentation, so I will leave them out here. Shoud you be interested,
+short documentation, so I will leave them out here. Should you be interested,
please check out the references.
```
diff --git a/pt-br/awk-pt.html.markdown b/pt-br/awk-pt.html.markdown
index 366ae886..597b0e7a 100644
--- a/pt-br/awk-pt.html.markdown
+++ b/pt-br/awk-pt.html.markdown
@@ -370,8 +370,10 @@ END {
}
```
+
Leituras adicionais (em inglês):
* [Awk tutorial](http://www.grymoire.com/Unix/Awk.html)
* [Awk man page](https://linux.die.net/man/1/awk)
-* [The GNU Awk User's Guide](https://www.gnu.org/software/gawk/manual/gawk.html) GNU AWK é encontrado na maioria dos sistemas GNU/Linux.
+* [The GNU Awk User's Guide](https://www.gnu.org/software/gawk/manual/gawk.html)
+ GNU AWK é encontrado na maioria dos sistemas GNU/Linux.
diff --git a/pt-br/clojure-pt.html.markdown b/pt-br/clojure-pt.html.markdown
index e40b8fe7..15ad930a 100644
--- a/pt-br/clojure-pt.html.markdown
+++ b/pt-br/clojure-pt.html.markdown
@@ -561,7 +561,7 @@ Caso queira aprender mais:
[http://clojuredocs.org/quickref/Clojure%20Core](http://clojuredocs.org/quickref/Clojure%20Core)
* 4clojure possui alguns problemas e desafios interessantes para quem quiser treinar clojure ou programação funcional:
-[http://www.4clojure.com/](http://www.4clojure.com/)
+[https://4clojure.oxal.org/](https://4clojure.oxal.org/)
* clojure-doc.org tem um bom número de artigos para iniciantes:
[http://clojure-doc.org/](http://clojure-doc.org/)
diff --git a/pt-br/go-pt.html.markdown b/pt-br/go-pt.html.markdown
index 31473ee1..f68d63eb 100644
--- a/pt-br/go-pt.html.markdown
+++ b/pt-br/go-pt.html.markdown
@@ -28,7 +28,7 @@ Go vem com uma biblioteca padrão exaustiva e uma comunidade entusiasta.
várias linhas */
// A cláusula package aparece no início de cada arquivo.
-// Main é um nome especial declarando um executável ao invés de uma biblioteca.
+// main é um nome especial declarando um executável ao invés de uma biblioteca.
package main
// A cláusula Import declara os pacotes referenciados neste arquivo.
diff --git a/pt-br/processing-pt.html.markdown b/pt-br/processing-pt.html.markdown
new file mode 100644
index 00000000..5ed2950a
--- /dev/null
+++ b/pt-br/processing-pt.html.markdown
@@ -0,0 +1,480 @@
+---
+language: processing
+filename: learnprocessing.pde
+contributors:
+ - ["Phone Thant Ko", "http://github.com/phonethantko"]
+ - ["Divay Prakash", "https://github.com/divayprakash"]
+translators:
+ - ["Kemel Zaidan", "https://github.com/kemelzaidan"]
+lang: pt-br
+---
+
+## Introdução
+
+Processing é uma linguagem de programação para criação de artes digitais e
+conteúdo multimídia, permitindo que não programadores aprendam os fundamentos
+da programação computacional em um contexto visual.
+
+Embora a linguagem seja baseada na linguagem Java, sua sintaxe foi amplamente
+influenciado por ambas as sintaxes Java e Javascript.
+[Veja mais aqui](https://processing.org/reference/)
+
+A linguagem é tipada estaticamente e também vem com o seu Ambiente de Desenvolvimento
+Integrado (do inglês Integrated Development Environment - IDE) oficial para
+compilar e executar os scripts.
+
+```
+/* ---------
+ Comentários
+ ---------
+*/
+
+// Comentário de linha única começa com //
+
+/*
+ Como o Processing é baseado em Java,
+ a sintaxe para seus comentários é a mesma do Java (como você deve ter notado
+ acima)!
+ Comentários de várias linhas são agrupados como visto aqui.
+*/
+
+/* ---------------------------------------
+ Escrevendo e executando programas em Processing
+ ---------------------------------------
+*/
+
+// No Processing, o ponto de entrada do programa é uma função chamada setup()
+// com um tipo de retorno void.
+// Observação! A sintaxe é muito semelhante à do C++.
+void setup() {
+ // Isso imprime a saída clássica "Hello World!" no console quando executado.
+ println("Olá Mundo!"); // Mais uma linguagem com esse maldito ponto e vírgula, não é?
+}
+
+// Normalmente, colocamos todos os códigos estáticos dentro do método setup()
+// como o próprio nome sugere, uma vez que é executado apenas uma vez.
+// Pode variar da definição das cores de fundo, ou o tamanho da tela.
+background(color); //define a cor do fundo
+size(largura,altura,[renderizador]); // define o tamanho da tela com parâmetro
+// opcional para definir o renderizador
+// Você verá mais sobre isso ao longo deste documento.
+
+// Se você deseja executar os códigos indefinidamente, eles devem ser colocados
+// dentro do método draw()
+// draw() deve existir caso você queira que o código seja executado
+// continuamente e, obviamente, só pode haver um método draw().
+int = 0;
+void draw(){
+ // Este bloco de código faz um loop para sempre até parar
+ imprima(i);
+ i++; // Operador de incremento!
+}
+
+// Agora que sabemos como escrever o script de trabalho e como executá-lo,
+// continuaremos a explorar quais tipos de dados e coleções são suportados no
+// Processing.
+
+/* ------------------------
+ Tipos de dados e coleções
+ ------------------------
+*/
+
+// De acordo com as Referências do Processing, ele suporta 8 tipos primitivos
+// de dados da seguinte forma.
+
+boolean valorBoleano = true; // Boleano
+byte valorByteDeA = 23; // Byte
+char valorCharDeA = 'A'; // Caractere
+color valorDeCorBrancoM = color(255, 255, 255); // Cor (especificada usando
+// método color())
+color valorDeCorBrancoH = #FFFFFF; // Cor (especificada usando valor de hash)
+int valor = 5; // Inteiro (Número sem decimais)
+long valorLongo = 2147483648L; // "L" é adicionado ao número para marcá-lo como um longo
+float valorFloat = 1,12345; // Float (números de ponto flutuante de 32 bits)
+double valorDouble = 1,12345D; // Double (números de ponto flutuante de 64 bits)
+
+// NOTA!
+// Embora os tipos de dados "long" e "double" funcionem na linguagem,
+// funções do Processing não usam esses tipos de dados, portanto
+// eles precisam ser convertidos em tipos de dados "int" e "float",
+// respectivamente, usando a sintaxe (int) e (float) antes de passar para uma
+// função.
+
+// Existem vários tipos de dados compostos que estão disponíveis por padrão para
+// uso no Processing.
+// Primeiramente, farei um resumo dos mais usados para economizar tempo.
+
+// String
+// Enquanto o tipo de dados char usa '', o tipo de dados String usa "" - aspas
+// duplas.
+string stringExemplo = "Olá, Processing!";
+// String também pode ser criada a partir de um array de tipos de dados char.
+// Nós vamos discutir array muito em breve.
+char fonte = {'H', 'E', 'L', 'L', 'O'};
+String stringDeFonte = new String(source); // HELLO
+// Como em Java, strings podem ser concatenadas usando o operador "+".
+print("Olá " + "Mundo!"); // Olá Mundo!
+
+// Array
+// Arrays em Processing podem conter quaisquer tipos de dados, incluindo os
+// próprios objetos. Como os arrays são semelhantes aos objetos, eles devem
+// ser criados com a palavra-chave "new".
+int[] arrayInt = new int[5];
+int[] arrayIntComValores = {1, 2, 3}; // Você também pode preencher com dados.
+
+// Lista de Arrays
+// As funções são semelhantes às do array; arraylists podem conter qualquer
+// tipo de dados. A única diferença é que as listas de matrizes são
+// redimensionadas dinamicamente, pois é uma forma de implementação de matriz
+// redimensionável da interface "List" do Java .
+ArrayList intArrayList = new ArrayList();
+
+// Objeto
+// Como é baseado em Java, o Processing suporta programação orientada a objetos.
+// Isso significa que você pode basicamente definir quaisquer tipos de dados de
+// sua preferência e manipulá-los para suas necessidades.
+// Claro, uma classe tem que ser definida antes para o objeto que você quer.
+// Formato --> NomeClasse NameInstancia
+UmaClasseQualquer meuObjeto // então instancia mais tarde
+//ou
+UmaClasseQualquer meuObjetoInstanciado = new UmaClasseQualquer();
+
+// O Processing surge com mais coleções (ex. - Dicionários e Listas) por
+// padrão, por uma questão de simplicidade, vou deixá-los fora da discussão aqui.
+
+/* ------------
+ Matemática
+ ------------
+*/
+
+// Aritmética
+1 + 1 // 2
+2 - 1 // 1
+2 * 3 // 6
+3/2 // 1
+3.0 / 2 // 1.5
+3.0% 2 // 1.0
+
+// O Processing também vem com um conjunto de funções que simplificam operações
+// matemáticas.
+float f = sq(3); // f = 9.0
+float p = pow(3, 3); // p = 27.0
+int a = abs(-13); // a = 13
+int r1 = round(3.1); // r1 = 3
+int r2 = round(3.7); // r2 = 4
+float sr = sqrt(25); // sr = 5.0
+
+// Vetores
+// O Processing fornece uma maneira fácil de implementar vetores em seu ambiente
+// usando a classe PVector. Ela pode descrever um vetor bi ou tridimensional e
+// vem com um conjunto de métodos que são úteis para operações com matrizes.
+// Você pode encontrar mais informações sobre a classe PVector e suas funções
+// aqui. (https://processing.org/reference/PVector.html)
+
+// Trigonometria
+// O Processing também suporta operações trigonométricas fornecendo um
+// conjunto de funções. sin(), cos(), tan(), asin(), acos(), atan() e também
+// degrees() e radians() para conversão conveniente.
+// No entanto, essas funções usam o ângulo em radianos como parâmetro, então é
+// necessário converter previamente.
+float um = sin(PI/2); // um = 1.0
+// Como você deve ter notado, existe um conjunto de constantes para usos
+// trigonométricos; PI, HALF_PI, QUARTER_PI e assim por diante...
+
+/* -------------
+ Controle de fluxo
+ -------------
+*/
+
+// Declarações Condicionais
+// Instruções If - A mesma sintaxe das instruções if em Java.
+if (author.getAppearance().equals("quente")) {
+ print("Narcisismo no máximo!");
+} else {
+ // Você pode verificar outras condições aqui.
+ print("Algo está realmente errado aqui!");
+}
+// Um atalho para instruções if-else também pode ser usado.
+int = 3;
+String valor = (i > 5) ? "Grande" : "Pequena"; // "Pequena"
+
+// A estrutura switch-case pode ser usada para verificar várias condições de
+// forma concisa. É importante usar a instrução break. Se a instrução `break`
+// não existe o programa executa todos os casos a seguir após um caso ser
+// verdadeiro.
+int valor = 2;
+switch(valor) {
+ case 0:
+ print("Nada!"); // Isso não é executado.
+ break; // Salta para a próxima instrução
+ case 1:
+ print("Chegando lá..."); // Isso novamente não é executado.
+ break;
+ case 2:
+ print("Bravo!"); // Esta linha é executada.
+ break;
+ default:
+ print("Não encontrado!"); // Esta linha é executada se nosso valor for algum outro valor.
+ break;
+}
+
+// Declarações iterativas
+// Declarações For - Novamente, a mesma sintaxe que em Java
+for(int i = 0; i < 5; i++){
+ print(i); // imprime de 0 a 4
+}
+
+// Declarações While - Novamente, nada de novo se você estiver familiarizado com
+// a sintaxe Java.
+int j = 3;
+while(j > 0) {
+ print(j);
+ j--; // Isso é importante para evitar que o código seja executado indefinidamente.
+}
+
+// loop()| noLoop() | redraw() | exit()
+// Estas são mais funções específicas do Processing para configurar o fluxo do
+// programa.
+loop(); // permite que o método draw() seja executado para sempre enquanto
+noLoop(); // só permite que ele seja executado uma vez.
+redraw(); // executa o método draw() mais uma vez.
+exit(); // Isso para o programa. É útil para programas com draw()
+// rodando continuamente.
+```
+
+## Desenho com Processing
+
+Como você já deve ter entendido o básico da linguagem, vamos agora
+ver a melhor parte do Processing - DESENHAR.
+
+```
+/* ------
+ Formas
+ ------
+*/
+
+// Formas 2D
+
+// Ponto
+point(x, y); // No espaço 2D
+point(x, y, z); // No espaço 3D
+// Desenha um ponto no espaço de coordenadas.
+
+// Linha
+line(x1, y1, x2, y2); // No espaço 2D
+line(x1, y1, z1, x2, y2, z2); // No espaço 3D
+// Desenha uma linha conectando dois pontos definidos por (x1, y1) e (x2, y2).
+
+// Triângulo
+triangle(x1, y1, x2, y2, x3, y3);
+// Desenha um triângulo conectando três pontos definidos por parâmetros de coordenadas.
+
+// Retângulo
+rect(a, b, c, d, [r]); // Com parâmetro opcional definindo o raio de todos os cantos
+rect(a, b, c, d, [te, td, bd, be]); // Com conjunto opcional de parâmetros definindo
+// raio de cada canto
+// Desenha um retângulo com {a, b} como coordenada superior esquerda e c e d como largura
+// e altura respectivamente.
+
+// Quad
+quad(x, y, x2, y2, x3, y3, x4, y4);
+// Desenha um quadrilátero com parâmetros que definem as coordenadas de cada canto
+// ponto.
+
+// Elipse
+ellipse(x, y, largura, altura);
+// Desenha um eclipse no ponto {x, y} com largura e altura especificadas.
+
+// Arco
+arc(x, y, largura, altura, inicio, fim, [modo]);
+// Enquanto os primeiros quatro parâmetros são autoexplicativos,
+// início e fim definem os ângulos que o arco começa e termina (em radianos).
+// O parâmetro opcional [mode] define o preenchimento;
+// PIE dá o contorno de torta, CHORD dá o contorno reto e OPEN é como
+// CHORD porém sem contorno
+
+// Curvas
+// O Processing fornece duas implementações de curvas; usando curve() e
+// bezier(). Como pretendo manter isso simples, não vou discutir mais detalhes.
+// No entanto, se você quiser implementá-lo em seu sketch, aqui estão as
+// referências: (https://processing.org/reference/curve_.html)
+// (https://processing.org/reference/bezier_.html)
+
+// Formas 3D
+
+// espaço 3D
+pode ser configurado definindo "P3D" para o parâmetro do renderizador no
+// método size().
+size(largura, altura, P3D);
+// No espaço 3D, você terá que traduzir para a coordenada específica para
+// renderiza as formas 3D.
+
+// Caixa
+box(tamanho); // Cubo com o mesmo comprimento definido pelo tamanho
+box(w, h, d); // Caixa com largura, altura e profundidade definidas separadamente
+
+// Esfera
+sphere(raio); // Seu tamanho é definido usando o parâmetro raio
+// O mecanismo por trás da renderização das esferas é implementado por
+// triângulos em mosaico. Dito isso, o nível de detalhe sendo renderizado é
+// controlado pela função sphereDetail(res)
+// Mais informações aqui: (https://processing.org/reference/sphereDetail_.html)
+
+// Formas irregulares
+// E se você quiser desenhar algo que não foi disponibilizado pelo Processing
+// funções?
+// Você pode usar beginShape(), endShape(), vertex(x,y) para definir formas por
+// especificando cada ponto. Mais informações aqui:
+// (https://processing.org/reference/beginShape_.html)
+// Você também pode usar formas personalizadas usando a classe PShape:
+// (https://processing.org/reference/PShape.html)
+
+/* ---------------
+ Transformações
+ ---------------
+*/
+
+// As transformações são particularmente úteis para acompanhar o espaço de
+// coordenadas e os vértices das formas que você desenhou. Particularmente;
+// métodos de pilha de matrizes; pushMatrix(), popMatrix() e translate(x,y)
+pushMatriz(); // Salva o sistema de coordenadas atual na pilha
+// ... aplique todas as transformações aqui ...
+popMatriz(); // Restaura o sistema de coordenadas salvo
+// Usando-os, o sistema de coordenadas pode ser preservado e visualizado sem
+// causar qualquer conflito.
+
+// Traduzir
+translate(x,y); // Traduz para o ponto{x, y} ou seja - configurando a origem para esse ponto
+translate(x, y, z); // Contraparte 3D da função
+
+// Rotacionar
+rotate(ângulo); // Gira a quantidade especificada pelo parâmetro ângulo
+// Possui 3 contrapartes 3D para realizar a rotação, uma para cada dimensão:
+// rotateX(ângulo), rotateY(ângulo), rotateZ(ângulo)
+
+// Escala
+scale(s); // Dimensiona o sistema de coordenadas expandindo ou contraindo-o.
+
+/* --------------------
+ Estilo e texturas
+ --------------------
+*/
+
+// Cores
+// Como discuti anteriormente, a cor de fundo pode ser configurada usando a
+// função background(). Você pode definir a cor de um objeto de antemão e depois
+// passar para a função como um argumento.
+color c = cor(255, 255, 255); // BRANCO!
+// Por padrão, o Processing usa o esquema de cores RGB, mas pode ser configurado
+// para HSB usando colorMode(). Leia mais aqui:
+// (https://processing.org/reference/colorMode_.html)
+background(c); // Até agora, a cor de fundo deve ser branca.
+// Você pode usar a função fill() para selecionar a cor para preencher as formas.
+// Tem que ser configurado antes de você começar a desenhar formas para que as
+// cores fiquem aplicadas.
+fill(color(0, 0, 0));
+// Se você quiser apenas colorir os contornos das formas, você pode usar
+// função stroke().
+stroke(255, 255, 0, 200); // cor do traço definida para amarelo com transparência
+// definido para um valor menor.
+
+// Imagens
+// O Processing pode renderizar imagens e usá-las de várias maneiras.
+// Principalmente armazenado como Tipo de dados PImage.
+filter(sombreador); // O Processing suporta várias funções de filtro para manipulação de imagens.
+texture(imagem); // PImage pode ser passado em argumentos para mapeamento de textura das formas.
+```
+
+Se você quiser levar as coisas adiante, há mais coisas que o Processing tem o poder de fazer. Renderizar modelos, shaders e outros efeitos. Há muito para se cobrir em uma
+documentação curta, então vou deixá-los aqui. Se você se interessar, por favor verifique as referências.
+
+```
+// Antes de prosseguirmos, vou falar um pouco mais sobre como importar bibliotecas
+// para que você possa estender a funcionalidade do Processing para outros horizontes.
+
+/* -------
+ Importações
+ -------
+*/
+
+// As possibilidades do Processing pode ser estendidas ainda mais quando
+// importamos bibliotecas e pacotes em nossos esboços.
+// A instrução de importação pode ser escrita como abaixo na parte superior
+// do código-fonte.
+import processing.algumacoisa.*;
+```
+
+## VAC?
+
+Vamos ao código? Vamos sujar as mãos!
+
+Vamos ver um exemplo do openprocessing para visualizar o quanto o Processing é
+capaz de fazer com poucas linhas de código.
+
+Copie o código abaixo em seu IDE do Processing e veja a mágica.
+
+```
+// Isenção de responsabilidade: eu não escrevi este programa porque atualmente
+// estou ocupado com meu estágio e este sketch é adaptado do openprocessing pois
+// mostra algo legal com um código simples.
+// Recuperado de: (https://www.openprocessing.org/sketch/559769)
+
+float theta;
+float a;
+float col;
+float num;
+
+void setup() {
+ size(600,600);
+}
+
+void draw() {
+ background(#F2F2F2);
+ translate(width/2, height/2);
+ theta = map(sin(millis()/1000.0), -1, 1, 0, PI/6);
+
+ float num=6;
+ for (int i=0; i30) {
+ pushMatrix();
+ translate(0, -30);
+ rotate(theta);
+ branch(len);
+ popMatrix();
+
+ pushMatrix();
+ translate(0, -30);
+ rotate(-theta);
+ branch(len);
+ popMatrix();
+
+ }
+}
+```
+
+A linguagem Processing é fácil de aprender e é particularmente útil para criar
+conteúdo (mesmo em 3D) sem ter que digitar muitos códigos. É tão simples
+que você pode ler o código e ter uma ideia aproximada do fluxo do programa.
+
+No entanto, isso não se aplica quando você introduz bibliotecas externas, pacotes
+e até mesmo suas próprias aulas. (Confie em mim! Projetos em processing podem ficar realmente monstruosos...)
+
+## Alguns recursos úteis
+
+ - [Site do Processing](http://processing.org)
+ - [Sketches em Processing](http://openprocessing.org)
diff --git a/purescript.html.markdown b/purescript.html.markdown
index 8cf1c1dd..1ceaecf9 100644
--- a/purescript.html.markdown
+++ b/purescript.html.markdown
@@ -59,9 +59,9 @@ compare 3 2 -- GT
true && (9 >= 19 || 1 < 2) -- true
-- Strings
-"Hellow" :: String -- "Hellow"
+"Hello" :: String -- "Hello"
-- Multiline string without newlines, to run in PSCi use "paste" mode.
-"Hellow\
+"Hello\
\orld" -- "Helloworld"
-- Multiline string with newlines
"""Hello
diff --git a/python.html.markdown b/python.html.markdown
index 4382181f..d9eda60c 100644
--- a/python.html.markdown
+++ b/python.html.markdown
@@ -10,14 +10,17 @@ contributors:
- ["Roberto Fernandez Diaz", "https://github.com/robertofd1995"]
- ["caminsha", "https://github.com/caminsha"]
- ["Stanislav Modrak", "https://stanislav.gq"]
+ - ["John Paul Wohlscheid", "https://gitpi.us"]
filename: learnpython.py
---
-Python was created by Guido van Rossum in the early 90s. It is now one of the most popular
-languages in existence. I fell in love with Python for its syntactic clarity. It's basically
-executable pseudocode.
+Python was created by Guido van Rossum in the early 90s. It is now one of the
+most popular languages in existence. I fell in love with Python for its
+syntactic clarity. It's basically executable pseudocode.
-Note: This article applies to Python 3 specifically. Check out [here](http://learnxinyminutes.com/docs/pythonlegacy/) if you want to learn the old Python 2.7
+Note: This article applies to Python 3 specifically. Check out
+[here](http://learnxinyminutes.com/docs/pythonlegacy/) if you want to learn the
+old Python 2.7
```python
@@ -97,8 +100,9 @@ bool(set()) # => False
bool(4) # => True
bool(-6) # => True
-# Using boolean logical operators on ints casts them to booleans for evaluation, but their non-cast value is returned
-# Don't mix up with bool(ints) and bitwise and/or (&,|)
+# Using boolean logical operators on ints casts them to booleans for evaluation,
+# but their non-cast value is returned. Don't mix up with bool(ints) and bitwise
+# and/or (&,|)
bool(0) # => False
bool(2) # => True
0 and 2 # => 0
@@ -152,10 +156,10 @@ b == a # => True, a's and b's objects are equal
# You can find the length of a string
len("This is a string") # => 16
-# You can also format using f-strings or formatted string literals (in Python 3.6+)
+# Since Python 3.6, you can use f-strings or formatted string literals.
name = "Reiko"
f"She said her name is {name}." # => "She said her name is Reiko"
-# You can basically put any Python expression inside the braces and it will be output in the string.
+# Any valid Python expression inside these braces is returned to the string.
f"{name} is {len(name)} characters long." # => "Reiko is 5 characters long."
# None is an object
@@ -294,7 +298,7 @@ filled_dict = {"one": 1, "two": 2, "three": 3}
# Note keys for dictionaries have to be immutable types. This is to ensure that
# the key can be converted to a constant hash value for quick look-ups.
# Immutable types include ints, floats, strings, tuples.
-invalid_dict = {[1,2,3]: "123"} # => Raises a TypeError: unhashable type: 'list'
+invalid_dict = {[1,2,3]: "123"} # => Yield a TypeError: unhashable type: 'list'
valid_dict = {(1,2,3):[1,2,3]} # Values can be of any type, however.
# Look up values with []
@@ -348,7 +352,7 @@ del filled_dict["one"] # Removes the key "one" from filled dict
# Sets store ... well sets
empty_set = set()
-# Initialize a set with a bunch of values. Yeah, it looks a bit like a dict. Sorry.
+# Initialize a set with a bunch of values.
some_set = {1, 1, 2, 2, 3, 4} # some_set is now {1, 2, 3, 4}
# Similar to keys of a dictionary, elements of a set have to be immutable.
@@ -420,7 +424,7 @@ for animal in ["dog", "cat", "mouse"]:
"""
"range(number)" returns an iterable of numbers
-from zero to the given number
+from zero up to (but excluding) the given number
prints:
0
1
@@ -454,8 +458,7 @@ for i in range(4, 8, 2):
print(i)
"""
-To loop over a list, and retrieve both the index and the value of each item in the list
-prints:
+Loop over a list to retrieve both the index and the value of each list item:
0 dog
1 cat
2 mouse
@@ -482,10 +485,11 @@ try:
# Use "raise" to raise an error
raise IndexError("This is an index error")
except IndexError as e:
- pass # Pass is just a no-op. Usually you would do recovery here.
+ pass # Refrain from this, provide a recovery (next example).
except (TypeError, NameError):
- pass # Multiple exceptions can be handled together, if required.
-else: # Optional clause to the try/except block. Must follow all except blocks
+ pass # Multiple exceptions can be processed jointly.
+else: # Optional clause to the try/except block. Must follow
+ # all except blocks.
print("All good!") # Runs only if the code in try raises no exceptions
finally: # Execute under all circumstances
print("We can clean up resources here")
@@ -500,6 +504,7 @@ contents = {"aa": 12, "bb": 21}
with open("myfile1.txt", "w+") as file:
file.write(str(contents)) # writes a string to a file
+import json
with open("myfile2.txt", "w+") as file:
file.write(json.dumps(contents)) # writes an object to a file
@@ -521,7 +526,8 @@ print(contents)
filled_dict = {"one": 1, "two": 2, "three": 3}
our_iterable = filled_dict.keys()
-print(our_iterable) # => dict_keys(['one', 'two', 'three']). This is an object that implements our Iterable interface.
+print(our_iterable) # => dict_keys(['one', 'two', 'three']). This is an object
+ # that implements our Iterable interface.
# We can loop over it.
for i in our_iterable:
@@ -533,15 +539,16 @@ our_iterable[1] # Raises a TypeError
# An iterable is an object that knows how to create an iterator.
our_iterator = iter(our_iterable)
-# Our iterator is an object that can remember the state as we traverse through it.
-# We get the next object with "next()".
+# Our iterator is an object that can remember the state as we traverse through
+# it. We get the next object with "next()".
next(our_iterator) # => "one"
# It maintains state as we iterate.
next(our_iterator) # => "two"
next(our_iterator) # => "three"
-# After the iterator has returned all of its data, it raises a StopIteration exception
+# After the iterator has returned all of its data, it raises a
+# StopIteration exception
next(our_iterator) # Raises StopIteration
# We can also loop over it, in fact, "for" does this implicitly!
@@ -549,7 +556,7 @@ our_iterator = iter(our_iterable)
for i in our_iterator:
print(i) # Prints one, two, three
-# You can grab all the elements of an iterable or iterator by calling list() on it.
+# You can grab all the elements of an iterable or iterator by call of list().
list(our_iterable) # => Returns ["one", "two", "three"]
list(our_iterator) # => Returns [] because state is saved
@@ -599,9 +606,9 @@ all_the_args(1, 2, a=3, b=4) prints:
# Use * to expand tuples and use ** to expand kwargs.
args = (1, 2, 3, 4)
kwargs = {"a": 3, "b": 4}
-all_the_args(*args) # equivalent to all_the_args(1, 2, 3, 4)
-all_the_args(**kwargs) # equivalent to all_the_args(a=3, b=4)
-all_the_args(*args, **kwargs) # equivalent to all_the_args(1, 2, 3, 4, a=3, b=4)
+all_the_args(*args) # equivalent: all_the_args(1, 2, 3, 4)
+all_the_args(**kwargs) # equivalent: all_the_args(a=3, b=4)
+all_the_args(*args, **kwargs) # equivalent: all_the_args(1, 2, 3, 4, a=3, b=4)
# Returning multiple values (with tuple assignments)
def swap(x, y):
@@ -611,17 +618,19 @@ def swap(x, y):
x = 1
y = 2
x, y = swap(x, y) # => x = 2, y = 1
-# (x, y) = swap(x,y) # Again parenthesis have been excluded but can be included.
+# (x, y) = swap(x,y) # Again the use of parenthesis is optional.
-# Function Scope
+# global scope
x = 5
def set_x(num):
- # Local var x not the same as global variable x
+ # local scope begins here
+ # local var x not the same as global var x
x = num # => 43
print(x) # => 43
def set_global_x(num):
+ # global indicates that particular var lives in the global scope
global x
print(x) # => 5
x = num # global var x is now set to 6
@@ -629,6 +638,12 @@ def set_global_x(num):
set_x(43)
set_global_x(6)
+"""
+prints:
+ 43
+ 5
+ 6
+"""
# Python has first class functions
@@ -651,7 +666,7 @@ list(map(max, [1, 2, 3], [4, 2, 1])) # => [4, 2, 3]
list(filter(lambda x: x > 5, [3, 4, 5, 6, 7])) # => [6, 7]
# We can use list comprehensions for nice maps and filters
-# List comprehension stores the output as a list which can itself be a nested list
+# List comprehension stores the output as a list (which itself may be nested).
[add_10(i) for i in [1, 2, 3]] # => [11, 12, 13]
[x for x in [3, 4, 5, 6, 7] if x > 5] # => [6, 7]
@@ -711,8 +726,8 @@ class Human:
# Note that the double leading and trailing underscores denote objects
# or attributes that are used by Python but that live in user-controlled
# namespaces. Methods(or objects or attributes) like: __init__, __str__,
- # __repr__ etc. are called special methods (or sometimes called dunder methods)
- # You should not invent such names on your own.
+ # __repr__ etc. are called special methods (or sometimes called dunder
+ # methods). You should not invent such names on your own.
def __init__(self, name):
# Assign the argument to the instance's name attribute
self.name = name
@@ -766,7 +781,7 @@ if __name__ == '__main__':
i.say("hi") # "Ian: hi"
j = Human("Joel")
j.say("hello") # "Joel: hello"
- # i and j are instances of type Human, or in other words: they are Human objects
+ # i and j are instances of type Human; i.e., they are Human objects.
# Call our class method
i.say(i.get_species()) # "Ian: H. sapiens"
@@ -803,8 +818,8 @@ if __name__ == '__main__':
# "species", "name", and "age", as well as methods, like "sing" and "grunt"
# from the Human class, but can also have its own unique properties.
-# To take advantage of modularization by file you could place the classes above in their own files,
-# say, human.py
+# To take advantage of modularization by file you could place the classes above
+# in their own files, say, human.py
# To import functions from other files use the following format
# from "filename-without-extension" import "function-or-class"
@@ -928,8 +943,8 @@ class Batman(Superhero, Bat):
# However we are dealing with multiple inheritance here, and super()
# only works with the next base class in the MRO list.
# So instead we explicitly call __init__ for all ancestors.
- # The use of *args and **kwargs allows for a clean way to pass arguments,
- # with each parent "peeling a layer of the onion".
+ # The use of *args and **kwargs allows for a clean way to pass
+ # arguments, with each parent "peeling a layer of the onion".
Superhero.__init__(self, 'anonymous', movie=True,
superpowers=['Wealthy'], *args, **kwargs)
Bat.__init__(self, *args, can_fly=False, **kwargs)
@@ -1028,12 +1043,9 @@ print(say()) # Can you buy me a beer?
print(say(say_please=True)) # Can you buy me a beer? Please! I am poor :(
```
-## Ready For More?
-
### Free Online
* [Automate the Boring Stuff with Python](https://automatetheboringstuff.com)
-* [Ideas for Python Projects](http://pythonpracticeprojects.com)
* [The Official Docs](https://docs.python.org/3/)
* [Hitchhiker's Guide to Python](https://docs.python-guide.org/en/latest/)
* [Python Course](https://www.python-course.eu)
diff --git a/raku-pod.html.markdown b/raku-pod.html.markdown
index 7e9b6fc3..b008beab 100644
--- a/raku-pod.html.markdown
+++ b/raku-pod.html.markdown
@@ -193,7 +193,7 @@ are C, C and C.
### Comments
Although Pod blocks are ignored by the Rakudo Raku compiler, everything
-indentified as a Pod block will be read and interpreted by Pod renderers. In
+identified as a Pod block will be read and interpreted by Pod renderers. In
order to prevent Pod blocks from being rendered by any renderer, use the
`=comment` directive.
diff --git a/raku.html.markdown b/raku.html.markdown
index a8059791..53404f58 100644
--- a/raku.html.markdown
+++ b/raku.html.markdown
@@ -688,7 +688,7 @@ say (0 or False); # OUTPUT: «False».
my ($a, $b, $c, $d, $e) = 1, 0, False, True, 'pi';
say $a && $b && $c; # OUTPUT: «0», the first falsey value
say $a && $b && $c; # OUTPUT: «False», the first falsey value
-say $a && $d && $e; # OUTPUT: «pi», last operand since everthing before is truthy
+say $a && $d && $e; # OUTPUT: «pi», last operand since everything before is truthy
# `||` returns the first argument that evaluates to `True`.
say $b || $a || $d; # OUTPUT: «1»
@@ -1965,7 +1965,7 @@ say so 'abbbbc' ~~ / a b* c /; # OUTPUT: «True»
say so 'aec' ~~ / a b* c /; # OUTPUT: «False», "b"(s) are optional, not replaceable.
# `**` - (Unbound) Quantifier
-# If you squint hard enough, you might understand why exponentation is used
+# If you squint hard enough, you might understand why exponentiation is used
# for quantity.
say so 'abc' ~~ / a b**1 c /; # OUTPUT: «True», exactly one time
say so 'abc' ~~ / a b**1..3 c /; # OUTPUT: «True», one to three times
diff --git a/rdf.html.markdown b/rdf.html.markdown
index 4cb7ddd0..5b2105b8 100644
--- a/rdf.html.markdown
+++ b/rdf.html.markdown
@@ -28,7 +28,7 @@ usually look like URLs but function as identifiers, not locators. The use of
URIs provides context for resource identifiers to make them unambiguous—for
example, to tell a book title from a job title.
-```turtle
+```
# The hash symbol is the comment delimiter.
# Turtle triple statements end with periods like natural language sentences.
diff --git a/ro-ro/clojure-ro.html.markdown b/ro-ro/clojure-ro.html.markdown
index 32ba9620..77052379 100644
--- a/ro-ro/clojure-ro.html.markdown
+++ b/ro-ro/clojure-ro.html.markdown
@@ -380,7 +380,7 @@ Clojuredocs.org contine documentatie cu exemple pentru majoritatea functiilor de
[http://clojuredocs.org/quickref/Clojure%20Core](http://clojuredocs.org/quickref/Clojure%20Core)
4Clojure este o metoda excelenta pentru a exersa Clojure/FP (Programarea Functionala):
-[http://www.4clojure.com/](http://www.4clojure.com/)
+[https://4clojure.oxal.org/](https://4clojure.oxal.org/)
Clojure-doc.org are un numar de article pentru incepatori:
[http://clojure-doc.org/](http://clojure-doc.org/)
diff --git a/ru-ru/clojure-ru.html.markdown b/ru-ru/clojure-ru.html.markdown
index 19233d23..66986fa0 100644
--- a/ru-ru/clojure-ru.html.markdown
+++ b/ru-ru/clojure-ru.html.markdown
@@ -421,7 +421,7 @@ Clojuredocs.org — сайт документации языка с пример
[http://clojuredocs.org/quickref/Clojure%20Core](http://clojuredocs.org/quickref/Clojure%20Core)
4Clojure — отличный способ закрепить навыки программирования на clojure, решая задачи вместе с коллегами со всего мира:
-[http://www.4clojure.com/](http://www.4clojure.com/)
+[https://4clojure.oxal.org/](https://4clojure.oxal.org/)
Clojure-doc.org (да, именно) неплохой перечень статей для начинающих:
[http://clojure-doc.org/](http://clojure-doc.org/)
diff --git a/ru-ru/go-ru.html.markdown b/ru-ru/go-ru.html.markdown
index 37592258..8d2eac90 100644
--- a/ru-ru/go-ru.html.markdown
+++ b/ru-ru/go-ru.html.markdown
@@ -29,7 +29,7 @@ Go - это язык общего назначения, целью которо
комментарий */
// Ключевое слово package присутствует в начале каждого файла.
-// Main это специальное имя, обозначающее исполняемый файл, нежели библиотеку.
+// main это специальное имя, обозначающее исполняемый файл, нежели библиотеку.
package main
// Import предназначен для указания зависимостей этого файла.
diff --git a/scala.html.markdown b/scala.html.markdown
index d2d45dc9..bb20f624 100644
--- a/scala.html.markdown
+++ b/scala.html.markdown
@@ -302,7 +302,7 @@ do {
// Recursion is the idiomatic way of repeating an action in Scala (as in most
// other functional languages).
// Recursive functions need an explicit return type, the compiler can't infer it.
-// Here it's Unit, which is analagous to a `void` return type in Java
+// Here it's Unit, which is analogous to a `void` return type in Java
def showNumbersInRange(a: Int, b: Int): Unit = {
print(a)
if (a < b)
diff --git a/set-theory.html.markdown b/set-theory.html.markdown
index d55ab7d5..f89345c0 100644
--- a/set-theory.html.markdown
+++ b/set-theory.html.markdown
@@ -17,7 +17,7 @@ Set theory is a branch of mathematics that studies sets, their operations, and t
* the cross operator, `×`, means "the Cartesian product of".
### Qualifiers
-* the colon qualifier, `:`, means "such that";
+* the colon, `:`, or the vertical bar `|` qualifiers are interchangeable and mean "such that";
* the membership qualifier, `∈`, means "belongs to";
* the subset qualifier, `⊆`, means "is a subset of";
* the proper subset qualifier, `⊂`, means "is a subset of but is not equal to".
diff --git a/sing.html.markdown b/sing.html.markdown
index 2e439800..50b52390 100644
--- a/sing.html.markdown
+++ b/sing.html.markdown
@@ -154,7 +154,7 @@ fn learnTypes() void
sys.validate(dyna_array.size() == 1);
// a map that associates a number to a string.
- // "map(x)..." reads "map with key of type x and vaue of type..."
+ // "map(x)..." reads "map with key of type x and value of type..."
var a_map map(string)i32;
a_map.insert("one", 1);
diff --git a/smalltalk.html.markdown b/smalltalk.html.markdown
index aaa592dc..d4016ecf 100644
--- a/smalltalk.html.markdown
+++ b/smalltalk.html.markdown
@@ -60,7 +60,7 @@ doSomethingWith: argumentObject
Everything here except the `^` involves sending more messages. Event the `ifTrue:` that you might think is a language control structure is just Smalltalk code.
-We start by sending `size` to `self`. `self` is the object currently running the code - so in this case it is the myObject we started with. `size` is a very common message that we might anticipate tells us something about how big an object is; you could look it up with the Smalltalk tools very simply. The result we get is then sent the message `>` with the plain old integer 4 (which is an object too; no strange primitive types to pollute the system here) and nobody should be surprised the `>` is a comparison that answers true or false. That boolean (which is actually a Boolean object in Smalltalk) is sent the message `ifTrue:` with the block of code between the `[]` as its argument; obvioulsy a true boolean might be expected to run that block of code and a false to ignore it.
+We start by sending `size` to `self`. `self` is the object currently running the code - so in this case it is the myObject we started with. `size` is a very common message that we might anticipate tells us something about how big an object is; you could look it up with the Smalltalk tools very simply. The result we get is then sent the message `>` with the plain old integer 4 (which is an object too; no strange primitive types to pollute the system here) and nobody should be surprised the `>` is a comparison that answers true or false. That boolean (which is actually a Boolean object in Smalltalk) is sent the message `ifTrue:` with the block of code between the `[]` as its argument; obviously a true boolean might be expected to run that block of code and a false to ignore it.
If the block is run then we do some more message sending to the argument object and noting the `^` we return the answer back to our starting point and it gets assigned to `result`. If the block is ignored we seem to run out of code and so `self` is returned and assigned to `result`.
diff --git a/tcsh.html.markdown b/tcsh.html.markdown
index e38b7a27..05954442 100644
--- a/tcsh.html.markdown
+++ b/tcsh.html.markdown
@@ -713,7 +713,7 @@ end
#### 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 completion 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
diff --git a/textile.html.markdown b/textile.html.markdown
index 2b81674a..293e647d 100644
--- a/textile.html.markdown
+++ b/textile.html.markdown
@@ -165,11 +165,11 @@ but again, they use different HTML markup and thus the distinction.
###. Superscripts and Subscripts use carats and tildes:
-Superscripts are 2 ^nd^ to none, but subscripts are CO ~2~ L too.
+Superscripts are 2 ^and^ to none, but subscripts are CO ~2~ L too.
Note the spaces around the superscripts and subscripts.
To avoid the spaces, add square brackets around them:
-2[^nd^] and CO[~2~]L
+2[^and^] and CO[~2~]L
###. Insertions and deletions are indicated using -/+ symbols:
This is -deleted- text and this is +inserted+ text.
@@ -375,7 +375,7 @@ table(tableclass).
|a|classy|table|
|a|classy|table|
-###. Spanning rows and colums:
+###. Spanning rows and columns:
A backslash \ is used for a column span:
|\2. spans two cols |
diff --git a/tmux.html.markdown b/tmux.html.markdown
index 1c2c2da3..095e24fb 100644
--- a/tmux.html.markdown
+++ b/tmux.html.markdown
@@ -183,7 +183,7 @@ bind a send-prefix
### Theme
###########################################################################
-# Statusbar Color Palatte
+# Statusbar Color Palette
set-option -g status-justify left
set-option -g status-bg black
set-option -g status-fg white
diff --git a/tr-tr/clojure-tr.html.markdown b/tr-tr/clojure-tr.html.markdown
index 5ebe5ce6..d21947ee 100644
--- a/tr-tr/clojure-tr.html.markdown
+++ b/tr-tr/clojure-tr.html.markdown
@@ -482,7 +482,7 @@ Clojuredocs.org, örneklerle bezenmiş Clojure dökümantasyonu:
[http://clojuredocs.org/quickref/Clojure%20Core](http://clojuredocs.org/quickref/Clojure%20Core)
4Clojure, interaktif bir şekilde FP ve Clojure yeteneklerinizi geliştirmenize olanak veriyor:
-[http://www.4clojure.com/](http://www.4clojure.com/)
+[https://4clojure.oxal.org/](https://4clojure.oxal.org/)
Clojure-doc.org, Başlangıç için bir içeriklere sahip:
[http://clojure-doc.org/](http://clojure-doc.org/)
diff --git a/vala.html.markdown b/vala.html.markdown
index 06d6dedc..739e0fda 100755
--- a/vala.html.markdown
+++ b/vala.html.markdown
@@ -486,7 +486,7 @@ int more = 57;
int* more_pointer = &more; // & = address-of
int indirection_demo = more_pointer*; // indirection
-// Profiles: affect which Vala features are avaliable and which libraries the
+// Profiles: affect which Vala features are available and which libraries the
// C-code will use.
// - gobject (default)
// posix
diff --git a/vim.html.markdown b/vim.html.markdown
index f5be9b0d..fb2fc81f 100644
--- a/vim.html.markdown
+++ b/vim.html.markdown
@@ -27,9 +27,9 @@ specific points in the file, and for fast editing.
:wq # Save file and quit vim
ZZ # Save file and quit vim
:q! # Quit vim without saving file
- # ! *forces* :q to execute, hence quiting vim without saving
+ # ! *forces* :q to execute, hence quitting vim without saving
ZQ # Quit vim without saving file
- :x # Save file and quit vim, shorter version of :wq
+ :x # Save file(only when the file is modified) and quit vim
u # Undo
CTRL+R # Redo
diff --git a/vimscript.html.markdown b/vimscript.html.markdown
index c32faee9..04fee6fa 100644
--- a/vimscript.html.markdown
+++ b/vimscript.html.markdown
@@ -11,7 +11,7 @@ contributors:
" ##############
"
" Vim script (also called VimL) is the subset of Vim's ex-commands which
-" supplies a number of features one one would expect from a scripting language,
+" supplies a number of features one would expect from a scripting language,
" such as values, variables, functions or loops. Always keep in the back of
" your mind that a Vim script file is just a sequence of ex-commands. It is
" very common for a script to mix programming-language features and raw
@@ -38,7 +38,7 @@ echo 'Hello' | echo 'world!'
" Putting a comment after a command usually works
pwd " Displays the current working directory
-" Except for some commands it does not; use the command delemiter before the
+" Except for some commands it does not; use the command delimiter before the
" comment (echo assumes that the quotation mark begins a string)
echo 'Hello world!' | " Displays a message
@@ -98,7 +98,7 @@ echo v:false | " Evaluates to 0 or the string 'v:false'
" Boolean values can result from comparison of two objects.
echo x == y | " Equality by value
-echo x != y | " Unequality
+echo x != y | " Inequality
echo x > y | " Greater than
echo x >= y | " Greater than or equal
echo x < y | " Smaller than
@@ -110,7 +110,7 @@ echo x isnot y | " Instance non-identity (lists and dictionaries)
" echo 'a' < 'b'. Case sensitivity depends on the setting of 'ignorecase'
"
" Explicit case-sensitivity is specified by appending '#' (match case) or '?'
-" (ignore case) to the operator. Prefer explicity case sensitivity when writing
+" (ignore case) to the operator. Prefer explicitly case sensitivity when writing
" portable scripts.
echo 'a' < 'B' | " True or false depending on 'ignorecase'
@@ -315,7 +315,7 @@ let s:isNumber = {x -> type(x) == type(0)} | " Local: any name allowed
" Assign values of list to multiple variables (number of items must match)
let [x, y] = [1, 2]
-" Assign the remainer to a rest variable (note the semicolon)
+" Assign the remainder to a rest variable (note the semicolon)
let [mother, father; children] = ['Alice', 'Bob', 'Carol', 'Dennis', 'Emily']
@@ -610,7 +610,7 @@ echo exists(':Make') | " Command
echo exists("#CursorHold") | " Auto-command defined for event
echo exists("#BufReadPre#*.gz") | " Event and pattern
echo exists("#filetypeindent") | " Auto-command group
-echo exists("##ColorScheme") | " Auto-commnand supported for event
+echo exists("##ColorScheme") | " Auto-command supported for event
" Various dynamic values (see |expand()|)
echo expand('%') | " Current file name
diff --git a/vyper.html.markdown b/vyper.html.markdown
index fec1a79f..bad0c31e 100644
--- a/vyper.html.markdown
+++ b/vyper.html.markdown
@@ -181,7 +181,7 @@ def _changeTaskStatus( \
_status: uint256, \
):
# backslashes (\) allow for multi-line code
- # Natspec comments are particularly helpful for documentation and readibility
+ # Natspec comments are particularly helpful for documentation and readability
# Natspec can be included using familiar Pythonic docstring syntax
"""
@notice
@@ -429,16 +429,16 @@ struct Struct:
owner: address
_balance: uint256 # balance is a reserved keyword, is a member for addresses
-exampleStuct: Struct
+exampleStruct: Struct
@public
def foo() -> uint256:
- self.exampleStuct = Struct({owner: msg.sender, _balance: 5})
- self.exampleStuct._balance = 10
- self.exampleStuct._balance = 5 # set to new value
- clear(self.exampleStuct._balance)
- clear(self.exampleStuct)
- return self.exampleStuct._balance
+ self.exampleStruct = Struct({owner: msg.sender, _balance: 5})
+ self.exampleStruct._balance = 10
+ self.exampleStruct._balance = 5 # set to new value
+ clear(self.exampleStruct._balance)
+ clear(self.exampleStruct)
+ return self.exampleStruct._balance
# Data locations: Memory vs. storage vs. calldata - all complex types (arrays,
@@ -510,7 +510,7 @@ def increment(x: uint256, y: uint256) -> (uint256, uint256):
y += 1
return (x, y)
-# Call previous functon
+# Call previous function
@public
@constant
def willCall() -> (uint256, uint256):
@@ -679,7 +679,7 @@ sha3(concat("ab", "cd")) # returns bytes32
# Step 1. Commit
# Place a commitment by sending output of `sha3()`
-sha3("a secret"); # btyes32 commit
+sha3("a secret"); # bytes32 commit
sha3(concat("secret", "other secret", "salt")); # commit multiple things
# The `sha3()` calculation should occur off-chain, only the bytes32
# output should be inputted into some `commit()` function
diff --git a/yaml.html.markdown b/yaml.html.markdown
index 5c898148..ce64906f 100644
--- a/yaml.html.markdown
+++ b/yaml.html.markdown
@@ -38,6 +38,7 @@ octal_notation: 0123 # evaluates to 83
# If you want it to be interpreted as a boolean, use true.
boolean: true
null_value: null
+another_null_value: ~
key with spaces: value
# Yes and No (doesn't matter the case) will be evaluated to boolean
@@ -203,7 +204,7 @@ python_complex_number: !!python/complex 1+2j
# Strings and numbers aren't the only scalars that YAML can understand.
# ISO-formatted date and datetime literals are also parsed.
datetime_canonical: 2001-12-15T02:59:43.1Z
-datetime_space_seperated_with_time_zone: 2001-12-14 21:59:43.10 -5
+datetime_space_separated_with_time_zone: 2001-12-14 21:59:43.10 -5
date_implicit: 2002-12-14
date_explicit: !!timestamp 2002-12-14
diff --git a/zh-cn/clojure-cn.html.markdown b/zh-cn/clojure-cn.html.markdown
index fa241384..e98eac2a 100644
--- a/zh-cn/clojure-cn.html.markdown
+++ b/zh-cn/clojure-cn.html.markdown
@@ -362,7 +362,7 @@ Clojuredocs.org有大多数核心函数的文档,还带了示例哦:
[http://clojuredocs.org/quickref/Clojure%20Core](http://clojuredocs.org/quickref/Clojure%20Core)
4Clojure是个很赞的用来练习clojure/FP技能的地方:
-[http://www.4clojure.com/](http://www.4clojure.com/)
+[https://4clojure.oxal.org/](https://4clojure.oxal.org/)
Clojure-doc.org (你没看错)有很多入门级的文章:
[http://clojure-doc.org/](http://clojure-doc.org/)
diff --git a/zh-cn/clojure-macro-cn.html.markdown b/zh-cn/clojure-macro-cn.html.markdown
index 23b2f203..85b966e9 100644
--- a/zh-cn/clojure-macro-cn.html.markdown
+++ b/zh-cn/clojure-macro-cn.html.markdown
@@ -131,7 +131,7 @@ lang: zh-cn
; 然而,如果我们希望它在编译期执行,就需要创建宏
(defmacro inline-2 [form]
- (inline-2-helper form)))
+ (inline-2-helper form))
(macroexpand '(inline-2 (1 + (3 / 2) - (1 / 2) + 1)))
; -> (+ (- (+ 1 (/ 3 2)) (/ 1 2)) 1)
diff --git a/zh-cn/go-cn.html.markdown b/zh-cn/go-cn.html.markdown
index dd52d187..0123c0a6 100644
--- a/zh-cn/go-cn.html.markdown
+++ b/zh-cn/go-cn.html.markdown
@@ -22,7 +22,7 @@ Go语言有非常棒的标准库,还有一个充满热情的社区。
注释 */
// 导入包的子句在每个源文件的开头。
-// Main比较特殊,它用来声明可执行文件,而不是一个库。
+// main比较特殊,它用来声明可执行文件,而不是一个库。
package main
// Import语句声明了当前文件引用的包。
diff --git a/zh-cn/lua-cn.html.markdown b/zh-cn/lua-cn.html.markdown
index 6736dc2a..6fd10a32 100644
--- a/zh-cn/lua-cn.html.markdown
+++ b/zh-cn/lua-cn.html.markdown
@@ -391,7 +391,8 @@ dofile('mod2') --> Hi! (再次运行,与require不同)
f = loadfile('mod2') -- Calling f() runs mod2.lua.
-- loadstring是loadfile的字符串版本。
-g = loadstring('print(343)') --返回一个函数。
+-- (loadstring已弃用, 使用load代替)
+g = load('print(343)') --返回一个函数。
g() -- 打印343; 在此之前什么也不打印。
--]]
diff --git a/zig.html.markdown b/zig.html.markdown
index 0efe5f64..f8c866e5 100644
--- a/zig.html.markdown
+++ b/zig.html.markdown
@@ -39,7 +39,7 @@ Prior knowledge of C is recommended.
## Zig language
-```zig
+```
//! Top-level documentation.
/// Documentation comment.
@@ -49,7 +49,7 @@ Prior knowledge of C is recommended.
### Hello world.
-```zig
+```
// Import standard library, reachable through the "std" constant.
const std = @import("std");
@@ -67,9 +67,9 @@ pub fn main() void {
```
### Booleans, integers and float.
-```zig
+```
// Booleans.
-// Keywords are prefered to operators for boolean operations.
+// Keywords are preferred to operators for boolean operations.
print("{}\n{}\n{}\n", .{
true and false,
true or false,
@@ -109,7 +109,7 @@ i <<| 8 == 255 // u8: won't go higher than 255
```
### Arrays.
-```zig
+```
// An array is a well-defined structure with a length attribute (len).
// 5-byte array with undefined content (stack garbage).
@@ -138,7 +138,7 @@ var some_integers: [10]i32 = undefined;
some_integers[0] = 30; // first element of the array is now 30
-var x = some_integers[0]; // "x" now equals to 30, its type is infered.
+var x = some_integers[0]; // "x" now equals to 30, its type is inferred.
var y = some_integers[1]; // Second element of the array isn't defined.
// "y" got a stack garbage value (no runtime error).
@@ -156,7 +156,7 @@ try some_integers[i]; // Runtime error 'index out of bounds'.
```
### Multidimensional arrays.
-```zig
+```
const mat4x4 = [4][4]f32{
[_]f32{ 1.0, 0.0, 0.0, 0.0 },
@@ -177,7 +177,7 @@ for (mat4x4) |row, row_index| {
```
### Strings.
-```zig
+```
// Simple string constant.
const greetings = "hello";
@@ -195,7 +195,7 @@ print("string: {s}\n", .{greetings});
```
### Slices.
-```zig
+```
// A slice is a pointer and a size, an array without compile-time known size.
// Slices have runtime out-of-band verifications.
@@ -206,7 +206,7 @@ const slice = array[0..array.len]; // "slice" represents the whole array.
```
### Pointers.
-```zig
+```
// Pointer on a value can be created with "&".
const x: i32 = 1;
@@ -223,7 +223,7 @@ const foo = pointer.?; // Get the pointed value, otherwise crash.
```
### Optional values (?).
-```zig
+```
// An optional is a value than can be of any type or null.
// Example: "optional_value" can either be "null" or an unsigned 32-bit integer.
@@ -239,7 +239,7 @@ if (x) |value| {
```
### Errors.
-```zig
+```
// Zig provides an unified way to express errors.
// Errors are defined in error enumerations, example:
@@ -299,7 +299,7 @@ var value = try some_function();
### Control flow.
-```zig
+```
// Conditional branching.
if (condition) {
@@ -384,7 +384,7 @@ const result = for (items) |value| {
```
### Labels.
-```zig
+```
// Labels are a way to name an instruction, a location in the code.
// Labels can be used to "continue" or "break" in a nested loop.
@@ -434,7 +434,7 @@ const result = for (items) |value| { // First: loop.
```
### Switch.
-```zig
+```
// As a switch in C, but slightly more advanced.
// Syntax:
@@ -461,7 +461,7 @@ const bar = switch (foo) {
```
### Structures.
-```zig
+```
// Structure containing a single value.
const Full = struct {
@@ -564,7 +564,7 @@ print("p.y: {}\n", .{p.y}); // 30
```
### Tuples.
-```zig
+```
// A tuple is a list of elements, possibly of different types.
const foo = .{ "hello", true, 42 };
@@ -572,7 +572,7 @@ const foo = .{ "hello", true, 42 };
```
### Enumerations.
-```zig
+```
const Type = enum { ok, not_ok };
@@ -606,7 +606,7 @@ const x = switch (direction) {
```
### Unions.
-```zig
+```
const Bar = union {
boolean: bool,
@@ -622,7 +622,7 @@ const foo: Bar = .{ .int = 42 };
```
### Tagged unions.
-```zig
+```
// Unions can be declared with an enum tag type, allowing them to be used in
// switch expressions.
@@ -653,7 +653,7 @@ switch (nay) {
```
### Defer and errdefer.
-```zig
+```
// Make sure that an action (single instruction or block of code) is executed
// before the end of the scope (function, block of code).
@@ -707,12 +707,12 @@ However, here are some examples, to get an idea of what you can expect:
Use a fixed buffer to get its memory, don't ask memory to the kernel.
Very simple, limited and wasteful (can't deallocate), but very fast.
- ArenaAllocator.
- Allow to free all allocted memory at once.
- To use in combinaison with another allocator.
+ Allow to free all allocated memory at once.
+ To use in combinations with another allocator.
Very simple way of avoiding leaks.
A first example.
-```zig
+```
// "!void" means the function doesn't return any value except for errors.
// In this case we try to allocate memory, and this may fail.
fn foo() !void {
@@ -735,7 +735,7 @@ fn foo() !void {
```
### Memory allocation combined with error management and defer.
-```zig
+```
fn some_memory_allocation_example() !void {
// Memory allocation may fail, so we "try" to allocate the memory and
@@ -759,7 +759,7 @@ fn some_memory_allocation_example() !void {
```
### Memory allocators: a taste of the standard library.
-```zig
+```
// Allocators: 4 main functions to know
// single_value = create (type)
@@ -825,7 +825,7 @@ fn arena_allocator_fn() !void {
// Combining the general purpose and arena allocators. Both are very useful,
-// and their combinaison should be in everyone's favorite cookbook.
+// and their combinations should be in everyone's favorite cookbook.
fn gpa_arena_allocator_fn() !void {
const config = .{.safety = true};
var gpa = std.heap.GeneralPurposeAllocator(config){};
@@ -846,7 +846,7 @@ fn gpa_arena_allocator_fn() !void {
```
### Comptime.
-```zig
+```
// Comptime is a way to avoid the pre-processor.
// The idea is simple: run code at compilation.
@@ -883,7 +883,7 @@ list.items[0] = 10;
```
### Conditional compilation.
-```zig
+```
const available_os = enum { OpenBSD, Linux };
const myos = available_os.OpenBSD;
@@ -905,7 +905,7 @@ const myprint = switch(myos) {
```
### Testing our functions.
-```zig
+```
const std = @import("std");
const expect = std.testing.expect;
@@ -925,7 +925,7 @@ test "returns true" {
The compiler has special functions called "built-ins", starting with an "@".
There are more than a hundred built-ins, allowing very low-level stuff:
- compile-time errors, logging, verifications
-- type coercion and convertion, even in an unsafe way
+- type coercion and conversion, even in an unsafe way
- alignment management
- memory tricks (such as getting the byte offset of a field in a struct)
- calling functions at compile-time
@@ -936,7 +936,7 @@ There are more than a hundred built-ins, allowing very low-level stuff:
- etc.
Example: enums aren't integers, they have to be converted with a built-in.
-```zig
+```
const Value = enum { zero, stuff, blah };
if (@enumToInt(Value.zero) == 0) { ... }
if (@enumToInt(Value.stuff) == 1) { ... }
@@ -956,7 +956,7 @@ if (@enumToInt(Value.blah) == 2) { ... }
Unions cannot be reinterpreted (in an union with an integer and a float, one cannot take a value for another by accident).
Etc.
- Removing most of the C undefined behaviors (UBs), and when the compiler encounters one, it stops.
-- Slice and Array structures are prefered to pointers.
+- Slice and Array structures are preferred to pointers.
Types enforced by the compiler are less prone to errors than pointer manipulations.
- Numerical overflows produce an error, unless explicitly accepted using wrapping operators.
- Try and catch mechanism.
@@ -964,7 +964,7 @@ if (@enumToInt(Value.blah) == 2) { ... }
- Unused variables are considered as errors by the compiler.
- Many pointer types exist in order to represent what is pointed.
Example: is this a single value or an array, is the length known, etc.
-- Structures need a value for their attributes, and it still is possible to give an undefined value (stack garbage), but at least it is explicitely undefined.
+- Structures need a value for their attributes, and it still is possible to give an undefined value (stack garbage), but at least it is explicitly undefined.
## Further Reading