diff options
-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-- | vim.html.markdown | 42 |
4 files changed, 71 insertions, 59 deletions
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/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 |