From 1371efe157ac337e68091a7e5dc8652ac29497eb Mon Sep 17 00:00:00 2001 From: John Gabriele Date: Sun, 29 Sep 2019 22:42:01 -0400 Subject: [PATCH 001/111] general-purpose, not specifically web-oriented Although Haxe has a great JS target, it has many other targets as well, and is a general-purpose language, and not strictly web-oriented. --- haxe.html.markdown | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/haxe.html.markdown b/haxe.html.markdown index a31728e1..235a9b74 100644 --- a/haxe.html.markdown +++ b/haxe.html.markdown @@ -6,8 +6,8 @@ contributors: - ["Dan Korostelev", "https://github.com/nadako/"] --- -Haxe is a web-oriented language that provides platform support for C++, C#, -Swf/ActionScript, Javascript, Java, PHP, Python, Lua, HashLink, and Neko byte code +[Haxe](https://haxe.org/) is a general-purpose language that provides platform support for C++, C#, +Swf/ActionScript, JavaScript, Java, PHP, Python, Lua, HashLink, and Neko bytecode (the latter two being also written by the Haxe author). Note that this guide is for Haxe version 3. Some of the guide may be applicable to older versions, but it is recommended to use other references. @@ -668,7 +668,7 @@ class TypedefsAndStructuralTypes { That would give us a single "Surface" type to work with across all of those platforms. - */ + */ } } @@ -700,8 +700,7 @@ class UsingExample { instance, and the compiler still generates code equivalent to a static method. */ - } - + } } ``` From 5129c2acd17f8f548d2f5b9c514387e60f7d8c1e Mon Sep 17 00:00:00 2001 From: John Gabriele Date: Sun, 29 Sep 2019 22:57:33 -0400 Subject: [PATCH 002/111] Space between `switch` and `(` --- haxe.html.markdown | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/haxe.html.markdown b/haxe.html.markdown index 235a9b74..6a50b88b 100644 --- a/haxe.html.markdown +++ b/haxe.html.markdown @@ -338,7 +338,7 @@ class LearnHaxe3 { */ var my_dog_name = "fido"; var favorite_thing = ""; - switch(my_dog_name) { + switch (my_dog_name) { case "fido" : favorite_thing = "bone"; case "rex" : favorite_thing = "shoe"; case "spot" : favorite_thing = "tennis ball"; @@ -366,7 +366,7 @@ class LearnHaxe3 { trace("k equals ", k); // outputs 10 - var other_favorite_thing = switch(my_dog_name) { + var other_favorite_thing = switch (my_dog_name) { case "fido" : "teddy"; case "rex" : "stick"; case "spot" : "football"; @@ -559,7 +559,7 @@ class SimpleEnumTest { // You can specify the "full" name, var e_explicit:SimpleEnum = SimpleEnum.Foo; var e = Foo; // but inference will work as well. - switch(e) { + switch (e) { case Foo: trace("e was Foo"); case Bar: trace("e was Bar"); case Baz: trace("e was Baz"); // comment this line to throw an error. @@ -572,7 +572,7 @@ class SimpleEnumTest { You can also specify a default for enum switches as well: */ - switch(e) { + switch (e) { case Foo: trace("e was Foo again"); default : trace("default works here too"); } @@ -595,21 +595,21 @@ class ComplexEnumTest { var e1:ComplexEnum = IntEnum(4); // specifying the enum parameter // Now we can switch on the enum, as well as extract any parameters // it might have had. - switch(e1) { + switch (e1) { case IntEnum(x) : trace('$x was the parameter passed to e1'); default: trace("Shouldn't be printed"); } // another parameter here that is itself an enum... an enum enum? var e2 = SimpleEnumEnum(Foo); - switch(e2){ + switch (e2){ case SimpleEnumEnum(s): trace('$s was the parameter passed to e2'); default: trace("Shouldn't be printed"); } // enums all the way down var e3 = ComplexEnumEnum(ComplexEnumEnum(MultiEnum(4, 'hi', 4.3))); - switch(e3) { + switch (e3) { // You can look for certain nested enums by specifying them // explicitly: case ComplexEnumEnum(ComplexEnumEnum(MultiEnum(i,j,k))) : { From a8d9e066eae5f48b27c93df3d0bbb53cd232a63a Mon Sep 17 00:00:00 2001 From: John Gabriele Date: Sun, 29 Sep 2019 23:21:42 -0400 Subject: [PATCH 003/111] decrements too --- haxe.html.markdown | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/haxe.html.markdown b/haxe.html.markdown index 6a50b88b..05fa59bf 100644 --- a/haxe.html.markdown +++ b/haxe.html.markdown @@ -234,10 +234,9 @@ class LearnHaxe3 { ^ Bitwise exclusive OR | Bitwise inclusive OR */ - - // increments + var i = 0; - trace("Increments and decrements"); + trace("Pre-/Post- Increments and Decrements"); trace(i++); // i = 1. Post-Increment trace(++i); // i = 2. Pre-Increment trace(i--); // i = 1. Post-Decrement From a22ba3395320bbd266aad71e73e8059fc84f45a7 Mon Sep 17 00:00:00 2001 From: John Gabriele Date: Sun, 29 Sep 2019 23:29:13 -0400 Subject: [PATCH 004/111] whitespace --- haxe.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/haxe.html.markdown b/haxe.html.markdown index 05fa59bf..e086dd7a 100644 --- a/haxe.html.markdown +++ b/haxe.html.markdown @@ -189,7 +189,7 @@ class LearnHaxe3 { trace(m.get('bar') + " is the value for m.get('bar')"); trace(m['bar'] + " is the value for m['bar']"); - var m2 = ['foo' => 4, 'baz' => 6]; // Alternative map syntax + var m2 = ['foo' => 4, 'baz' => 6]; // Alternative map syntax trace(m2 + " is the value for m2"); // Remember, you can use type inference. The Haxe compiler will @@ -286,7 +286,7 @@ class LearnHaxe3 { } // do-while loop - var l = 0; + var l = 0; do { trace("do statement always runs at least once"); } while (l > 0); From 19a377def003d9992f631ff0727add5263eee824 Mon Sep 17 00:00:00 2001 From: Chris Zimmerman Date: Mon, 30 Sep 2019 17:55:50 -0400 Subject: [PATCH 005/111] Adds documentation for some basic ES6 features. --- javascript.html.markdown | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/javascript.html.markdown b/javascript.html.markdown index c466c09b..ce9772ca 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -586,6 +586,48 @@ if (Object.create === undefined){ // don't overwrite it if it exists return new Constructor(); }; } + +// ES6 Additions + +// The "let" keyword allows you to define variables in a lexical scope, +// as opposed to a block scope like the var keyword does. +let name = "Billy"; + +// Variables defined with let can be reassigned new values. +name = "William"; + +// The "const" keyword allows you to define a variable in a lexical scope +// like with let, but you cannot reassign the value once one has been assigned. + +const pi = 3.14; + +pi = 4.13; // You cannot do this. + +// There is a new syntax for functions in ES6 known as "lambda syntax". +// This allows functions to be defined in a lexical scope like with variables +// defined by const and let. + +const isEven = (number) => { + return number % 2 === 0; +}; + +isEven(7); // false + +// The "equivalent" of this function in the traditional syntax would look like this: + +function isEven(number) { + return number % 2 === 0; +}; + +// I put the word "equivalent" in double quotes because a function defined +// using the lambda syntax cannnot be called before the definition. +// The following is an example of invalid usage: + +add(1, 8); + +const add = (firstNumber, secondNumber) => { + return firstNumber + secondNumber; +}; ``` ## Further Reading From 3ade005c37a40c8e1712f6c68c81ebc9682a36c1 Mon Sep 17 00:00:00 2001 From: Chris Zimmerman Date: Mon, 30 Sep 2019 18:11:43 -0400 Subject: [PATCH 006/111] Fixes the spacing of comments in the English C# documentation --- csharp.html.markdown | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/csharp.html.markdown b/csharp.html.markdown index df6544d3..0cf59762 100644 --- a/csharp.html.markdown +++ b/csharp.html.markdown @@ -18,16 +18,18 @@ C# is an elegant and type-safe object-oriented language that enables developers ```c# // Single-line comments start with // + /* Multi-line comments look like this */ + /// /// This is an XML documentation comment which can be used to generate external /// documentation or provide context help within an IDE /// /// This is some parameter documentation for firstParam /// Information on the returned value of a function -//public void MethodOrClassOrOtherWithParsableHelp(string firstParam) {} +public void MethodOrClassOrOtherWithParsableHelp(string firstParam) {} // Specify the namespaces this source code will be using // The namespaces below are all part of the standard .NET Framework Class Library @@ -254,7 +256,7 @@ on a new line! ""Wow!"", the masses cried"; int fooWhile = 0; while (fooWhile < 100) { - //Iterated 100 times, fooWhile 0->99 + // Iterated 100 times, fooWhile 0->99 fooWhile++; } @@ -273,10 +275,10 @@ on a new line! ""Wow!"", the masses cried"; } while (fooDoWhile < 100); - //for loop structure => for(; ; ) + // for loop structure => for(; ; ) for (int fooFor = 0; fooFor < 10; fooFor++) { - //Iterated 10 times, fooFor 0->9 + // Iterated 10 times, fooFor 0->9 } // For Each Loop @@ -287,7 +289,7 @@ on a new line! ""Wow!"", the masses cried"; // (The ToCharArray() could be removed, because a string also implements IEnumerable) foreach (char character in "Hello World".ToCharArray()) { - //Iterated over all the characters in the string + // Iterated over all the characters in the string } // Switch Case @@ -329,7 +331,7 @@ on a new line! ""Wow!"", the masses cried"; // Convert String To Integer // this will throw a FormatException on failure - int.Parse("123");//returns an integer version of "123" + int.Parse("123"); // returns an integer version of "123" // try parse will default to type default on failure // in this case: 0 @@ -373,7 +375,7 @@ on a new line! ""Wow!"", the masses cried"; Console.Read(); } // End main method - // CONSOLE ENTRY A console application must have a main method as an entry point + // CONSOLE ENTRY - A console application must have a main method as an entry point public static void Main(string[] args) { OtherInterestingFeatures(); @@ -404,7 +406,7 @@ on a new line! ""Wow!"", the masses cried"; ref int maxCount, // Pass by reference out int count) { - //the argument passed in as 'count' will hold the value of 15 outside of this function + // the argument passed in as 'count' will hold the value of 15 outside of this function count = 15; // out param must be assigned before control leaves the method } @@ -564,11 +566,11 @@ on a new line! ""Wow!"", the masses cried"; } ); - //Running this will produce different outputs - //since each thread finishes at different times. - //Some example outputs are: - //cat dog horse pony - //dog horse pony cat + // Running this will produce different outputs + // since each thread finishes at different times. + // Some example outputs are: + // cat dog horse pony + // dog horse pony cat // DYNAMIC OBJECTS (great for working with other languages) dynamic student = new ExpandoObject(); @@ -865,7 +867,7 @@ on a new line! ""Wow!"", the masses cried"; } } - //Method to display the attribute values of this Object. + // Method to display the attribute values of this Object. public virtual string Info() { return "Gear: " + Gear + @@ -1069,7 +1071,7 @@ on a new line! ""Wow!"", the masses cried"; { private static bool LogException(Exception ex) { - /* log exception somewhere */ + // log exception somewhere return false; } @@ -1117,12 +1119,12 @@ on a new line! ""Wow!"", the masses cried"; [Obsolete("Use NewMethod instead", false)] public static void ObsoleteMethod() { - /* obsolete code */ + // obsolete code } public static void NewMethod() { - /* new code */ + // new code } public static void Main() @@ -1154,9 +1156,9 @@ namespace Learning.More.CSharp } } -//New C# 7 Feature -//Install Microsoft.Net.Compilers Latest from Nuget -//Install System.ValueTuple Latest from Nuget +// New C# 7 Feature +// Install Microsoft.Net.Compilers Latest from Nuget +// Install System.ValueTuple Latest from Nuget using System; namespace Csharp7 { From 3e1fe4dc0077817c8946fc8644c29d2ba585b0e1 Mon Sep 17 00:00:00 2001 From: Victor Bastos Date: Tue, 1 Oct 2019 11:55:55 -0300 Subject: [PATCH 007/111] [php/pt-br] Small typo --- pt-br/php-pt.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt-br/php-pt.html.markdown b/pt-br/php-pt.html.markdown index 8a1c956e..e55f1100 100644 --- a/pt-br/php-pt.html.markdown +++ b/pt-br/php-pt.html.markdown @@ -20,7 +20,7 @@ Este documento descreve PHP 5+. // Duas barras iniciam o comentário de uma linha. -# O hash (aka pound symbol) também inicia, mas // é mais comum. +# O hash (conhecido como "pound symbol") também inicia, mas // é mais comum. /* O texto envolto por barra-asterisco e asterisco-barra From 4df895568d5600f20636e88b58cdfd74e7df4410 Mon Sep 17 00:00:00 2001 From: Victor Bastos Date: Tue, 1 Oct 2019 11:58:32 -0300 Subject: [PATCH 008/111] [cypher/pt-br] Small typo --- pt-br/cypher-pt.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt-br/cypher-pt.html.markdown b/pt-br/cypher-pt.html.markdown index 9b60f771..d4400148 100644 --- a/pt-br/cypher-pt.html.markdown +++ b/pt-br/cypher-pt.html.markdown @@ -101,7 +101,7 @@ path = shortestPath( (user)-[:KNOWS*..5]-(other) ) Crie consultas --- -Create a new node +Crie um novo nó ``` CREATE (a:Person {name:"Théo Gauchoux"}) RETURN a From 09e6e2d6c4839c25564dc9fce42555bf7658ff14 Mon Sep 17 00:00:00 2001 From: Victor Bastos Date: Tue, 1 Oct 2019 12:04:06 -0300 Subject: [PATCH 009/111] [groovy/pt-br] Small typo --- pt-br/groovy-pt.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt-br/groovy-pt.html.markdown b/pt-br/groovy-pt.html.markdown index aed23df1..f3a7699e 100644 --- a/pt-br/groovy-pt.html.markdown +++ b/pt-br/groovy-pt.html.markdown @@ -17,7 +17,7 @@ Groovy - Uma linguagem dinâmica para a plataforma Java. [Leia mais aqui.](http: Prepara-se: 1) Instale a máquina virtual de Groovy - http://gvmtool.net/ - 2) Intalse o Groovy: gvm install groovy + 2) Intale o Groovy: gvm install groovy 3) Inicie o console groovy digitando: groovyConsole */ From ffd1fed725668b48ec8c11cbe419bd1e8d136ae3 Mon Sep 17 00:00:00 2001 From: Fer Date: Tue, 1 Oct 2019 12:06:10 -0300 Subject: [PATCH 010/111] Update markdown-pt.html.markdown Translation adjustments --- pt-br/markdown-pt.html.markdown | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/pt-br/markdown-pt.html.markdown b/pt-br/markdown-pt.html.markdown index f22093f9..53049c13 100644 --- a/pt-br/markdown-pt.html.markdown +++ b/pt-br/markdown-pt.html.markdown @@ -11,17 +11,17 @@ filename: learnmarkdown-pt.md Markdown foi criado por John Gruber in 2004. Originado para ser fácil de ler e escrever sintaxe que converte facilmente em HTML (hoje, suporta outros formatos também). -Dê-me feedback tanto quanto você quiser! / Sinta-se livre para a garfar (fork) e +Dê-me feedback tanto quanto você quiser! / Sinta-se livre para fazer uma bifurcação (fork) e puxar o projeto (pull request) ```markdown +de marcação. No entanto, se você criar um elemento HTML em seu arquivo Markdown, você +não pode usar sintaxe de marcação dentro desse conteúdo do elemento.--> - @@ -77,19 +77,20 @@ Termino com dois espaços (destacar-me para vê-los). Há um
acima de mim! - - + + > Este é um bloco de citação. Você pode -> Enrolar manualmente suas linhas e colocar um `>` antes de cada linha ou você pode -> deixar suas linhas ficarem muito longas e enrolar por conta própria. Não faz diferença, +> Quebrar manualmente suas linhas e colocar um `>` antes de cada linha ou você pode +> deixar suas linhas ficarem muito longas e quebrarem por conta própria. Não faz diferença, > desde que eles começam com um `>`. + > Você também pode usar mais de um nível >> De recuo? > Como pura é isso? - + * Item * Item @@ -113,8 +114,8 @@ ou 2. Item dois 3. Tem três - + 1. Item um 1. Item dois @@ -137,14 +138,14 @@ uma linha com quatro espaços ou uma guia --> Isto é código É assim, sacou? - my_array.each do |item| puts item end - + John não sabia nem o que o função 'goto()' fazia! @@ -155,13 +156,13 @@ ruby! --> def foobar puts "Hello world!" end -\`\`\` +\`\`\` <-- O texto acima não requer recuo, mas o GitHub vai usar a sintaxe destacando do idioma que você especificar após a ``` --> - *** @@ -175,7 +176,7 @@ o texto a ser exibido entre parênteses rígidos [] seguido pela url em parênte [Click aqui!](http://test.com/) - + [Click aqui!](http://test.com/ "Link para Test.com") From 1e17f8e3c7c3e7c3bf287af242dc4311f5cda615 Mon Sep 17 00:00:00 2001 From: Antonio Roberto Furlaneto Date: Tue, 1 Oct 2019 12:07:14 -0300 Subject: [PATCH 011/111] [csharp/pt-br] Missing translation --- pt-br/csharp-pt.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pt-br/csharp-pt.html.markdown b/pt-br/csharp-pt.html.markdown index 2ff59296..3bdbcdb1 100644 --- a/pt-br/csharp-pt.html.markdown +++ b/pt-br/csharp-pt.html.markdown @@ -85,8 +85,8 @@ namespace Learning.CSharp // Long - 64-bit integer long fooLong = 100000L; // (-9,223,372,036,854,775,808 <= long <= 9,223,372,036,854,775,807) ulong fooUlong = 100000L; // (0 <= ulong <= 18,446,744,073,709,551,615) - // Numbers default to being int or uint depending on size. - // L is used to denote that this variable value is of type long or ulong + // Números por padrão são int ou uint dependendo do tamanho. + // L é usado para denotar que o valor da variável é do tipo long ou ulong. // Double - Double-precision 64-bit IEEE 754 Floating Point double fooDouble = 123.4; // Precision: 15-16 digits From 1ccbe647ede9c36aa1d789811826e43341b7911f Mon Sep 17 00:00:00 2001 From: Victor Bastos Date: Tue, 1 Oct 2019 12:10:38 -0300 Subject: [PATCH 012/111] [typescript/pt-br] Small typo --- pt-br/typescript-pt.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pt-br/typescript-pt.html.markdown b/pt-br/typescript-pt.html.markdown index 077aa2cc..e8ed6a7f 100644 --- a/pt-br/typescript-pt.html.markdown +++ b/pt-br/typescript-pt.html.markdown @@ -22,7 +22,7 @@ var isDone: boolean = false; var lines: number = 42; var name: string = "Anders"; -// Quando é impossível saber, há o "Qualquer" tipo +// Quando é impossível saber, há o tipo "Qualquer" var notSure: any = 4; notSure = "maybe a string instead"; notSure = false; // Ok, definitivamente um boolean @@ -65,7 +65,7 @@ interface Person { move(): void; } -// Objeto que implementa a "Pessoa" Interface +// Objeto que implementa a Interface "Pessoa" // Pode ser tratado como uma pessoa desde que tem o nome e mover propriedades var p: Person = { name: "Bobby", move: () => {} }; // Os objetos que têm a propriedade opcional: From 0e5203510bcd6500d707e0a03f30cb9f90b93cac Mon Sep 17 00:00:00 2001 From: Fer Date: Tue, 1 Oct 2019 12:16:59 -0300 Subject: [PATCH 013/111] [css/pt-br] Translation adjustments --- pt-br/css-pt.html.markdown | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pt-br/css-pt.html.markdown b/pt-br/css-pt.html.markdown index c73669d0..1c4be746 100644 --- a/pt-br/css-pt.html.markdown +++ b/pt-br/css-pt.html.markdown @@ -14,15 +14,15 @@ translators: lang: pt-br --- -Nos primeiros dias da web não havia elementos visuais, apenas texto puro. Mas com maior desenvolvimento de navegadores da web, páginas web totalmente visuais também se tornou comum. +No início da web não havia elementos visuais, apenas texto puro. Mas com maior desenvolvimento de navegadores da web, páginas web totalmente visuais também se tornara comum. -CSS ajuda a manter a separação entre o conteúdo (HTML) e o look-and-feel de uma página web. +CSS ajuda a manter a separação entre o conteúdo (HTML) e o visual de uma página web. CSS permite atingir diferentes elementos em uma página HTML e atribuir diferentes propriedades visuais para eles. -Este guia foi escrito para CSS2, embora CSS3 está rapidamente se tornando popular. +Este guia foi escrito para CSS2, embora CSS3 esteja rapidamente se tornando popular. -**NOTA:** Porque CSS produz resultados visuais, a fim de aprender, você precisa tentar de tudo em um playground CSS como [dabblet](http://dabblet.com/). +**NOTA:** Porque CSS produz resultados visuais, a fim de aprender, você precisa treinar em um playground CSS como [dabblet](http://dabblet.com/). O foco principal deste artigo é sobre a sintaxe e algumas dicas gerais. ```css @@ -42,7 +42,7 @@ Abaixo um elemento de exemplo:
*/ -/* Você pode direciona-lo usando uma das suas classes CSS */ +/* Você pode direcioná-lo usando uma das suas classes CSS */ .class1 { } /* ou ambas as classes! */ @@ -82,9 +82,9 @@ classe div.some [attr $ = 'ue'] {} /* Você pode selecionar um elemento que é filho de outro elemento */ div.some-parent> .class-name {} -/* Ou um descendente de um outro elemento. As crianças são os descendentes diretos de -   seu elemento pai, apenas um nível abaixo da árvore. Pode ser qualquer descendentes -   nivelar por baixo da árvore. */ +/* Ou um descendente de um outro elemento. Os filhos são os descendentes diretos de +   seu elemento pai, apenas um nível abaixo da árvore. Pode ser quaisquer descendentes +   nivelados por baixo da árvore. */ div.some-parent class-name {} /* Atenção: o mesmo seletor sem espaço tem um outro significado. @@ -118,7 +118,7 @@ seletor:first-child {} /* Qualquer elemento que é o último filho de seu pai */ seletor:last-child {} -/* Assim como pseudo classes, pseudo elementos permitem que você estilo certas partes de um documento */ +/* Assim como pseudo classes, pseudo elementos permitem que você estilize certas partes de um documento */ /* Corresponde a um primeiro filho virtual do elemento selecionado */ seletor::before {} @@ -127,7 +127,7 @@ seletor::before {} seletor::after {} /* Nos locais apropriados, um asterisco pode ser utilizado como um curinga para selecionar todos -   elemento */ +   os elementos */ * {} /* */ Todos os elementos .parent * {} /* */ todos os descendentes .parent> * {} /* */ todas as crianças @@ -181,7 +181,7 @@ seletor { ## Uso -Guardar uma folha de estilo CSS com a extensão `.css`. +Salvar uma folha de estilo CSS com a extensão `.css`. ```xml 1 list(filled_dict.keys()) TypeError: 'list' object is not callable ``` solution: use another variable name instead of list --- python3.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python3.html.markdown b/python3.html.markdown index 430927a9..8ef53ad1 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -466,8 +466,8 @@ prints: 1 cat 2 mouse """ -list = ["dog", "cat", "mouse"] -for i, value in enumerate(list): +animals = ["dog", "cat", "mouse"] +for i, value in enumerate(animals): print(i, value) """ From bcefaaf7b7048f07bb27a4aa920a43e242141c3d Mon Sep 17 00:00:00 2001 From: Tommaso Date: Sat, 5 Oct 2019 21:19:37 +0200 Subject: [PATCH 040/111] Add explanation of `=~` and `alias` inside bash/it-it --- it-it/bash-it.html.markdown | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/it-it/bash-it.html.markdown b/it-it/bash-it.html.markdown index efc47969..099cc681 100644 --- a/it-it/bash-it.html.markdown +++ b/it-it/bash-it.html.markdown @@ -140,6 +140,25 @@ then echo "Questo verrà eseguito se $Nome è Daniya O Zach." fi +# C'è anche l'operatore `=~`, che serve per confrontare una stringa con un'espressione regolare: +Email=me@example.com +if [[ "$Email" =~ [a-z]+@[a-z]{2,}\.(com|net|org) ]] +then + echo "Email valida!" +fi +# L'operatore =~ funziona solo dentro alle doppie parentesi quadre [[ ]], +# che hanno un comportamento leggermente diverso rispetto alle singole [ ]. +# Se vuoi approfondire, visita questo link (in inglese): +# http://www.gnu.org/software/bash/manual/bashref.html#Conditional-Constructs + +# Usando `alias`, puoi definire nuovi comandi o modificare quelli già esistenti. +# Ad esempio, così puoi ridefinire il comando ping per inviare solo 5 pacchetti +alias ping='ping -c 5' +# "Scavalca" l'alias e usa il comando vero, utilizzando il backslash +\ping 192.168.1.1 +# Stampa la lista di tutti gli alias +alias -p + # Le espressioni sono nel seguente formato: echo $(( 10 + 5 )) From b7a5d8f8e085383f198c090e35bddf8936219786 Mon Sep 17 00:00:00 2001 From: Tommaso Date: Sat, 5 Oct 2019 21:30:24 +0200 Subject: [PATCH 041/111] Add section about pipes, and fix docs here and there for elixir/it-it --- it-it/elixir-it.html.markdown | 52 ++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/it-it/elixir-it.html.markdown b/it-it/elixir-it.html.markdown index 60301b1a..48afe0c8 100644 --- a/it-it/elixir-it.html.markdown +++ b/it-it/elixir-it.html.markdown @@ -24,7 +24,7 @@ e molte altre funzionalità. # Per usare la shell di elixir usa il comando `iex`. # Compila i tuoi moduli con il comando `elixirc`. -# Entrambi i comandi dovrebbero già essere nel tuo PATH se hai installato +# Entrambi i comandi dovrebbero già essere nel tuo PATH se hai installato # elixir correttamente. ## --------------------------- @@ -65,7 +65,7 @@ coda #=> [2,3] # le tuple hanno dimensione differente. # {a, b, c} = {1, 2} #=> ** (MatchError) no match of right hand side value: {1,2} -# Ci sono anche i binari +# Ci sono anche i binari <<1,2,3>> # binari (Binary) # Stringhe e liste di caratteri @@ -80,7 +80,7 @@ multi-linea. #=> "Sono una stringa\nmulti-linea.\n" # Le stringhe sono tutte codificate in UTF-8: -"cìaò" +"cìaò" #=> "cìaò" # le stringhe in realtà sono dei binari, e le liste di caratteri sono liste. @@ -124,10 +124,11 @@ rem(10, 3) #=> 1 # Questi operatori si aspettano un booleano come primo argomento. true and true #=> true false or true #=> true -# 1 and true #=> ** (ArgumentError) argument error +# 1 and true +#=> ** (BadBooleanError) expected a boolean on left-side of "and", got: 1 # Elixir fornisce anche `||`, `&&` e `!` che accettano argomenti -# di qualsiasi tipo. +# di qualsiasi tipo. # Tutti i valori tranne `false` e `nil` saranno valutati come true. 1 || true #=> 1 false && 1 #=> false @@ -147,7 +148,7 @@ nil && 20 #=> nil 1 < :ciao #=> true # L'ordine generale è definito sotto: -# numeri < atomi < riferimenti < funzioni < porte < pid < tuple < liste +# numeri < atomi < riferimenti < funzioni < porte < pid < tuple < liste # < stringhe di bit # Per citare Joe Armstrong su questo: "L'ordine non è importante, @@ -171,7 +172,7 @@ else "Questo sì" end -# Ti ricordi il pattern matching? +# Ti ricordi il pattern matching? # Moltre strutture di controllo di flusso in elixir si basano su di esso. # `case` ci permette di confrontare un valore a diversi pattern: @@ -214,7 +215,7 @@ cond do "Questa sì! (essenzialmente funziona come un else)" end -# `try/catch` si usa per gestire i valori lanciati (throw), +# `try/catch` si usa per gestire i valori lanciati (throw), # Supporta anche una clausola `after` che è invocata in ogni caso. try do throw(:ciao) @@ -235,7 +236,7 @@ quadrato = fn(x) -> x * x end quadrato.(5) #=> 25 # Accettano anche guardie e condizioni multiple. -# le guardie ti permettono di perfezionare il tuo pattern matching, +# le guardie ti permettono di perfezionare il tuo pattern matching, # sono indicate dalla parola chiave `when`: f = fn x, y when x > 0 -> x + y @@ -265,13 +266,13 @@ end Matematica.somma(1, 2) #=> 3 Matematica.quadrato(3) #=> 9 -# Per compilare il modulo 'Matematica' salvalo come `matematica.ex` e usa +# Per compilare il modulo 'Matematica' salvalo come `matematica.ex` e usa # `elixirc`. # nel tuo terminale: elixirc matematica.ex # All'interno di un modulo possiamo definire le funzioni con `def` e funzioni # private con `defp`. -# Una funzione definita con `def` è disponibile per essere invocata anche da +# Una funzione definita con `def` è disponibile per essere invocata anche da # altri moduli, una funziona privata può essere invocata solo localmente. defmodule MatematicaPrivata do def somma(a, b) do @@ -286,7 +287,11 @@ end MatematicaPrivata.somma(1, 2) #=> 3 # MatematicaPrivata.esegui_somma(1, 2) #=> ** (UndefinedFunctionError) -# Anche le dichiarazioni di funzione supportano guardie e condizioni multiple: +# Anche le dichiarazioni di funzione supportano guardie e condizioni multiple. +# Quando viene chiamata una funzione dichiarata con più match, solo la prima +# che matcha viene effettivamente invocata. +# Ad esempio: chiamando area({:cerchio, 3}) vedrà invocata la seconda definizione +# di area mostrata sotto, non la prima: defmodule Geometria do def area({:rettangolo, w, h}) do w * h @@ -322,16 +327,25 @@ defmodule Modulo do Questo è un attributo incorporato in un modulo di esempio. """ - @miei_dati 100 # Questo è un attributo personalizzato . + @miei_dati 100 # Questo è un attributo personalizzato. IO.inspect(@miei_dati) #=> 100 end +# L'operatore pipe |> permette di passare l'output di una espressione +# come primo parametro di una funzione. +# Questo facilita operazioni quali pipeline di operazioni, composizione di +# funzioni, ecc. +Range.new(1,10) +|> Enum.map(fn x -> x * x end) +|> Enum.filter(fn x -> rem(x, 2) == 0 end) +#=> [4, 16, 36, 64, 100] + ## --------------------------- ## -- Strutture ed Eccezioni ## --------------------------- -# Le Strutture (Structs) sono estensioni alle mappe che portano +# Le Strutture (Structs) sono estensioni alle mappe che portano # valori di default, garanzia alla compilazione e polimorfismo in Elixir. defmodule Persona do defstruct nome: nil, eta: 0, altezza: 0 @@ -367,7 +381,7 @@ end ## -- Concorrenza ## --------------------------- -# Elixir si basa sul modello degli attori per la concorrenza. +# Elixir si basa sul modello degli attori per la concorrenza. # Tutto ciò di cui abbiamo bisogno per scrivere programmi concorrenti in elixir # sono tre primitive: creare processi, inviare messaggi e ricevere messaggi. @@ -379,12 +393,12 @@ spawn(f) #=> #PID<0.40.0> # `spawn` restituisce un pid (identificatore di processo). Puoi usare questo # pid per inviare messaggi al processo. # Per passare messaggi si usa l'operatore `send`. -# Perché tutto questo sia utile dobbiamo essere capaci di ricevere messaggi, +# Perché tutto questo sia utile dobbiamo essere capaci di ricevere messaggi, # oltre ad inviarli. Questo è realizzabile con `receive`: # Il blocco `receive do` viene usato per mettersi in ascolto di messaggi # ed elaborarli quando vengono ricevuti. Un blocco `receive do` elabora -# un solo messaggio ricevuto: per fare elaborazione multipla di messaggi, +# un solo messaggio ricevuto: per fare elaborazione multipla di messaggi, # una funzione con un blocco `receive do` al suo intero dovrà chiamare # ricorsivamente sé stessa per entrare di nuovo nel blocco `receive do`. defmodule Geometria do @@ -405,7 +419,7 @@ pid = spawn(fn -> Geometria.calcolo_area() end) #=> #PID<0.40.0> # Alternativamente pid = spawn(Geometria, :calcolo_area, []) -# Invia un messaggio a `pid` che farà match su un pattern nel blocco in receive +# Invia un messaggio a `pid` che farà match su un pattern nel blocco in receive send pid, {:rettangolo, 2, 3} #=> Area = 6 # {:rettangolo,2,3} @@ -421,7 +435,7 @@ self() #=> #PID<0.27.0> ## Referenze * [Getting started guide](http://elixir-lang.org/getting_started/1.html) dalla [pagina web ufficiale di elixir](http://elixir-lang.org) -* [Documentazione Elixir](http://elixir-lang.org/docs/master/) +* [Documentazione Elixir](https://elixir-lang.org/docs.html) * ["Programming Elixir"](https://pragprog.com/book/elixir/programming-elixir) di Dave Thomas * [Elixir Cheat Sheet](http://media.pragprog.com/titles/elixir/ElixirCheat.pdf) * ["Learn You Some Erlang for Great Good!"](http://learnyousomeerlang.com/) di Fred Hebert From da2caced2209b7e60699790715ff84585864e37f Mon Sep 17 00:00:00 2001 From: Heitor Pascoal de Bittencourt Date: Tue, 8 Oct 2019 21:22:47 -0300 Subject: [PATCH 042/111] [c/en] Fix link for Learn C the Hard Way book --- c.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c.html.markdown b/c.html.markdown index 7975a1c2..e5ffc379 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -10,6 +10,7 @@ contributors: - ["himanshu", "https://github.com/himanshu81494"] - ["Joshua Li", "https://github.com/JoshuaRLi"] - ["Dragos B. Chirila", "https://github.com/dchirila"] + - ["Heitor P. de Bittencourt", "https://github.com/heitorPB/"] --- Ah, C. Still **the** language of modern high-performance computing. @@ -820,7 +821,7 @@ Best to find yourself a copy of [K&R, aka "The C Programming Language"](https:// It is *the* book about C, written by Dennis Ritchie, the creator of C, and Brian Kernighan. Be careful, though - it's ancient and it contains some inaccuracies (well, ideas that are not considered good anymore) or now-changed practices. -Another good resource is [Learn C The Hard Way](http://c.learncodethehardway.org/book/). +Another good resource is [Learn C The Hard Way](http://learncodethehardway.org/c/). If you have a question, read the [compl.lang.c Frequently Asked Questions](http://c-faq.com). From 97c80bff9e4c75d52ca7b7f4a3c3ce895863b00e Mon Sep 17 00:00:00 2001 From: Heitor Pascoal de Bittencourt Date: Tue, 8 Oct 2019 21:27:35 -0300 Subject: [PATCH 043/111] [c/es] Fix book link --- es-es/c-es.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/es-es/c-es.html.markdown b/es-es/c-es.html.markdown index 8bc1eabb..cae4349e 100644 --- a/es-es/c-es.html.markdown +++ b/es-es/c-es.html.markdown @@ -5,6 +5,7 @@ contributors: - ["Adam Bard", "http://adambard.com/"] translators: - ["Francisco García", "http://flaskbreaker.tumblr.com/"] + - ["Heitor P. de Bittencourt", "https://github.com/heitorPB/"] lang: es-es --- @@ -423,7 +424,7 @@ libro de C, escrito por Dennis Ritchie, creador de C y Brian Kernighan. Aún as se cuidadoso, es antiguo, contiene algunas inexactitudes, y algunas prácticas han cambiado. -Otro buen recurso es [Learn C the hard way](http://c.learncodethehardway.org/book/). +Otro buen recurso es [Learn C the hard way](http://learncodethehardway.org/c/). Si tienes una pregunta, lee [compl.lang.c Frequently Asked Questions](http://c-faq.com). From b06385dd128cec36143853efacf7e9fac0bf9b1f Mon Sep 17 00:00:00 2001 From: Heitor Pascoal de Bittencourt Date: Tue, 8 Oct 2019 21:28:45 -0300 Subject: [PATCH 044/111] [c/tr] Fix book link --- tr-tr/c-tr.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tr-tr/c-tr.html.markdown b/tr-tr/c-tr.html.markdown index 6042a609..4ef12527 100644 --- a/tr-tr/c-tr.html.markdown +++ b/tr-tr/c-tr.html.markdown @@ -477,7 +477,7 @@ typedef void (*my_fnp_type)(char *); [K&R, aka "The C Programming Language"](https://en.wikipedia.org/wiki/The_C_Programming_Language)'in bir kopyasını bulundurmak mükemmel olabilir -Diğer bir iyi kaynak ise [Learn C the hard way](http://c.learncodethehardway.org/book/) +Diğer bir iyi kaynak ise [Learn C the hard way](http://learncodethehardway.org/c/) It's very important to use proper spacing, indentation and to be consistent with your coding style in general. Readable code is better than clever code and fast code. For a good, sane coding style to adopt, see the From c643189c0f792402237d253dcf4110f4f69b09d6 Mon Sep 17 00:00:00 2001 From: Heitor Pascoal de Bittencourt Date: Tue, 8 Oct 2019 21:30:02 -0300 Subject: [PATCH 045/111] [c/pt-br] Fix book link --- pt-br/c-pt.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pt-br/c-pt.html.markdown b/pt-br/c-pt.html.markdown index e1c27958..4e55f068 100644 --- a/pt-br/c-pt.html.markdown +++ b/pt-br/c-pt.html.markdown @@ -8,6 +8,7 @@ translators: - ["João Farias", "https://github.com/JoaoGFarias"] - ["Elton Viana", "https://github.com/eltonvs"] - ["Cássio Böck", "https://github.com/cassiobsilva"] + - ["Heitor P. de Bittencourt", "https://github.com/heitorPB/"] lang: pt-br filename: c-pt.el --- @@ -641,7 +642,7 @@ typedef void (*minha_função_type)(char *); Este é *o* livro sobre C, escrito pelos criadores da linguagem. Mas cuidado - ele é antigo e contém alguns erros (bem, ideias que não são mais consideradas boas) ou práticas ultrapassadas. -Outra boa referência é [Learn C the hard way](http://c.learncodethehardway.org/book/). +Outra boa referência é [Learn C the hard way](http://learncodethehardway.org/c/). Se você tem uma pergunta, leia [compl.lang.c Frequently Asked Questions](http://c-faq.com). From 4c879a928ddc2a896aa4d1c03e450ff612843065 Mon Sep 17 00:00:00 2001 From: Heitor Pascoal de Bittencourt Date: Tue, 8 Oct 2019 21:30:56 -0300 Subject: [PATCH 046/111] [c/zh-ch] Fix book link --- zh-cn/c-cn.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zh-cn/c-cn.html.markdown b/zh-cn/c-cn.html.markdown index 8566e811..8eecc56e 100644 --- a/zh-cn/c-cn.html.markdown +++ b/zh-cn/c-cn.html.markdown @@ -612,7 +612,7 @@ typedef void (*my_fnp_type)(char *); 最好找一本 [K&R, aka "The C Programming Language", “C程序设计语言”](https://en.wikipedia.org/wiki/The_C_Programming_Language)。它是关于C最重要的一本书,由C的创作者撰写。不过需要留意的是它比较古老了,因此有些不准确的地方。 -另一个比较好的资源是 [Learn C the hard way](http://c.learncodethehardway.org/book/) +另一个比较好的资源是 [Learn C the hard way](http://learncodethehardway.org/c/) 如果你有问题,请阅读[compl.lang.c Frequently Asked Questions](http://c-faq.com/)。 From ce9d59bdb2a7d263045d77e3ea40d4f6ef61c572 Mon Sep 17 00:00:00 2001 From: Heitor Pascoal de Bittencourt Date: Tue, 8 Oct 2019 21:31:20 -0300 Subject: [PATCH 047/111] [c/ru-ru] Fix book link --- ru-ru/c-ru.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ru-ru/c-ru.html.markdown b/ru-ru/c-ru.html.markdown index 44e7ad3b..974095d8 100644 --- a/ru-ru/c-ru.html.markdown +++ b/ru-ru/c-ru.html.markdown @@ -471,7 +471,7 @@ void str_reverse_through_pointer(char *str_in) { Лучше всего найдите копию [K&R, aka "The C Programming Language"](https://en.wikipedia.org/wiki/The_C_Programming_Language) Это **книга** написанная создателями Си. Но будьте осторожны, она содержит идеи которые больше не считаются хорошими. -Другой хороший ресурс: [Learn C the hard way](http://c.learncodethehardway.org/book/). +Другой хороший ресурс: [Learn C the hard way](http://learncodethehardway.org/c/). Если у вас появился вопрос, почитайте [compl.lang.c Frequently Asked Questions](http://c-faq.com). From ccde50813f72e9c2bd6b8e2a9025985a8646619f Mon Sep 17 00:00:00 2001 From: lbertolazzi <33129418+lbertolazzi@users.noreply.github.com> Date: Fri, 11 Oct 2019 10:10:44 -0300 Subject: [PATCH 048/111] =?UTF-8?q?[elisp/pt]=20Corre=C3=A7=C3=A3o=20ortog?= =?UTF-8?q?r=C3=A1fica?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt-br/elisp-pt.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt-br/elisp-pt.html.markdown b/pt-br/elisp-pt.html.markdown index fc2d1e40..aa611097 100644 --- a/pt-br/elisp-pt.html.markdown +++ b/pt-br/elisp-pt.html.markdown @@ -111,7 +111,7 @@ filename: learn-emacs-lisp-pt.el (hello) ;; `C-xC-e' => Hello, I am Bastien -;; Os parêntesis vazios na definição da função significam que ela +;; Os parênteses vazios na definição da função significam que ela ;; não aceita argumentos. Mas sempre utilizar `my-name' é um tédio! ;; Vamos dizer à função para aceitar um argumento (o argumento é ;; chamado "name"): From 2c13b562f8d5c3a81027ee3abd46410452fbf3af Mon Sep 17 00:00:00 2001 From: lbertolazzi <33129418+lbertolazzi@users.noreply.github.com> Date: Fri, 11 Oct 2019 10:19:39 -0300 Subject: [PATCH 049/111] Update pascal-pt.html.markdown --- pt-br/pascal-pt.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt-br/pascal-pt.html.markdown b/pt-br/pascal-pt.html.markdown index 3a37271a..82cce843 100644 --- a/pt-br/pascal-pt.html.markdown +++ b/pt-br/pascal-pt.html.markdown @@ -157,7 +157,7 @@ BEGIN r := int; // um real pode receber um valor inteiro (mas não o contrário) c := str[1]; //acessando elementos de um vetor: vetor[índice do elemento] - str := 'hello' + 'world'; //concatenção de strings + str := 'hello' + 'world'; //concatenação de strings my_str[0] := 'a'; { só se pode atribuir valores a vetores elemento por elemento (não o vetor inteiro de uma vez) } From 3496f8228f7d53131ed6496dab45e4038a808e65 Mon Sep 17 00:00:00 2001 From: lbertolazzi <33129418+lbertolazzi@users.noreply.github.com> Date: Fri, 11 Oct 2019 10:41:24 -0300 Subject: [PATCH 050/111] =?UTF-8?q?[whip/pt]=20Corre=C3=A7=C3=A3o=20ortogr?= =?UTF-8?q?=C3=A1fica?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt-br/whip-pt.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt-br/whip-pt.html.markdown b/pt-br/whip-pt.html.markdown index 7bdeec25..b11faf28 100644 --- a/pt-br/whip-pt.html.markdown +++ b/pt-br/whip-pt.html.markdown @@ -71,7 +71,7 @@ false (= 1 1) ; => true (equal 2 1) ; => false -; Por exemplo, inigualdade pode ser verificada combinando as funções +; Por exemplo, desigualdade pode ser verificada combinando as funções ;`not` e `equal`. (! (= 2 1)) ; => true From 9fb99aa5bd2bcd742d972fa269de76c1994aff97 Mon Sep 17 00:00:00 2001 From: lbertolazzi <33129418+lbertolazzi@users.noreply.github.com> Date: Fri, 11 Oct 2019 10:51:55 -0300 Subject: [PATCH 051/111] =?UTF-8?q?[haskell/pt]=20Corre=C3=A7=C3=A3o=20ort?= =?UTF-8?q?ogr=C3=A1fica?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt-br/haskell-pt.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pt-br/haskell-pt.html.markdown b/pt-br/haskell-pt.html.markdown index 181aa471..c55a4c03 100644 --- a/pt-br/haskell-pt.html.markdown +++ b/pt-br/haskell-pt.html.markdown @@ -41,7 +41,7 @@ o desenvolvimento deste paradigma de programação. 7 * 7 -- 7 vezes 7 7 / 7 -- 7 dividido por 7 --- Divisões não são inteiras, são fracionádas por padrão da linguagem +-- Divisões não são inteiras, são fracionadas por padrão da linguagem 28736 / 82374 -- 0.3488479374559934 @@ -67,7 +67,7 @@ not False -- Nega uma falácia 7 > 7 -- 7 é maior que 7 ? -{- Haskell é uma linguagem que tem uma sintáxe bastante familiar na +{- Haskell é uma linguagem que tem uma sintaxe bastante familiar na matemática, por exemplo em chamadas de funções você tem: NomeFunção ArgumentoA ArgumentoB ArgumentoC ... From cbf8a43ca14fe063b42f2d7a209a6f7139e7cd5e Mon Sep 17 00:00:00 2001 From: Sridhar Easwaran Date: Fri, 11 Oct 2019 20:29:26 +0530 Subject: [PATCH 052/111] Add example for Optional Positional Parameter --- dart.html.markdown | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dart.html.markdown b/dart.html.markdown index 07f755f7..fb1856fd 100644 --- a/dart.html.markdown +++ b/dart.html.markdown @@ -503,6 +503,17 @@ example30() { } } +// Optional Positional Parameter +// parameter will be disclosed with square bracket [ ] & square bracketed parameter are optional. +example31() { + findVolume(int length, int breath, [int height]) { + print('length = $length, breath = $breath, height = $height'); + } + + findVolume(10,20,30); //valid + findVolume(10,20); //also valid +} + // Programs have only one entry point in the main function. // Nothing is expected to be executed on the outer scope before a program // starts running with what's in its main function. @@ -514,7 +525,7 @@ main() { example8, example9, example10, example11, example12, example13, example14, example15, example16, example17, example18, example19, example20, example21, example22, example23, example24, example25, example26, - example27, example28, example29, example30 + example27, example28, example29, example30, example31 ].forEach((ef) => ef()); } From 170f9c7f496866b83fa5f73f19e9a4bfc074e2f1 Mon Sep 17 00:00:00 2001 From: Sridhar Easwaran Date: Fri, 11 Oct 2019 21:19:31 +0530 Subject: [PATCH 053/111] Update css-ta.html.markdown --- ta_in/css-ta.html.markdown | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/ta_in/css-ta.html.markdown b/ta_in/css-ta.html.markdown index cbe88f1e..4ea7f959 100644 --- a/ta_in/css-ta.html.markdown +++ b/ta_in/css-ta.html.markdown @@ -233,6 +233,48 @@ css முன்னுரிமை பின்வருமாறு * `B` இது அடுத்தது. * `D` இதுவே கடைசி . +## Media Queries [மீடியா குரிஸ்] + +CSS மீடியா குரிஸ் CSS 3 அம்சங்கள். பயன்படுத்தும் கணினி, கைபேசி அல்லது சாதனத்தின் பிஸேல் டென்சிட்டிக்கு ஏற்றவாறு மீடியா குரிஸ் விதிகளை பயன்படுத்தலாம். + +```css +/* அனைத்து டேவிஸ்களுக்கும் பொதுவான விதி */ +h1 { + font-size: 2em; + color: white; + background-color: black; +} + +/* பிரிண்ட் செய்யும்போது h1 கலர் மாற்ற */ +@media print { + h1 { + color: black; + background-color: white; + } +} + +/* 480 பிஸேல்ளுக்கு மேல் சிகிரீன் அளவு உள்ள சாதனத்தில் எழுத்து அளவு மிகை படுத்த */ +@media screen and (min-width: 480px) { + h1 { + font-size: 3em; + font-weight: normal; + } +} +``` + +மீடியா குரிஸ் வழங்கும் அம்சங்கள் : +`width`, `height`, `device-width`, `device-height`, `orientation`, `aspect-ratio`, `device-aspect-ratio`, `color`, `color-index`, `monochrome`, `resolution`, `scan`, `grid`. இவையுள் பெரும்பான்மை `min-` அல்லது `max-` வுடன் பயன்படுத்தலாம் . + +`resolution` பழைய சாதனங்களில் பயன்படாது, எனவே `device-pixel-ratio` பயன்படுத்தவும். + +பல கைபேசி மற்றும் கணினிகள், வீடு கணினி திரை அளவு காட்ட முற்படும். எனவே `viewport` மெட்டா டேக் பயன்படுத்தவும். + +```html + + + +``` + ## css அம்சங்களின் பொருந்தகூடிய தன்மை பெரும்பாலான css 2 வின் அம்சங்கள் எல்லா உலாவிகளிலும் , கருவிகளிலும் உள்ளன. ஆனால் முன்கூட்டியே அந்த அம்சங்களை பரிசோதிப்பது நல்லது. From 08b2589618fdc0bf61bdafd49aa19458d32af820 Mon Sep 17 00:00:00 2001 From: Sridhar Easwaran Date: Fri, 11 Oct 2019 22:17:39 +0530 Subject: [PATCH 054/111] Update xml-ta.html.markdown --- ta_in/xml-ta.html.markdown | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/ta_in/xml-ta.html.markdown b/ta_in/xml-ta.html.markdown index d782399d..13aa9255 100644 --- a/ta_in/xml-ta.html.markdown +++ b/ta_in/xml-ta.html.markdown @@ -5,6 +5,7 @@ contributors: - ["João Farias", "https://github.com/JoaoGFarias"] translators: - ["Rasendran Kirushan", "https://github.com/kirushanr"] + - ["Sridhar Easwaran", "https://github.com/sridhareaswaran"] lang: in-ta --- @@ -14,6 +15,57 @@ XML ஆனது ஒரு கட்டமைப்பு மொழி ஆகு HTML போல் அன்றி , XML ஆனது தகவலை மட்டும் கொண்டு செல்ல்கிறது + +## சில வரையறை மற்றும் முன்னுரை + +பல கூறுகளால் அமைக்கப்பட்டது. ஒவொரு கூறுகளிலும் அட்ட்ரிபூட்க்கள் இருக்கும், அவை அந்தந்த கூறுகளை வரையறுக்க பயன்படும். மேலும் அந்த கூறுகளை தகவல் அல்லது கிளை கூறுகள் இருக்கலாம். அணைத்து கோப்புகளிலும் ரூட்/ஆரம்ப கூறு இருக்கும், அது தனக்குள் கிளை கூறுகளை கொண்டுருக்கும். + +XML பாகுபடுத்தி மிகவும் கண்டிப்பான வீதிகளைக்கொண்டது. [XML தொடரியல் விதிகளை அறிய] (http://www.w3schools.com/xml/xml_syntax.asp). + + +```xml + + + + + + + +Content + + + + + + + + + + + + + + + + + + + + + + Text + + + + + + Text + + +Text +``` + * XML வாக்கிய அமைப்பு From 092b9155bede1cfe3dcec9b130823348b2d04e7f Mon Sep 17 00:00:00 2001 From: Sridhar Easwaran Date: Fri, 11 Oct 2019 22:28:57 +0530 Subject: [PATCH 055/111] Update dart.html.markdown --- dart.html.markdown | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/dart.html.markdown b/dart.html.markdown index fb1856fd..ce6f681b 100644 --- a/dart.html.markdown +++ b/dart.html.markdown @@ -503,15 +503,42 @@ example30() { } } -// Optional Positional Parameter +// Optional Positional Parameter: // parameter will be disclosed with square bracket [ ] & square bracketed parameter are optional. example31() { - findVolume(int length, int breath, [int height]) { + findVolume31(int length, int breath, [int height]) { print('length = $length, breath = $breath, height = $height'); } - findVolume(10,20,30); //valid - findVolume(10,20); //also valid + findVolume31(10,20,30); //valid + findVolume31(10,20); //also valid +} + +// Optional Named Parameter: +// parameter will be disclosed with curly bracket { } +// curly bracketed parameter are optional. +// have to use parameter name to assign a value which separated with colan : +// in curly bracketed parameter order does not matter +// these type parameter help us to avoid confusion while passing value for a function which has many parameter. +example32() { + findVolume32(int length, int breath, {int height}) { + print('length = $length, breath = $breath, height = $height'); + } + + findVolume32(10,20,height:30);//valid & we can see the parameter name is mentioned here. + findVolume32(10,20);//also valid +} + +// Optional Default Parameter: +// same like optional named parameter in addition we can assign default value for this parameter. +// which means no value is passed this default value will be taken. +example33() { + findVolume33(int length, int breath, {int height=10}) { + print('length = $length, breath = $breath, height = $height'); + } + + findVolume33(10,20,height:30);//valid + findVolume33(10,20);//valid } // Programs have only one entry point in the main function. @@ -525,7 +552,7 @@ main() { example8, example9, example10, example11, example12, example13, example14, example15, example16, example17, example18, example19, example20, example21, example22, example23, example24, example25, example26, - example27, example28, example29, example30, example31 + example27, example28, example29, example30, example31, example32, example33 ].forEach((ef) => ef()); } From 3b4ca43798a2fc0483c1a3a195ddde934cd2983f Mon Sep 17 00:00:00 2001 From: davidgtu Date: Fri, 11 Oct 2019 15:22:12 -0400 Subject: [PATCH 056/111] fix spacing --- css.html.markdown | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/css.html.markdown b/css.html.markdown index 64dc097c..5a9d1376 100644 --- a/css.html.markdown +++ b/css.html.markdown @@ -164,14 +164,14 @@ selector { max-width: 5in; /* inches */ /* Colors */ - color: #F6E; /* short hex format */ - color: #FF66EE; /* long hex format */ - color: tomato; /* a named color */ - color: rgb(255, 255, 255); /* as rgb values */ - color: rgb(10%, 20%, 50%); /* as rgb percentages */ - color: rgba(255, 0, 0, 0.3); /* as rgba values (CSS 3) Note: 0 <= a <= 1 */ - color: transparent; /* equivalent to setting the alpha to 0 */ - color: hsl(0, 100%, 50%); /* as hsl percentages (CSS 3) */ + color: #F6E; /* short hex format */ + color: #FF66EE; /* long hex format */ + color: tomato; /* a named color */ + color: rgb(255, 255, 255); /* as rgb values */ + color: rgb(10%, 20%, 50%); /* as rgb percentages */ + color: rgba(255, 0, 0, 0.3); /* as rgba values (CSS 3) Note: 0 <= a <= 1 */ + color: transparent; /* equivalent to setting the alpha to 0 */ + color: hsl(0, 100%, 50%); /* as hsl percentages (CSS 3) */ color: hsla(0, 100%, 50%, 0.3); /* as hsl percentages with alpha */ /* Borders */ From 0e437a75db091eb5cb057f1a49bf07db562d1d8f Mon Sep 17 00:00:00 2001 From: davidgtu Date: Fri, 11 Oct 2019 15:53:07 -0400 Subject: [PATCH 057/111] add type assertion --- typescript.html.markdown | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/typescript.html.markdown b/typescript.html.markdown index cf2111d5..6c6da2c4 100644 --- a/typescript.html.markdown +++ b/typescript.html.markdown @@ -257,8 +257,24 @@ for (const i in list) { console.log(i); // 0, 1, 2 } +// Type Assertion +let foo = {} // Creating foo as an empty object +foo.bar = 123 // Error: property 'bar' does not exist on `{}` +foo.baz = 'hello world' // Error: property 'baz' does not exist on `{}` +// Because the inferred type of foo is `{}` (an object with 0 properties), you +// are not allowed to add bar and baz to it. However with type assertion, +// the following will pass: + +interface Foo { + bar: number; + baz: string; +} + +let foo = {} as Foo; // Type assertion here +foo.bar = 123; +foo.baz = 'hello world' ``` From ceaa8824b1a7ab141e317013a8a1643dd9b02684 Mon Sep 17 00:00:00 2001 From: Alexander Meinhold <35108195+alexmeinhold@users.noreply.github.com> Date: Fri, 11 Oct 2019 22:07:05 +0200 Subject: [PATCH 058/111] Update common-lisp.html.markdown Real -> Read --- common-lisp.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common-lisp.html.markdown b/common-lisp.html.markdown index b12e50ca..1f2bb366 100644 --- a/common-lisp.html.markdown +++ b/common-lisp.html.markdown @@ -69,7 +69,7 @@ t ; another atom, denoting true ;;; is a good starting point. Third party libraries can be easily installed with ;;; Quicklisp -;;; CL is usually developed with a text editor and a Real Eval Print +;;; CL is usually developed with a text editor and a Read Eval Print ;;; Loop (REPL) running at the same time. The REPL allows for interactive ;;; exploration of the program while it is running "live". From abcfb458343c1cd0e1559dfb1d54c03f2a3c17ad Mon Sep 17 00:00:00 2001 From: Apoorv Choubey Date: Sat, 12 Oct 2019 19:50:10 +0530 Subject: [PATCH 059/111] add CSS resource --- css.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/css.html.markdown b/css.html.markdown index 64dc097c..5ecfe5e3 100644 --- a/css.html.markdown +++ b/css.html.markdown @@ -179,7 +179,7 @@ selector { border-style:solid; border-color:red; /* similar to how background-color is set */ border: 5px solid red; /* this is a short hand approach for the same */ - border-radius:20px; /* this is a CSS3 property */ + border-radius:20px; /* this is a CSS3 property */ /* Images as backgrounds of elements */ background-image: url(/img-path/img.jpg); /* quotes inside url() optional */ @@ -317,6 +317,7 @@ a new feature. * [Dabblet](http://dabblet.com/) (CSS playground) * [Mozilla Developer Network's CSS documentation](https://developer.mozilla.org/en-US/docs/Web/CSS) (Tutorials and reference) * [Codrops' CSS Reference](http://tympanus.net/codrops/css_reference/) (Reference) +* [DevTips' CSS Basics](https://www.youtube.com/playlist?list=PLqGj3iMvMa4IOmy04kDxh_hqODMqoeeCy) (Tutorials) ## Further Reading From 5fe22c9c770b6a391a18c3e7f44c1e5b4620ae40 Mon Sep 17 00:00:00 2001 From: Apoorv Choubey Date: Sat, 12 Oct 2019 20:25:05 +0530 Subject: [PATCH 060/111] add SQL resource --- sql.html.markdown | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/sql.html.markdown b/sql.html.markdown index 2bece208..5edf0f7c 100644 --- a/sql.html.markdown +++ b/sql.html.markdown @@ -9,14 +9,14 @@ Structured Query Language (SQL) is an ISO standard language for creating and wor Implementations typically provide a command line prompt where you can enter the commands shown here interactively, and they also offer a way to execute a series of these commands stored in a script file. (Showing that you’re done with the interactive prompt is a good example of something that isn’t standardized--most SQL implementations support the keywords QUIT, EXIT, or both.) -Several of these sample commands assume that the [MySQL employee sample database](https://dev.mysql.com/doc/employee/en/) available on [github](https://github.com/datacharmer/test_db) has already been loaded. The github files are scripts of commands, similar to the relevant commands below, that create and populate tables of data about a fictional company’s employees. The syntax for running these scripts will depend on the SQL implementation you are using. A utility that you run from the operating system prompt is typical. +Several of these sample commands assume that the [MySQL employee sample database](https://dev.mysql.com/doc/employee/en/) available on [github](https://github.com/datacharmer/test_db) has already been loaded. The github files are scripts of commands, similar to the relevant commands below, that create and populate tables of data about a fictional company’s employees. The syntax for running these scripts will depend on the SQL implementation you are using. A utility that you run from the operating system prompt is typical. ```sql -- Comments start with two hyphens. End each command with a semicolon. -- SQL is not case-sensitive about keywords. The sample commands here --- follow the convention of spelling them in upper-case because it makes +-- follow the convention of spelling them in upper-case because it makes -- it easier to distinguish them from database, table, and column names. -- Create and delete a database. Database and table names are case-sensitive. @@ -26,47 +26,47 @@ DROP DATABASE someDatabase; -- List available databases. SHOW DATABASES; --- Use a particular existing database. +-- Use a particular existing database. USE employees; -- Select all rows and columns from the current database's departments table. --- Default activity is for the interpreter to scroll the results on your screen. +-- Default activity is for the interpreter to scroll the results on your screen. SELECT * FROM departments; --- Retrieve all rows from the departments table, --- but only the dept_no and dept_name columns. +-- Retrieve all rows from the departments table, +-- but only the dept_no and dept_name columns. -- Splitting up commands across lines is OK. SELECT dept_no, dept_name FROM departments; --- Retrieve all departments columns, but just 5 rows. +-- Retrieve all departments columns, but just 5 rows. SELECT * FROM departments LIMIT 5; -- Retrieve dept_name column values from the departments --- table where the dept_name value has the substring 'en'. +-- table where the dept_name value has the substring 'en'. SELECT dept_name FROM departments WHERE dept_name LIKE '%en%'; -- Retrieve all columns from the departments table where the dept_name --- column starts with an 'S' and has exactly 4 characters after it. +-- column starts with an 'S' and has exactly 4 characters after it. SELECT * FROM departments WHERE dept_name LIKE 'S____'; -- Select title values from the titles table but don't show duplicates. SELECT DISTINCT title FROM titles; --- Same as above, but sorted (case-sensitive) by the title values. +-- Same as above, but sorted (case-sensitive) by the title values. SELECT DISTINCT title FROM titles ORDER BY title; -- Show the number of rows in the departments table. SELECT COUNT(*) FROM departments; -- Show the number of rows in the departments table that --- have 'en' as a substring of the dept_name value. +-- have 'en' as a substring of the dept_name value. SELECT COUNT(*) FROM departments WHERE dept_name LIKE '%en%'; --- A JOIN of information from multiple tables: the titles table shows --- who had what job titles, by their employee numbers, from what +-- A JOIN of information from multiple tables: the titles table shows +-- who had what job titles, by their employee numbers, from what -- date to what date. Retrieve this information, but instead of the --- employee number, use the employee number as a cross-reference to +-- employee number, use the employee number as a cross-reference to -- the employees table to get each employee's first and last name -- instead. (And only get 10 rows.) @@ -85,12 +85,12 @@ WHERE TABLE_TYPE='BASE TABLE'; -- for how you specify the columns, such as their datatypes. CREATE TABLE tablename1 (fname VARCHAR(20), lname VARCHAR(20)); --- Insert a row of data into the table tablename1. This assumes that the --- table has been defined to accept these values as appropriate for it. +-- Insert a row of data into the table tablename1. This assumes that the +-- table has been defined to accept these values as appropriate for it. INSERT INTO tablename1 VALUES('Richard','Mutt'); -- In tablename1, change the fname value to 'John' --- for all rows that have an lname value of 'Mutt'. +-- for all rows that have an lname value of 'Mutt'. UPDATE tablename1 SET fname='John' WHERE lname='Mutt'; -- Delete rows from the tablename1 table @@ -100,6 +100,11 @@ DELETE FROM tablename1 WHERE lname like 'M%'; -- Delete all rows from the tablename1 table, leaving the empty table. DELETE FROM tablename1; --- Remove the entire tablename1 table. +-- Remove the entire tablename1 table. DROP TABLE tablename1; ``` + +## Further Reading + +* [Codecademy - SQL](https://www.codecademy.com/learn/learn-sql) A good introduction to SQL in a "learn by doing it" format. +* [Database System Concepts](https://www.db-book.com) book's Chapter 3 - Introduction to SQL has an in depth explanation of SQL concepts. From 8a8dd005bf68b5565bba0f5e4da573bcb9c92951 Mon Sep 17 00:00:00 2001 From: Apoorv Choubey Date: Sat, 12 Oct 2019 20:47:18 +0530 Subject: [PATCH 061/111] add Java resource --- java.html.markdown | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/java.html.markdown b/java.html.markdown index ca0b04c2..4f45a268 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -289,7 +289,7 @@ public class LearnJava { // interface. This allows the execution time of basic // operations, such as get and insert element, to remain // constant-amortized even for large sets. - // TreeMap - A Map that is sorted by its keys. Each modification + // TreeMap - A Map that is sorted by its keys. Each modification // maintains the sorting defined by either a Comparator // supplied at instantiation, or comparisons of each Object // if they implement the Comparable interface. @@ -470,11 +470,11 @@ public class LearnJava { // " int foo = 5; String bar = (foo < 10) ? "A" : "B"; - System.out.println("bar : " + bar); // Prints "bar : A", because the + System.out.println("bar : " + bar); // Prints "bar : A", because the // statement is true. // Or simply System.out.println("bar : " + (foo < 10 ? "A" : "B")); - + //////////////////////////////////////// // Converting Data Types @@ -918,7 +918,7 @@ public class Lambdas { planets.keySet().forEach(p -> System.out.format("%s\n", p)); // Tracing the above, we see that planets is a HashMap, keySet() returns - // a Set of its keys, forEach applies each element as the lambda + // a Set of its keys, forEach applies each element as the lambda // expression of: (parameter p) -> System.out.format("%s\n", p). Each // time, the element is said to be "consumed" and the statement(s) // referred to in the lambda body is applied. Remember the lambda body @@ -998,6 +998,8 @@ The links provided here below are just to get an understanding of the topic, fee * [Codewars - Java Katas](https://www.codewars.com/?language=java) +* [University of Helsinki - Object-Oriented programming with Java](http://moocfi.github.io/courses/2013/programming-part-1/) + **Books**: * [Head First Java](http://www.headfirstlabs.com/books/hfjava/) From 2486fa8c1e51e975c603fa7972542deae287817b Mon Sep 17 00:00:00 2001 From: Mariusz Skoneczko Date: Tue, 22 Oct 2019 12:08:08 +1100 Subject: [PATCH 062/111] [python3/en] Clarify difference between iterators and iterables in the last example (closes #3586) --- python3.html.markdown | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/python3.html.markdown b/python3.html.markdown index 430927a9..61c53408 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -550,8 +550,14 @@ next(our_iterator) # => "three" # After the iterator has returned all of its data, it raises a StopIteration exception next(our_iterator) # Raises StopIteration -# You can grab all the elements of an iterator by calling list() on it. -list(filled_dict.keys()) # => Returns ["one", "two", "three"] +# We can also loop over it, in fact, "for" does this implicitly! +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. +list(our_iterable) # => Returns ["one", "two", "three"] +list(our_iterator) # => Returns [] because state is saved #################################################### From db010c8a72a3390461fea62db0890e9f986993bd Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 22 Oct 2019 09:10:07 +0200 Subject: [PATCH 063/111] [swift/en] Fix typos --- swift.html.markdown | 56 ++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/swift.html.markdown b/swift.html.markdown index c2fb3471..1f9fe897 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -91,7 +91,7 @@ let multiLineString = """ This is a multi-line string. It's called that because it takes up multiple lines (wow!) Any indentation beyond the closing quotation marks is kept, the rest is discarded. - You can include " or "" in multi-line strings because the delimeter is three "s. + You can include " or "" in multi-line strings because the delimiter is three "s. """ // Arrays @@ -159,12 +159,12 @@ let `class` = "keyword" or contains nil (no value) to indicate that a value is missing. Nil is roughly equivalent to `null` in other languages. A question mark (?) after the type marks the value as optional of that type. - + If a type is not optional, it is guaranteed to have a value. - + Because Swift requires every property to have a type, even nil must be explicitly stored as an Optional value. - + Optional is an enum, with the cases .none (nil) and .some(T) (the value) */ @@ -178,7 +178,7 @@ let someOptionalString4 = String?.none //nil To access the value of an optional that has a value, use the postfix operator !, which force-unwraps it. Force-unwrapping is like saying, "I know that this optional definitely has a value, please give it to me." - + Trying to use ! to access a non-existent optional value triggers a runtime error. Always make sure that an optional contains a non-nil value before using ! to force-unwrap its value. @@ -194,7 +194,7 @@ if someOptionalString != nil { // Swift supports "optional chaining," which means that you can call functions // or get properties of optional values and they are optionals of the appropriate type. // You can even do this multiple times, hence the name "chaining." - + let empty = someOptionalString?.isEmpty // Bool? // if-let structure - @@ -370,7 +370,7 @@ func say(_ message: String) { } say("Hello") -// Default parameters can be ommitted when calling the function. +// Default parameters can be omitted when calling the function. func printParameters(requiredParameter r: Int, optionalParameter o: Int = 10) { print("The required parameter was \(r) and the optional parameter was \(o)") } @@ -443,7 +443,7 @@ func testGuard() { return // guard statements MUST exit the scope that they are in. // They generally use `return` or `throw`. } - + print("number is \(aNumber)") } testGuard() @@ -564,7 +564,7 @@ enum Furniture { case desk(height: Int) // Associate with String and Int case chair(String, Int) - + func description() -> String { //either placement of let is acceptable switch self { @@ -591,15 +591,15 @@ print(chair.description()) // "Chair of Foo with 40 cm" - Define initializers to set up their initial state - Be extended to expand their functionality beyond a default implementation - Conform to protocols to provide standard functionality of a certain kind - + Classes have additional capabilities that structures don't have: - Inheritance enables one class to inherit the characteristics of another. - Type casting enables you to check and interpret the type of a class instance at runtime. - Deinitializers enable an instance of a class to free up any resources it has assigned. - Reference counting allows more than one reference to a class instance. - + Unless you need to use a class for one of these reasons, use a struct. - + Structures are value types, while classes are reference types. */ @@ -607,7 +607,7 @@ print(chair.description()) // "Chair of Foo with 40 cm" struct NamesTable { let names: [String] - + // Custom subscript subscript(index: Int) -> String { return names[index] @@ -629,7 +629,7 @@ class Shape { class Rect: Shape { var sideLength: Int = 1 - + // Custom getter and setter property var perimeter: Int { get { @@ -640,16 +640,16 @@ class Rect: Shape { sideLength = newValue / 4 } } - + // Computed properties must be declared as `var`, you know, cause' they can change var smallestSideLength: Int { return self.sideLength - 1 } - + // Lazily load a property // subShape remains nil (uninitialized) until getter called lazy var subShape = Rect(sideLength: 4) - + // If you don't need a custom getter and setter, // but still want to run code before and after getting or setting // a property, you can use `willSet` and `didSet` @@ -659,19 +659,19 @@ class Rect: Shape { print(someIdentifier) } } - + init(sideLength: Int) { self.sideLength = sideLength // always super.init last when init custom properties super.init() } - + func shrink() { if sideLength > 0 { sideLength -= 1 } } - + override func getArea() -> Int { return sideLength * sideLength } @@ -703,13 +703,13 @@ class Circle: Shape { override func getArea() -> Int { return 3 * radius * radius } - + // Place a question mark postfix after `init` is an optional init // which can return nil init?(radius: Int) { self.radius = radius super.init() - + if radius <= 0 { return nil } @@ -813,7 +813,7 @@ for _ in 0..<10 { - Internal: Accessible and subclassible in the module it is declared in. - Fileprivate: Accessible and subclassible in the file it is declared in. - Private: Accessible and subclassible in the enclosing declaration (think inner classes/structs/enums) - + See more here: https://docs.swift.org/swift-book/LanguageGuide/AccessControl.html */ @@ -878,11 +878,11 @@ extension Int { var doubled: Int { return self * 2 } - + func multipliedBy(num: Int) -> Int { return num * self } - + mutating func multiplyBy(num: Int) { self *= num } @@ -965,18 +965,18 @@ func fakeFetch(value: Int) throws -> String { guard 7 == value else { throw MyError.reallyBadValue(msg: "Some really bad value") } - + return "test" } func testTryStuff() { // assumes there will be no error thrown, otherwise a runtime exception is raised let _ = try! fakeFetch(value: 7) - + // if an error is thrown, then it proceeds, but if the value is nil // it also wraps every return value in an optional, even if its already optional let _ = try? fakeFetch(value: 7) - + do { // normal try operation that provides error handling via `catch` block try fakeFetch(value: 1) From fb48be47d6cac609cf9d29caae5d4e73df3e214a Mon Sep 17 00:00:00 2001 From: Ross Mackay Date: Tue, 22 Oct 2019 13:16:52 +0100 Subject: [PATCH 064/111] Fix outdated comment in en/th-th typescript docs --- th-th/typescript.th.html.markdown | 2 +- typescript.html.markdown | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/th-th/typescript.th.html.markdown b/th-th/typescript.th.html.markdown index fc2a823b..5395c2a7 100644 --- a/th-th/typescript.th.html.markdown +++ b/th-th/typescript.th.html.markdown @@ -190,7 +190,7 @@ interface Person { } var p1: Person = { name: "Tyrone", age: 42 }; -p1.age = 25; // Error แน่นอน เพราะ p1.x ถูกกำหนดเป็น read-only +p1.age = 25; // Error แน่นอน เพราะ p1.age ถูกกำหนดเป็น read-only var p2 = { name: "John", age: 60 }; // สังเกตว่า p2 ไม่ได้กำหนดเป็น Person var p3: Person = p2; // ทำได้ เป็น read-only alias ของ p2 และกำหนดเป็น Person diff --git a/typescript.html.markdown b/typescript.html.markdown index cf2111d5..6f238d5b 100644 --- a/typescript.html.markdown +++ b/typescript.html.markdown @@ -199,7 +199,7 @@ interface Person { } var p1: Person = { name: "Tyrone", age: 42 }; -p1.age = 25; // Error, p1.x is read-only +p1.age = 25; // Error, p1.age is read-only var p2 = { name: "John", age: 60 }; var p3: Person = p2; // Ok, read-only alias for p2 From 5657bd4fa2a038a56d22b02060e217fff0049f94 Mon Sep 17 00:00:00 2001 From: waynee95 Date: Wed, 23 Oct 2019 15:34:13 +0200 Subject: [PATCH 065/111] [nix/de] Fix broken link --- de-de/nix-de.html.markdown | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/de-de/nix-de.html.markdown b/de-de/nix-de.html.markdown index 79b60d20..ea02e81d 100644 --- a/de-de/nix-de.html.markdown +++ b/de-de/nix-de.html.markdown @@ -8,11 +8,11 @@ translators: lang: de-de --- -Nix ist eine simple funktionale Programmiersprache, die für den +Nix ist eine simple funktionale Programmiersprache, die für den [Nix package manager](https://nixos.org/nix/) und [NixOS](https://nixos.org/) entwickelt wurde. -Du kannst Nix Ausdrücke evaluieren mithilfe von +Du kannst Nix Ausdrücke evaluieren mithilfe von [nix-instantiate](https://nixos.org/nix/manual/#sec-nix-instantiate) oder [`nix-repl`](https://github.com/edolstra/nix-repl). @@ -24,7 +24,7 @@ with builtins; [ # Inline Kommentare sehen so aus. - /* Multizeilen Kommentare + /* Multizeilen Kommentare sehen so aus. */ @@ -61,7 +61,7 @@ with builtins; [ "String Literale sind in Anführungszeichen." " - String Literale können mehrere + String Literale können mehrere Zeilen umspannen. " @@ -95,7 +95,7 @@ with builtins; [ tutorials/learn.nix #=> /the-base-path/tutorials/learn.nix - # Ein Pfad muss mindestens einen Schrägstrich enthalten. Ein Pfad für eine + # Ein Pfad muss mindestens einen Schrägstrich enthalten. Ein Pfad für eine # Datei im selben Verzeichnis benötigt ein ./ Präfix. ./learn.nix #=> /the-base-path/learn.nix @@ -238,7 +238,7 @@ with builtins; [ #=> { d = 2; e = 3; } # Die Nachkommen eines Attributs können in diesem Feld nicht zugeordnet werden, wenn - # das Attribut selbst nicht zugewiesen wurde. + # das Attribut selbst nicht zugewiesen wurde. { a = { b = 1; }; a.c = 2; @@ -261,9 +261,9 @@ with builtins; [ #=> 7 # Die erste Linie diese Tutorials startet mit "with builtins;", - # weil builtins ein Set mit allen eingebauten + # weil builtins ein Set mit allen eingebauten # Funktionen (length, head, tail, filter, etc.) umfasst. - # Das erspart uns beispielsweise "builtins.length" zu schreiben, + # Das erspart uns beispielsweise "builtins.length" zu schreiben, # anstatt nur "length". @@ -305,7 +305,7 @@ with builtins; [ (tryEval (abort "foo")) #=> error: evaluation aborted with the following error message: ‘foo’ - # `assert` evaluiert zu dem gegebenen Wert, wenn die Bedingung wahr ist, sonst + # `assert` evaluiert zu dem gegebenen Wert, wenn die Bedingung wahr ist, sonst # löst es eine abfangbare Exception aus. (assert 1 < 2; 42) #=> 42 @@ -319,7 +319,7 @@ with builtins; [ #========================================= # Da die Wiederholbarkeit von Builds für den Nix Packetmanager entscheidend ist, - # werden in der Nix Sprache reine funktionale Elemente betont. Es gibt aber ein paar + # werden in der Nix Sprache reine funktionale Elemente betont. Es gibt aber ein paar # unreine Elemente. # Du kannst auf Umgebungsvariablen verweisen. (getEnv "HOME") @@ -355,4 +355,4 @@ with builtins; [ (https://medium.com/@MrJamesFisher/nix-by-example-a0063a1a4c55) * [Susan Potter - Nix Cookbook - Nix By Example] - (http://funops.co/nix-cookbook/nix-by-example/) + (https://ops.functionalalgebra.com/nix-by-example/) From 68083173eca275cbb4f9e068ab47812786146797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20de=20Santa?= Date: Thu, 24 Oct 2019 13:22:35 -0300 Subject: [PATCH 066/111] Add "Clojure for the Brave and True" resource --- pt-br/clojure-pt.html.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pt-br/clojure-pt.html.markdown b/pt-br/clojure-pt.html.markdown index b88d4eec..409394f2 100644 --- a/pt-br/clojure-pt.html.markdown +++ b/pt-br/clojure-pt.html.markdown @@ -382,3 +382,6 @@ Clojuredocs.org tem documentação com exemplos para quase todas as funções pr Clojure-doc.org tem um bom número de artigos para iniciantes: [http://clojure-doc.org/](http://clojure-doc.org/) + +Clojure for the Brave and True é um livro de introdução ao Clojure e possui uma versão gratuita online: +[https://www.braveclojure.com/clojure-for-the-brave-and-true/](https://www.braveclojure.com/clojure-for-the-brave-and-true/) From aa353ba1a555baae1f47051f3b5713a5769be1ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20de=20Santa?= Date: Thu, 24 Oct 2019 13:29:43 -0300 Subject: [PATCH 067/111] Add "Clojure for the Brave and True" resource --- clojure.html.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clojure.html.markdown b/clojure.html.markdown index c94625d6..16771e25 100644 --- a/clojure.html.markdown +++ b/clojure.html.markdown @@ -416,3 +416,6 @@ Clojuredocs.org has documentation with examples for most core functions: Clojure-doc.org (yes, really) has a number of getting started articles: [http://clojure-doc.org/](http://clojure-doc.org/) + +Clojure for the Brave and True has a great introduction to Clojure and a free online version: +[https://www.braveclojure.com/clojure-for-the-brave-and-true/](https://www.braveclojure.com/clojure-for-the-brave-and-true/) From f47496b08327441eb3d6e553ce80efdd16fddc82 Mon Sep 17 00:00:00 2001 From: Felipe N Souza Date: Sat, 26 Oct 2019 21:39:37 -0300 Subject: [PATCH 068/111] [Python/pt-br] Improve translation --- pt-br/python3-pt.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pt-br/python3-pt.html.markdown b/pt-br/python3-pt.html.markdown index b72c732a..c8b234f6 100644 --- a/pt-br/python3-pt.html.markdown +++ b/pt-br/python3-pt.html.markdown @@ -11,11 +11,11 @@ lang: pt-br filename: learnpython3-pt.py --- -Python foi criado por Guido Van Rossum nos anos 1990. Ele é atualmente uma -das mais populares linguagens em existência. Eu fiquei morrendo de amor -pelo Python por sua clareza sintática. É praticamente pseudocódigo executável. +Python foi criada por Guido Van Rossum nos anos 1990. Ela é atualmente uma +das linguagens mais populares existentes. Eu me apaixonei por +Python por sua clareza sintática. É praticamente pseudocódigo executável. -Suas opiniões são grandemente apreciadas. Você pode encontrar-me em +Opniões são muito bem vindas. Você pode encontrar-me em [@louiedinh](http://twitter.com/louiedinh) ou louiedinh [em] [serviço de e-mail do google]. From 6b5938017b5105066d27484605af8dd88fab183d Mon Sep 17 00:00:00 2001 From: AstiaSun Date: Mon, 28 Oct 2019 01:20:19 +0200 Subject: [PATCH 069/111] [mips/uk-ua] Add ukrainian translation for MIPS Assemly --- uk-ua/mips-ua.html.markdown | 366 ++++++++++++++++++++++++++++++++++++ 1 file changed, 366 insertions(+) create mode 100644 uk-ua/mips-ua.html.markdown diff --git a/uk-ua/mips-ua.html.markdown b/uk-ua/mips-ua.html.markdown new file mode 100644 index 00000000..20fa7638 --- /dev/null +++ b/uk-ua/mips-ua.html.markdown @@ -0,0 +1,366 @@ +--- +language: "MIPS Assembly" +filename: MIPS.asm +contributors: + - ["Stanley Lim", "https://github.com/Spiderpig86"] +translators: + - ["AstiaSun", "https://github.com/AstiaSun"] +lang: uk-ua +--- + +Мова асемблера MIPS (англ. Microprocessor without Interlocked Pipeline Stages) була написана для роботи з мікропорцесорами MIPS, парадигма яких була описана в 1981 році [Джоном Геннессі](https://uk.wikipedia.org/wiki/Джон_Лерой_Геннессі). Ці RISC процесори використовуються у таких вбудованих системах, як маршрутизатори та мережеві шлюзи. + +[Read More](https://en.wikipedia.org/wiki/MIPS_architecture) + +```asm +# Коментарі позначені як'#' + +# Всі символи після '#' ігноруються лексичним аналізатором асемблера. + +# Зазвичай програми поділяються на .data та .text частини + +.data # У цьому розділі дані зберігаються у пам'яті, виділеній в RAM, подібно до змінних + # в мовах програмування вищого рівня + + # Змінна оголошується наступним чином: [назва]: .[тип] [значенння] + # Наприклад: + hello_world: .asciiz "Hello World\n" # Оголосити текстову змінну + num1: .word 42 # word - це чисельний тип 32-бітного розряду + + arr1: .word 1, 2, 3, 4, 5 # Масив чисел + arr2: .byte 'a', 'b' # Масив буквених символів (розмір кожного - 1 байт) + buffer: .space 60 # Виділити місце в RAM + # (не очищується, тобто не заповнюється 0) + + # Розміри типів даних + _byte: .byte 'a' # 1 байт + _halfword: .half 53 # 2 байти + _word: .word 3 # 4 байти + _float: .float 3.14 # 4 байти + _double: .double 7.0 # 8 байтів + + .align 2 # Вирівнення пам'яті даних, де число + # показує кількість байтів, вирівнених + # у степені 2. (.align 2 означає + # чисельне (word) вирівнювання оскільки + # 2^2 = 4 байти) + +.text # Розділ, що містить інструкції та + # логіку програми + +.globl _main # Оголошує назву інструкції як + # глобальну, тобто, яка є доступною для + # всіх інших файлів + + _main: # програми MIPS виконують інструкції + # послідовно, тобто першочергово код + # буде виконуватись після цієї позначки + + # Виведемо на екран "hello world" + la $a0, hello_world # Завантажує адресу тексту у пам'яті + li $v0, 4 # Завантажує значення системної + # команди (вказуючи тип функціоналу) + syscall # Виконує зазначену системну команду + # з обраним аргументом ($a0) + + # Регісти (використовуються, щоб тримати дані протягом виконання програми) + # $t0 - $t9 # Тимчасові регістри використовуються + # для проміжних обчислень всередині + # підпрограм (не зберігаються між + # викликами функцій) + + # $s0 - $s7 # Збережені регісти, у яких значення + # збегіраються між викликами підпрограм. + # Зазвичай збегрігаються у стеку. + + # $a0 - $a3 # Регістри для передачі аргументів для + # підпрограм + # $v0 - $v1 # Регістри для значень, що повертаються + # від викликаної функції + + # Типи інструкції завантаження / збереження + la $t0, label # Скопіювати адресу в пам'яті, де + # зберігається значення змінної label + # в регістр $t0 + lw $t0, label # Скопівати чисельне значення з пам'яті + lw $t1, 4($s0) # Скопівати чисельне значення з адреси + # пам'яті ресгіста зі зміщенням в + # 4 байти (адреса + 4) + lb $t2, label # Скопіювати буквений символ в частину + # нижчого порядку регістра $t2 + lb $t2, 0($s0) # Скопіювати буквений символ з адреси + # в $s0 із зсувом 0 + # Подіне використання і 'lh' для halfwords + + sw $t0, label # Збегігти чисельне значення в адресу в + # пам'яті, що відповідає змінній label + sw $t0, 8($s0) # Збегігти чисельне значення в адресу, + # зазначеній у $s0, та зі зсувом у 8 байтів + # Така ж ідея використання 'sb' та 'sh' для буквених символів та halfwords. + # 'sa' не існує + + +### Математичні операції ### + _math: + # Пам'ятаємо, що попередньо потрібно завантажити данні в пам'ять + lw $t0, num # Із розділа з данними + li $t0, 5 # Або безпосередньо з константи + li $t1, 6 + add $t2, $t0, $t1 # $t2 = $t0 + $t1 + sub $t2, $t0, $t1 # $t2 = $t0 - $t1 + mul $t2, $t0, $t1 # $t2 = $t0 * $t1 + div $t2, $t0, $t1 # $t2 = $t0 / $t1 (Може не підтримуватись + # деякими версіями MARS) + div $t0, $t1 # Виконує $t0 / $t1. Отримати частку можна + # за допомогою команди 'mflo', остаток - 'mfhi' + + # Bitwise Shifting + sll $t0, $t0, 2 # Побітовий здвиг вліво з безпосереднім + # значенням (константою) 2 + sllv $t0, $t1, $t2 # Здвиг вліво зі змінною кількістю у + # регістрі + srl $t0, $t0, 5 # Побітовий здвиг вправо (не збегігає + # знак, знак розширюється 0) + srlv $t0, $t1, $t2 # Здвиг вправо зі змінною кількістю у + # регістрі + sra $t0, $t0, 7 # Побітовий арифметичний збвиг вправо + # (зберігає знак) + srav $t0, $t1, $t2 # Здвиг вправо зі змінною кількістю у + # регістрі + + # Bitwise operators + and $t0, $t1, $t2 # Побітове І (AND) + andi $t0, $t1, 0xFFF # Побітове І з беспосереднім значенням + or $t0, $t1, $t2 # Побітове АЛЕ (OR) + ori $t0, $t1, 0xFFF # Побітове АЛЕ з беспосереднім значенням + xor $t0, $t1, $t2 # Побітова виключна диз'юнкція (XOR) + xori $t0, $t1, 0xFFF # Побітове XOR з беспосереднім значенням + nor $t0, $t1, $t2 # Побітова стрілка Пірса (NOR) + +## Розгалуження ## + _branching: + # В овсновному інструкції розгалуження мають наступну форму: + #