From a1a64276425800b03a3b29a5843ad9dc772a4c2a Mon Sep 17 00:00:00 2001 From: Aleksey Pirogov Date: Sat, 13 Sep 2014 22:31:33 +0400 Subject: [PATCH 01/68] russian translation for Markdown --- ru-ru/markdown-ru.html.markdown | 270 ++++++++++++++++++++++++++++++++ 1 file changed, 270 insertions(+) create mode 100644 ru-ru/markdown-ru.html.markdown diff --git a/ru-ru/markdown-ru.html.markdown b/ru-ru/markdown-ru.html.markdown new file mode 100644 index 00000000..c8b643b6 --- /dev/null +++ b/ru-ru/markdown-ru.html.markdown @@ -0,0 +1,270 @@ +--- +language: markdown +contributors: + - ["Dan Turkel", "http://danturkel.com/"] + - ["Pirogov Alexey", "http://twitter.com/alex_pir"] +filename: markdown.md +--- + +Язык разметки Markdown создан Джоном Грубером (англ. John Gruber) и Аароном Шварцем (англ. Aaron H. Swartz) в 2004 году. Авторы задавались целью создать максимально удобочитаемый и удобный в публикации облегчённый язык разметки, пригодный для последующего преобразования в HTML (а также и в другие форматы). + + ```markdown + + + + + + + +# Это заголовок h1 +## Это заголовок h2 +### Это заголовок h3 +#### Это заголовок h4 +##### Это заголовок h5 +###### Это заголовок h6 + + +Это заголовок h1 +================ + +А это заголовок h2 +------------------ + + + + + +*Этот текст будет выведен курсивом.* +_Также как этот._ + +**А этот текст будет полужирным.** +__И этот тоже.__ + +***Полужирный курсив.*** +**_И тут!_** +*__И даже здесь!__* + + + +~~Зачёркнутый текст.~~ + + + +Это параграф. Всё предельно просто. + +А тут уже параграф №2. +Эта строка всё ещё относится к параграфу №2! + + +О, а вот это уже параграф №3! + + + +Принудительный
перенос! + + + +> Это цитата. В цитатах можно +> принудительно переносить строки, вставляя ">" в начало каждой следующей строки. А можно просто оставлять достаточно длинными, и такие длинные строки будут перенесены автоматически. +> Разницы между этими двумя подходами к переносу строк нет, коль скоро +> каждая строка начинается с символа ">" + +> А ещё цитаты могут быть многоуровневыми: +>> как здесь +>>> и здесь :) +> Неплохо? + + + + +* Список, +* Размеченный +* "Звёздочками" + +либо + ++ Список, ++ Размеченный ++ "Плюсами" + +либо + +- Список, +- Размеченный +- "Дефисами" + + + +1. Первый элемент +2. Второй элемент +3. Третий элемент + + + +1. Первый элемент +1. Второй элемент +1. Третий элемент + + + + +1. Введение +2. Начало работы +3. Примеры использования + * Простые + * Сложные +4. Заключение + + + + + Это код, + причём - многострочный + + + + my_array.each do |item| + puts item + end + + + +Например, можно выделить имя функции `go_to()` прямо посреди текста. + + + +\`\`\`ruby +def foobar + puts "Hello world!" +end +\`\`\` + +<-- Обратите внимание: фрагмент, указанный выше, не предваряется отступами, +поскольку Github сам в состоянии определить границы блока - по строкам "```" --> + + + + +*** +--- +- - - +**************** + + + + +[Ссылка!](http://test.com/) + + + +[Ссылка!](http://test.com/ "Ссылка на Test.com") + + + +[Перейти к музыке](/music/). + + + +[Здесь][link1] высможете узнать больше! +А можно кликнуть [сюда][foobar], если очень хочется. + + +[link1]: http://test.com/ "Круто!" +[foobar]: http://foobar.biz/ "Тоже хорошо!" + + + + + +Ссылка на [Google][]. + +[google]: http://google.com/ + + + + + + +![Альтернативный текст для изображения](http://imgur.com/myimage.jpg "Подсказка") + + + +![Альтернативный текст][myimage] + +![То же изображение ещё раз][myimage] + +[myimage]: relative/urls/cool/image.jpg "подсказка" + + + + +Ссылка вида эквивалентна +[http://testwebsite.com/](http://testwebsite.com/) + + + + + + + + + +\*текст, заключённый в звёздочки!\* + + + + +| Колонка 1 | Колонка 2 | Колонка 3 | +| :----------- | :----------: | -----------: | +| Выравнивание | Выравнивание | Выравнивание | +| влево | по центру | вправо | + + + +Колонка 1|Колонка 2|Колонка 3 +:--|:-:|--: +Выглядит|это|страшновато... + + + +``` + +За более подробной информацией обращайтесь к [статье](http://daringfireball.net/projects/markdown/syntax) Джона Грубера о синтаксисе Markdown. + +Также часто бывает полезной отличная ["шпаргалка"](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) по Markdown от Adam Pritchard. + +Если вдруг встретите ошибки в переводе или же захотите его дополнить, делайте pull requests - авторы всегда рады обратной связи! From 16b1249444203485168124bfa54c66b3b1abf1ee Mon Sep 17 00:00:00 2001 From: Aleksey Pirogov Date: Sat, 13 Sep 2014 22:34:40 +0400 Subject: [PATCH 02/68] Markdown-ru: language tag --- ru-ru/markdown-ru.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ru-ru/markdown-ru.html.markdown b/ru-ru/markdown-ru.html.markdown index c8b643b6..8b2a0982 100644 --- a/ru-ru/markdown-ru.html.markdown +++ b/ru-ru/markdown-ru.html.markdown @@ -3,7 +3,8 @@ language: markdown contributors: - ["Dan Turkel", "http://danturkel.com/"] - ["Pirogov Alexey", "http://twitter.com/alex_pir"] -filename: markdown.md +filename: markdown-ru.md +lang: ru-ru --- Язык разметки Markdown создан Джоном Грубером (англ. John Gruber) и Аароном Шварцем (англ. Aaron H. Swartz) в 2004 году. Авторы задавались целью создать максимально удобочитаемый и удобный в публикации облегчённый язык разметки, пригодный для последующего преобразования в HTML (а также и в другие форматы). From b52a32dd2439c293892b72e35b57b4887a5a53cf Mon Sep 17 00:00:00 2001 From: "Gregory S. Kielian" Date: Sat, 27 Sep 2014 12:04:25 -0700 Subject: [PATCH 03/68] Added `sed` and `grep` examples to useful-commands --- bash.html.markdown | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bash.html.markdown b/bash.html.markdown index dc7d32b6..0f571e83 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -9,6 +9,7 @@ contributors: - ["akirahirose", "https://twitter.com/akirahirose"] - ["Anton Strömkvist", "http://lutic.org/"] - ["Rahil Momin", "https://github.com/iamrahil"] + - ["Gregrory Kielian", "https://github.com/gskielian"] filename: LearnBash.sh --- @@ -199,4 +200,8 @@ sort file.txt uniq -d file.txt # prints only the first column before the ',' character cut -d ',' -f 1 file.txt +# replaces every occurance of 'apples' with 'oranges' in file.txt +sed -i 's/apples/oranges/g' file.txt +# prints the number of occurances of "foo" in file.txt +grep -c "foo" file.txt ``` From e9c21740df4c93ee4575eca41b0028fa2d90ce1b Mon Sep 17 00:00:00 2001 From: "Gregory S. Kielian" Date: Sat, 27 Sep 2014 12:06:36 -0700 Subject: [PATCH 04/68] amended grep description --- bash.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash.html.markdown b/bash.html.markdown index 0f571e83..fd347488 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -202,6 +202,6 @@ uniq -d file.txt cut -d ',' -f 1 file.txt # replaces every occurance of 'apples' with 'oranges' in file.txt sed -i 's/apples/oranges/g' file.txt -# prints the number of occurances of "foo" in file.txt +# prints the number of lines with the string "foo" in file.txt grep -c "foo" file.txt ``` From d22d591e3e2120dd1bed70cd8093569c8b7101c2 Mon Sep 17 00:00:00 2001 From: "Gregory S. Kielian" Date: Sat, 27 Sep 2014 12:12:56 -0700 Subject: [PATCH 05/68] amended sed and bash descriptions --- bash.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash.html.markdown b/bash.html.markdown index fd347488..160fe8f2 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -200,8 +200,8 @@ sort file.txt uniq -d file.txt # prints only the first column before the ',' character cut -d ',' -f 1 file.txt -# replaces every occurance of 'apples' with 'oranges' in file.txt +# replaces every occurrence of 'apples' with 'oranges' in file.txt sed -i 's/apples/oranges/g' file.txt -# prints the number of lines with the string "foo" in file.txt +# prints the number of lines containing the string "foo" in file.txt grep -c "foo" file.txt ``` From 923a8ed99b1648cc2ece83660ed263492c332afe Mon Sep 17 00:00:00 2001 From: "C. Bess" Date: Sat, 4 Oct 2014 12:08:23 -0500 Subject: [PATCH 06/68] - mo betta examples - add `inout` example - better `optional` example - Playground issue has been resolved, uncommented `protocol` example --- swift.html.markdown | 81 +++++++++++++++++++++++++++++++++------------ 1 file changed, 59 insertions(+), 22 deletions(-) diff --git a/swift.html.markdown b/swift.html.markdown index 77047355..ffe6cac2 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -13,6 +13,9 @@ The official [Swift Programming Language](https://itunes.apple.com/us/book/swift See also Apple's [getting started guide](https://developer.apple.com/library/prerelease/ios/referencelibrary/GettingStarted/LandingPage/index.html), which has a complete tutorial on Swift. ```swift +// import a module +import UIKit + // // MARK: Basics // @@ -26,7 +29,7 @@ println("Hello, world") var myVariable = 42 let øπΩ = "value" // unicode variable names -let myConstant = 3.1415926 +let π = 3.1415926 let convenience = "keyword" // contextual variable name let weak = "keyword"; let override = "another keyword" // statements can be separated by a semi-colon let `class` = "keyword" // backticks allow keywords to be used as variable names @@ -34,9 +37,24 @@ let explicitDouble: Double = 70 let intValue = 0007 // 7 let largeIntValue = 77_000 // 77000 let label = "some text " + String(myVariable) // Casting -let piText = "Pi = \(myConstant), Pi 2 = \(myConstant * 2)" // String interpolation -var optionalString: String? = "optional" // Can be nil -optionalString = nil +let piText = "Pi = \(π), Pi 2 = \(π * 2)" // String interpolation +var someOptionalString: String? = "optional" // Can be nil + +if someOptionalString != nil { + // I am not nil + if someOptionalString!.hasPrefix("opt") { + println("has the prefix") + } + + let empty = someOptionalString?.isEmpty +} +someOptionalString = nil + +if let someStringConstant = someOptionalString { + // has Some value +} + +// AnyObject == id /* Comment here @@ -84,9 +102,10 @@ for (key, value) in dict { } // for loop (range) -for i in -1...1 { // [-1, 0, 1] +for i in -1...shoppingList.count { println(i) } +shoppingList[1...2] = ["steak", "peacons"] // use ..< to exclude the last number // while loop @@ -123,14 +142,14 @@ default: // required (in order to cover all possible input) // Function with Swift header docs (format as reStructedText) /** - A greet operation +A greet operation - - A bullet in docs - - Another bullet in the docs +- A bullet in docs +- Another bullet in the docs - :param: name A name - :param: day A day - :returns: A string containing the name and day value. +:param: name A name +:param: day A day +:returns: A string containing the name and day value. */ func greet(name: String, day: String) -> String { return "Hello \(name), today is \(day)." @@ -141,9 +160,16 @@ greet("Bob", "Tuesday") func getGasPrices() -> (Double, Double, Double) { return (3.59, 3.69, 3.79) } +let pricesTuple = getGasPrices() +let price = pricesTuple.2 // 3.79 +println("Gas price: \(price)") // Variadic Args -func setup(numbers: Int...) {} +func setup(numbers: Int...) { + // its an array + let number = numbers[0] + let argCount = numbers.count +} // Passing and returning functions func makeIncrementer() -> (Int -> Int) { @@ -155,6 +181,17 @@ func makeIncrementer() -> (Int -> Int) { var increment = makeIncrementer() increment(7) +// pass by ref +func swapTwoInts(inout a: Int, inout b: Int) { + let tempA = a + a = b + b = tempA +} +var someIntA = 7 +var someIntB = 3 +swapTwoInts(&someIntA, &someIntB) +println(someIntB) // 7 + // // MARK: Closures @@ -197,7 +234,7 @@ print(numbers) // [3, 6, 18] // Structures and classes have very similar capabilites struct NamesTable { let names: [String] - + // Custom subscript subscript(index: Int) -> String { return names[index] @@ -239,7 +276,7 @@ internal class Rect: Shape { sideLength = newValue / 4 } } - + // Lazily load a property // subShape remains nil (uninitialized) until getter called lazy var subShape = Rect(sideLength: 4) @@ -255,8 +292,9 @@ internal class Rect: Shape { } init(sideLength: Int) { - super.init() self.sideLength = sideLength + // always super.init last when init custom properties + super.init() } func shrink() { @@ -313,7 +351,7 @@ enum Suit { // // `protocol`s can require that conforming types have specific -// instance properties, instance methods, type methods, +// instance properties, instance methods, type methods, // operators, and subscripts. protocol ShapeGenerator { @@ -321,7 +359,6 @@ protocol ShapeGenerator { func buildShape() -> Shape } -/* // Protocols declared with @objc allow optional functions, // which allow you to check for conformance @objc protocol TransformShape { @@ -331,17 +368,17 @@ protocol ShapeGenerator { class MyShape: Rect { var delegate: TransformShape? - + func grow() { sideLength += 2 - + if let allow = self.delegate?.canReshape?() { // test for delegate then for method self.delegate?.reshaped?() } } } -*/ + // // MARK: Other @@ -363,7 +400,7 @@ extension Int { var customProperty: String { return "This is \(self)" } - + func multiplyBy(num: Int) -> Int { return num * self } @@ -372,7 +409,7 @@ extension Int { println(7.customProperty) // "This is 7" println(14.multiplyBy(2)) // 42 -// Generics: Similar to Java. Use the `where` keyword to specify the +// Generics: Similar to Java and C#. Use the `where` keyword to specify the // requirements of the generics. func findIndex(array: [T], valueToFind: T) -> Int? { From d83a0f038558cf32680287417bbd692b33fe13cc Mon Sep 17 00:00:00 2001 From: "Gregory S. Kielian" Date: Sat, 4 Oct 2014 14:50:00 -0700 Subject: [PATCH 07/68] Changed descriptions, added grep, fgrep examples --- bash.html.markdown | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bash.html.markdown b/bash.html.markdown index 160fe8f2..9b199b8c 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -200,8 +200,12 @@ sort file.txt uniq -d file.txt # prints only the first column before the ',' character cut -d ',' -f 1 file.txt -# replaces every occurrence of 'apples' with 'oranges' in file.txt -sed -i 's/apples/oranges/g' file.txt -# prints the number of lines containing the string "foo" in file.txt -grep -c "foo" file.txt +# replaces every occurrence of 'okay' with 'great' in file.txt, (regex compatible) +sed -i 's/okay/great/g' file.txt +# print to stdout all lines of file.txt which match some regex, the example prints lines which beginning with "foo" and end in "bar" +grep "^foo.*bar$" file.txt +# pass the option "-c" to instead print the number of lines matching the regex +grep -c "^foo.*bar$" file.txt +# if you literally want to search for the string, and not the regex, use fgrep (or grep -F) +fgrep "^foo.*bar$" file.txt ``` From 645233dce9b4d97f1958dbb08b18551b9bfe906d Mon Sep 17 00:00:00 2001 From: Simon Neveu Date: Wed, 8 Oct 2014 09:38:07 +0100 Subject: [PATCH 08/68] Init haml md --- haml.html.markdown | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 haml.html.markdown diff --git a/haml.html.markdown b/haml.html.markdown new file mode 100644 index 00000000..cde76eee --- /dev/null +++ b/haml.html.markdown @@ -0,0 +1,8 @@ +--- +language: haml +filename: learnhaml.haml +contributors: + - ["Simon Neveu", "https://github.com/sneveu"] +--- + +HAML is a \ No newline at end of file From 269d717224db16057d8c0f20084df533d8dc45dd Mon Sep 17 00:00:00 2001 From: Simon Neveu Date: Wed, 8 Oct 2014 23:18:30 +0100 Subject: [PATCH 09/68] added comments, tags, classes, and attributes --- haml.html.markdown | 64 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/haml.html.markdown b/haml.html.markdown index cde76eee..124f160b 100644 --- a/haml.html.markdown +++ b/haml.html.markdown @@ -5,4 +5,66 @@ contributors: - ["Simon Neveu", "https://github.com/sneveu"] --- -HAML is a \ No newline at end of file +Haml is a markup language predominantly used with Ruby that’s used to cleanly and simply describe the HTML of any web document without the use of inline code. It encourages well-written markup. + +Haml aims to reduce repetition in your markup by closing tags for you based on the structure of the indents in your code. The result is markup that is well-structured, DRY, logical, and easier to read. + +```haml +/ ------------------------------------------- +/ Comments +/ ------------------------------------------- + +/ This is what a comment looks like haml + +/ + To write a multi line comment, indent your commented code to be + wrapped by the forward slash + +-# This is a silent comment, which means it wont be rendered into the doc at all + + +/ ------------------------------------------- +/ Html elements +/ ------------------------------------------- + +/ To write your tags, use the percent sign followed by the name of the tag +%body + %header + %nav + +/ Notice no closing tags. The above code would output + + +
+ +
+ + +/ Divs are the default elements so they can be written simply like this +.foo + +/ To add content to a tag, nest it +%h1 Headline copy + +/ + To output a ruby value as the contents of the tag, use an equals sign followed + by the ruby code + +%h1= author.name + +/ Classes can be added to your tags either by chaining .classnames to the tag +%div.foo.bar + +/ or as part of a ruby hash +%div{:class => 'foo bar'} + +/ Attributes for any tag can be added in the hash +%a{:href => '#', :class => 'bar', :title => 'Bar'} + +/ For boolean attributes assign the value 'true' +%input{:selected => true} + +/ To write data-attributes, use the :data key with it's value as another hash +%div{:data => {:attribute => 'foo'}} + + From f6a604e1551233cb2f9b6a2c2c723f0acdc84f50 Mon Sep 17 00:00:00 2001 From: Simon Neveu Date: Wed, 8 Oct 2014 23:25:21 +0100 Subject: [PATCH 10/68] Copy change to intro and formatting --- haml.html.markdown | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/haml.html.markdown b/haml.html.markdown index 124f160b..60dc5426 100644 --- a/haml.html.markdown +++ b/haml.html.markdown @@ -1,13 +1,17 @@ --- language: haml -filename: learnhaml.haml +filename: learnhaml.html.haml contributors: - ["Simon Neveu", "https://github.com/sneveu"] --- -Haml is a markup language predominantly used with Ruby that’s used to cleanly and simply describe the HTML of any web document without the use of inline code. It encourages well-written markup. +Haml is a markup language predominantly used with Ruby that cleanly +and simply describes the HTML of any web document without the use of +inline code. -Haml aims to reduce repetition in your markup by closing tags for you based on the structure of the indents in your code. The result is markup that is well-structured, DRY, logical, and easier to read. +It aims to reduce repetition in your markup by closing tags for you +based on the structure of the indents in your code. The result is +markup that is well-structured, DRY, logical, and easier to read. ```haml / ------------------------------------------- From 46f174fab100f31659f3141a9aeca137035e34b3 Mon Sep 17 00:00:00 2001 From: Simon Neveu Date: Wed, 8 Oct 2014 23:32:22 +0100 Subject: [PATCH 11/68] testing git config --- haml.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/haml.html.markdown b/haml.html.markdown index 60dc5426..9cde462e 100644 --- a/haml.html.markdown +++ b/haml.html.markdown @@ -13,6 +13,7 @@ It aims to reduce repetition in your markup by closing tags for you based on the structure of the indents in your code. The result is markup that is well-structured, DRY, logical, and easier to read. + ```haml / ------------------------------------------- / Comments From d1ef1771ad5448c3c004f1aec3e8b836df3cb96e Mon Sep 17 00:00:00 2001 From: Simon Neveu Date: Thu, 9 Oct 2014 23:13:37 +0100 Subject: [PATCH 12/68] Added filters, ruby interpolation and additional resources --- haml.html.markdown | 82 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 74 insertions(+), 8 deletions(-) diff --git a/haml.html.markdown b/haml.html.markdown index 9cde462e..47da2aee 100644 --- a/haml.html.markdown +++ b/haml.html.markdown @@ -7,7 +7,8 @@ contributors: Haml is a markup language predominantly used with Ruby that cleanly and simply describes the HTML of any web document without the use of -inline code. +inline code. It is a popular alternative to using rails templating +language (.erb) and allows you to embed ruby code into your markup. It aims to reduce repetition in your markup by closing tags for you based on the structure of the indents in your code. The result is @@ -19,7 +20,7 @@ markup that is well-structured, DRY, logical, and easier to read. / Comments / ------------------------------------------- -/ This is what a comment looks like haml +/ This is what a comment looks like haml. / To write a multi line comment, indent your commented code to be @@ -38,7 +39,6 @@ markup that is well-structured, DRY, logical, and easier to read. %nav / Notice no closing tags. The above code would output -
@@ -48,14 +48,25 @@ markup that is well-structured, DRY, logical, and easier to read. / Divs are the default elements so they can be written simply like this .foo -/ To add content to a tag, nest it +/ To add content to a tag, add the text directly after the declaration %h1 Headline copy -/ - To output a ruby value as the contents of the tag, use an equals sign followed - by the ruby code +/ To write multiline content, nest it instead +%p + This is a lot of content that we could probably split onto two + separate lines. -%h1= author.name +/ You can escape html by using the ampersand and equals sign ( &= ) +%p + &= "Yes & yes" + +/ which would output 'Yes & yes' + +/ You can unescape html by using the bang and equals sign ( != ) +%p + != "This is how you write a paragraph tag

