diff options
| -rw-r--r-- | it-it/go-it.html.markdown | 44 | ||||
| -rw-r--r-- | it-it/rst-it.html.markdown | 35 | ||||
| -rw-r--r-- | java.html.markdown | 29 | ||||
| -rw-r--r-- | javascript.html.markdown | 24 | ||||
| -rw-r--r-- | pt-br/dynamic-programming-pt.html.markdown | 4 | ||||
| -rw-r--r-- | vim.html.markdown | 42 | 
6 files changed, 95 insertions, 83 deletions
| diff --git a/it-it/go-it.html.markdown b/it-it/go-it.html.markdown index e005f2dc..e49ccd79 100644 --- a/it-it/go-it.html.markdown +++ b/it-it/go-it.html.markdown @@ -26,14 +26,14 @@ Aggiunge la concorrenza in maniera diretta e semplice da capire, per far  forza sulle CPU multi-core di oggigiorno. Presenta caratteristiche utili  per la programmazione in larga scala. -Go comes with a great standard library and an enthusiastic community. +Go include un'ottima libreria standard e ha una community entusiasta.  ```go  // Commento su riga singola  /* Commento   su riga multipla */ -// In cima a ogni file è necessario specificare il package. +// In cima ad ogni file è necessario specificare il package.  // Main è un package speciale che identifica un eseguibile anziché una libreria.  package main @@ -65,19 +65,19 @@ func oltreIlCiaoMondo() {  	x = 3     // Assegnazione di una variabile.      // E' possibile la dichiarazione "rapida" := per inferire il tipo, dichiarare e assegnare contemporaneamente.  	y := 4 -    // Una funzione che ritorna due valori. -	somma, prod := imparaMoltepliciValoriDiRitorno(x, y) +    // Una funzione che restituisce due valori. +	somma, prod := imparaMoltepliciValoriRestituiti(x, y)  	fmt.Println("somma:", somma, "prodotto:", prod)    // Semplice output.  	imparaTipi()                                       // < y minuti, devi imparare ancora!  }  /* <- commento su righe multiple -Le funzioni possono avere parametri e ritornare (molteplici!) valori. -Qua, x e y sono gli argomenti, mentre somma e prod sono i valori ritornati. +Le funzioni possono avere parametri e restituire (molteplici!) valori. +In questo esempio, x e y sono gli argomenti, mentre somma e prod sono i valori restituiti.  Da notare il fatto che x e somma vengono dichiarati come interi.  */ -func imparaMoltepliciValoriDiRitorno(x, y int) (somma, prod int) { -	return x + y, x * y // Ritorna due valori. +func imparaMoltepliciValoriRestituiti(x, y int) (somma, prod int) { +	return x + y, x * y // Restituisce due valori.  }  // Ecco alcuni tipi presenti in Go @@ -86,7 +86,7 @@ func imparaTipi() {  	str := "Impara il Go!" // Tipo stringa.  	s2 := `Una stringa letterale -puo' includere andata a capo.` // Sempre di tipo stringa. +può includere andata a capo.` // Sempre di tipo stringa.      // Stringa letterale non ASCII. I sorgenti Go sono in UTF-8.  	g := 'Σ' // Il tipo runa, alias per int32, è costituito da un code point unicode. @@ -144,20 +144,20 @@ puo' includere andata a capo.` // Sempre di tipo stringa.  	imparaControlloDiFlusso() // Torniamo in carreggiata.  } -// In Go è possibile associare dei nomi ai valori di ritorno di una funzione. -// Assegnare un nome al tipo di dato ritornato permette di fare return in vari +// In Go è possibile associare dei nomi ai valori restituiti da una funzione. +// Assegnare un nome al tipo di dato restituito permette di fare return in vari  // punti all'interno del corpo della funzione, ma anche di usare return senza -// specificare in modo esplicito che cosa ritornare. -func imparaValoriDiRitornoConNome(x, y int) (z int) { +// specificare in modo esplicito che cosa restituire. +func imparaValoriRestituitiConNome(x, y int) (z int) {  	z = x * y  	return // z è implicito, perchè compare nella definizione di funzione.  }  // Go è dotato di garbage collection. Ha i puntatori, ma non l'aritmetica dei -// puntatori. Puoi fare errori coi puntatori a nil, ma non puoi direttamente -// incrementare un puntatore. +// puntatori. Puoi commettere errori a causa di puntatori nulli, ma non puoi +// incrementare un puntatore direttamente.  func imparaLaMemoria() (p, q *int) { -    // I valori di ritorno (con nome) p e q sono puntatori a int. +    // I valori restituiti (con nome) p e q sono puntatori a int.  	p = new(int) // La funzione new si occupa di allocare memoria.      // L'int allocato viene inizializzato a 0, dunque p non è più nil.  	s := make([]int, 20) // Alloca 20 int come un singolo blocco di memoria. @@ -207,14 +207,14 @@ func imparaControlloDiFlusso() {  	}  	// x == 42 qua. -    // Il for è l'unica istruzione per ciclare in Go, ma ha varie forme. +    // Il for è l'unica istruzione per i loop in Go, ma ha varie forme.  	for { // Ciclo infinito.  		break    // Scherzavo.  		continue // Non si arriva qua.  	} -    // Puoi usare range per ciclare su un vettore, slice, stringa, mappa o canale. -    // range ritorna uno (per i canali) o due valori (vettore, slice, stringa, mappa). +    // Puoi usare range per iterare lungo un vettore, slice, stringa, mappa o canale. +    // range restituisce uno (per i canali) o due valori (vettore, slice, stringa, mappa).  	for chiave, valore := range map[string]int{"uno": 1, "due": 2, "tre": 3} {          // per ogni coppia dentro la mappa, stampa chiave e valore  		fmt.Printf("chiave=%s, valore=%d\n", chiave, valore) @@ -236,7 +236,7 @@ func imparaControlloDiFlusso() {      // Inoltre le funzioni letterali possono essere definite e chiamate      // inline, col ruolo di parametri di funzione, a patto che:      // a) la funzione letterale venga chiamata subito (), -    // b) il valore ritornato è in accordo con il tipo dell'argomento. +    // b) il valore restituito è in accordo con il tipo dell'argomento.  	fmt.Println("Somma e raddoppia due numeri: ",  		func(a, b int) int {  			return (a + b) * 2 @@ -247,7 +247,7 @@ func imparaControlloDiFlusso() {  	goto amore  amore: -	imparaFabbricaDiFunzioni() // Una funzione che ritorna un'altra funzione è divertente! +	imparaFabbricaDiFunzioni() // Una funzione che restituisce un'altra funzione è divertente!  	imparaDefer()              // Un tour veloce di una parola chiave importante.  	imparaInterfacce()         // Arriva la roba buona!  } @@ -271,7 +271,7 @@ func fabbricaDiFrasi(miaStringa string) func(prima, dopo string) string {  func imparaDefer() (ok bool) {      // Le istruzioni dette "deferred" (rinviate) sono eseguite -    // appena prima che la funzione ritorni. +    // appena prima che la funzione abbia termine.  	defer fmt.Println("le istruzioni 'deferred' sono eseguite in ordine inverso (LIFO).")  	defer fmt.Println("\nQuesta riga viene stampata per prima perché")      // defer viene usato di solito per chiudere un file, così la funzione che diff --git a/it-it/rst-it.html.markdown b/it-it/rst-it.html.markdown index 8947c738..a834e899 100644 --- a/it-it/rst-it.html.markdown +++ b/it-it/rst-it.html.markdown @@ -6,10 +6,12 @@ contributors:      - ["Andre Polykanine", "https://github.com/Oire"]  translators:      - ["Ale46", "https://github.com/Ale46"] +    - ["Chris54721", "https://chris54721.net"]  lang: it-it  --- -RST è un formato di file formalmente creato dalla comunità Python per scrivere documentazione (e quindi fa parte di Docutils). +RST (Restructured Text) è un formato di file inizialmente creato dalla comunità Python +per la documentazione (per questo motivo appartiene a Docutils).  I file RST sono semplici file di testo con una sintassi leggera (in confronto all'HTML). @@ -23,7 +25,7 @@ Per usare Restructured Text, sarà necessario installare [Python](http://www.pyt  $ easy_install docutils  ``` -O se il tuo sistema ha `pip`, puoi usare anche lui: +Oppure, se hai `pip` installato sul tuo sistema:  ```bash  $ pip install docutils @@ -32,7 +34,7 @@ $ pip install docutils  ## Sintassi del file -Un semplice esempio della sintassi del file: +Ecco un semplice esempio della sintassi RST:  ```  .. Le righe che iniziano con due punti sono comandi speciali. Ma se non è possibile trovare alcun comando, la riga viene considerata come un commento @@ -41,16 +43,16 @@ Un semplice esempio della sintassi del file:  I titoli principali sono scritti utilizzando caratteri di uguale, sopra e sotto  =============================================================================== -Si noti che devono esistere tanti caratteri di uguale quanti sono i caratteri del titolo. +Si noti che devono esserci tanti caratteri di uguale quanti caratteri del titolo. -Anche il titolo è sottolineato con caratteri di uguale -====================================================== +Anche i titoli normali usano caratteri di uguale, ma solo sotto +=============================================================== -Sottotitoli con i trattini --------------------------- +I sottotitoli usano i trattini +------------------------------ -E sotto-sottotitoli con tildi -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +E i sotto-sottotitoli le tildi +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  Puoi inserire il testo in *corsivo* o in **grassetto**, puoi "contrassegnare" il testo come codice con un doppio apice ``: `` print () ``. @@ -60,13 +62,13 @@ Le liste sono semplici come in Markdown:  - Secondo elemento       - Sottoelemento -o +oppure  * Primo elemento  * Secondo elemento       * Sottoelemento -Le tabelle sono davvero facili da scrivere: +Le tabelle sono molto semplici da inserire:  =========== ========  Stato       Capitale @@ -75,22 +77,21 @@ Francia     Parigi  Giappone    Tokio  =========== ======== -Le tabelle più complesse possono essere fatte facilmente (colonne e/o righe unite) ma ti suggerisco di leggere il documento completo per questo :) +Anche le tabelle più complesse possono essere inserite facilmente (colonne e/o righe unite) ma ti suggerisco di leggere la documentazione completa per questo :)  Esistono diversi modi per creare collegamenti: -- Aggiungendo un underscore dopo una parola: Github_ e aggiungendo l'URL di destinazione dopo il testo (questo modo ha il vantaggio di non inserire URL non necessari all'interno del testo leggibile). +- Aggiungendo un underscore dopo una parola: Github_ e aggiungendo l'URL di destinazione dopo il testo (questo metodo ha il vantaggio di non inserire URL non necessari all'interno del testo leggibile).  - Digitando un URL completo: https://github.com/ (verrà automaticamente convertito in un collegamento) -- Facendo un collegamento simile a Markdown: `Github <https://github.com/>`_ . +- Utilizzando una sintassi simile a Markdown: `Github <https://github.com/>`_ .  .. _Github https://github.com/  ``` -  ## Come usarlo -RST viene fornito con docutils che dispone di `rst2html`, per esempio: +RST viene fornito con docutils, che dispone di `rst2html`, per esempio:  ```bash  $ rst2html miofile.rst output.html diff --git a/java.html.markdown b/java.html.markdown index 7b59b085..621d500c 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -173,7 +173,7 @@ public class LearnJava {          // Char - A single 16-bit Unicode character          char fooChar = 'A'; -        // final variables can't be reassigned to another object, +        // final variables can't be reassigned,          final int HOURS_I_WORK_PER_WEEK = 9001;          // but they can be initialized later.          final double E; @@ -703,15 +703,21 @@ public class ExampleClass extends ExampleClassParent implements InterfaceOne,  //     // Method declarations  // } -// Marking a class as abstract means that it contains at least one abstract -// method that must be defined in a child class. Similar to interfaces, abstract -// classes cannot be instantiated, but instead must be extended and the abstract -// methods defined. Different from interfaces, abstract classes can contain a -// mixture of concrete and abstract methods. Methods in an interface cannot -// have a body, unless the method is static, and variables are final by default, -// unlike an abstract class. Also abstract classes CAN have the "main" method. +// Abstract Classes cannot be instantiated. +// Abstract classes may define abstract methods. +// Abstract methods have no body and are marked abstract +// Non-abstract child classes must @Override all abstract methods +// from their super-classes. +// Abstract classes can be useful when combining repetitive logic +// with customised behavior, but as Abstract classes require +// inheritance, they violate "Composition over inheritance" +// so consider other approaches using composition. +// https://en.wikipedia.org/wiki/Composition_over_inheritance +  public abstract class Animal  { +    private int age; +      public abstract void makeSound();      // Method can have a body @@ -722,17 +728,12 @@ public abstract class Animal          age = 30;      } -    // No need to initialize, however in an interface -    // a variable is implicitly final and hence has -    // to be initialized. -    private int age; -      public void printAge()      {          System.out.println(age);      } -    // Abstract classes can have main function. +    // Abstract classes can have main method.      public static void main(String[] args)      {          System.out.println("I am abstract"); diff --git a/javascript.html.markdown b/javascript.html.markdown index 85c8a52d..4ed8f849 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -103,7 +103,7 @@ false;  // ... which works with more than just strings  "1, 2, " + 3; // = "1, 2, 3" -"Hello " + ["world", "!"] // = "Hello world,!" +"Hello " + ["world", "!"]; // = "Hello world,!"  // and are compared with < and >  "a" < "b"; // = true @@ -222,7 +222,7 @@ while (true){  var input;  do {      input = getInput(); -} while (!isValid(input)) +} while (!isValid(input));  // The `for` loop is the same as C and Java:  // initialization; continue condition; iteration. @@ -293,7 +293,7 @@ myFunction("foo"); // = "FOO"  // automatic semicolon insertion. Watch out for this when using Allman style.  function myFunction(){      return // <- semicolon automatically inserted here -    {thisIsAn: 'object literal'} +    {thisIsAn: 'object literal'};  }  myFunction(); // = undefined @@ -388,7 +388,7 @@ myFunc(); // = undefined  // through `this`, even if it wasn't attached when it was defined.  var myOtherFunc = function(){      return this.myString.toUpperCase(); -} +};  myObj.myOtherFunc = myOtherFunc;  myObj.myOtherFunc(); // = "HELLO WORLD!" @@ -397,7 +397,7 @@ myObj.myOtherFunc(); // = "HELLO WORLD!"  var anotherFunc = function(s){      return this.myString + s; -} +};  anotherFunc.call(myObj, " And Hello Moon!"); // = "Hello World! And Hello Moon!"  // The `apply` function is nearly identical, but takes an array for an argument @@ -420,7 +420,7 @@ boundFunc(" And Hello Saturn!"); // = "Hello World! And Hello Saturn!"  // `bind` can also be used to partially apply (curry) a function. -var product = function(a, b){ return a * b; } +var product = function(a, b){ return a * b; };  var doubler = product.bind(this, 2);  doubler(8); // = 16 @@ -430,11 +430,11 @@ doubler(8); // = 16  var MyConstructor = function(){      this.myNumber = 5; -} +};  myNewObj = new MyConstructor(); // = {myNumber: 5}  myNewObj.myNumber; // = 5 -// Unlike most other popular object-oriented languages, JavaScript has no  +// Unlike most other popular object-oriented languages, JavaScript has no  // concept of 'instances' created from 'class' blueprints; instead, JavaScript  // combines instantiation and inheritance into a single concept: a 'prototype'. @@ -451,7 +451,7 @@ var myObj = {  var myPrototype = {      meaningOfLife: 42,      myFunc: function(){ -        return this.myString.toLowerCase() +        return this.myString.toLowerCase();      }  }; @@ -515,7 +515,7 @@ MyConstructor.prototype = {  };  var myNewObj2 = new MyConstructor();  myNewObj2.getMyNumber(); // = 5 -myNewObj2.myNumber = 6 +myNewObj2.myNumber = 6;  myNewObj2.getMyNumber(); // = 6  // Built-in types like strings and numbers also have constructors that create @@ -540,7 +540,7 @@ if (new Number(0)){  // you can actually add functionality to a string, for instance.  String.prototype.firstCharacter = function(){      return this.charAt(0); -} +};  "abc".firstCharacter(); // = "a"  // This fact is often used in "polyfilling", which is implementing newer @@ -556,7 +556,7 @@ if (Object.create === undefined){ // don't overwrite it if it exists          Constructor.prototype = proto;          // then use it to create a new, appropriately-prototyped object          return new Constructor(); -    } +    };  }  ``` diff --git a/pt-br/dynamic-programming-pt.html.markdown b/pt-br/dynamic-programming-pt.html.markdown index 40e6fda2..c4c9eafb 100644 --- a/pt-br/dynamic-programming-pt.html.markdown +++ b/pt-br/dynamic-programming-pt.html.markdown @@ -51,7 +51,7 @@ array antecedente e uma variável como maiorSequenciasAteAgora e seu índice  ajudariam a poupar muito tempo.  Um conceito similar poderia ser aplicado ao procurar o maior caminho em um   grafo acíclico dirigido. ---------------------------------------------------------------------------- +  ```   for i=0 to n-1              LS[i]=1 @@ -62,7 +62,7 @@ grafo acíclico dirigido.              if (largest < LS[i])  ``` -### Alguns Problemas Famosos de Programação Dinâmica +## Alguns Problemas Famosos de Programação Dinâmica  ```  Floyd Warshall Algorithm - Tutorial and C Program source code:http://www.thelearningpoint.net/computer-science/algorithms-all-to-all-shortest-paths-in-graphs---floyd-warshall-algorithm-with-c-program-source-code  diff --git a/vim.html.markdown b/vim.html.markdown index 7723136f..15144b8d 100644 --- a/vim.html.markdown +++ b/vim.html.markdown @@ -8,15 +8,16 @@ filename: LearnVim.txt  [Vim](http://www.vim.org) -(Vi IMproved) is a clone of the popular vi editor for Unix. It is a text  -editor designed for speed and increased productivity, and is ubiquitous in most  -unix-based systems. It has numerous keybindings for speedy navigation to  +(Vi IMproved) is a clone of the popular vi editor for Unix. It is a text +editor designed for speed and increased productivity, and is ubiquitous in most +unix-based systems. It has numerous keybindings for speedy navigation to  specific points in the file, and for fast editing.  ## Basics of navigating Vim  ```      vim <filename>   # Open <filename> in vim +    :help <topic>    # Open up built-in help docs about <topic> if any exists      :q               # Quit vim      :w               # Save current file      :wq              # Save file and quit vim @@ -51,12 +52,12 @@ specific points in the file, and for fast editing.      # Jumping to characters      f<character>     # Jump forward and land on <character> -    t<character>     # Jump forward and land right before <character>  +    t<character>     # Jump forward and land right before <character> -    # For example,     +    # For example,      f<               # Jump forward and land on <      t<               # Jump forward and land right before < -     +      # Moving by word      w                # Move forward by one word @@ -73,19 +74,28 @@ specific points in the file, and for fast editing.      L                # Move to the bottom of the screen  ``` +## Help docs: + +Vim has built in help documentation that can accessed with `:help <topic>`. +For example `:help navigation` will pull up documentation about how to navigate +your workspace! + +`:help` can also be used without an option. This will bring up a default help dialog +that aims to make getting started with vim more approachable! +  ## Modes:  Vim is based on the concept on **modes**. -Command Mode - vim starts up in this mode, used to navigate and write commands  -Insert Mode  - used to make changes in your file  -Visual Mode  - used to highlight text and do operations to them  +Command Mode - vim starts up in this mode, used to navigate and write commands +Insert Mode  - used to make changes in your file +Visual Mode  - used to highlight text and do operations to them  Ex Mode      - used to drop down to the bottom with the ':' prompt to enter commands  ```      i                # Puts vim into insert mode, before the cursor position      a                # Puts vim into insert mode, after the cursor position -    v                # Puts vim into visual mode     +    v                # Puts vim into visual mode      :                # Puts vim into ex mode      <esc>            # 'Escapes' from whichever mode you're in, into Command mode @@ -102,18 +112,18 @@ Ex Mode      - used to drop down to the bottom with the ':' prompt to enter comm  ## The 'Grammar' of vim -Vim can be thought of as a set of commands in a  +Vim can be thought of as a set of commands in a  'Verb-Modifier-Noun' format, where: -Verb     - your action  -Modifier - how you're doing your action  +Verb     - your action +Modifier - how you're doing your action  Noun     - the object on which your action acts on  A few important examples of 'Verbs', 'Modifiers', and 'Nouns':  ```      # 'Verbs' -  +      d                # Delete      c                # Change      y                # Yank (copy) @@ -135,7 +145,7 @@ A few important examples of 'Verbs', 'Modifiers', and 'Nouns':      s                # Sentence      p                # Paragraph      b                # Block -     +      # Sample 'sentences' or commands      d2w              # Delete 2 words @@ -180,7 +190,7 @@ Here's a sample ~/.vimrc file:  ```  " Example ~/.vimrc -" 2015.10  +" 2015.10  " Required for vim to be iMproved  set nocompatible | 
