summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--coffeescript.html.markdown2
-rw-r--r--id-id/css-id.html.markdown1
-rw-r--r--it-it/brainfuck-it.html.markdown101
-rw-r--r--it-it/java-it.html.markdown2
-rw-r--r--xml.html.markdown131
-rw-r--r--zh-cn/coffeescript-cn.html.markdown4
6 files changed, 237 insertions, 4 deletions
diff --git a/coffeescript.html.markdown b/coffeescript.html.markdown
index 86c875ba..82c6024c 100644
--- a/coffeescript.html.markdown
+++ b/coffeescript.html.markdown
@@ -2,7 +2,7 @@
language: coffeescript
contributors:
- ["Tenor Biel", "http://github.com/L8D"]
- - ["Xavier Yao"], "http://github.com/xavieryao"]
+ - ["Xavier Yao", "http://github.com/xavieryao"]
filename: coffeescript.coffee
---
diff --git a/id-id/css-id.html.markdown b/id-id/css-id.html.markdown
index d0798ec7..456dfafe 100644
--- a/id-id/css-id.html.markdown
+++ b/id-id/css-id.html.markdown
@@ -1,3 +1,4 @@
+---
language: css
contributors:
- ["Mohammad Valipour", "https://github.com/mvalipour"]
diff --git a/it-it/brainfuck-it.html.markdown b/it-it/brainfuck-it.html.markdown
new file mode 100644
index 00000000..4999d7e6
--- /dev/null
+++ b/it-it/brainfuck-it.html.markdown
@@ -0,0 +1,101 @@
+---
+
+language: brainfuck
+contributors:
+ - ["Prajit Ramachandran", "http://prajitr.github.io/"]
+ - ["Mathias Bynens", "http://mathiasbynens.be/"]
+translators:
+ - ["Ivan Sala", "http://slavni96.github.io/"]
+lang: it-it
+
+---
+
+Brainfuck è un linguaggio di programmazione estremamente minimale,
+ma è ingrado di rappresentare completamente una macchina di turnig,
+e sfrutta solo 8 caratteri.
+[Per saperne di più](http://it.wikipedia.org/wiki/Brainfuck)
+
+```
+
+Qualsiasi carattere che non sia "><+-.,[]" (escludendo gli apici)
+viene ignorato.
+Branfuck è caratterizzato da un array (vettore) di 30,000 celle
+inizializzare a zero, e un puntatore che punta alla cella corrente.
+
+Vi sono solo otto comando:
++ : Incrementa il valore della cella attuale di uno.
+- : Decrementa il valore della cella attuale di uno.
+> : Sposta il puntatore sulla cella seguente (prossima a destra).
+< : Sposta il puntatore sulla cella precendete (precedente a sinistra).
+. : Stampa il valore in ASCII della cella corrente. (es: 65 = 'A')
+, : Legge un singolo carattere come input per la cella corrente.
+[ : Se il valore della cella corrente è zero, conclude il ciclo
+ andando alla sua corrispondente ].
+ Altrimenti, passa alla prossima istruzione.
+] : Se il valore della cella corrente è zero, passa alla prossima istruzione.
+ Altrimenti torna indetro fino alla [ corrispondente.
+
+[ e ] creano un loop (while). Ovviamente dovranno essere bilanciati.
+Per ogni [ dovrà corrispondere una ]
+
+Alcuni semplici esempi di programmi scritti in Brainfuck:
+
+++++++ [ > ++++++++++ < - ] > +++++ .
+
+Questo programma stampa in output la lettera 'A'. Priam incrementa
+la cella #1 fino a 6, Quindi la cella #1 viene usata per crare un ciclo.
+Poi, entra in un loop ([) e si sposta alla cella #2.
+Incrementa la cella #2 10 volte, e torna alla cella #1, e la decrementa.
+Questo avviene 6 volte (servono che la cella #1 venga decrementata 6 volte
+per raggiungere lo 0. Quindi passa alla corrispondente ] e prosegue).
+
+A questo punto, siamo sulla cella #1, che ha valore 0,
+la cella #2 ha valore 60 (6*10). Ci spostiamo sulla cella #2, incrementiamo
+per 5 volte, e otteniamo il valore 65, quindi stampaimo il valore della cella
+#2 (.).
+65 è 'A' in ASCII, quindi alla fine viene stampata 'A'.
+
+
+, [ > + < - ] > .
+
+Questo programma legge un carattere come input dall'utente,
+quindi salva il carattere dentro la cella #1.
+In seguito, incominca a ciclare.
+Si sposta alla cella #², e increementa il valore della cella (#2).
+Quindi torna alla cella #1, e decrementa il valore della cella (#1).
+Questo continua fino a quando la cella #²1 diventa 0, e quindi la cella #2
+avrà il valore iniziale della cella #1.
+Infine, visto che ci troviamo sulla cella #1 alla fine del ciclo, si sposta
+sulla cella #2 e stampa il valore in ASCII.
+
+Gli spazi nel codice sovrastante, sono presenti solo a scopo di ottenere
+una maggiore leggibilità, si poteva anche scrivere senza:
+
+,[>+<-]>.
+
+Proviamo, adesso, a capire cosa fa invece questo programma:
+
+,>,< [ > [ >+ >+ << -] >> [- << + >>] <<< -] >>
+
+Prende due numeri in input e quindi li moltiplica.
+
+Prima prende in input i due numeri (,>,<), quindi inizia un cilclo
+basandosi sulla cella #1.
+Quindi si sposta sulla cella #2, e inizia un altro ciclo condizionato
+dal valore della cella #2, incrementando la cella #3.
+Arrivati a questo punto abbiamo un problema: alla fine del ciclo interno
+la cella #2 ha valore 0. In questo caso, quando il ciclo esterno rifarà
+partire il ciclo interno, non funzionerà più perchè la cella #2 ha valore 0.
+Per ovviare a questo problema, oltre alla cella 3, incrementiamo anche la cella
+#4, e alla fine di ogni ciclo interno copiala il valore della cella #4
+nella cella #2, in modo che il ciclo interno
+possa essere eseguito una altra volta.
+Alla fine la cella #3 contiene il risultato.
+```
+
+E questo è brainfuck...Non è difficele, vero?
+Per divertimento adesso puoi scrivere i tuoi programmi in brainfuck,
+oppure puoi scrivere un interprete brainfuck in un altro linguaggio.
+L'interprete è abbastanza semplice da implementare, ma se sei veramente
+masochista prova ad implementare un interprete brainfuck in...
+brainfuck.
diff --git a/it-it/java-it.html.markdown b/it-it/java-it.html.markdown
index fb91aa19..6eabd61f 100644
--- a/it-it/java-it.html.markdown
+++ b/it-it/java-it.html.markdown
@@ -5,7 +5,7 @@ contributors:
- ["Jake Prather", "http://github.com/JakeHP"]
- ["Madison Dickson", "http://github.com/mix3d"]
translators:
- - ["Ivan Sala","http://github.com/dev-sala"]
+ - ["Ivan Sala","http://github.com/slavni96"]
lang: it-it
---
diff --git a/xml.html.markdown b/xml.html.markdown
new file mode 100644
index 00000000..349d4763
--- /dev/null
+++ b/xml.html.markdown
@@ -0,0 +1,131 @@
+---
+language: xml
+filename: learnxml.xml
+contributors:
+ - ["João Farias", "https://github.com/JoaoGFarias"]
+---
+
+XML is a markup language designed to store and transport data.
+
+Unlike HTML, XML does not specifies how to display or to format data, just carry it.
+
+* XML Syntax
+
+```XML
+<!-- Comments in XML are like this -->
+
+<?xml version="1.0" encoding="UTF-8"?>
+<bookstore>
+ <book category="COOKING">
+ <title lang="en">Everyday Italian</title>
+ <author>Giada De Laurentiis</author>
+ <year>2005</year>
+ <price>30.00</price>
+ </book>
+ <book category="CHILDREN">
+ <title lang="en">Harry Potter</title>
+ <author>J K. Rowling</author>
+ <year>2005</year>
+ <price>29.99</price>
+ </book>
+ <book category="WEB">
+ <title lang="en">Learning XML</title>
+ <author>Erik T. Ray</author>
+ <year>2003</year>
+ <price>39.95</price>
+ </book>
+</bookstore>
+
+<!-- Above is a typical XML file.
+ It starts with a declaration, informing some metadata (optional)
+
+ XML uses a tree structure. Above, the root node is 'bookstore', which has
+ three child nodes, all 'books'. Those nodes has more child nodes, and so on...
+
+ Nodes are created using open/close tags, and childs are just nodes between
+ the open and close tags.-->
+
+
+<!-- XML carries two kind of data:
+ 1 - Attributes -> That's metadata about a node.
+ Usually, the XML parser uses this information to store the data properly.
+ It is characterized by appearing in parenthesis within the opening tag
+ 2 - Elements -> That's pure data.
+ That's what the parser will retrive from the XML file.
+ Elements appear between the open and close tags, without paranthesis. -->
+
+
+<!-- Below, an element with two attributes -->
+<file type="gif" id="4293">computer.gif</file>
+
+
+```
+
+* Well-Formated Document x Validation
+
+A XML document is well-formated if it is syntactically correct.
+However, is possible to inject more constraints in the document,
+using document definitions, such as DTD and XML Schema.
+
+A XML document which follows a document definition is called valid,
+regarding that document.
+
+With this tool, you can check the XML data outside the application logic.
+
+```XML
+
+<!-- Below, you can see an simplified version of bookstore document,
+ with the addition of DTD definition.-->
+
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE note SYSTEM "Bookstore.dtd">
+<bookstore>
+ <book category="COOKING">
+ <title >Everyday Italian</title>
+ <price>30.00</price>
+ </book>
+</bookstore>
+
+<!-- This DTD could be something like:-->
+
+<!DOCTYPE note
+[
+<!ELEMENT bookstore (book+)>
+<!ELEMENT book (title,price)>
+<!ATTLIST book category CDATA "Literature">
+<!ELEMENT title (#PCDATA)>
+<!ELEMENT price (#PCDATA)>
+]>
+
+
+<!-- The DTD starts with a declaration.
+ Following, the root node is declared, requiring 1 or more child nodes 'book'.
+ Eeach 'book' should contain exactly one 'title' and 'price' and an attribute
+ called 'category', with "Literature" as its default value.
+ The 'title' and 'price' nodes contain a parsed character data.-->
+
+<!-- The DTD could be declared inside the XML file itself.-->
+
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE note
+[
+<!ELEMENT bookstore (book+)>
+<!ELEMENT book (title,price)>
+<!ATTLIST book category CDATA "Literature">
+<!ELEMENT title (#PCDATA)>
+<!ELEMENT price (#PCDATA)>
+]>
+
+<bookstore>
+ <book category="COOKING">
+ <title >Everyday Italian</title>
+ <price>30.00</price>
+ </book>
+</bookstore>
+
+
+```
+
+
+
diff --git a/zh-cn/coffeescript-cn.html.markdown b/zh-cn/coffeescript-cn.html.markdown
index 8fb96749..44561541 100644
--- a/zh-cn/coffeescript-cn.html.markdown
+++ b/zh-cn/coffeescript-cn.html.markdown
@@ -2,9 +2,9 @@
language: coffeescript
contributors:
- ["Tenor Biel", "http://github.com/L8D"]
- - ["Xavier Yao"], "http://github.com/xavieryao"]
+ - ["Xavier Yao", "http://github.com/xavieryao"]
translators:
- - ["Xavier Yao"], "http://github.com/xavieryao"]
+ - ["Xavier Yao", "http://github.com/xavieryao"]
filename: coffeescript-cn.coffee
lang: zh-cn
---