" + +/ which would output 'This is how you write a paragraph tag

' / Classes can be added to your tags either by chaining .classnames to the tag %div.foo.bar @@ -73,3 +84,58 @@ markup that is well-structured, DRY, logical, and easier to read. %div{:data => {:attribute => 'foo'}} +/ ------------------------------------------- +/ Inserting Ruby +/ ------------------------------------------- + +/ + To output a ruby value as the contents of a tag, use an equals sign followed + by the ruby code + +%h1= book.name + +%p + = book.author + = book.publisher + + +/ To run some ruby code without rendering it to the html, use a hyphen instead +- books = ['book one', 'book 2', 'book 3'] + +/ Allowing you to do all sorts of awesome, like ruby blocks +- books.shuffle.each_with_index do |book, index| + %h1= book + + if book do + %p This is a book + +/ + Again, no need to add the closing tags to the block, even for the ruby. + Indentation will take care of that for you. + + +/ ------------------------------------------- +/ Inline Ruby / Ruby interpolation +/ ------------------------------------------- + +/ Include a ruby variable in a line of plain text using #{} +%p Your highest scoring game is #{best_game} + + +/ ------------------------------------------- +/ Filters +/ ------------------------------------------- + +/ + Use the colon to define haml filters, one example of a filter you can + use is :javascript, which can be used for writing inline js + + :javascript + console.log('This is inline + + +``` + +### Optimizing a whole project using r.js + +Many people prefer using AMD for sane code organization during development, but still want to ship a single script file in production instead of performing hundreds of XHRs on page load. + +`require.js` comes with a script called `r.js` (that you will probably run in node.js, although Rhino is supported too) that can analyse your project's dependency graph, and build a single file containing all your modules (properly named), minified and ready for consumption. + +Install it using `npm`: +```sh +$ npm install requirejs -g +``` +Now you can feed it with a configuration file: +```sh +$ r.js -o app.build.js +``` +For our above example the configuration might look like: +```javascript +/* file : app.build.js */ +({ + name : 'main', // name of the entry point + out : 'main-built.js', // name of the file to write the output to + baseUrl : 'app', + paths : { + // `empty:` tells r.js that this should still be loaded from the CDN, using + // the location specified in `main.js` + jquery : 'empty:', + coolLibFromBower : '../bower_components/cool-lib/coollib' + } +}) +``` +To use the built file in production, simply swap `data-main`: +```html + +``` +An incredibly detailed [overview of build options](https://github.com/jrburke/r.js/blob/master/build/example.build.js) is available in the GitHub repo. + +### Topics not covered in this tutorial +* [Loader plugins / transforms](http://requirejs.org/docs/plugins.html) +* [CommonJS style loading and exporting](http://requirejs.org/docs/commonjs.html) +* [Advanced configuration](http://requirejs.org/docs/api.html#config) +* [Shim configuration (loading non-AMD modules)](http://requirejs.org/docs/api.html#config-shim) +* [CSS loading and optimizing with require.js](http://requirejs.org/docs/optimization.html#onecss) +* [Using almond.js for builds](https://github.com/jrburke/almond) + +### Further reading: + +* [Official Spec](https://github.com/amdjs/amdjs-api/wiki/AMD) +* [Why AMD?](http://requirejs.org/docs/whyamd.html) +* [Universal Module Definition](https://github.com/umdjs/umd) + +### Implementations: + +* [require.js](http://requirejs.org) +* [dojo toolkit](http://dojotoolkit.org/documentation/tutorials/1.9/modules/) +* [cujo.js](http://cujojs.com/) +* [curl.js](https://github.com/cujojs/curl) +* [lsjs](https://github.com/zazl/lsjs) +* [mmd](https://github.com/alexlawrence/mmd) From e2913890cbc9d79d7840cead6157ff8e0f3216f9 Mon Sep 17 00:00:00 2001 From: Geoffrey Liu Date: Sun, 12 Oct 2014 13:43:05 -0700 Subject: [PATCH 27/68] Corrections Merci @Oire ! --- fr-fr/xml-fr.html.markdown | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/fr-fr/xml-fr.html.markdown b/fr-fr/xml-fr.html.markdown index 4dd09937..d7e76892 100644 --- a/fr-fr/xml-fr.html.markdown +++ b/fr-fr/xml-fr.html.markdown @@ -9,7 +9,7 @@ filename: learnxml.xml XML est un langage de balisage conçu pour stocker et transporter les informations. -Contrairement à HTML, XML ne spécifie pas comment afficher ou formater les informations, juste comment le porter. +Contrairement à HTML, XML ne spécifie pas comment afficher ou formater les informations, juste comment les porter. * La syntaxe XML @@ -17,40 +17,40 @@ Contrairement à HTML, XML ne spécifie pas comment afficher ou formater les inf - + Everyday Italian Giada De Laurentiis 2005 30.00 - + Harry Potter J. K. Rowling 2005 29.99 - + Learning XML Erik T. Ray 2003 39.95 - + - @@ -62,9 +62,9 @@ On crée les nœuds avec des balises d'ouverture / fermeture, et les enfants son ``` -* Un document bien-formaté & le validation +* Un document bien formaté & le validation -Un document XML est bien formaté s'il est syntaxiquement correcte. +Un document XML est bien formaté s'il est syntaxiquement correct. Cependant, il est possible d'injecter plus de contraintes dans le document, en utilisant les définitions de documents, tels que les schémas DTD et XML. @@ -79,19 +79,19 @@ Avec cet outil, vous pouvez vérifier les données XML en dehors de la logique d    avec l'addition de définition DTD. --> - - + + Everyday Italian 30.00 - + + @@ -103,25 +103,25 @@ Avec cet outil, vous pouvez vérifier les données XML en dehors de la logique d    Chaque «livre» doit contenir exactement un «titre» et «prix» et un attribut    appelé «catégorie», avec «littérature» comme valeur par défaut.    Les nœuds de «titre» et «prix» contiennent des informations de caractère analysés - (anglais: «parsed character data») --> + (Anglais: «parsed character data») --> - + + ]> - + Everyday Italian 30.00 - + ``` From 8e9d5af1ea5680bbf5f232d5510f35f3c69619c2 Mon Sep 17 00:00:00 2001 From: Matt Kline Date: Sun, 12 Oct 2014 23:35:49 -0700 Subject: [PATCH 28/68] Minor C++ fixes --- c++.html.markdown | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/c++.html.markdown b/c++.html.markdown index ce2d2d65..b55a764c 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -150,7 +150,7 @@ int main() #include // Include for I/O streams -using namespace std; +using namespace std; // Streams are in the std namespace (standard library) int main() { @@ -175,7 +175,7 @@ int main() // Strings in C++ are objects and have many member functions #include -using namespace std; // Strings are in the namespace std (standard library) +using namespace std; // Strings are also in the namespace std (standard library) string myString = "Hello"; string myOtherString = " World"; @@ -210,7 +210,7 @@ string bar = "I am bar"; string& fooRef = foo; // This creates a reference to foo. fooRef += ". Hi!"; // Modifies foo through the reference -cout << foo; // Prints "I am foo. Hi!" +cout << fooRef; // Prints "I am foo. Hi!" fooRef = bar; // Error: references cannot be reassigned. @@ -373,6 +373,9 @@ public: // Overload the += operator Point& operator+=(const Point& rhs); + + // It would also make sense to add the - and -= operators, + // but we will skip those for brevity. }; Point Point::operator+(const Point& rhs) const From eadecf8b95eba4afec302c0ab49b0ca0ca921299 Mon Sep 17 00:00:00 2001 From: Matt Kline Date: Fri, 17 Oct 2014 00:03:33 -0700 Subject: [PATCH 29/68] Spell out favorite (instead of fav) in C++ doc --- c++.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/c++.html.markdown b/c++.html.markdown index b55a764c..4a070d95 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -157,13 +157,13 @@ int main() int myInt; // Prints to stdout (or terminal/screen) - cout << "Enter your fav number:\n"; + cout << "Enter your favorite number:\n"; // Takes in input cin >> myInt; // cout can also be formatted - cout << "Your fav number is " << myInt << "\n"; - // Your fav number is ## + cout << "Your favorite number is " << myInt << "\n"; + // prints "Your favorite number is " cerr << "Used for error messages"; } From fbf3c6d588cf39525afd23cb01230a997440dfcf Mon Sep 17 00:00:00 2001 From: Matt Kline Date: Fri, 17 Oct 2014 00:57:32 -0700 Subject: [PATCH 30/68] Add C++ section about RAII Future contributions will include standard library containers and C++11 features. --- c++.html.markdown | 130 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 129 insertions(+), 1 deletion(-) diff --git a/c++.html.markdown b/c++.html.markdown index 4a070d95..dbca751f 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -263,7 +263,7 @@ public: // Along with constructors, C++ provides destructors. // These are called when an object is deleted or falls out of scope. // This enables powerful paradigms such as RAII - // (http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) + // (see below) // Destructors must be virtual to allow classes to be derived from this one. virtual ~Dog(); @@ -427,6 +427,134 @@ catch (const std::exception& ex) std::cout << "Unknown exception caught"; throw; // Re-throws the exception } + +/////// +// RAII +/////// + +// RAII stands for Resource Allocation Is Initialization. +// It is often considered the most powerful paradigm in C++, +// and is the simple concept that a constructor for an object +// acquires that object's resources and the destructor releases them. + +// To understand how this is useful, +// consider a function that uses a C file handle: +void doSomethingWithAFile(const char* filename) +{ + // To begin with, assume nothing can fail. + + FILE* fh = fopen(filename, "r"); // Open the file in read mode. + + doSomethingWithTheFile(fh); + doSomethingElseWithIt(fh); + + fclose(fh); // Close the file handle. +} + +// Unfortunately, things are quickly complicated by error handling. +// Suppose fopen can fail, and that doSomethingWithTheFile and +// doSomethingElseWithIt return error codes if they fail. +// (Exceptions are the preferred way of handling failure, +// but some programmers, especially those with a C background, +// disagree on the utility of exceptions). +// We now have to check each call for failure and close the file handle +// if a problem occurred. +bool doSomethingWithAFile(const char* filename) +{ + FILE* fh = fopen(filename, "r"); // Open the file in read mode + if (fh == nullptr) // The returned pointer is null on failure. + reuturn false; // Report that failure to the caller. + + // Assume each function returns false if it failed + if (!doSomethingWithTheFile(fh)) { + fclose(fh); // Close the file handle so it doesn't leak. + return false; // Propagate the error. + } + if (!doSomethingElseWithIt(fh)) { + fclose(fh); // Close the file handle so it doesn't leak. + return false; // Propagate the error. + } + + fclose(fh); // Close the file handle so it doesn't leak. + return true; // Indicate success +} + +// C programmers often clean this up a little bit using goto: +bool doSomethingWithAFile(const char* filename) +{ + FILE* fh = fopen(filename, "r"); + if (fh == nullptr) + reuturn false; + + if (!doSomethingWithTheFile(fh)) + goto failure; + + if (!doSomethingElseWithIt(fh)) + goto failure; + + fclose(fh); // Close the file + return true; // Indicate success + +failure: + fclose(fh); + return false; // Propagate the error +} + +// If the functions indicate errors using exceptions, +// things are a little cleaner, but still sub-optimal. +void doSomethingWithAFile(const char* filename) +{ + FILE* fh = fopen(filename, "r"); // Open the file in read mode + if (fh == nullptr) + throw std::exception("Could not open the file."); + + try { + doSomethingWithTheFile(fh); + doSomethingElseWithIt(fh); + } + catch (...) { + fclose(fh); // Be sure to close the file if an error occurs. + throw; // Then re-throw the exception. + } + + fclose(fh); // Close the file + // Everything succeeded +} + +// Compare this to the use of C++'s file stream class (fstream) +// fstream uses its destructor to close the file. +// Recall from above that destructors are automatically called +// whenver an object falls out of scope. +void doSomethingWithAFile(const std::string& filename) +{ + // ifstream is short for input file stream + std::ifstream fh(filename); // Open the file + + // Do things with the file + doSomethingWithTheFile(fh); + doSomethingElseWithIt(fh); + +} // The file is automatically closed here by the destructor + +// This has _massive_ advantages: +// 1. No matter what happens, +// the resource (in this case the file handle) will be cleaned up. +// Once you write the destructor correctly, +// It is _impossible_ to forget to close the handle and leak the resource. +// 2. Note that the code is much cleaner. +// The destructor handles closing the file behind the scenes +// without you having to worry about it. +// 3. The code is exception safe. +// An exception can be thrown anywhere in the function and cleanup +// will still occur. + +// All idiomatic C++ code uses RAII extensively for all resources. +// Additional examples include +// - Memory using unique_ptr and shared_ptr +// - Containers - the standard library linked list, +// vector (i.e. self-resizing array), hash maps, and so on +// all automatically destroy their contents when they fall out of scope. +// - Mutexes using lock_guard and unique_lock ``` Futher Reading: From 03d1bc5ed97f16627afc64d4c7a53e84a0281906 Mon Sep 17 00:00:00 2001 From: Matt Kline Date: Fri, 17 Oct 2014 18:42:30 -0700 Subject: [PATCH 31/68] Address @levibostian's concerns for #800 --- c++.html.markdown | 56 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 15 deletions(-) diff --git a/c++.html.markdown b/c++.html.markdown index dbca751f..50de5eff 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -7,12 +7,14 @@ contributors: lang: en --- -C++ was designed as a systems programming language that +C++ is a systems programming language that, +[according to its inventor Bjarne Stroustrup](http://channel9.msdn.com/Events/Lang-NEXT/Lang-NEXT-2014/Keynote), +was designed to -- is a "better C" -- supports data abstraction -- supports object-oriented programming -- supports generic programming +- be a "better C" +- support data abstraction +- support object-oriented programming +- support generic programming Though its syntax can be more difficult or complex than newer languages, it is widely used because it compiles to native instructions that can be @@ -32,9 +34,21 @@ one of the most widely-used programming languages. // A main() function in C++ should return an int, // though void main() is accepted by most compilers (gcc, clang, etc.) -int main() // or int main(int argc, char** argv) +// This value serves as the program's exit status. +// See http://en.wikipedia.org/wiki/Exit_status for more information. +int main(int argc, char** argv) { - return 0; // Can also end without return statement + // Command line arguments are passed in by argc and argv in the same way + // they are in C. + // argc indicates the number of arguments, + // and argv is an array of C-style strings (char*) + // representing the arguments. + // The first argument is the name by which the program was called. + // argc and argv can be omitted if you do not care about arguments, + // giving the function signature of int main() + + // An exit status of 0 indicates success. + return 0; } // In C++, character literals are one byte. @@ -82,21 +96,33 @@ void print(int myInt) int main() { - printing("Hello"); // Resolves to void print(const char*) - printing(15); // Resolves to void print(int) + print("Hello"); // Resolves to void print(const char*) + print(15); // Resolves to void print(int) } ///////////////////////////// // Default function arguments ///////////////////////////// -void two_ints(int a = 1, int b = 4); +// You can provide default arguments for a function +// if they are not provided by the caller. + +void doSomethingWithInts(int a = 1, int b = 4) +{ + // Do something with the ints here +} int main() { - two_ints(); // a = 1, b = 4 - two_ints(20); // a = 20, b = 4 - two_ints(20, 5); // a = 20, b = 5 + doSomethingWithInts(); // a = 1, b = 4 + doSomethingWithInts(20); // a = 20, b = 4 + doSomethingWithInts(20, 5); // a = 20, b = 5 +} + +// Default arguments must be at the end of the arguments list. + +void invalidDeclaration(int a = 1, int b) // Error! +{ } @@ -106,7 +132,7 @@ int main() // Namespaces provide separate scopes for variable, function, // and other declarations. -// Namespaces can be nested +// Namespaces can be nested. namespace First { namespace Nested { @@ -362,7 +388,7 @@ public: Point() { }; // The following syntax is known as an initialization list - // and is the proper way to initialize class member values + // and is the proper way to initialize class member values Point (double a, double b) : x(a), y(b) From 01b671bf398001647650db24dcc51f584ea82490 Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Fri, 17 Oct 2014 20:54:45 -0500 Subject: [PATCH 32/68] Fix beginning typo from bash --- bash.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash.html.markdown b/bash.html.markdown index 9b199b8c..11c1f3a2 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -202,7 +202,7 @@ uniq -d file.txt cut -d ',' -f 1 file.txt # replaces every occurrence of 'okay' with 'great' in file.txt, (regex compatible) sed -i 's/okay/great/g' file.txt -# print to stdout all lines of file.txt which match some regex, the example prints lines which beginning with "foo" and end in "bar" +# print to stdout all lines of file.txt which match some regex, the example prints lines which begin with "foo" and end in "bar" grep "^foo.*bar$" file.txt # pass the option "-c" to instead print the number of lines matching the regex grep -c "^foo.*bar$" file.txt From 0ec14c6914ae9a0c968b8f2e70e31b43f3aaaf73 Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Fri, 17 Oct 2014 20:57:18 -0500 Subject: [PATCH 33/68] Add fixes from @marcom's PR https://github.com/adambard/learnxinyminutes-docs/pull/765 --- c.html.markdown | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/c.html.markdown b/c.html.markdown index 10e6fa45..6daabe94 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -5,6 +5,7 @@ contributors: - ["Adam Bard", "http://adambard.com/"] - ["Árpád Goretity", "http://twitter.com/H2CO3_iOS"] - ["Jakub Trzebiatowski", "http://cbs.stgn.pl"] + - ["Marco Scannadinari", "https://marcoms.github.io"] --- @@ -21,6 +22,10 @@ memory management and C will take you as far as you need to go. Multi-line comments look like this. They work in C89 as well. */ +/* +Multi-line comments don't nest /* Be careful */ // comment ends on this line... +*/ // ...not this one! + // Constants: #define #define DAYS_IN_YEAR 365 @@ -74,10 +79,10 @@ int main() { long long x_long_long = 0; // floats are usually 32-bit floating point numbers - float x_float = 0.0; + float x_float = 0.0f; // 'f' suffix here denotes floating point literal // doubles are usually 64-bit floating-point numbers - double x_double = 0.0; + double x_double = 0.0; // real numbers without any suffix are doubles // Integral types may be unsigned. unsigned short ux_short; From 780826ac277bdbbc7d6841facbcc8df9f19b22f3 Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Fri, 17 Oct 2014 20:58:45 -0500 Subject: [PATCH 34/68] Fix typos from amd.html PR https://github.com/adambard/learnxinyminutes-docs/pull/803 --- amd.html.markdown | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/amd.html.markdown b/amd.html.markdown index 3500fa58..36210d03 100644 --- a/amd.html.markdown +++ b/amd.html.markdown @@ -8,7 +8,11 @@ filename: learnamd.js ## Getting Started with AMD -The **Asynchronous Module Definition** API specifies a mechanism for defining JavaScript modules such that the module and its dependencies can be asynchronously loaded. This is particularly well suited for the browser environment where synchronous loading of modules incurs performance, usability, debugging, and cross-domain access problems. +The **Asynchronous Module Definition** API specifies a mechanism for defining +JavaScript modules such that the module and its dependencies can be asynchronously +loaded. This is particularly well suited for the browser environment where +synchronous loading of modules incurs performance, usability, debugging, and +cross-domain access problems. ### Basic concept ```javascript @@ -55,7 +59,7 @@ require(['loudmouth'], function(loudmouth){ loudmouth(); }); -// To make this tutorial running code, let's implement a very basic +// To make this tutorial run code, let's implement a very basic // (non-asynchronous) version of AMD right here on the spot: function define(name, deps, factory){ // notice how modules without dependencies are handled From ccdd47267b28104a74352151a0424bd6f62bd390 Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Fri, 17 Oct 2014 21:09:51 -0500 Subject: [PATCH 35/68] Add a couple missing parts to the markdown doc from @ukom PR https://github.com/adambard/learnxinyminutes-docs/pull/341 --- markdown.html.markdown | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/markdown.html.markdown b/markdown.html.markdown index 3d4d0af6..7541f904 100644 --- a/markdown.html.markdown +++ b/markdown.html.markdown @@ -126,6 +126,14 @@ render the numbers in order, but this may not be a good idea --> * Sub-item 4. Item four + + +Boxes below without the 'x' are unchecked HTML checkboxes. +- [ ] First task to complete. +- [ ] Second task that needs done +This checkbox below will be a checked HTML checkbox. +- [x] This task has been completed + From 4a7a7e3e9dabc3b02e656a377ca3f8342e781f48 Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Fri, 17 Oct 2014 21:17:43 -0500 Subject: [PATCH 36/68] Add @ukom Polish Perl translation from PR https://github.com/adambard/learnxinyminutes-docs/pull/341 --- pl-pl/perl-pl.html.markdown | 169 ++++++++++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 pl-pl/perl-pl.html.markdown diff --git a/pl-pl/perl-pl.html.markdown b/pl-pl/perl-pl.html.markdown new file mode 100644 index 00000000..9e8ade5b --- /dev/null +++ b/pl-pl/perl-pl.html.markdown @@ -0,0 +1,169 @@ +--- +name: perl +category: language +language: perl +filename: learnperl.pl +contributors: + - ["Korjavin Ivan", "http://github.com/korjavin"] + - ["Michał Kupczyński", "http://github.com/ukoms"] +lang: pl-pl +--- + +Perl 5 jest wysoce użytecznym, bogatym w wiele opcji językiem programowania +z ponad 25 latami nieustannego rozwoju. + +Perl 5 używany jest na ponad 100 różnych platformach (od przenośnych do w +pełni stacjonarnych) i nadaje się zarówno do szybkiego prototypowania jak +i projektów deweloperskich prowadzonych na szeroką skalę. + +```perl + +# Pojedyncza linia komentarza zaczyna się od znaku hasha (płotka) "#". + +#### Typy zmiennych w Perlu + +# Zmienna zaczyna się od symbolu dolara "$". +# Prawidłowa nazwa zmiennej zaczyna się od litery lub podkreślnika "_", +# po których następuje dowolna ilość liter, cyfr i podkreślników. + +### W Perlu występują trzy główne typy zmiennych: skalary, tablice i hasze. + +## Skalary +# Skalar przechowuje pojedynczą wartość: +my $zwierze = "wielbłąd"; +my $odpowiedź = 42; + +# Wartości skalarne mogą być ciągami znaków, liczbami całkowitymi lub +# zmiennoprzecinkowymi, zaś Perl automatycznie dokonuje konwersji pomiędzy nimi, +# w zależności od wykonywanego kodu/kontekstu. + +## Tablice +# Tablica przechowuje listę wartości: +my @zwierzęta = ("wielbłąd", "alpaka", "sowa"); +my @liczby = (23, 42, 69); +my @mieszanka = ("wielbłąd", 42, 1.23); + +## Hasze +# Hasz przechowuje zestawy par klucz-wartość: +my %kolor_owocu = ('jabłko', 'czerwony', 'banan', 'żółty'); + +# Możesz używać białych znaków (spacje, tabulatory) i operatora strzałki "=>" +# by czytelniej sformatować zapis hasza: +my %kolor_owocu = ( + jabłko => 'czerwony', + banan => 'żółty', +); + +# Skalary, tablice i hasze są bardziej wyczerpująco udokumentowane w dokumencie +# [perldoc perldata](http://perldoc.perl.org/perldata.html). + +# Bardziej złożone typy danych mogą być stworzone poprzez używanie referencji, +# które pozwalają Ci zbudować listy i hasze wewnątrz list i haszy. + +#### Warunki logiczne i pętle + +# W Perlu występują typowe warunki i pętle. +if ($var) { + ... +} elsif ($var eq 'bar') { + ... +} else { + ... +} + +unless (warunek) { + ... +} +# Powyższy zapis jest równoznaczny zapisowi "if (!warunek)" + +# Perlowy skrócony zapis warunków: +print "Siema!" if $rozochocony; +print "Nie mamy bananów" unless $banany; + +# Pętla while +while (warunek) { + ... +} + +# Pętle for oraz foreach +for ($i = 0; $i <= $max; $i++) { + ... +} + +foreach (@tablica) { + print "Tym elementem jest $_\n"; +} + +# lub + +foreach my $iterator (@tablica) { + print "Iterowanym elementem jest $iterator\n"; +} + +#### Wyrażenia regularne + +# Perlowe wyrażenia regularne są tematem tak rozległym, jak wymagającym. +# Istnieje ogromna ilość dokumentacji w artykułach takich jak +# [perlrequick](http://perldoc.perl.org/perlrequick.html), +# [perlretut](http://perldoc.perl.org/perlretut.html) i inne. +# W dużym skrócie, podstawy perlowych wyrażeń regularnych są następujące: + +# Proste dopasowanie: +if (/foo/) { ... } # prawda jeżeli $_ zawiera "foo" +if ($a =~ /foo/) { ... } # prawda jeżeli $a zawiera "foo" + +# Prosta zamiana: +# Zamienia "foo" na "bar" w zmiennej $a +$a =~ s/foo/bar/; +# Zamienia WSZYSTKIE WYSTĄPIENIA "foo" na "bar" w zmiennej $a +$a =~ s/foo/bar/g; + +#### Pliki i I/O + +# Możesz otworzyć plik do odczytu lub zapisu używając funkcji "open ()". +open (my $odczyt, "<", "odczyt.txt") or die "Błąd otwierania input.txt: $!"; +open (my $zapis, ">", "zapis.txt") or die "Błąd otwierania output.txt: $!"; +open (my $dopisanie, ">>", "my.log") or die "Błąd otwierania my.log: $!"; + +# Pliki możesz odczytywać z otworzonego handlera używając operatora "<>" +# (operator diamentowy). W kontekście skalarnym (przypisanie wyniku do skalara) +# operator ten zczytuje pojedynczą linię pliku, w kontekście listowym +# (przypisanie wyniku do tablicy) zczytuje całą zawartość pliku, przypisując +# każdą linię jako kolejny element listy: +my $linia = <$in>; +my @linie = <$in>; + +#### Perlowe funkcje (procedury) + +# Pisanie funkcji (procedur) jest proste: +sub logger { + my $wiadomosc_do_loga = shift; + open (my HANDLER, ">>", "my.log") or die "Błąd otwierania my.log: $!"; + print HANDLER $wiadomosc_do_loga; +} + +# Teraz można używać napisanej funkcji, tak jak każdej innej wbudowanej +# funkcji perlowej: +logger ("Mamy funkcję perlową"); + +``` + +#### Używanie modułów perlowych + +Moduły perlowe dostarczają szeroki wachlarz możliwości, byś nie musiał +wynajdywać koła na nowo. Moduły te można pobrać z [CPAN](http://www.cpan.org). +Sam Perl zawiera w swoich dystrybucjach kilka najpopularniejszych modułów +z repozytorium [CPAN](http://www.cpan.org). + +Najczęściej zadawane pytania [perlfaq](http://perldoc.perl.org/perlfaq.html) +- zawierają pytania i odpowiedzi dotyczące wielu typowo realizowanych zadań. +Często znajdziesz tam również sugestie dotyczące użycia najlepszego modułu +z repozytorium CPAN do zrealizowania konkretnego zadania. + + +#### Do doczytania + + - [perl-tutorial](http://perl-tutorial.org/) + - [Naucz się Perla na www.perl.com](http://www.perl.org/learn.html) + - [perldoc](http://perldoc.perl.org/) + - wbudowane w Perla: `perldoc perlintro` \ No newline at end of file From 679d7098f2fe663b62e7a7e328369b760f94195c Mon Sep 17 00:00:00 2001 From: "C. Bess" Date: Fri, 17 Oct 2014 21:22:28 -0500 Subject: [PATCH 37/68] - update examples - further explain Optional types - add build config example - explain array/dictionary mutability - expand tuple example --- swift.html.markdown | 56 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/swift.html.markdown b/swift.html.markdown index ffe6cac2..005e511c 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -27,6 +27,9 @@ import UIKit println("Hello, world") +// variables (var) value can change after being set +// constants (let) value can NOT be changed after being set + var myVariable = 42 let øπΩ = "value" // unicode variable names let π = 3.1415926 @@ -38,7 +41,29 @@ let intValue = 0007 // 7 let largeIntValue = 77_000 // 77000 let label = "some text " + String(myVariable) // Casting let piText = "Pi = \(π), Pi 2 = \(π * 2)" // String interpolation + +// Build Specific values +// uses -D build configuration +#if false + println("Not printed") + let buildValue = 3 +#else + let buildValue = 7 +#endif +println("Build value: \(buildValue)") // Build value: 7 + +/* + Optionals are a Swift language feature that allows you to store a `Some` or + `None` value. + + Because Swift requires every property to have a value, even nil must be + explicitly stored as an Optional value. + + Optional is an enum. +*/ var someOptionalString: String? = "optional" // Can be nil +// same as above, but ? is a postfix operator (syntax candy) +var someOptionalString2: Optional = "optional" if someOptionalString != nil { // I am not nil @@ -50,11 +75,23 @@ if someOptionalString != nil { } someOptionalString = nil -if let someStringConstant = someOptionalString { - // has Some value +// implicitly unwrapped optional +var unwrappedString: String! = "Value is expected." +// same as above, but ! is a postfix operator (more syntax candy) +var unwrappedString2: ImplicitlyUnwrappedOptional = "Value is expected." + +if let someOptionalStringConstant = someOptionalString { + // has `Some` value, non-nil + if !someOptionalStringConstant.hasPrefix("ok") { + // does not have the prefix + } } +// Swift has support for storing a value of any type. // AnyObject == id +// Unlike Objective-C `id`, AnyObject works with any value (Class, Int, struct, etc) +var anyObjectVar: AnyObject = 7 +anyObjectVar = "Changed value to a string, not good practice, but possible." /* Comment here @@ -67,10 +104,17 @@ Comment here // MARK: Collections // +/* + Array and Dictionary types are structs. So `let` and `var` also indicate + that they are mutable (var) or immutable (let) when declaring these types. +*/ + // Array var shoppingList = ["catfish", "water", "lemons"] shoppingList[1] = "bottle of water" -let emptyArray = [String]() +let emptyArray = [String]() // immutable +var emptyMutableArray = [String]() // mutable + // Dictionary var occupations = [ @@ -78,7 +122,8 @@ var occupations = [ "kaylee": "Mechanic" ] occupations["Jayne"] = "Public Relations" -let emptyDictionary = [String: Float]() +let emptyDictionary = [String: Float]() // immutable +var emptyMutableDictionary = [String: Float]() // mutable // @@ -162,6 +207,9 @@ func getGasPrices() -> (Double, Double, Double) { } let pricesTuple = getGasPrices() let price = pricesTuple.2 // 3.79 +// Ignore Tuple (or other) values by using _ (underscore) +let (_, price1, _) = pricesTuple // price1 == 3.69 +println(price1 == pricesTuple.1) // true println("Gas price: \(price)") // Variadic Args From 8e723a5f456403911b512c92979c9417a972406c Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Fri, 17 Oct 2014 21:43:23 -0500 Subject: [PATCH 38/68] Update language type for XML fr --- fr-fr/xml-fr.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fr-fr/xml-fr.html.markdown b/fr-fr/xml-fr.html.markdown index d7e76892..ed5f55ff 100644 --- a/fr-fr/xml-fr.html.markdown +++ b/fr-fr/xml-fr.html.markdown @@ -4,7 +4,8 @@ contributors: - ["João Farias", "https://github.com/JoaoGFarias"] translators: - ["Geoffrey Liu", "https://github.com/g-liu"] -filename: learnxml.xml +filename: learnxml-fr.xml +lang: fr-fr --- XML est un langage de balisage conçu pour stocker et transporter les informations. From b2cb538a5a758ce03a219545a77b274cd8609cc4 Mon Sep 17 00:00:00 2001 From: Oscar Date: Sat, 18 Oct 2014 11:44:44 +0800 Subject: [PATCH 39/68] Recursive function a little bit to recursive Infinitely recursive --- ocaml.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocaml.html.markdown b/ocaml.html.markdown index b9505f13..f9db7080 100644 --- a/ocaml.html.markdown +++ b/ocaml.html.markdown @@ -93,7 +93,7 @@ let inc_int (x: int) : int = x + 1 ;; (* You need to mark recursive function definitions as such with "rec" keyword. *) let rec factorial n = if n = 0 then 1 - else factorial n * factorial (n-1) + else n * factorial (n-1) ;; (* Function application usually doesn't need parentheses around arguments *) From c49e6f1928d6a717734fe1afbb3f96adac37c0b7 Mon Sep 17 00:00:00 2001 From: Dzianis Dashkevich Date: Sat, 18 Oct 2014 14:00:32 +0300 Subject: [PATCH 40/68] [elixir/en] Replace Records section w/ Structs one Fix typos Add "Programming Elixir" and Elixir Cheat Sheet to References section --- elixir.html.markdown | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/elixir.html.markdown b/elixir.html.markdown index c0abc815..0a20e3df 100644 --- a/elixir.html.markdown +++ b/elixir.html.markdown @@ -2,6 +2,7 @@ language: elixir contributors: - ["Joao Marques", "http://github.com/mrshankly"] + - ["Dzianis Dashkevich", "https://github.com/dskecse"] filename: learnelixir.ex --- @@ -59,7 +60,7 @@ tail #=> [2,3] # the tuples have different sizes. # {a, b, c} = {1, 2} #=> ** (MatchError) no match of right hand side value: {1,2} -# There's also binaries +# There are also binaries <<1,2,3>> # binary # Strings and char lists @@ -108,7 +109,7 @@ div(10, 2) #=> 5 # To get the division remainder use `rem` rem(10, 3) #=> 1 -# There's also boolean operators: `or`, `and` and `not`. +# There are also boolean operators: `or`, `and` and `not`. # These operators expect a boolean as their first argument. true and true #=> true false or true #=> true @@ -119,7 +120,6 @@ false or true #=> true 1 || true #=> 1 false && 1 #=> false nil && 20 #=> nil - !true #=> false # For comparisons we have: `==`, `!=`, `===`, `!==`, `<=`, `>=`, `<` and `>` @@ -165,12 +165,12 @@ case {:one, :two} do {:four, :five} -> "This won't match" {:one, x} -> - "This will match and assign `x` to `:two`" + "This will match and bind `x` to `:two`" _ -> "This will match any value" end -# It's common practice to assign a value to `_` if we don't need it. +# It's common to bind the value to `_` if we don't need it. # For example, if only the head of a list matters to us: [head | _] = [1,2,3] head #=> 1 @@ -190,7 +190,7 @@ cond do "But I will" end -# It is common to see a last condition equal to `true`, which will always match. +# It is common to see the last condition equal to `true`, which will always match. cond do 1 + 1 == 3 -> "I will never be seen" @@ -301,7 +301,7 @@ end Recursion.sum_list([1,2,3], 0) #=> 6 # Elixir modules support attributes, there are built-in attributes and you -# may also add custom attributes. +# may also add custom ones. defmodule MyMod do @moduledoc """ This is a built-in attribute on a example module. @@ -312,21 +312,24 @@ defmodule MyMod do end ## --------------------------- -## -- Records and Exceptions +## -- Structs and Exceptions ## --------------------------- -# Records are basically structures that allow you to associate a name with -# a particular value. -defrecord Person, name: nil, age: 0, height: 0 +# Structs are extensions on top of maps that bring default values, +# compile-time guarantees and polymorphism into Elixir. +defmodule Person do + defstruct name: nil, age: 0, height: 0 +end -joe_info = Person.new(name: "Joe", age: 30, height: 180) -#=> Person[name: "Joe", age: 30, height: 180] +joe_info = %Person{ name: "Joe", age: 30, height: 180 } +#=> %Person{age: 30, height: 180, name: "Joe"} # Access the value of name joe_info.name #=> "Joe" # Update the value of age -joe_info = joe_info.age(31) #=> Person[name: "Joe", age: 31, height: 180] +older_joe_info = %{ joe_info | age: 31 } +#=> %Person{age: 31, height: 180, name: "Joe"} # The `try` block with the `rescue` keyword is used to handle exceptions try do @@ -394,5 +397,7 @@ self() #=> #PID<0.27.0> * [Getting started guide](http://elixir-lang.org/getting_started/1.html) from [elixir webpage](http://elixir-lang.org) * [Elixir Documentation](http://elixir-lang.org/docs/master/) +* ["Programming Elixir"](https://pragprog.com/book/elixir/programming-elixir) by Dave Thomas +* [Elixir Cheat Sheet](http://media.pragprog.com/titles/elixir/ElixirCheat.pdf) * ["Learn You Some Erlang for Great Good!"](http://learnyousomeerlang.com/) by Fred Hebert -* "Programming Erlang: Software for a Concurrent World" by Joe Armstrong +* ["Programming Erlang: Software for a Concurrent World"](https://pragprog.com/book/jaerlang2/programming-erlang) by Joe Armstrong From 1f39917528fc13b20a12b0d7567c0171b7ffaaaf Mon Sep 17 00:00:00 2001 From: Simon Neveu Date: Sat, 18 Oct 2014 12:25:42 +0100 Subject: [PATCH 41/68] Added info on indentation and escaping html, typos --- haml.html.markdown | 58 ++++++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/haml.html.markdown b/haml.html.markdown index 86d9ba81..aed3dcae 100644 --- a/haml.html.markdown +++ b/haml.html.markdown @@ -1,26 +1,36 @@ --- language: haml -filename: learnhaml.html.haml +filename: learnhaml.haml contributors: - ["Simon Neveu", "https://github.com/sneveu"] --- -Haml is a markup language predominantly used with Ruby that cleanly -and simply describes the HTML of any web document without the use of -inline code. It is a popular alternative to using rails templating -language (.erb) and allows you to embed ruby code into your markup. +Haml is a markup language predominantly used with Ruby that cleanly and simply describes the HTML of any web document without the use of inline code. It is a popular alternative to using Rails templating language (.erb) and allows you to embed Ruby code into your markup. -It aims to reduce repetition in your markup by closing tags for you -based on the structure of the indents in your code. The result is -markup that is well-structured, DRY, logical, and easier to read. +It aims to reduce repetition in your markup by closing tags for you based on the structure of the indents in your code. The result is markup that is well-structured, DRY, logical, and easier to read. + +You can also use Haml on a project independent of Ruby, by installing the Haml gem on your machine and using the command line to convert it to html. + +$ haml input_file.haml output_file.html ```haml +/ ------------------------------------------- +/ Indenting +/ ------------------------------------------- + +/ + Because of the importance indentation has on how your code is rendered, the + indents should be consistent throughout the document. Any differences in + indentation will throw an error. It's common-practice to use two spaces, + but it's really up to you, as long as they're constant. + + / ------------------------------------------- / Comments / ------------------------------------------- -/ This is what a comment looks like haml. +/ This is what a comment looks like in Haml. / To write a multi line comment, indent your commented code to be @@ -45,7 +55,7 @@ markup that is well-structured, DRY, logical, and easier to read.
-/ Divs are the default elements so they can be written simply like this +/ The div tag is the default element, so they can be written simply like this .foo / To add content to a tag, add the text directly after the declaration @@ -56,11 +66,15 @@ markup that is well-structured, DRY, logical, and easier to read. This is a lot of content that we could probably split onto two separate lines. -/ You can escape html by using the ampersand and equals sign ( &= ) +/ + You can escape html by using the ampersand and equals sign ( &= ). This + converts html-sensitive characters (&, /, :) into their html encoded + equivalents. For example + %p &= "Yes & yes" -/ which would output 'Yes & yes' +/ would output 'Yes & yes' / You can unescape html by using the bang and equals sign ( != ) %p @@ -68,10 +82,10 @@ markup that is well-structured, DRY, logical, and easier to read. / which would output 'This is how you write a paragraph tag

' -/ Classes can be added to your tags either by chaining .classnames to the tag +/ CSS classes can be added to your tags either by chaining .classnames to the tag %div.foo.bar -/ or as part of a ruby hash +/ or as part of a Ruby hash %div{:class => 'foo bar'} / Attributes for any tag can be added in the hash @@ -80,7 +94,7 @@ markup that is well-structured, DRY, logical, and easier to read. / For boolean attributes assign the value 'true' %input{:selected => true} -/ To write data-attributes, use the :data key with it's value as another hash +/ To write data-attributes, use the :data key with its value as another hash %div{:data => {:attribute => 'foo'}} @@ -89,8 +103,8 @@ markup that is well-structured, DRY, logical, and easier to read. / ------------------------------------------- / - To output a ruby value as the contents of a tag, use an equals sign followed - by the ruby code + To output a Ruby value as the contents of a tag, use an equals sign followed + by the Ruby code %h1= book.name @@ -99,10 +113,10 @@ markup that is well-structured, DRY, logical, and easier to read. = book.publisher -/ To run some ruby code without rendering it to the html, use a hyphen instead +/ To run some Ruby code without rendering it to the html, use a hyphen instead - books = ['book 1', 'book 2', 'book 3'] -/ Allowing you to do all sorts of awesome, like ruby blocks +/ Allowing you to do all sorts of awesome, like Ruby blocks - books.shuffle.each_with_index do |book, index| %h1= book @@ -110,7 +124,7 @@ markup that is well-structured, DRY, logical, and easier to read. %p This is a book / - Again, no need to add the closing tags to the block, even for the ruby. + Again, no need to add the closing tags to the block, even for the Ruby. Indentation will take care of that for you. @@ -118,7 +132,7 @@ markup that is well-structured, DRY, logical, and easier to read. / Inline Ruby / Ruby interpolation / ------------------------------------------- -/ Include a ruby variable in a line of plain text using #{} +/ Include a Ruby variable in a line of plain text using #{} %p Your highest scoring game is #{best_game} @@ -127,7 +141,7 @@ markup that is well-structured, DRY, logical, and easier to read. / ------------------------------------------- / - Use the colon to define haml filters, one example of a filter you can + Use the colon to define Haml filters, one example of a filter you can use is :javascript, which can be used for writing inline js :javascript From b9466505f55bf99d8f93beab1e7f0fdce7b64319 Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Sat, 18 Oct 2014 13:19:07 -0500 Subject: [PATCH 42/68] Attempt at fixing amd file's markdown on site. --- amd.html.markdown | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/amd.html.markdown b/amd.html.markdown index 36210d03..b3237dc7 100644 --- a/amd.html.markdown +++ b/amd.html.markdown @@ -136,6 +136,7 @@ require(['jquery', 'coolLibFromBower', 'modules/someHelpers'], function($, coolL }); ``` `require.js`-based apps will usually have a single entry point (`main.js`) that is passed to the `require.js` script tag as a data-attribute. It will be automatically loaded and executed on pageload: + ```html @@ -155,13 +156,15 @@ Many people prefer using AMD for sane code organization during development, but `require.js` comes with a script called `r.js` (that you will probably run in node.js, although Rhino is supported too) that can analyse your project's dependency graph, and build a single file containing all your modules (properly named), minified and ready for consumption. Install it using `npm`: -```sh +```shell $ npm install requirejs -g ``` + Now you can feed it with a configuration file: -```sh +```shell $ r.js -o app.build.js ``` + For our above example the configuration might look like: ```javascript /* file : app.build.js */ @@ -177,10 +180,12 @@ For our above example the configuration might look like: } }) ``` + To use the built file in production, simply swap `data-main`: ```html ``` + An incredibly detailed [overview of build options](https://github.com/jrburke/r.js/blob/master/build/example.build.js) is available in the GitHub repo. ### Topics not covered in this tutorial From 484b01e663f209b86000ee181a6a8832ec130242 Mon Sep 17 00:00:00 2001 From: Joao Farias Date: Sat, 18 Oct 2014 19:52:45 -0300 Subject: [PATCH 43/68] [groovy-pt] Translation of Groovy page to pt-br --- pt-br/groovy-pt.html.markdown | 435 ++++++++++++++++++++++++++++++++++ 1 file changed, 435 insertions(+) create mode 100644 pt-br/groovy-pt.html.markdown diff --git a/pt-br/groovy-pt.html.markdown b/pt-br/groovy-pt.html.markdown new file mode 100644 index 00000000..885d5b27 --- /dev/null +++ b/pt-br/groovy-pt.html.markdown @@ -0,0 +1,435 @@ +--- +language: Groovy +category: language +filename: learngroovy.groovy +contributors: + - ["Roberto Pérez Alcolea", "http://github.com/rpalcolea"] +translators: + - ["João Farias", "https://github.com/JoaoGFarias"] +lang: pt-br +--- + +Groovy - Uma linguagem dinâmica para a plataforma Java. [Leia mais aqui.](http://groovy.codehaus.org) + +```groovy + +/* + Prepara-se: + + 1) Instale a máquina virtual de Groovy - http://gvmtool.net/ + 2) Intalse o Groovy: gvm install groovy + 3) Inicie o console groovy digitando: groovyConsole + +*/ + +// Comentário de uma linha inicia-se com duas barras +/* +Comentário de múltiplas linhas são assim. +*/ + +// Olá Mundo! +println "Olá mundo!" + +/* + Variáveis: + + Você pode atribuir valores a variáveis para uso posterior +*/ + +def x = 1 +println x + +x = new java.util.Date() +println x + +x = -3.1499392 +println x + +x = false +println x + +x = "Groovy!" +println x + +/* + Coleções e mapeamentos +*/ + +//Criando uma lista vazia +def tecnologias = [] + +/*** Adicionando elementos à lista ***/ + +// Assim como Java +tecnologias.add("Grails") + +// Shift para esquerda adiciona e retorna a lista +tecnologias << "Groovy" + +// Adição de múltiplos elementos +tecnologias.addAll(["Gradle","Griffon"]) + +/*** Removendo elementos da lista ***/ + +// Assim como Java +tecnologias.remove("Griffon") + +// Subtração também funciona +tecnologias = technologies - 'Grails' + +/*** Iterando sobre listas ***/ + +// Itera sobre os elementos da lista +tecnologias.each { println "Tecnologias: $it"} +tecnologias.eachWithIndex { it, i -> println "$i: $it"} + +/*** Checando os elementos da lista ***/ + +//Avalia se a lista contém o elemento 'Groovy' +contem = tecnologias.contains( 'Groovy' ) + +// Ou +contem = 'Groovy' in tecnologias + +// Checagem por múltiplos elementos +tecnologias.containsAll(['Groovy','Grails']) + +/*** Ordenando listas ***/ + +// Ordena a lista (altera a lista in-place) +tecnologias.sort() + +// Para ordenar a lista sem alterar a original +tecnologiasOrdenadas = tecnologias.sort( false ) + +/*** Manipulando listas ***/ + +//Substitue todos os elementos da lista +Collections.replaceAll(tecnologias, 'Gradle', 'gradle') + +//Desorganiza a lista +Collections.shuffle(tecnologias, new Random()) + +//Limpa a lista +technologies.clear() + +//Criando um mapeamento vazio +def devMap = [:] + +//Adicionando valores +devMap = ['nome':'Roberto', 'framework':'Grails', 'linguagem':'Groovy'] +devMap.put('ultimoNome','Perez') + +//Iterando sobre os elementos do mapeamento +devMap.each { println "$it.key: $it.value" } +devMap.eachWithIndex { it, i -> println "$i: $it"} + +//Avalia se um mapeamento contém uma chave +assert devMap.containsKey('nome') + +//Avalia se um mapeamento contém um valor +assert devMap.containsValue('Roberto') + +//Pega as chaves de um mapeamento +println devMap.keySet() + +//Pega os valores de um mapeamento +println devMap.values() + +/* + Groovy Beans + + GroovyBeans são JavaBeans com uma sintaxe muito mais simples. + + Quando Groovy é compilado para bytecode, as seguintes regras são usadas: + + * Se o nome é declarado com um modificador de acesso(public, private or + protected) então um atributo é gerado. + + * Um nome declarado sem modificador de acesso gera um campo privado com + getter e setter públicos (ou seja, uma propriedade). + + * Se uma propriedade é declarada como final, um campo private final é criado + e o setter não é gerado. + + * Você pode declarar uma propriedade e também declarar seus próprios getters + e setters. + + * Você pode declarar uma propriedade e um campo com o mesmo nome, a propriedade + usará este campo. + + * Se você quer uma propriedade private ou protected, você deve prover seus + próprios getters e setter, que devem ser declarados como private ou protected. + + * Se você acessar uma propriedade dentro da classe e esta propriedade é definida + em tempo de compilação com 'this', implícito ou explícito (por exemplo, + this.foo, ou simplesmente foo), Groovy acessará este campo diretamente, sem + passar pelo getter ou setter. + + * Se você acessar uma propriedade que não existe usando foo, explicitamente ou + implicitamente, então Groovy irá acessar esta propriedade através da meta + classe, o que pode falhar em tempo de execução. + +*/ + +class Foo { + // propriedade de leitura, apenas + final String nome = "Roberto" + + // propriedade de leitura, apenas, com getter e setter públicos + String linguagem + protected void setLinguagem(String linguagem) { this.linguagem = linguagem } + + // propriedade tipada dinamicamente + def ultimoNome +} + +/* + Condicionais e loops +*/ + +//Groovy suporta a sintaxe if-else +def x = 3 + +if(x==1) { + println "Um" +} else if(x==2) { + println "Dois" +} else { + println "X é maior que Dois" +} + +//Groovy também suporta o operador ternário +def y = 10 +def x = (y > 1) ? "functionou" : "falhou" +assert x == "functionou" + +//Loop 'for' +//Itera sobre um intervalo (range) +def x = 0 +for (i in 0 .. 30) { + x += i +} + +//Itera sobre uma lista +x = 0 +for( i in [5,3,2,1] ) { + x += i +} + +//Itera sobre um array +array = (0..20).toArray() +x = 0 +for (i in array) { + x += i +} + +//Itera sobre um mapa +def map = ['name':'Roberto', 'framework':'Grails', 'language':'Groovy'] +x = 0 +for ( e in map ) { + x += e.value +} + +/* + Operadores + + Sobrecarregamento de Operadores para uma lsita dos operadores comuns que + Grooby suporta: + http://groovy.codehaus.org/Operator+Overloading + + Operadores Groovy úteis +*/ +//Operador de espalhamento: invoca uma ação sobre todos os itens de um +//objeto agregador. +def tecnologias = ['Groovy','Grails','Gradle'] +tecnologias*.toUpperCase() // = to tecnologias.collect { it?.toUpperCase() } + +//Operador de navegação segura: usado para evitar NullPointerException. +def usuario = User.get(1) +def nomeUsuario = usuario?.nomeUsuario + + +/* + Closures + Um closure, em Grooby, é como um "bloco de código" ou um ponteiro para método. + É um pedação de código que é definido e executado em um momento posterior. + + Mais informação em: http://groovy.codehaus.org/Closures+-+Formal+Definition +*/ +//Exemplo: +def clos = { println "Hello World!" } + +println "Executando o closure:" +clos() + +//Passando parêmetros para um closure +def soma = { a, b -> println a+b } +soma(2,4) + +//Closdures por referir-se a variáveis que não estão listadas em sua +//lista de parêmetros. +def x = 5 +def multiplicarPor = { num -> num * x } +println multiplicarPor(10) + +// Se você tiver um closure que tem apenas um argumento, você pode omitir +// o parâmetro na definição do closure +def clos = { print it } +clos( "oi" ) + +/* + Groovy pode memorizar resultados de closures [1][2][3] +*/ +def cl = {a, b -> + sleep(3000) // simula processamento + a + b +} + +mem = cl.memoize() + +def chamaClosure(a, b) { + def inicio = System.currentTimeMillis() + mem(a, b) + println "Os inputs(a = $a, b = $b) - tomam ${System.currentTimeMillis() - inicio} msecs." +} + +chamaClosure(1, 2) +chamaClosure(1, 2) +chamaClosure(2, 3) +chamaClosure(2, 3) +chamaClosure(3, 4) +chamaClosure(3, 4) +chamaClosure(1, 2) +chamaClosure(2, 3) +chamaClosure(3, 4) + +/* + Expando + + A classe Expando é um bean dinâmico que permite adicionar propriedade e + closures como métodos a uma instância desta classe + + http://mrhaki.blogspot.mx/2009/10/groovy-goodness-expando-as-dynamic-bean.html +*/ + def usuario = new Expando(nome:"Roberto") + assert 'Roberto' == nome.name + + nome.lastName = 'Pérez' + assert 'Pérez' == nome.lastName + + nome.showInfo = { out -> + out << "Name: $name" + out << ", Last name: $lastName" + } + + def sw = new StringWriter() + println nome.showInfo(sw) + + +/* + Metaprogramação (MOP) +*/ + +//Usando a ExpandoMetaClasse para adicionar comportamento +String.metaClass.testAdd = { + println "adicionamos isto" +} + +String x = "teste" +x?.testAdd() + +//Interceptando chamadas a métodos +class Test implements GroovyInterceptable { + def soma(Integer x, Integer y) { x + y } + + def invocaMetodo(String name, args) { + System.out.println "Invoca método $name com argumentos: $args" + } +} + +def teste = new Test() +teste?.soma(2,3) +teste?.multiplica(2,3) + +//Groovy suporta propertyMissing para lidar com tentativas de resolução de +//propriedades. +class Foo { + def propertyMissing(String nome) { nome } +} +def f = new Foo() + +assertEquals "boo", f.boo + +/* + TypeChecked e CompileStatic + Groovy, por natureza, é e sempre será uma linguagem dinâmica, mas ela também + suporta typecheked e compilestatic + + Mais informações: http://www.infoq.com/articles/new-groovy-20 +*/ +//TypeChecked +import groovy.transform.TypeChecked + +void testeMethod() {} + +@TypeChecked +void test() { + testeMethod() + + def nome = "Roberto" + + println noomee + +} + +//Outro exemplo: +import groovy.transform.TypeChecked + +@TypeChecked +Integer test() { + Integer num = "1" + + Integer[] numeros = [1,2,3,4] + + Date dia = numeros[1] + + return "Teste" + +} + +//Exemplo de CompileStatic : +import groovy.transform.CompileStatic + +@CompileStatic +int soma(int x, int y) { + x + y +} + +assert soma(2,5) == 7 + + +``` + +## Referências + +[Groovy documentation](http://groovy.codehaus.org/Documentation) + +[Groovy web console](http://groovyconsole.appspot.com/) + +Junte-se a um [grupo de usuários Groovy](http://groovy.codehaus.org/User+Groups) + +## Livro + +* [Groovy Goodness] (https://leanpub.com/groovy-goodness-notebook) + +* [Groovy in Action] (http://manning.com/koenig2/) + +* [Programming Groovy 2: Dynamic Productivity for the Java Developer] (http://shop.oreilly.com/product/9781937785307.do) + +[1] http://roshandawrani.wordpress.com/2010/10/18/groovy-new-feature-closures-can-now-memorize-their-results/ +[2] http://www.solutionsiq.com/resources/agileiq-blog/bid/72880/Programming-with-Groovy-Trampoline-and-Memoize +[3] http://mrhaki.blogspot.mx/2011/05/groovy-goodness-cache-closure-results.html + + + From 9a2123c6757bd11f8723437032e823656987a011 Mon Sep 17 00:00:00 2001 From: Aleksey Pirogov Date: Sun, 19 Oct 2014 09:23:10 +0400 Subject: [PATCH 44/68] edits of ru-ru/markdown-ru --- ru-ru/markdown-ru.html.markdown | 68 ++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 30 deletions(-) diff --git a/ru-ru/markdown-ru.html.markdown b/ru-ru/markdown-ru.html.markdown index 8b2a0982..eb8e4881 100644 --- a/ru-ru/markdown-ru.html.markdown +++ b/ru-ru/markdown-ru.html.markdown @@ -7,27 +7,32 @@ filename: markdown-ru.md lang: ru-ru --- -Язык разметки Markdown создан Джоном Грубером (англ. John Gruber) и Аароном Шварцем (англ. Aaron H. Swartz) в 2004 году. Авторы задавались целью создать максимально удобочитаемый и удобный в публикации облегчённый язык разметки, пригодный для последующего преобразования в HTML (а также и в другие форматы). +Язык разметки Markdown создан Джоном Грубером (англ. John Gruber) +и Аароном Шварцем (англ. Aaron H. Swartz) в 2004 году. +Авторы задавались целью создать максимально удобочитаемый +и удобный в публикации облегчённый язык разметки, +пригодный для последующего преобразования в HTML +(а также и в другие форматы). ```markdown +текст, который должен стать заголовком, предваряется +соответствующим количеством символов "#": --> # Это заголовок h1 ## Это заголовок h2 ### Это заголовок h3 @@ -47,7 +52,7 @@ HTML-элементов --> *Этот текст будет выведен курсивом.* -_Также как этот._ +_Так же, как этот._ **А этот текст будет полужирным.** __И этот тоже.__ @@ -56,15 +61,15 @@ __И этот тоже.__ **_И тут!_** *__И даже здесь!__* - ~~Зачёркнутый текст.~~ - + -Это параграф. Всё предельно просто. +Это абзац. Всё предельно просто. А тут уже параграф №2. Эта строка всё ещё относится к параграфу №2! @@ -72,7 +77,7 @@ __И этот тоже.__ О, а вот это уже параграф №3! - + Принудительный
перенос! @@ -90,24 +95,24 @@ __И этот тоже.__ * Список, * Размеченный -* "Звёздочками" +* Звёздочками либо + Список, + Размеченный -+ "Плюсами" ++ Плюсами либо - Список, - Размеченный -- "Дефисами" +- Дефисами @@ -155,7 +160,7 @@ __И этот тоже.__ -\`\`\`ruby +\`\`\`ruby def foobar puts "Hello world!" end @@ -174,9 +179,10 @@ end **************** - + [Ссылка!](http://test.com/) @@ -193,15 +199,16 @@ end [Здесь][link1] высможете узнать больше! А можно кликнуть [сюда][foobar], если очень хочется. - + [link1]: http://test.com/ "Круто!" [foobar]: http://foobar.biz/ "Тоже хорошо!" + а также в круглые скобки. +- Сноска может находиться в любом месте документа и может иметь +идентификатор (далее ID) произвольной длины, +лишь бы это ID был уникальным. --> @@ -227,20 +234,21 @@ end [myimage]: relative/urls/cool/image.jpg "подсказка" - + Ссылка вида эквивалентна [http://testwebsite.com/](http://testwebsite.com/) - + - +Такой символ должен быть "экранирован" с помощью обратной косой черты +(символа "\"): --> \*текст, заключённый в звёздочки!\* @@ -249,7 +257,7 @@ end да и синтаксис имеют не слишком удобный. Но если очень нужно, размечайте таблицы так: --> -| Колонка 1 | Колонка 2 | Колонка 3 | +| Столбец 1 | Столбец 2 | Столбец 3 | | :----------- | :----------: | -----------: | | Выравнивание | Выравнивание | Выравнивание | | влево | по центру | вправо | From a7b885816d08372d33e0eece7c8e0834c699e7a6 Mon Sep 17 00:00:00 2001 From: hobozo Date: Tue, 21 Oct 2014 15:30:30 -0700 Subject: [PATCH 45/68] Update haskell.html.markdown Corrected terminology: currying -> partial application --- haskell.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/haskell.html.markdown b/haskell.html.markdown index ad12de2a..2785405c 100644 --- a/haskell.html.markdown +++ b/haskell.html.markdown @@ -171,8 +171,8 @@ foldl1 (\acc x -> acc + x) [1..5] -- 15 -- 4. More functions ---------------------------------------------------- --- currying: if you don't pass in all the arguments to a function, --- it gets "curried". That means it returns a function that takes the +-- partial application: if you don't pass in all the arguments to a function, +-- it gets "partially applied". That means it returns a function that takes the -- rest of the arguments. add a b = a + b From b4e5719ae90dbba989b1f3f5b9018d436d99e25d Mon Sep 17 00:00:00 2001 From: Andrei Curelaru Date: Sat, 25 Oct 2014 01:28:23 +0200 Subject: [PATCH 46/68] =?UTF-8?q?D=C3=A9but=20de=20traduction=20Markdown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fr-fr/markdown.html.markdown | 255 +++++++++++++++++++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 fr-fr/markdown.html.markdown diff --git a/fr-fr/markdown.html.markdown b/fr-fr/markdown.html.markdown new file mode 100644 index 00000000..32806054 --- /dev/null +++ b/fr-fr/markdown.html.markdown @@ -0,0 +1,255 @@ +--- +language: markdown +contributors: + - ["Andrei Curelaru", "http://infinidad.fr/"] +filename: markdown.md +--- + +Markdown a été crée par Jhon Gruber en 2004. Ceci se veut être une syntaxe facile à lire et à écrire, aisément convertible en HTML(et beaucoup d'autres formats aussi à present). + +Donnez moi autant de retours que vous voulez! +Sentez vous libre de forker et envoyer des pull request! + + +```markdown + + + + + + +# Ceci est un

+## Ceci est un

+### Ceci est un

+#### Ceci est un

+##### Ceci est un

+###### Ceci est un
+ + +Ceci est un h1 +============= + +Ceci est un h2 +------------- + + + + +*This text is in italics.* +_And so is this text._ + +**This text is in bold.** +__And so is this text.__ + +***This text is in both.*** +**_As is this!_** +*__And this!__* + + + +~~This text is rendered with strikethrough.~~ + + + +This is a paragraph. I'm typing in a paragraph isn't this fun? + +Now I'm in paragraph 2. +I'm still in paragraph 2 too! + + +I'm in paragraph three! + + + +I end with two spaces (highlight me to see them). + +There's a
above me! + + + +> This is a block quote. You can either +> manually wrap your lines and put a `>` before every line or you can let your lines get really long and wrap on their own. +> It doesn't make a difference so long as they start with a `>`. + +> You can also use more than one level +>> of indentation? +> How neat is that? + + + + +* Item +* Item +* Another item + +or + ++ Item ++ Item ++ One more item + +or + +- Item +- Item +- One last item + + + +1. Item one +2. Item two +3. Item three + + + +1. Item one +1. Item two +1. Item three + + + + +1. Item one +2. Item two +3. Item three + * Sub-item + * Sub-item +4. Item four + + + +Boxes below without the 'x' are unchecked HTML checkboxes. +- [ ] First task to complete. +- [ ] Second task that needs done +This checkbox below will be a checked HTML checkbox. +- [x] This task has been completed + + + + + This is code + So is this + + + + my_array.each do |item| + puts item + end + + + +John didn't even know what the `go_to()` function did! + + + +\`\`\`ruby +def foobar + puts "Hello world!" +end +\`\`\` + +<-- The above text doesn't require indenting, plus Github will use syntax +highlighting of the language you specify after the ``` --> + + + + +*** +--- +- - - +**************** + + + + +[Click me!](http://test.com/) + + + +[Click me!](http://test.com/ "Link to Test.com") + + + +[Go to music](/music/). + + + +[Click this link][link1] for more info about it! +[Also check out this link][foobar] if you want to. + +[link1]: http://test.com/ "Cool!" +[foobar]: http://foobar.biz/ "Alright!" + + + + + +[This][] is a link. + +[this]: http://thisisalink.com/ + + + + + + +![This is the alt-attribute for my image](http://imgur.com/myimage.jpg "An optional title") + + + +![This is the alt-attribute.][myimage] + +[myimage]: relative/urls/cool/image.jpg "if you need a title, it's here" + + + + + is equivalent to +[http://testwebsite.com/](http://testwebsite.com/) + + + + + + + +I want to type *this text surrounded by asterisks* but I don't want it to be +in italics, so I do this: \*this text surrounded by asterisks\*. + + + + +| Col1 | Col2 | Col3 | +| :----------- | :------: | ------------: | +| Left-aligned | Centered | Right-aligned | +| blah | blah | blah | + + + +Col 1 | Col2 | Col3 +:-- | :-: | --: +Ugh this is so ugly | make it | stop + + + +``` + +For more info, check out John Gruber's official post of syntax [here](http://daringfireball.net/projects/markdown/syntax) and Adam Pritchard's great cheatsheet [here](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). From f7b1bfeb45d3f1a0c3a059740541f856bdcb1606 Mon Sep 17 00:00:00 2001 From: Vinh Nguyen Date: Sat, 25 Oct 2014 09:59:01 +0700 Subject: [PATCH 47/68] Fix Vietnamese Git guide typo and update content --- vi-vn/git-vi.html.markdown | 64 ++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/vi-vn/git-vi.html.markdown b/vi-vn/git-vi.html.markdown index bdb88204..1bcc94a0 100644 --- a/vi-vn/git-vi.html.markdown +++ b/vi-vn/git-vi.html.markdown @@ -2,14 +2,15 @@ category: tool tool: git contributors: - - ["Jake Prather", "http://github.com/JakeHP"] + - ["Jake Prather", "http://github.com/JakeHP"] + - ["Vinh Nguyen", "https://twitter.com/vinhnx"] filename: LearnGit-vi.txt lang: vi-vn --- Git là một hệ quản lý mã nguồn và phiên bản phân tán (distributed version control and source code management system). -Nó làm được điều này là do một loạt các snapshot từ đề án của bạn, and nó hoạt động +Nó làm được điều này là do một loạt các snapshot từ đề án của bạn, và nó hoạt động với các snapshot đó để cung cấp cho bạn với chức năng đến phiên bản và quản lý mã nguồn của bạn. @@ -19,7 +20,7 @@ quản lý mã nguồn của bạn. Version Control là một hệ thống ghi lại những thay đổi ở một tập tin, hay một nhóm các tập tin, theo thời gian. -### Centralized Versioning VS Distributed Versioning +### So sánh giữa Centralized Versioning và Distributed Versioning * Quản lý phiên bản tập trung (Centralized Versioning) tập trung vào việc đồng bộ hóa, theo dõi, và lưu trữ tập tin. * Quản lý phiên bản phân tán (Distributed Versioning) tập trung vào việc chia sẻ các thay đổi. Mỗi sự thay đổi có một mã định dạng (id) duy nhất. @@ -75,7 +76,7 @@ con trỏ này sẽ cập nhật tự động và trỏ đến commit mới nh ### HEAD và head (thành phần của thư mục .git) -HEAD là một con trỏ đến nhánh hiện tại. Một repo chỉ có một HEAD *đang hoạt động*. +HEAD là một con trỏ đến branch hiện tại. Một repo chỉ có một HEAD *đang hoạt động*. head là một con trỏ đến bất kỳ commit nào. Một repo có thể có nhiều head. ### Các Tài Nguyên Mang Tính Khái Niệm @@ -165,29 +166,29 @@ $ git add ./*.java ### branch -Quản lý nhánh. Bạn có thể xem, sửa, tạo, xóa các nhánh bằng cách dùng lệnh này. +Quản lý nhánh (branch). Bạn có thể xem, sửa, tạo, xóa các nhánh bằng cách dùng lệnh này. ```bash -# liệt kê các nhanh đang có và ở remote +# liệt kê các branch đang có và ở remote $ git branch -a -# tạo nhánh mới +# tạo branch mới $ git branch myNewBranch -# xóa một nhánh +# xóa một branch $ git branch -d myBranch -# đặt tên lại một nhánh +# đặt tên lại một branch # git branch -m $ git branch -m myBranchName myNewBranchName -# chỉnh sủa diễn giải của một nhánh +# chỉnh sửa diễn giải của một branch $ git branch myBranchName --edit-description ``` ### checkout -Cập nhật tất cả các file torng tree hiện tại để cho trùng khớp với phiên bản của index, hoặc tree cụ thể. +Cập nhật tất cả các file trong tree hiện tại để cho trùng khớp với phiên bản của index, hoặc tree cụ thể. ```bash # Checkout (chuyển) một repo - mặc định là nhánh master @@ -201,8 +202,8 @@ $ git checkout -b newBranch ### clone Nhân bản, hoặc sao chép, một repo hiện có thành một thư mục mới. Nó cũng thêm -các nhánh có remote-tracking cho mỗi nhánh trong một repo được nhân bản, mà -cho phép bạn push đến một nhánh remote. +các branch có remote-tracking cho mỗi branch trong một repo được nhân bản, mà +cho phép bạn push đến một remote branch. ```bash # Nhân bản learnxinyminutes-docs @@ -211,7 +212,7 @@ $ git clone https://github.com/adambard/learnxinyminutes-docs.git ### commit -Lưu trữ nội dung hiện tại của index trong một "commit" mới. Điều này cho phép tạo ra thay đổi và một lời nhắn (ghi chú) tạo ra bởi người dùng. +Lưu trữ nội dung hiện tại của index trong một "commit" mới. Điều này cho phép tạo ra thay đổi và một ghi chú tạo ra bởi người dùng. ```bash # commit với một ghi chú @@ -279,7 +280,7 @@ $ git log --merges "Trộn" các thay đổi từ commit bên ngoài vào trong nhánh hiện tại. ```bash -# Merge nhánh cụ thể vào nhánh hiện tại. +# Merge branch cụ thể vào branch hiện tại. $ git merge branchName # Luôn khởi tạo một merge commit khi trộn (merge) @@ -304,30 +305,35 @@ $ git mv -f myFile existingFile ### pull -Kéo (tải) về từ một repo và merge nó vào nhánh khác. +Pull về từ một repo và merge nó vào branch khác. ```bash -# Cập nhật repo cục bộ của bạn, bằng cách merge các thay đổi mới +# Cập nhật repo local của bạn, bằng cách merge các thay đổi mới # từ remote "origin" và nhánh "master". # git pull # git pull => hoàn toàn mặc định như => git pull origin master $ git pull origin master -# Merge các thay đổi từ nhánh remote và rebase -# các commit nhánh lên trên thư mục cục bộ, như: "git pull , git rebase " +# Merge các thay đổi từ remote branch và rebase +# các commit trong branch lên trên local repo, như sau: "git pull , git rebase " $ git pull origin master --rebase ``` ### push -Đẩy và trộn (mege) các tay đổi từ một nhánh đế một remote & nhánh. +push và merge các thay đổi từ một branch đến một remote & branch. -```bash -# Push và merge các thay đổi từ repo cục bộ đến một -# remote tên là "origin" và nhánh "master". -# git push -# git push => hoàn toàn defaults to => git push origin master -$ git push origin master +```bash +# Push và merge các thay đổi từ một repo local đến một +# remote có tên là "origin" và nhánh "master". +# git push +# git push => mặc định ẩn đến => git push origin master +$ git push origin master + +# Để liên kết đến một branch local với một branch remote, thêm vào cờ -u: +$ git push -u origin master +# Từ lúc này, bất cứ khi nào bạn muốn push từ cùng một nhánh local đó, sử dụng lối tắt: +$ git push ``` ### rebase (thận trọng) @@ -390,4 +396,8 @@ $ git rm /pather/to/the/file/HelloWorld.c * [SalesForce Cheat Sheet](https://na1.salesforce.com/help/doc/en/salesforce_git_developer_cheatsheet.pdf) -* [GitGuys](http://www.gitguys.com/) +* [GitGuys](http://www.gitguys.com/) + +* [Git - the simple guide](http://rogerdudler.github.io/git-guide/index.html) + + From e4889157c7e1f0550b0f2b57b46bc7c085a917f4 Mon Sep 17 00:00:00 2001 From: Andrei Curelaru Date: Sat, 25 Oct 2014 14:56:07 +0200 Subject: [PATCH 48/68] mi chemin --- fr-fr/markdown.html.markdown | 174 +++++++++++++++++------------------ 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/fr-fr/markdown.html.markdown b/fr-fr/markdown.html.markdown index 32806054..82c26bb0 100644 --- a/fr-fr/markdown.html.markdown +++ b/fr-fr/markdown.html.markdown @@ -1,30 +1,27 @@ --- language: markdown contributors: - - ["Andrei Curelaru", "http://infinidad.fr/"] +- ["Andrei Curelaru", "http://www.infinidad.fr"] filename: markdown.md --- -Markdown a été crée par Jhon Gruber en 2004. Ceci se veut être une syntaxe facile à lire et à écrire, aisément convertible en HTML(et beaucoup d'autres formats aussi à present). +Markdown a été crée par Jhon Gruber en 2004. Ceci se veut être d'une syntaxe facile à lire et à écrire, +aisément convertible en HTML(et beaucoup d'autres formats aussi à présent). -Donnez moi autant de retours que vous voulez! -Sentez vous libre de forker et envoyer des pull request! +Faites moi autant de retours que vous voulez! Sentez vous libre de "forker" et envoyer des pull request! ```markdown - - - + + - + # Ceci est un

## Ceci est un

### Ceci est un

@@ -32,122 +29,125 @@ text you want to be in that element by a number of hashes (#) --> ##### Ceci est un

###### Ceci est un
- + Ceci est un h1 ============= Ceci est un h2 ------------- - - + + -*This text is in italics.* -_And so is this text._ +*Ce texte est en italique.* +_Celui-ci aussi._ -**This text is in bold.** -__And so is this text.__ +**CE texte est en gras.** +__Celui-là aussi.__ -***This text is in both.*** -**_As is this!_** -*__And this!__* +***Ce texte a les deux styles.*** +**_Pareil ici_** +*__Et là!__* - + -~~This text is rendered with strikethrough.~~ +~~Ce texte est barré avec strikethrough.~~ + - +Ceci est un paragraphe. J'écris dans un paragraphe, marrant non? -This is a paragraph. I'm typing in a paragraph isn't this fun? - -Now I'm in paragraph 2. -I'm still in paragraph 2 too! +Maintenant je suis dans le paragraphe 2. +Je suis toujours dans le paragraphe 2 ici aussi! -I'm in paragraph three! +Puis là, eh oui, le paragraphe3! + -I end with two spaces (highlight me to see them). +J'ai deux espaces vides à la fin (sélectionnez moi pour les voir). -There's a
above me! +Bigre, il y a un
au dessus de moi! - + -> This is a block quote. You can either -> manually wrap your lines and put a `>` before every line or you can let your lines get really long and wrap on their own. -> It doesn't make a difference so long as they start with a `>`. +> Ceci est une superbe citation. Vous pouvez même +> revenir à la ligne quand ça vous chante, et placer un `>` devant chaque bout de ligne faisant partie +> de la citation. +> La taille ne compte pas^^ tant que chaque ligne commence par un `>`. -> You can also use more than one level ->> of indentation? -> How neat is that? +> Vous pouvez aussi utiliser plus d'un niveau +>> d'imbrication! +> Class et facile, pas vrai? - - + + * Item * Item -* Another item +* Un autre item or + Item + Item -+ One more item ++ Encore un item -or +or - Item - Item -- One last item +- Un dernier item - + -1. Item one -2. Item two -3. Item three +1. Item un +2. Item deux +3. Item trois - + -1. Item one -1. Item two -1. Item three - +1. Item un +1. Item deux +1. Item trois + - + -1. Item one -2. Item two -3. Item three - * Sub-item - * Sub-item -4. Item four +1. Item un +2. Item deux +3. Item trois +* Sub-item +* Sub-item +4. Item quatre - + -Boxes below without the 'x' are unchecked HTML checkboxes. -- [ ] First task to complete. -- [ ] Second task that needs done -This checkbox below will be a checked HTML checkbox. -- [x] This task has been completed +Les [ ] ci dessous, n'ayant pas de [ x ], deviendront des cases à cocher HTML non-cochées. +- [ ] Première tache à réaliser. +- [ ] Une autre chose à faire. +La case suivante sera une case à cocher HTML cochée. +- [x] Ca ... c'est fait! - - + + - This is code - So is this +This is code +So is this - my_array.each do |item| - puts item - end +my_array.each do |item| +puts item +end @@ -157,7 +157,7 @@ John didn't even know what the `go_to()` function did! \`\`\`ruby def foobar - puts "Hello world!" +puts "Hello world!" end \`\`\` @@ -170,7 +170,7 @@ with or without spaces. --> *** --- -- - - +- - - **************** @@ -237,10 +237,10 @@ in italics, so I do this: \*this text surrounded by asterisks\*. -| Col1 | Col2 | Col3 | +| Col1 | Col2 | Col3 | | :----------- | :------: | ------------: | | Left-aligned | Centered | Right-aligned | -| blah | blah | blah | +| blah | blah | blah | @@ -248,8 +248,8 @@ Col 1 | Col2 | Col3 :-- | :-: | --: Ugh this is so ugly | make it | stop - + ``` -For more info, check out John Gruber's official post of syntax [here](http://daringfireball.net/projects/markdown/syntax) and Adam Pritchard's great cheatsheet [here](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). +For more info, check out John Gruber's official post of syntax [here](http://daringfireball.net/projects/markdown/syntax) and Adam Pritchard's great cheatsheet [here](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). \ No newline at end of file From 476c3a21c6f38c4497c968f8b8d2a946542da137 Mon Sep 17 00:00:00 2001 From: Andrei Curelaru Date: Sat, 25 Oct 2014 16:43:50 +0200 Subject: [PATCH 49/68] =?UTF-8?q?ay=C3=A9=20c'est=20fait?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fr-fr/markdown.html.markdown | 157 ++++++++++++++++------------------- 1 file changed, 73 insertions(+), 84 deletions(-) diff --git a/fr-fr/markdown.html.markdown b/fr-fr/markdown.html.markdown index 82c26bb0..b1b000fa 100644 --- a/fr-fr/markdown.html.markdown +++ b/fr-fr/markdown.html.markdown @@ -5,23 +5,20 @@ contributors: filename: markdown.md --- -Markdown a été crée par Jhon Gruber en 2004. Ceci se veut être d'une syntaxe facile à lire et à écrire, -aisément convertible en HTML(et beaucoup d'autres formats aussi à présent). +Markdown a été crée par Jhon Gruber en 2004. Ceci se veut être d'une syntaxe facile à lire et à écrire, aisément convertible en HTML (et beaucoup d'autres formats aussi à présent). Faites moi autant de retours que vous voulez! Sentez vous libre de "forker" et envoyer des pull request! ```markdown - - + + + + + - + # Ceci est un

## Ceci est un

### Ceci est un

@@ -42,40 +39,37 @@ Ceci est un h2 *Ce texte est en italique.* _Celui-ci aussi._ -**CE texte est en gras.** +**Ce texte est en gras.** __Celui-là aussi.__ ***Ce texte a les deux styles.*** **_Pareil ici_** *__Et là!__* - + ~~Ce texte est barré avec strikethrough.~~ - -Ceci est un paragraphe. J'écris dans un paragraphe, marrant non? + + +Ceci est un paragraphe. Là, je suis dans un paragraphe, facile non? Maintenant je suis dans le paragraphe 2. Je suis toujours dans le paragraphe 2 ici aussi! -Puis là, eh oui, le paragraphe3! +Puis là, eh oui, le paragraphe 3! - J'ai deux espaces vides à la fin (sélectionnez moi pour les voir). Bigre, il y a un
au dessus de moi! - + > Ceci est une superbe citation. Vous pouvez même > revenir à la ligne quand ça vous chante, et placer un `>` devant chaque bout de ligne faisant partie @@ -87,32 +81,31 @@ Bigre, il y a un
au dessus de moi! > Class et facile, pas vrai? - + * Item * Item * Un autre item -or +ou + Item + Item + Encore un item -or +ou - Item - Item - Un dernier item - + 1. Item un 2. Item deux 3. Item trois - + 1. Item un 1. Item deux @@ -137,119 +130,115 @@ La case suivante sera une case à cocher HTML cochée. - [x] Ca ... c'est fait! - + -This is code -So is this + echo "Ca, c'est du Code!"; + var Ca = "aussi !"; - + -my_array.each do |item| -puts item -end + my_array.each do |item| + puts item + end - + -John didn't even know what the `go_to()` function did! +La fonction `run()` ne vous oblige pas d'aller courir! - + -\`\`\`ruby +\`\`\`ruby def foobar puts "Hello world!" end -\`\`\` +\`\`\` -<-- The above text doesn't require indenting, plus Github will use syntax -highlighting of the language you specify after the ``` --> +<-- Pas besoin d'indentation pour le code juste au dessus, de plus, Github va utiliser une coloration syntaxique pour le langage indiqué après les ``` --> - - + + *** --- - - - **************** - - + + -[Click me!](http://test.com/) +[Clic moi!](http://test.com/) - + -[Click me!](http://test.com/ "Link to Test.com") +[Clic moi!](http://test.com/ "Lien vers Test.com") - + -[Go to music](/music/). +[En avant la musique](/music/). - + -[Click this link][link1] for more info about it! -[Also check out this link][foobar] if you want to. +[Cliquez ici][link1] pour plus d'information! +[Regardez aussi par ici][foobar] si vous voulez. [link1]: http://test.com/ "Cool!" [foobar]: http://foobar.biz/ "Alright!" - + - + -[This][] is a link. +[Ceci][] est un lien. -[this]: http://thisisalink.com/ +[ceci]: http://ceciestunlien.com/ - + - + -![This is the alt-attribute for my image](http://imgur.com/myimage.jpg "An optional title") +![Ceci est l'attribut ALT de l'image](http://imgur.com/monimage.jpg "Titre optionnel") - + -![This is the alt-attribute.][myimage] +![Ceci est l'attribut ALT de l'image][monimage] -[myimage]: relative/urls/cool/image.jpg "if you need a title, it's here" +[monimage]: relative/urls/cool/image.jpg "si vous voulez un titre, c'est ici." - - + + - is equivalent to + est équivalent à : [http://testwebsite.com/](http://testwebsite.com/) - + - + +Il suffit de précéder les caractères spécifiques à ignorer par des backslash \ -I want to type *this text surrounded by asterisks* but I don't want it to be -in italics, so I do this: \*this text surrounded by asterisks\*. +Pour taper *ce texte* entouré d'astérisques mais pas en italique : Tapez \*ce texte\*. - - + + | Col1 | Col2 | Col3 | | :----------- | :------: | ------------: | -| Left-aligned | Centered | Right-aligned | -| blah | blah | blah | +| Alignement Gauche | Centé | Alignement Droite | +| bla | bla | bla | - + Col 1 | Col2 | Col3 :-- | :-: | --: -Ugh this is so ugly | make it | stop +Ough que c'est moche | svp | arrêtez ``` -For more info, check out John Gruber's official post of syntax [here](http://daringfireball.net/projects/markdown/syntax) and Adam Pritchard's great cheatsheet [here](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). \ No newline at end of file +Pour plus d'information, consultez [ici](http://daringfireball.net/projects/markdown/syntax) le post officiel de Jhon Gruber à propos de la syntaxe, et [là](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) la superbe cheatsheet de Adam Pritchard. \ No newline at end of file From 710e504fbcb4c70abb2f9eb2ac8c6f7cbd879d50 Mon Sep 17 00:00:00 2001 From: Jelle Besseling Date: Sat, 25 Oct 2014 16:19:40 +0200 Subject: [PATCH 50/68] Dutch translation of the brainfuck tutorial --- nl-nl/brainfuck-nl.html.markdown | 86 ++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 nl-nl/brainfuck-nl.html.markdown diff --git a/nl-nl/brainfuck-nl.html.markdown b/nl-nl/brainfuck-nl.html.markdown new file mode 100644 index 00000000..cd12b1d0 --- /dev/null +++ b/nl-nl/brainfuck-nl.html.markdown @@ -0,0 +1,86 @@ +--- +language: brainfuck +contributors: + - ["Prajit Ramachandran", "http://prajitr.github.io/"] + - ["Mathias Bynens", "http://mathiasbynens.be/"] +translators: + - ["Jelle Besseling", "https://github.com/Jell-E"] +lang: nl-nl +--- + +Brainfuck (schrijf je niet met een hoofdletter behalve aan het begin van een +zin) is een extreem +minimalistische Turing-complete programmeertaal met maar acht commando's. + +``` +Elk karakter behalve "><+-.,[]" (en de quotes) wordt genegeerd. + +Brainfuck wordt gerepresenteerd door een array met 30,000 cellen die initieel +gevuld is met nullen en een pointer die wijst naar de huidige cel. + +Dit zijn de acht commando's: ++ : Verhoog de huidige cell met 1. +- : Verminder de huidige cell met 1. +> : Beweeg de pointer naar de volgende cell (één naar rechts). +< : Beweeg de pointer naar de vorige cell (één naar links). +. : Print de huidige cell als een ASCII karakter(d.w.z. 65 = 'A'). +, : Lees een karakter in de huidige cell. +[ : Als de huidige cell nul is ga dan naar de bijbehorende ] . + Als het geen nul is, ga dan gewoon verder. +] : Als de huidige cell nul is ga dan gewoon verder. + Als het geen nul is, ga dan terug naar de bijbehorende [ . + +[ en ] maken een while loop. Ze moeten uiteraard wel gebalanceerd zijn + +Laten we een kijkje nemen naar een paar brainfuck programma's. + +++++++ [ > ++++++++++ < - ] > +++++ . + +Dit programma print het karakter 'A'. Eerst verhoogt het cell #1 tot 6. +Cell #1 wordt gebruikt om te loopen. Dan begint het de loop ([) en gaat +naar cell #2. Het verhoogt cell #2 tien keer, gaat terug naar cell #1, en +verlaagt cell #1. Deze loop gebeurt zes keer (na zes keer staat cell #1 +weer op nul, waarna het doorgaat naar het einde van de loop (]) en +verder gaat). + +De pointer staat nu weer op cell #1, deze heeft een waarde van 0, en cell #2 +heeft een waarde van 60. > beweegt de pointer naar cell #2, daarna verhoogt +het de cell vijf keer, waardoor het een waarde van 65 bevat, en print dan +de waarde van cell #2. 65 is 'A' in ASCII, dus 'A' wordt geprint in de terminal. + + +, [ > + < - ] > . + +Dit programma leest een karakter van de gebruiker in put en kopieert dat +karakter in cel #1. Dan start de loop. Ga naar cel #2, verhoog de waarde in +cel #2, ga terug naar cel #1, en verklein de waarde in cel #1. Dit gaat door +totdat cel #1 nul is en cel #2 de oude waarde heeft van cell #1. Omdat we +op cel #1 staan verplaatst > de pointer één naar rechts en . print het +karakter in cel #2. + +Houd wel in gedachten dat de spaties alleen zijn voor leesbaarheid, je kan het +bovenstaande programma net zo goed schrijven als: + +,[>+<-]>. + +Probeer maar eens te bedenken wat het volgende programma doet: + +,>,< [ > [ >+ >+ << -] >> [- << + >>] <<< -] >> + +Dit programma neemt twee getallen als input, en vermenigvuldigt ze. + +In het begin leest het twee karakters in cel #1 en #2. Dan start het de +buitenste loop, met als teller cel #1. Het beweegt naar cel #2, dan start het +de binnenste loop met als teller cel #2, daar verhoogd het cel #3. Maar +dan is er een probleem als cel #2 nul wordt aan het einde van de binnenste loop. +Om dit op te lossen wordt ook cel #4 verhoogd naar het oorspronkelijke getal +uit cel #2 en daarna wordt cel #4 weer gekopieerd naar cell #2. +Het resultaat komt in cel #3 te staan. +``` + +En dat is dan brainfuck. Niet heel moeilijk, toch? Je kan zelf voor de lol +brainfuck programma's gaan schrijven, of je kan een interpreter schrijven +voor brainfuck in een andere taal. Het is namelijk redelijk makkelijk om te +implementeren aangezien brainfuck maar acht commando's heeft. En als je een +masochist bent kan je ook nog proberen om brainfuck te implementeren… in +brainfuck. From 9ff3a57c07c654a41460d113f7a8535a97d5c642 Mon Sep 17 00:00:00 2001 From: Jelle Besseling Date: Sat, 25 Oct 2014 16:36:27 +0200 Subject: [PATCH 51/68] [python/de] Fix typo in url of German translation My text editor apparently also fixed some incorrect trailing spaces and tabs on empty lines --- de-de/python-de.html.markdown | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/de-de/python-de.html.markdown b/de-de/python-de.html.markdown index 5ddb6f4b..b996ccae 100644 --- a/de-de/python-de.html.markdown +++ b/de-de/python-de.html.markdown @@ -3,7 +3,7 @@ language: python contributors: - ["Louie Dinh", "http://ldinh.ca"] translators: - - ["kultprok", "http:/www.kulturproktologie.de"] + - ["kultprok", "http://www.kulturproktologie.de"] filename: learnpython-de.py lang: de-de --- @@ -17,7 +17,7 @@ Hinweis: Dieser Beitrag bezieht sich besonders auf Python 2.7, er sollte aber au ```python # Einzeilige Kommentare beginnen mit einer Raute (Doppelkreuz) -""" Mehrzeilige Strings werden mit +""" Mehrzeilige Strings werden mit drei '-Zeichen geschrieben und werden oft als Kommentare genutzt. """ @@ -283,7 +283,7 @@ Ausgabe: for animal in ["hund", "katze", "maus"]: # Wir können Strings mit % formatieren print "%s ist ein Säugetier" % animal - + """ `range(Zahl)` gibt eine null-basierte Liste bis zur angegebenen Zahl wieder Ausgabe: @@ -458,7 +458,7 @@ import math as m math.sqrt(16) == m.sqrt(16) #=> True # Module sind in Python nur gewöhnliche Dateien. Wir -# können unsere eigenen schreiben und importieren. Der Name des +# können unsere eigenen schreiben und importieren. Der Name des # Moduls ist der Dateiname. # Wir können auch die Funktionen und Attribute eines @@ -484,4 +484,3 @@ dir(math) * [Programming Python](http://www.amazon.com/gp/product/0596158106/ref=as_li_qf_sp_asin_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0596158106&linkCode=as2&tag=homebits04-20) * [Dive Into Python](http://www.amazon.com/gp/product/1441413022/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1441413022&linkCode=as2&tag=homebits04-20) * [Python Essential Reference](http://www.amazon.com/gp/product/0672329786/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0672329786&linkCode=as2&tag=homebits04-20) - From 059ef4ebfafb9ae46603599c0619f0e2634c693a Mon Sep 17 00:00:00 2001 From: Jelle Besseling Date: Sat, 25 Oct 2014 16:38:43 +0200 Subject: [PATCH 52/68] Revert "[python/de] Fix typo in url of German translation" This reverts commit c44552b25840c742043aa64470f5cc3caaac4a5b. --- de-de/python-de.html.markdown | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/de-de/python-de.html.markdown b/de-de/python-de.html.markdown index b996ccae..5ddb6f4b 100644 --- a/de-de/python-de.html.markdown +++ b/de-de/python-de.html.markdown @@ -3,7 +3,7 @@ language: python contributors: - ["Louie Dinh", "http://ldinh.ca"] translators: - - ["kultprok", "http://www.kulturproktologie.de"] + - ["kultprok", "http:/www.kulturproktologie.de"] filename: learnpython-de.py lang: de-de --- @@ -17,7 +17,7 @@ Hinweis: Dieser Beitrag bezieht sich besonders auf Python 2.7, er sollte aber au ```python # Einzeilige Kommentare beginnen mit einer Raute (Doppelkreuz) -""" Mehrzeilige Strings werden mit +""" Mehrzeilige Strings werden mit drei '-Zeichen geschrieben und werden oft als Kommentare genutzt. """ @@ -283,7 +283,7 @@ Ausgabe: for animal in ["hund", "katze", "maus"]: # Wir können Strings mit % formatieren print "%s ist ein Säugetier" % animal - + """ `range(Zahl)` gibt eine null-basierte Liste bis zur angegebenen Zahl wieder Ausgabe: @@ -458,7 +458,7 @@ import math as m math.sqrt(16) == m.sqrt(16) #=> True # Module sind in Python nur gewöhnliche Dateien. Wir -# können unsere eigenen schreiben und importieren. Der Name des +# können unsere eigenen schreiben und importieren. Der Name des # Moduls ist der Dateiname. # Wir können auch die Funktionen und Attribute eines @@ -484,3 +484,4 @@ dir(math) * [Programming Python](http://www.amazon.com/gp/product/0596158106/ref=as_li_qf_sp_asin_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0596158106&linkCode=as2&tag=homebits04-20) * [Dive Into Python](http://www.amazon.com/gp/product/1441413022/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1441413022&linkCode=as2&tag=homebits04-20) * [Python Essential Reference](http://www.amazon.com/gp/product/0672329786/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0672329786&linkCode=as2&tag=homebits04-20) + From f7aadaff81b3d0c55c4ea2fbea65774590daa2e6 Mon Sep 17 00:00:00 2001 From: Andrei Curelaru Date: Sat, 25 Oct 2014 16:59:58 +0200 Subject: [PATCH 53/68] some fixes on line-length --- fr-fr/markdown.html.markdown | 106 +++++++++++++++++++++++++---------- 1 file changed, 75 insertions(+), 31 deletions(-) diff --git a/fr-fr/markdown.html.markdown b/fr-fr/markdown.html.markdown index b1b000fa..ba6c038d 100644 --- a/fr-fr/markdown.html.markdown +++ b/fr-fr/markdown.html.markdown @@ -5,20 +5,32 @@ contributors: filename: markdown.md --- -Markdown a été crée par Jhon Gruber en 2004. Ceci se veut être d'une syntaxe facile à lire et à écrire, aisément convertible en HTML (et beaucoup d'autres formats aussi à présent). +Markdown a été crée par Jhon Gruber en 2004. Ceci se veut être d'une syntaxe +facile à lire et à écrire, aisément convertible en HTML, +(et beaucoup d'autres formats aussi à présent). -Faites moi autant de retours que vous voulez! Sentez vous libre de "forker" et envoyer des pull request! +Faites moi autant de retours que vous voulez! Sentez vous libre de "forker" +et envoyer des pull request! ```markdown - + - + - + - + # Ceci est un

## Ceci est un

### Ceci est un

@@ -26,7 +38,10 @@ Faites moi autant de retours que vous voulez! Sentez vous libre de "forker" et e ##### Ceci est un

###### Ceci est un
- + + Ceci est un h1 ============= @@ -46,11 +61,12 @@ __Celui-là aussi.__ **_Pareil ici_** *__Et là!__* - + ~~Ce texte est barré avec strikethrough.~~ - Ceci est un paragraphe. Là, je suis dans un paragraphe, facile non? @@ -62,17 +78,21 @@ Je suis toujours dans le paragraphe 2 ici aussi! Puis là, eh oui, le paragraphe 3! J'ai deux espaces vides à la fin (sélectionnez moi pour les voir). Bigre, il y a un
au dessus de moi! - + > Ceci est une superbe citation. Vous pouvez même -> revenir à la ligne quand ça vous chante, et placer un `>` devant chaque bout de ligne faisant partie +> revenir à la ligne quand ça vous chante, et placer un `>` +> devant chaque bout de ligne faisant partie > de la citation. > La taille ne compte pas^^ tant que chaque ligne commence par un `>`. @@ -81,7 +101,8 @@ Bigre, il y a un
au dessus de moi! > Class et facile, pas vrai? - + * Item * Item @@ -105,12 +126,13 @@ ou 2. Item deux 3. Item trois - + 1. Item un 1. Item deux 1. Item trois - + @@ -121,16 +143,20 @@ ou * Sub-item 4. Item quatre - + + +Les [ ] ci dessous, n'ayant pas de [ x ], +deviendront des cases à cocher HTML non-cochées. -Les [ ] ci dessous, n'ayant pas de [ x ], deviendront des cases à cocher HTML non-cochées. - [ ] Première tache à réaliser. - [ ] Une autre chose à faire. La case suivante sera une case à cocher HTML cochée. - [x] Ca ... c'est fait! - + echo "Ca, c'est du Code!"; var Ca = "aussi !"; @@ -146,18 +172,21 @@ fonctionne aussi à l'intérieur du bloc de code --> La fonction `run()` ne vous oblige pas d'aller courir! - + -\`\`\`ruby +\`\`\`ruby + def foobar puts "Hello world!" end \`\`\` -<-- Pas besoin d'indentation pour le code juste au dessus, de plus, Github va utiliser une coloration syntaxique pour le langage indiqué après les ``` --> +<-- Pas besoin d'indentation pour le code juste au dessus, de plus, Github +va utiliser une coloration syntaxique pour le langage indiqué après les ``` --> - *** @@ -166,12 +195,16 @@ avec ou sans espaces entre chaque un. --> **************** - [Clic moi!](http://test.com/) - + [Clic moi!](http://test.com/ "Lien vers Test.com") @@ -187,9 +220,13 @@ avec ou sans espaces entre chaque un. --> [link1]: http://test.com/ "Cool!" [foobar]: http://foobar.biz/ "Alright!" - + - + [Ceci][] est un lien. @@ -198,9 +235,10 @@ avec ou sans espaces entre chaque un. --> - + -![Ceci est l'attribut ALT de l'image](http://imgur.com/monimage.jpg "Titre optionnel") +![Attribut ALT de l'image](http://imgur.com/monimage.jpg "Titre optionnel") @@ -221,10 +259,14 @@ avec ou sans espaces entre chaque un. --> Il suffit de précéder les caractères spécifiques à ignorer par des backslash \ -Pour taper *ce texte* entouré d'astérisques mais pas en italique : Tapez \*ce texte\*. +Pour taper *ce texte* entouré d'astérisques mais pas en italique : +Tapez \*ce texte\*. - + | Col1 | Col2 | Col3 | | :----------- | :------: | ------------: | @@ -241,4 +283,6 @@ Ough que c'est moche | svp | arrêtez ``` -Pour plus d'information, consultez [ici](http://daringfireball.net/projects/markdown/syntax) le post officiel de Jhon Gruber à propos de la syntaxe, et [là](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) la superbe cheatsheet de Adam Pritchard. \ No newline at end of file +Pour plus d'information : + consultez [ici](http://daringfireball.net/projects/markdown/syntax) le post officiel de Jhon Gruber à propos de la syntaxe, + et [là](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) la superbe cheatsheet de Adam Pritchard. \ No newline at end of file From 9bfb86a75df37132f915d964990d25862d9ded7d Mon Sep 17 00:00:00 2001 From: Andrei Curelaru Date: Sat, 25 Oct 2014 19:47:24 +0200 Subject: [PATCH 54/68] typographic and other fixes --- fr-fr/markdown.html.markdown | 43 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/fr-fr/markdown.html.markdown b/fr-fr/markdown.html.markdown index ba6c038d..edd3f025 100644 --- a/fr-fr/markdown.html.markdown +++ b/fr-fr/markdown.html.markdown @@ -5,9 +5,9 @@ contributors: filename: markdown.md --- -Markdown a été crée par Jhon Gruber en 2004. Ceci se veut être d'une syntaxe -facile à lire et à écrire, aisément convertible en HTML, -(et beaucoup d'autres formats aussi à présent). +Markdown a été créé par Jhon Gruber en 2004. Il se veut être d'une syntaxe +facile à lire et à écrire, aisément convertible en HTML + (et beaucoup d'autres formats aussi à présent). Faites moi autant de retours que vous voulez! Sentez vous libre de "forker" et envoyer des pull request! @@ -18,18 +18,18 @@ et envoyer des pull request! est un document Markdown valide. Autrement dit, vous pouvez utiliser des balises HTML dans un fichier Markdown, comme la balise commentaire dans laquelle nous sommes à présent, car celle-ci ne sera pas affectée par -le parser(analyseur syntaxique) Markdown. --> +le parser( analyseur syntaxique ) Markdown. --> - + - + # Ceci est un

## Ceci est un

@@ -61,8 +61,8 @@ __Celui-là aussi.__ **_Pareil ici_** *__Et là!__* - + ~~Ce texte est barré avec strikethrough.~~ @@ -72,7 +72,7 @@ séparées par une ou plusieurs lignes vides. --> Ceci est un paragraphe. Là, je suis dans un paragraphe, facile non? Maintenant je suis dans le paragraphe 2. -Je suis toujours dans le paragraphe 2 ici aussi! +Je suis toujours dans le paragraphe 2! Puis là, eh oui, le paragraphe 3! @@ -87,18 +87,17 @@ J'ai deux espaces vides à la fin (sélectionnez moi pour les voir). Bigre, il y a un
au dessus de moi! - + > Ceci est une superbe citation. Vous pouvez même -> revenir à la ligne quand ça vous chante, et placer un `>` +> revenir à la ligne quand ça vous chante, et placer un `>` > devant chaque bout de ligne faisant partie > de la citation. > La taille ne compte pas^^ tant que chaque ligne commence par un `>`. > Vous pouvez aussi utiliser plus d'un niveau >> d'imbrication! -> Class et facile, pas vrai? +> Classe et facile, pas vrai? +les bons chiffres. Ceci dit, cette variante perd en clarté.--> 1. Item un 1. Item deux 1. Item trois - + @@ -152,16 +151,16 @@ deviendront des cases à cocher HTML non-cochées. - [ ] Première tache à réaliser. - [ ] Une autre chose à faire. La case suivante sera une case à cocher HTML cochée. -- [x] Ca ... c'est fait! +- [x] Ça ... c'est fait! - echo "Ca, c'est du Code!"; - var Ca = "aussi !"; + echo "Ça, c'est du Code!"; + var Ça = "aussi !"; - my_array.each do |item| @@ -170,7 +169,7 @@ fonctionne aussi à l'intérieur du bloc de code --> -La fonction `run()` ne vous oblige pas d'aller courir! +La fonction `run()` ne vous oblige pas à aller courir! From 10fad1328574fdadef79b3e960dc759cebea8770 Mon Sep 17 00:00:00 2001 From: Andrei Curelaru Date: Sat, 25 Oct 2014 19:51:39 +0200 Subject: [PATCH 55/68] Good bye Asterix --- fr-fr/markdown.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fr-fr/markdown.html.markdown b/fr-fr/markdown.html.markdown index edd3f025..fa10e62f 100644 --- a/fr-fr/markdown.html.markdown +++ b/fr-fr/markdown.html.markdown @@ -100,8 +100,8 @@ Bigre, il y a un
au dessus de moi! > Classe et facile, pas vrai? - + * Item * Item From b4edd938235f139dcacd555121a1f755f55482f3 Mon Sep 17 00:00:00 2001 From: Andrei Curelaru Date: Sat, 25 Oct 2014 22:36:40 +0200 Subject: [PATCH 56/68] other fixes --- fr-fr/markdown.html.markdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fr-fr/markdown.html.markdown b/fr-fr/markdown.html.markdown index fa10e62f..e3ac5a92 100644 --- a/fr-fr/markdown.html.markdown +++ b/fr-fr/markdown.html.markdown @@ -175,11 +175,12 @@ La fonction `run()` ne vous oblige pas à aller courir! des syntaxes spécifiques --> \`\`\`ruby - + def foobar puts "Hello world!" end -\`\`\` +\`\`\` <-- Pas besoin d'indentation pour le code juste au dessus, de plus, Github va utiliser une coloration syntaxique pour le langage indiqué après les ``` --> From 928fdd34b03a3e5ef5f30327a3072c242c549fd7 Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Sun, 26 Oct 2014 12:57:49 +0100 Subject: [PATCH 57/68] [markdown/en] Fixed typo in language author MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s “John Gruber”, not “Jhon Gruber”. --- fr-fr/markdown.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fr-fr/markdown.html.markdown b/fr-fr/markdown.html.markdown index e3ac5a92..50e507cd 100644 --- a/fr-fr/markdown.html.markdown +++ b/fr-fr/markdown.html.markdown @@ -5,7 +5,7 @@ contributors: filename: markdown.md --- -Markdown a été créé par Jhon Gruber en 2004. Il se veut être d'une syntaxe +Markdown a été créé par John Gruber en 2004. Il se veut être d'une syntaxe facile à lire et à écrire, aisément convertible en HTML (et beaucoup d'autres formats aussi à présent). @@ -285,4 +285,4 @@ Ough que c'est moche | svp | arrêtez Pour plus d'information : consultez [ici](http://daringfireball.net/projects/markdown/syntax) le post officiel de Jhon Gruber à propos de la syntaxe, - et [là](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) la superbe cheatsheet de Adam Pritchard. \ No newline at end of file + et [là](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) la superbe cheatsheet de Adam Pritchard. From 9f2d4d80277bd8d420f002b4214fcd48cadad49e Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Sun, 26 Oct 2014 13:58:11 +0100 Subject: [PATCH 58/68] Brainfuck French translation added --- fr-fr/brainfuck-fr.html.markdown | 87 ++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 fr-fr/brainfuck-fr.html.markdown diff --git a/fr-fr/brainfuck-fr.html.markdown b/fr-fr/brainfuck-fr.html.markdown new file mode 100644 index 00000000..4b8e918f --- /dev/null +++ b/fr-fr/brainfuck-fr.html.markdown @@ -0,0 +1,87 @@ +--- +language: brainfuck +filename: learnbrainfuck-fr.bf +contributors: + - ["Prajit Ramachandran", "http://prajitr.github.io/"] + - ["Mathias Bynens", "http://mathiasbynens.be/"] +translators: + - ["Baptiste Fontaine", "http://bfontaine.net"] +lang: fr-fr +--- + +Brainfuck (sans majuscule à part au début d’une phrase) est un langage +Turing-complet extrêmement simple avec seulement 8 commandes. + +``` +Tout caractère en dehors de "><+-.,[]" (en dehors des guillements) est ignoré. + +Brainfuck est représenté par un tableau de 30 000 cellules initialisées à 0 et +un pointeur de données pointant sur la cellule courante. + +Il y a huit commandes : ++ : Incrémente la valeur de la cellule courante de un. +- : Décrémente la valeur de la cellule courante de un. +> : Déplace le pointeur de données sur la cellule suivante (à droite). +< : Déplace le pointeur de données sur la cellule précédente (à gauche). +. : Affiche la valeur ASCII de la cellule courante (par ex. 65 = 'A'). +, : Lit un caractère et le place dans la cellule courante. +[ : Si la valeur dans la cellule courante vaut 0, saute au ] correspondant. + Sinon, continue avec la commande suivante. +] : Si la valeur dans la cellule courante vaut 0, continue avec la commande + suivante. Sinon, retourne au [ correspondant. + +[ et ] forment une boucle « tant que » (« while »). Ils doivent évidemment +aller par paires. + +Regardons quelques programmes simples en brainfuck. + +++++++ [ > ++++++++++ < - ] > +++++ . + +Ce programme affiche la lettre 'A'. Il commence par incrémenter la première +cellule à 6. Il entre ensuite dans une boucle et se déplace sur la seconde +cellule. Il l’incrémente 10 fois, retourne sur la première cellule, et la +décrémente. Cette boucle est exécutée 6 fois (ce qui correspond aux 6 +décrémentations de la première cellule pour la faire atteindre 0, ce qui fait +sortir de la boucle). + +À ce moment-là, nous sommes sur la première cellule, qui a une valeur de 0, +tandis que la seconde cellule a une valeur de 60. Nous nous déplaçons sur +celle-ci, l’incrémentons 5 fois, pour une valeur de 65, et affichons sa valeur. +En ASCII, 65 correspond à 'A' donc le programme affiche 'A' dans le terminal. + +, [ > + < - ] > . + +Ce programme lit un caractère sur l’entrée standard et le copie dans la +première cellule. Il commence ensuite une boucle : il bouge sur la seconde +cellule, incrémente sa valeur, retourne sur la première et décrémente sa +valeur. Il continue jusqu’à ce que cette valeur soit à 0, et que la seconde +cellule contienne l’ancienne valeur de la première. Comme nous sommes sur la +première cellule à la fin de la boucle, il bouge sur la seconde et affiche sa +valeur en ASCII. + +Souvenez-vous que les espaces sont uniquement pour favoriser la lisibilité, +vous pourriez tout aussi aisément écrire le programme comme ceci : + +,[>+<-]>. + +Essayez et devinez ce que ce programme fait : + +,>,< [ > [ >+ >+ << -] >> [- << + >>] <<< -] >> + +Ce programme prend deux nombres en entrée, et les multiplie. + +Il commence par lire deux entrées, puis commence une boucle externe, qui a une +condition sur la première cellule. Il bouge ensuite sur la seconde, et commence +une boucle interne sur celle-ci, en incrémentant la troisième cellule. Il y a +cependant un problème : à la fin de la boucle interne, la valeur de la seconde +cellule est à zéro. Dans ce cas, la boucle interne ne fonctionnera pas une +seconde fois. Pour régler le problème, nous incrémentons aussi la quatrième +cellule, puis recopions sa valeur dans la seconde cellule. +À la fin, la troisième cellule contient le résultat de la multiplication. +``` + +Et voilà ce qu’est le brainfuck. Pas très dur, hein ? Pour le fun, vous pouvez +écrire vos propres programmes en brainfuck, ou écrire un interpréteur brainfuck +dans un autre langage. L’interpréteur est relativement simple à implémenter, +mais si vous êtes un masochiste, essayez d’écrire un interpréteur brainfuck en… +brainfuck. From 00c4a6324e177b86c8b26318ed77d7373d8e716f Mon Sep 17 00:00:00 2001 From: Subramanian Date: Mon, 27 Oct 2014 09:06:43 +0530 Subject: [PATCH 59/68] correcting the setName method set the method argument dogsName to name, instead of doggie_name --- c++.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c++.html.markdown b/c++.html.markdown index 50de5eff..9f357b08 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -305,7 +305,7 @@ void Dog::Dog() // if you are modifying them or const reference if you are not. void Dog::setName(const std::string& dogsName) { - name = doggie_name; + name = dogsName; } void Dog::setWeight(int dogsWeight) From fb28f2c10258eb92dc40db648a304f3e5b78bd2f Mon Sep 17 00:00:00 2001 From: ml242 Date: Mon, 27 Oct 2014 00:43:20 -0400 Subject: [PATCH 60/68] Your Name: Matt Subject Line: Addresses Comparisons in Javascript What Happened: I believe that starting out with the double equals instead of the triple equals for strict comparison checking is incorrect. Because double equals uses type coercion, it is more of a feature the needs to be understood. Beginners looking at the language should look upon the stricter method as the proper one because it is less likely to give a surprising result. I also tried to address the behaviour by adding an example to the double equals comparison. Hope that the community is interested in pulling in these changes, they stem from teaching beginners javaScript but I am by no means the authority. --- javascript.html.markdown | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/javascript.html.markdown b/javascript.html.markdown index 76017c17..f190ff98 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -77,13 +77,13 @@ false; !true; // = false !false; // = true -// Equality is == -1 == 1; // = true -2 == 1; // = false +// Equality is === +1 === 1; // = true +2 === 1; // = false -// Inequality is != -1 != 1; // = false -2 != 1; // = true +// Inequality is !== +1 !== 1; // = false +2 !== 1; // = true // More comparisons 1 < 10; // = true @@ -97,11 +97,13 @@ false; // and are compared with < and > "a" < "b"; // = true -// Type coercion is performed for comparisons... +// Type coercion is performed for comparisons with double equals... "5" == 5; // = true +null == undefined; // = true // ...unless you use === "5" === 5; // = false +null === undefined; // = false // You can access characters in a string with charAt "This is a string".charAt(0); // = 'T' From 122b9ab40855ad386e398e8f71cb539eeab47b85 Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Mon, 27 Oct 2014 12:25:34 +0100 Subject: [PATCH 61/68] Brainfuck/fr: a couple fixes after proof-reading --- fr-fr/brainfuck-fr.html.markdown | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fr-fr/brainfuck-fr.html.markdown b/fr-fr/brainfuck-fr.html.markdown index 4b8e918f..3882734d 100644 --- a/fr-fr/brainfuck-fr.html.markdown +++ b/fr-fr/brainfuck-fr.html.markdown @@ -54,12 +54,12 @@ En ASCII, 65 correspond à 'A' donc le programme affiche 'A' dans le terminal. Ce programme lit un caractère sur l’entrée standard et le copie dans la première cellule. Il commence ensuite une boucle : il bouge sur la seconde cellule, incrémente sa valeur, retourne sur la première et décrémente sa -valeur. Il continue jusqu’à ce que cette valeur soit à 0, et que la seconde -cellule contienne l’ancienne valeur de la première. Comme nous sommes sur la -première cellule à la fin de la boucle, il bouge sur la seconde et affiche sa -valeur en ASCII. +valeur. Il continue jusqu’à ce que la valeur de la première cellule soit à 0, +et que la seconde cellule contienne l’ancienne valeur de la première. Comme +nous sommes sur la première cellule à la fin de la boucle, il bouge sur la +seconde et affiche sa valeur en ASCII. -Souvenez-vous que les espaces sont uniquement pour favoriser la lisibilité, +Souvenez-vous que les espaces sont uniquement là pour favoriser la lisibilité, vous pourriez tout aussi aisément écrire le programme comme ceci : ,[>+<-]>. From 67de7d7281ce9703665cfcbf240cd2c79bac450c Mon Sep 17 00:00:00 2001 From: ven Date: Mon, 27 Oct 2014 20:01:55 +0100 Subject: [PATCH 62/68] [Common Lisp/en] Add a missing argument to `(walker)` --- 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 08134e35..c4ecb5e8 100644 --- a/common-lisp.html.markdown +++ b/common-lisp.html.markdown @@ -431,7 +431,7 @@ nil ; for false - and the empty list :walked (walker (1- n)))) -(walker) ; => :walked +(walker 5) ; => :walked ;; Most of the time, we use DOLIST or LOOP From 759f7349d2ff36ee7d9b28c20d9ce690de413683 Mon Sep 17 00:00:00 2001 From: Srinivas Gorur-Shandilya Date: Mon, 27 Oct 2014 16:52:14 -0400 Subject: [PATCH 63/68] cleaned up code, added struct docs cleaned up code, added struct docs --- matlab.html.markdown | 49 +++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/matlab.html.markdown b/matlab.html.markdown index 9dae8ef2..42db6ad7 100644 --- a/matlab.html.markdown +++ b/matlab.html.markdown @@ -40,36 +40,40 @@ ctrl-c % Abort current computation edit('myfunction.m') % Open function/script in editor type('myfunction.m') % Print the source of function/script to Command Window -profile viewer % Open profiler +profile on % turns on the code profiler +profile of % turns off the code profiler +profile viewer % Open profiler -help command % Displays documentation for command in Command Window -doc command % Displays documentation for command in Help Window -lookfor command % Searches for a given command +help command % Displays documentation for command in Command Window +doc command % Displays documentation for command in Help Window +lookfor command % Searches for a command in all other commands % Output formatting -format short % 4 decimals in a floating number -format long % 15 decimals -format bank % only two digits after decimal point - for financial calculations -fprintf +format short % 4 decimals in a floating number +format long % 15 decimals +format bank % only two digits after decimal point - for financial calculations +fprintf('text') % print "text" to the screen +disp('text') % print "text" to the screen % Variables & Expressions -myVariable = 4 % Notice Workspace pane shows newly created variable +myVariable = 4 % Notice Workspace pane shows newly created variable myVariable = 4; % Semi colon suppresses output to the Command Window -4 + 6 % ans = 10 -8 * myVariable % ans = 32 -2 ^ 3 % ans = 8 +4 + 6 % ans = 10 +8 * myVariable % ans = 32 +2 ^ 3 % ans = 8 a = 2; b = 3; c = exp(a)*sin(pi/2) % c = 7.3891 % Calling functions can be done in either of two ways: % Standard function syntax: -load('myFile.mat', 'y') +load('myFile.mat', 'y') % arguments within parantheses, spererated by commas % Command syntax: -load myFile.mat y % no parentheses, and spaces instead of commas +load myFile.mat y % no parentheses, and spaces instead of commas % Note the lack of quote marks in command form: inputs are always passed as % literal text - cannot pass variable values. Also, can't receive output: -[V,D] = eig(A) % this has no equivalent in command form +[V,D] = eig(A); % this has no equivalent in command form +[~,D] = eig(A); % if you only want D and not V @@ -100,6 +104,10 @@ a = {'one', 'two', 'three'} a(1) % ans = 'one' - returns a cell char(a(1)) % ans = one - returns a string +% Structures +A.b = {'one','two'}; +A.c = [1 2]; +A.d.e = false; % Vectors x = [4 32 53 7 1] @@ -160,6 +168,10 @@ A(1,:) % All columns in row 1 % 4 5 42 % 7 8 9 +% this is the same as +vertcat(A,A); + + [A , A] % Concatenation of matrices (horizontally) %ans = @@ -168,6 +180,8 @@ A(1,:) % All columns in row 1 % 4 5 42 4 5 42 % 7 8 9 7 8 9 +% this is the same as +horzcat(A,A); A(:, [3 1 2]) % Rearrange the columns of original matrix @@ -180,10 +194,13 @@ A(:, [3 1 2]) % Rearrange the columns of original matrix size(A) % ans = 3 3 A(1, :) =[] % Delete the first row of the matrix +A(:, 1) =[] % Delete the first column of the matrix +transpose(A) % Transpose the matrix, which is the same as: +A' ctranspose(A) % Hermitian transpose the matrix % (the transpose, followed by taking complex conjugate of each element) -transpose(A) % Transpose the matrix, without taking complex conjugate + From 02db45c5dc935043a9e19f3550121ae78965e5ca Mon Sep 17 00:00:00 2001 From: Dana de Waal Date: Tue, 28 Oct 2014 03:23:52 +0100 Subject: [PATCH 64/68] A few trailing spaces and take 2 on Dutch spelling and translation. --- nl-nl/coffeescript-nl.html.markdown | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/nl-nl/coffeescript-nl.html.markdown b/nl-nl/coffeescript-nl.html.markdown index 70dcd463..dc0b1e19 100644 --- a/nl-nl/coffeescript-nl.html.markdown +++ b/nl-nl/coffeescript-nl.html.markdown @@ -5,23 +5,24 @@ contributors: - ["Xavier Yao", "http://github.com/xavieryao"] translators: - ["Jelle Besseling", "https://github.com/Jell-E"] + - ["D.A.W. de Waal", "http://github.com/diodewaal"] filename: coffeescript-nl.coffee lang: nl-nl --- -CoffeeScript is een kleine programmeertaal die compileerd naar JavaScript, -er is geen interpretatie tijdens het uitvoeren. -Als een van de nakomelingen van JavaScript probeert CoffeeScript om leesbare, -goed geformatteerdeen goed draaiende JavaScript code te genereren, -die in elke JavaScript runtime werkt. +CoffeeScript is een kleine programmeertaal die direct compileert naar +JavaScript en er is geen interpretatie tijdens het uitvoeren. +CoffeeScript probeert om leesbare, goed geformatteerde en goed draaiende +JavaScript code te genereren, die in elke JavaScript runtime werkt, als een +opvolger van JavaScript. -Op [de CoffeeScript website](http://coffeescript.org/), staat een -vollediger tutorial voor CoffeeScript. +Op [de CoffeeScript website](http://coffeescript.org/), staat een +volledigere tutorial voor CoffeeScript. ``` coffeescript # CoffeeScript is een taal voor hipsters. # Het gaat mee met alle trends van moderne talen. -# Dus commentaar begint met een hekje, net zoals bij Python en Ruby. +# Commentaar begint dus met een hekje, net zoals bij Python en Ruby. ### Blokken commentaar maak je zo, ze vertalen naar JavaScripts */ en /* @@ -47,7 +48,7 @@ vul = (houder, vloeistof = "koffie") -> # #vul = function(houder, vloeistof) { # if (vloeistof == null) { -# vloeistof = "coffee"; +# vloeistof = "koffie"; # } # return "Nu de " + houder + " met " + vloeistof + " aan het vullen..."; #}; @@ -75,12 +76,12 @@ wedstrijd = (winnaar, lopers...) -> # return print(winnaar, lopers); #}; -# Bestaan: +# Aanwezigheid: alert "Ik wist het!" if elvis? #=> if(typeof elvis !== "undefined" && elvis !== null) { alert("I knew it!"); } # Lijst abstractie: -derdemachten = (wiskunde.derdemacht num for num in lijst) +derdemachten = (wiskunde.derdemacht num for num in lijst) #=>derdemachten = (function() { # var _i, _len, _results; # _results = []; From eb43eb7ccdeaad7440d9fda90128691effda15e1 Mon Sep 17 00:00:00 2001 From: i Date: Tue, 28 Oct 2014 03:11:59 -0400 Subject: [PATCH 65/68] basic arithmetic *doesn't* work It's not really true that arithmetic is accurate in JavaScript. --- javascript.html.markdown | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/javascript.html.markdown b/javascript.html.markdown index cc210c4a..792cab98 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -39,13 +39,14 @@ doStuff() // 1. Numbers, Strings and Operators // JavaScript has one number type (which is a 64-bit IEEE 754 double). -// As with Lua, don't freak out about the lack of ints: doubles have a 52-bit -// mantissa, which is enough to store integers up to about 9✕10¹⁵ precisely. +// Doubles have a 52-bit mantissa, which is enough to store integers +// up to about 9✕10¹⁵ precisely. 3; // = 3 1.5; // = 1.5 -// All the basic arithmetic works as you'd expect. +// Some basic arithmetic works as you'd expect. 1 + 1; // = 2 +.1 + .2; // = 0.30000000000000004 8 - 1; // = 7 10 * 2; // = 20 35 / 5; // = 7 From e1bdeff354c2535515ea31e733a5f078a2f469eb Mon Sep 17 00:00:00 2001 From: Srinivas Gorur-Shandilya Date: Tue, 28 Oct 2014 09:56:18 -0400 Subject: [PATCH 66/68] clarified lookfor --- matlab.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/matlab.html.markdown b/matlab.html.markdown index 42db6ad7..121f16de 100644 --- a/matlab.html.markdown +++ b/matlab.html.markdown @@ -46,7 +46,8 @@ profile viewer % Open profiler help command % Displays documentation for command in Command Window doc command % Displays documentation for command in Help Window -lookfor command % Searches for a command in all other commands +lookfor command % Searches for command in the first commented line of all functions +lookfor command -all % searches for command in all functions % Output formatting From b3cceac37eefae7cfeac73fad7eefde3e40a5fce Mon Sep 17 00:00:00 2001 From: Adam Bard Date: Tue, 28 Oct 2014 23:12:58 +0200 Subject: [PATCH 67/68] Update markdown.html.markdown --- fr-fr/markdown.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/fr-fr/markdown.html.markdown b/fr-fr/markdown.html.markdown index 50e507cd..29c0d65d 100644 --- a/fr-fr/markdown.html.markdown +++ b/fr-fr/markdown.html.markdown @@ -3,6 +3,7 @@ language: markdown contributors: - ["Andrei Curelaru", "http://www.infinidad.fr"] filename: markdown.md +lang: fr-fr --- Markdown a été créé par John Gruber en 2004. Il se veut être d'une syntaxe From 583f874cdf54c46ccfb1ea0a9480bdbffa308927 Mon Sep 17 00:00:00 2001 From: pbaisla Date: Wed, 29 Oct 2014 23:44:36 +0530 Subject: [PATCH 68/68] [tmux/en] Fix URL names --- tmux.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tmux.html.markdown b/tmux.html.markdown index ebc312ed..de3a8341 100644 --- a/tmux.html.markdown +++ b/tmux.html.markdown @@ -239,6 +239,6 @@ set -g status-right "#[fg=green] | #[fg=white]#(tmux-mem-cpu-load)#[fg=green] | Tmux | Home
Tmux Manual page
-Archlinux Wiki
-Gentoo Wiki
+Gentoo Wiki
+Archlinux Wiki
Display CPU/MEM % in statusbar