From bcb1b623b1db1057085982507399c62eaa053e7b Mon Sep 17 00:00:00 2001 From: Joel Bradshaw Date: Fri, 23 Jun 2017 13:35:19 -0700 Subject: [scala/en] Make return value example actually demonstrate issue Previously the `return z` didn't actually have any effect on the output, since the outer function just return the anon function's result directly. Updated to make the outer function do something to demonstrate the difference. Also renamed functions to make what they're doing easier to follow, and added a couple examples of behavior w/ explanations --- scala.html.markdown | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scala.html.markdown b/scala.html.markdown index 5eb94986..e541f4b3 100644 --- a/scala.html.markdown +++ b/scala.html.markdown @@ -253,16 +253,20 @@ weirdSum(2, 4) // => 16 // def that surrounds it. // WARNING: Using return in Scala is error-prone and should be avoided. // It has no effect on anonymous functions. For example: -def foo(x: Int): Int = { - val anonFunc: Int => Int = { z => +def addTenButMaybeTwelve(x: Int): Int = { + val anonMaybeAddTwo: Int => Int = { z => if (z > 5) - return z // This line makes z the return value of foo! + return z // This line makes z the return value of addTenButMaybeTwelve! else z + 2 // This line is the return value of anonFunc } - anonFunc(x) // This line is the return value of foo + anonMaybeAddTwo(x) + 10 // This line is the return value of foo } +addTenButMaybeTwelve(2) // Returns 14 as expected: 2 <= 5, adds 12 +addTenButMaybeTwelve(7) // Returns 7: 7 > 5, return value set to z, so + // last line doesn't get called and 10 is not added + ///////////////////////////////////////////////// // 3. Flow Control -- cgit v1.2.3 From 23cee36b4c056dcd3c01676132cb9a6588fb75ad Mon Sep 17 00:00:00 2001 From: Joel Bradshaw Date: Thu, 29 Jun 2017 10:49:44 -0700 Subject: Update more function mentions in comments --- scala.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scala.html.markdown b/scala.html.markdown index e541f4b3..192af953 100644 --- a/scala.html.markdown +++ b/scala.html.markdown @@ -258,9 +258,9 @@ def addTenButMaybeTwelve(x: Int): Int = { if (z > 5) return z // This line makes z the return value of addTenButMaybeTwelve! else - z + 2 // This line is the return value of anonFunc + z + 2 // This line is the return value of anonMaybeAddTwo } - anonMaybeAddTwo(x) + 10 // This line is the return value of foo + anonMaybeAddTwo(x) + 10 // This line is the return value of addTenButMaybeTwelve } addTenButMaybeTwelve(2) // Returns 14 as expected: 2 <= 5, adds 12 -- cgit v1.2.3 From 3743c596d8a6519d21e11dfa161aed4a92a742bc Mon Sep 17 00:00:00 2001 From: Thales Mello Date: Thu, 8 Mar 2018 18:03:32 -0300 Subject: Improvements to syntax and comments Improve code by using context managers to handle closing of files. Also, replace the flame-war indexing comment for one with some explanations to why things are as they are. --- pythonstatcomp.html.markdown | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pythonstatcomp.html.markdown b/pythonstatcomp.html.markdown index 6dde1cf0..0e6f1f87 100644 --- a/pythonstatcomp.html.markdown +++ b/pythonstatcomp.html.markdown @@ -38,18 +38,16 @@ r.text # raw page source print(r.text) # prettily formatted # save the page source in a file: os.getcwd() # check what's the working directory -f = open("learnxinyminutes.html", "wb") -f.write(r.text.encode("UTF-8")) -f.close() +with open("learnxinyminutes.html", "wb") as f: + f.write(r.text.encode("UTF-8")) # downloading a csv fp = "https://raw.githubusercontent.com/adambard/learnxinyminutes-docs/master/" fn = "pets.csv" r = requests.get(fp + fn) print(r.text) -f = open(fn, "wb") -f.write(r.text.encode("UTF-8")) -f.close() +with open(fn, "wb") as f: + f.write(r.text.encode("UTF-8")) """ for more on the requests module, including APIs, see http://docs.python-requests.org/en/latest/user/quickstart/ @@ -71,8 +69,8 @@ pets # 1 vesuvius 6 23 fish # 2 rex 5 34 dog -""" R users: note that Python, like most normal programming languages, starts - indexing from 0. R is the unusual one for starting from 1. +""" R users: note that Python, like most C-influenced programming languages, starts + indexing from 0. R starts indexing at 1 due to Fortran influnce. """ # two different ways to print out a column -- cgit v1.2.3 From bb18dc81548a68b25227306bead977d55da23c66 Mon Sep 17 00:00:00 2001 From: Thales Mello Date: Fri, 9 Mar 2018 14:29:43 -0300 Subject: Update pythonstatcomp.html.markdown --- pythonstatcomp.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonstatcomp.html.markdown b/pythonstatcomp.html.markdown index 0e6f1f87..082c7025 100644 --- a/pythonstatcomp.html.markdown +++ b/pythonstatcomp.html.markdown @@ -70,7 +70,7 @@ pets # 2 rex 5 34 dog """ R users: note that Python, like most C-influenced programming languages, starts - indexing from 0. R starts indexing at 1 due to Fortran influnce. + indexing from 0. R starts indexing at 1 due to Fortran influence. """ # two different ways to print out a column -- cgit v1.2.3 From 3f02799903c104631ccf778dabb30ba8b116b7bc Mon Sep 17 00:00:00 2001 From: Ben Quigley Date: Sun, 8 Apr 2018 13:44:35 -0400 Subject: Removed semicolons No semicolons needed in Python --- pythonstatcomp.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pythonstatcomp.html.markdown b/pythonstatcomp.html.markdown index 6dde1cf0..66eeb7ad 100644 --- a/pythonstatcomp.html.markdown +++ b/pythonstatcomp.html.markdown @@ -205,7 +205,7 @@ hre["DeathY"] = extractYear(hre.Death) hre["EstAge"] = hre.DeathY.astype(int) - hre.BirthY.astype(int) # simple scatterplot, no trend line, color represents dynasty -sns.lmplot("BirthY", "EstAge", data=hre, hue="Dynasty", fit_reg=False); +sns.lmplot("BirthY", "EstAge", data=hre, hue="Dynasty", fit_reg=False) # use scipy to run a linear regression from scipy import stats @@ -222,7 +222,7 @@ rval**2 # 0.020363950027333586 pval # 0.34971812581498452 # use seaborn to make a scatterplot and plot the linear regression trend line -sns.lmplot("BirthY", "EstAge", data=hre); +sns.lmplot("BirthY", "EstAge", data=hre) """ For more information on seaborn, see - http://web.stanford.edu/~mwaskom/software/seaborn/ -- cgit v1.2.3 From 47f49bc28b4546ecbb114e43cdd7ab3378bc1913 Mon Sep 17 00:00:00 2001 From: Anton Alekseev Date: Tue, 10 Apr 2018 21:12:03 +0300 Subject: Fix dead link to style guide, mention Emacs mode --- solidity.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index a0f8cd40..6174286c 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -829,7 +829,6 @@ someContractAddress.callcode('function_name'); ## Additional resources - [Solidity Docs](https://solidity.readthedocs.org/en/latest/) - [Smart Contract Best Practices](https://github.com/ConsenSys/smart-contract-best-practices) -- [Solidity Style Guide](https://ethereum.github.io/solidity//docs/style-guide/): Ethereum's style guide is heavily derived from Python's [pep8](https://www.python.org/dev/peps/pep-0008/) style guide. - [EthFiddle - The JsFiddle for Solidity](https://ethfiddle.com/) - [Browser-based Solidity Editor](https://remix.ethereum.org/) - [Gitter Solidity Chat room](https://gitter.im/ethereum/solidity) @@ -850,9 +849,10 @@ someContractAddress.callcode('function_name'); - [Hacking Distributed Blog](http://hackingdistributed.com/) ## Style -- Python's [PEP8](https://www.python.org/dev/peps/pep-0008/) is used as the baseline style guide, including its general philosophy +- [Solidity Style Guide](http://solidity.readthedocs.io/en/latest/style-guide.html): Ethereum's style guide is heavily derived from Python's [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide. ## Editors +- [Emacs Solidity Mode](https://github.com/ethereum/emacs-solidity) - [Vim Solidity](https://github.com/tomlion/vim-solidity) - Editor Snippets ([Ultisnips format](https://gist.github.com/nemild/98343ce6b16b747788bc)) -- cgit v1.2.3 From a80844cac53e372b0f8b423dca90151d5adb0417 Mon Sep 17 00:00:00 2001 From: "Shawn M. Hanes" Date: Wed, 11 Apr 2018 17:55:04 -0400 Subject: [Java/en] Added Lambdas section. --- java.html.markdown | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/java.html.markdown b/java.html.markdown index ab2be4a2..18a3b21a 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -11,6 +11,7 @@ contributors: - ["Michael Dähnert", "https://github.com/JaXt0r"] - ["Rob Rose", "https://github.com/RobRoseKnows"] - ["Sean Nam", "https://github.com/seannam"] + - ["Shawn M. Hanes", "https://github.com/smhanes15"] filename: LearnJava.java --- @@ -858,6 +859,108 @@ public class EnumTest { // The enum body can include methods and other fields. // You can see more at https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html +// Getting Started with Lambda Expressions +// +// New to Java version 8 are lambda expressions. Lambdas are more commonly found +// in functional programming languages, which means they are methods which can +// be created without belonging to a class, passed around as if it were itself +// an object, and executed on demand. +// +// Final note, lambdas must implement a functional interface. A functional +// interface is one which has only a single abstract method declared. It can +// have any number of default methods. Lambda expressions can be used as an +// instance of that functional interface. Any interface meeting the requirements +// is treated as a functional interface. You can read more about interfaces +// above. +// +import java.util.Map; +import java.util.HashMap; +import java.util.function.*; +import java.security.SecureRandom; + +public class Lambdas { + public static void main(String[] args) { + // Lambda declaration syntax: + // -> + + // We will use this hashmap in our examples below. + Map planets = new HashMap<>(); + planets.put("Mercury", "87.969"); + planets.put("Venus", "224.7"); + planets.put("Earth", "365.2564"); + planets.put("Mars", "687"); + planets.put("Jupiter", "4,332.59"); + planets.put("Saturn", "10,759"); + planets.put("Uranus", "30,688.5"); + planets.put("Neptune", "60,182"); + + // Lambda with zero parameters using the Supplier functional interface + // from java.util.function.Supplier. The actual lambda expression is + // what comes after numPlanets =. + Supplier numPlanets = () -> Integer.toString(planets.size()); + System.out.format("Number of Planets: %s\n\n", numPlanets.get()); + + // Lambda with one parameter and using the Consumer functional interface + // from java.util.function.Consumer. This is because planets is a Map, + // which implements both Collection and Iterable. The forEach used here, + // found in Iterable, applies the lambda expression to each member of + // the Collection. The default implementation of forEach behaves as if: + /* + for (T t : this) + action.accept(t); + */ + + // The actual lambda expression is the parameter passed to forEach. + planets.keySet().forEach((p) -> System.out.format("%s\n", p)); + + // If you are only passing a single argument, then the above can also be + // written as (note absent parentheses around p): + planets.keySet().forEach(p -> System.out.format("%s\n", p)); + + // Tracing the above, we see that planets is a HashMap, keySet() returns + // a Set of its keys, forEach applies each element as the lambda + // expression of: (parameter p) -> System.out.format("%s\n", p). Each + // time, the element is said to be "consumed" and the statement(s) + // referred to in the lambda body is applied. Remember the lambda body + // is what comes after the ->. + + // The above without use of lambdas would look more traditionally like: + for (String planet : planets.keySet()) { + System.out.format("%s\n", planet); + } + + // This example differs from the above in that a different forEach + // implementation is used: the forEach found in the HashMap class + // implementing the Map interface. This forEach accepts a BiConsumer, + // which generically speaking is a fancy way of saying it handles + // the Set of each Key -> Value pairs. This default implementation + // behaves as if: + /* + for (Map.Entry entry : map.entrySet()) + action.accept(entry.getKey(), entry.getValue()); + */ + + // The actual lambda expression is the parameter passed to forEach. + String orbits = "%s orbits the Sun in %s Earth days.\n"; + planets.forEach((K, V) -> System.out.format(orbits, K, V)); + + // The above without use of lambdas would look more traditionally like: + for (String planet : planets.keySet()) { + System.out.format(orbits, planet, planets.get(planet)); + } + + // Or, if following more closely the specification provided by the + // default implementation: + for (Map.Entry planet : planets.entrySet()) { + System.out.format(orbits, planet.getKey(), planet.getValue()); + } + + // These examples cover only the very basic use of lambdas. It might not + // seem like much or even very useful, but remember that a lambda can be + // created as an object that can later be passed as parameters to other + // methods. + } +} ``` ## Further Reading -- cgit v1.2.3 From cc0329efbb5fb9330e6c79a40f8dd2967bda5931 Mon Sep 17 00:00:00 2001 From: "Shawn M. Hanes" Date: Wed, 11 Apr 2018 18:12:59 -0400 Subject: [Java/en] Added Lambdas section. --- java.html.markdown | 164 ++++++++++++++++++++++++++--------------------------- 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/java.html.markdown b/java.html.markdown index 18a3b21a..ca0b04c2 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -11,7 +11,7 @@ contributors: - ["Michael Dähnert", "https://github.com/JaXt0r"] - ["Rob Rose", "https://github.com/RobRoseKnows"] - ["Sean Nam", "https://github.com/seannam"] - - ["Shawn M. Hanes", "https://github.com/smhanes15"] + - ["Shawn M. Hanes", "https://github.com/smhanes15"] filename: LearnJava.java --- @@ -879,87 +879,87 @@ import java.util.function.*; import java.security.SecureRandom; public class Lambdas { - public static void main(String[] args) { - // Lambda declaration syntax: - // -> - - // We will use this hashmap in our examples below. - Map planets = new HashMap<>(); - planets.put("Mercury", "87.969"); - planets.put("Venus", "224.7"); - planets.put("Earth", "365.2564"); - planets.put("Mars", "687"); - planets.put("Jupiter", "4,332.59"); - planets.put("Saturn", "10,759"); - planets.put("Uranus", "30,688.5"); - planets.put("Neptune", "60,182"); - - // Lambda with zero parameters using the Supplier functional interface - // from java.util.function.Supplier. The actual lambda expression is - // what comes after numPlanets =. - Supplier numPlanets = () -> Integer.toString(planets.size()); - System.out.format("Number of Planets: %s\n\n", numPlanets.get()); - - // Lambda with one parameter and using the Consumer functional interface - // from java.util.function.Consumer. This is because planets is a Map, - // which implements both Collection and Iterable. The forEach used here, - // found in Iterable, applies the lambda expression to each member of - // the Collection. The default implementation of forEach behaves as if: - /* - for (T t : this) - action.accept(t); - */ - - // The actual lambda expression is the parameter passed to forEach. - planets.keySet().forEach((p) -> System.out.format("%s\n", p)); - - // If you are only passing a single argument, then the above can also be - // written as (note absent parentheses around p): - planets.keySet().forEach(p -> System.out.format("%s\n", p)); - - // Tracing the above, we see that planets is a HashMap, keySet() returns - // a Set of its keys, forEach applies each element as the lambda - // expression of: (parameter p) -> System.out.format("%s\n", p). Each - // time, the element is said to be "consumed" and the statement(s) - // referred to in the lambda body is applied. Remember the lambda body - // is what comes after the ->. - - // The above without use of lambdas would look more traditionally like: - for (String planet : planets.keySet()) { - System.out.format("%s\n", planet); - } - - // This example differs from the above in that a different forEach - // implementation is used: the forEach found in the HashMap class - // implementing the Map interface. This forEach accepts a BiConsumer, - // which generically speaking is a fancy way of saying it handles - // the Set of each Key -> Value pairs. This default implementation - // behaves as if: - /* - for (Map.Entry entry : map.entrySet()) - action.accept(entry.getKey(), entry.getValue()); - */ - - // The actual lambda expression is the parameter passed to forEach. - String orbits = "%s orbits the Sun in %s Earth days.\n"; - planets.forEach((K, V) -> System.out.format(orbits, K, V)); - - // The above without use of lambdas would look more traditionally like: - for (String planet : planets.keySet()) { - System.out.format(orbits, planet, planets.get(planet)); - } - - // Or, if following more closely the specification provided by the - // default implementation: - for (Map.Entry planet : planets.entrySet()) { - System.out.format(orbits, planet.getKey(), planet.getValue()); - } - - // These examples cover only the very basic use of lambdas. It might not - // seem like much or even very useful, but remember that a lambda can be - // created as an object that can later be passed as parameters to other - // methods. - } + public static void main(String[] args) { + // Lambda declaration syntax: + // -> + + // We will use this hashmap in our examples below. + Map planets = new HashMap<>(); + planets.put("Mercury", "87.969"); + planets.put("Venus", "224.7"); + planets.put("Earth", "365.2564"); + planets.put("Mars", "687"); + planets.put("Jupiter", "4,332.59"); + planets.put("Saturn", "10,759"); + planets.put("Uranus", "30,688.5"); + planets.put("Neptune", "60,182"); + + // Lambda with zero parameters using the Supplier functional interface + // from java.util.function.Supplier. The actual lambda expression is + // what comes after numPlanets =. + Supplier numPlanets = () -> Integer.toString(planets.size()); + System.out.format("Number of Planets: %s\n\n", numPlanets.get()); + + // Lambda with one parameter and using the Consumer functional interface + // from java.util.function.Consumer. This is because planets is a Map, + // which implements both Collection and Iterable. The forEach used here, + // found in Iterable, applies the lambda expression to each member of + // the Collection. The default implementation of forEach behaves as if: + /* + for (T t : this) + action.accept(t); + */ + + // The actual lambda expression is the parameter passed to forEach. + planets.keySet().forEach((p) -> System.out.format("%s\n", p)); + + // If you are only passing a single argument, then the above can also be + // written as (note absent parentheses around p): + planets.keySet().forEach(p -> System.out.format("%s\n", p)); + + // Tracing the above, we see that planets is a HashMap, keySet() returns + // a Set of its keys, forEach applies each element as the lambda + // expression of: (parameter p) -> System.out.format("%s\n", p). Each + // time, the element is said to be "consumed" and the statement(s) + // referred to in the lambda body is applied. Remember the lambda body + // is what comes after the ->. + + // The above without use of lambdas would look more traditionally like: + for (String planet : planets.keySet()) { + System.out.format("%s\n", planet); + } + + // This example differs from the above in that a different forEach + // implementation is used: the forEach found in the HashMap class + // implementing the Map interface. This forEach accepts a BiConsumer, + // which generically speaking is a fancy way of saying it handles + // the Set of each Key -> Value pairs. This default implementation + // behaves as if: + /* + for (Map.Entry entry : map.entrySet()) + action.accept(entry.getKey(), entry.getValue()); + */ + + // The actual lambda expression is the parameter passed to forEach. + String orbits = "%s orbits the Sun in %s Earth days.\n"; + planets.forEach((K, V) -> System.out.format(orbits, K, V)); + + // The above without use of lambdas would look more traditionally like: + for (String planet : planets.keySet()) { + System.out.format(orbits, planet, planets.get(planet)); + } + + // Or, if following more closely the specification provided by the + // default implementation: + for (Map.Entry planet : planets.entrySet()) { + System.out.format(orbits, planet.getKey(), planet.getValue()); + } + + // These examples cover only the very basic use of lambdas. It might not + // seem like much or even very useful, but remember that a lambda can be + // created as an object that can later be passed as parameters to other + // methods. + } } ``` -- cgit v1.2.3 From 50021745fa4cd0d5ad5a475f2b2f126fcc662767 Mon Sep 17 00:00:00 2001 From: erikarvstedt <36110478+erikarvstedt@users.noreply.github.com> Date: Mon, 7 May 2018 12:47:20 +0200 Subject: css: add selector groups --- css.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/css.html.markdown b/css.html.markdown index 3b378d44..64dc097c 100644 --- a/css.html.markdown +++ b/css.html.markdown @@ -135,6 +135,10 @@ selector::after {} .parent * { } /* all descendants */ .parent > * { } /* all children */ +/* Group any number of selectors to define styles that affect all selectors + in the group */ +selector1, selector2 { } + /* #################### ## PROPERTIES #################### */ -- cgit v1.2.3 From a462b444e06f75c9f98983e925b8f79a1092d277 Mon Sep 17 00:00:00 2001 From: Brian Stearns Date: Thu, 31 May 2018 15:53:10 -0400 Subject: Correct English a/an usage --- scala.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scala.html.markdown b/scala.html.markdown index 016e2b4f..28424684 100644 --- a/scala.html.markdown +++ b/scala.html.markdown @@ -716,7 +716,7 @@ import scala.collection.immutable.{Map => _, Set => _, _} // Java classes can also be imported. Scala syntax can be used import java.swing.{JFrame, JWindow} -// Your programs entry point is defined in an scala file using an object, with a +// Your programs entry point is defined in a scala file using an object, with a // single method, main: object Application { def main(args: Array[String]): Unit = { -- cgit v1.2.3 From 8aa693c8cb1b5e7136603ce8e000d2142a6a20e6 Mon Sep 17 00:00:00 2001 From: Yvan Sraka Date: Sat, 9 Jun 2018 18:35:45 +0200 Subject: Fix typos in French version of Dynamic Programming tutorial --- fr-fr/dynamic-programming-fr.html.markdown | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/fr-fr/dynamic-programming-fr.html.markdown b/fr-fr/dynamic-programming-fr.html.markdown index 24e8c95f..b3660ac9 100644 --- a/fr-fr/dynamic-programming-fr.html.markdown +++ b/fr-fr/dynamic-programming-fr.html.markdown @@ -8,7 +8,6 @@ translators: lang: fr-fr --- - # Programmation dynamique ## Introduction @@ -17,9 +16,9 @@ La programmation dynamique est une technique très efficace pour résoudre une c ## Moyens de résoudre ces problèmes -1.) *De haut en bas* : Commençons à résoudre le problème en le séparant en morceaux. Si nous voyons que le problème a déjà été résolu, alors nous retournons la réponse précédemment sauvegardée. Si le problème n'a pas été résolu, alors nous le résolvons et sauvegardons la réponse. C'est généralement facile et intuitif de réfléchir de cette façon. Cela s'appelle la Mémorisation. +1. *De haut en bas* : Commençons à résoudre le problème en le séparant en morceaux. Si nous voyons que le problème a déjà été résolu, alors nous retournons la réponse précédemment sauvegardée. Si le problème n'a pas été résolu, alors nous le résolvons et sauvegardons la réponse. C'est généralement facile et intuitif de réfléchir de cette façon. Cela s'appelle la Mémorisation. -2.) *De bas en haut* : Il faut analyser le problème et trouver les sous-problèmes, et l'ordre dans lequel il faut les résoudre. Ensuite, nous devons résoudre les sous-problèmes et monter jusqu'au problème que nous voulons résoudre. De cette façon, nous sommes assurés que les sous-problèmes sont résolus avant de résoudre le vrai problème. Cela s'appelle la Programmation Dynamique. +2. *De bas en haut* : Il faut analyser le problème et trouver les sous-problèmes, et l'ordre dans lequel il faut les résoudre. Ensuite, nous devons résoudre les sous-problèmes et monter jusqu'au problème que nous voulons résoudre. De cette façon, nous sommes assurés que les sous-problèmes sont résolus avant de résoudre le vrai problème. Cela s'appelle la Programmation Dynamique. ## Exemple de Programmation Dynamique @@ -27,7 +26,7 @@ Le problème de la plus grande sous-chaîne croissante est de trouver la plus gr Premièrement, nous avons à trouver la valeur de la plus grande sous-chaîne (LSi) à chaque index `i`, avec le dernier élément de la sous-chaîne étant ai. Alors, la plus grande sous-chaîne sera le plus gros LSi. Pour commencer, LSi est égal à 1, car ai est le seul élément de la chaîne (le dernier). Ensuite, pour chaque `j` tel que `j Date: Sun, 1 Jul 2018 15:05:02 -0700 Subject: add for/of to js --- javascript.html.markdown | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/javascript.html.markdown b/javascript.html.markdown index 85c8a52d..f2dd08c8 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -248,6 +248,13 @@ for (var x in person){ description += person[x] + " "; } // description = 'Paul Ken 18 ' +// The for/of statement allows iteration over an iterator. +var myPets = ""; +var pets = ["cat", "dog", "hamster", "hedgehog"]; +for (var pet of pets){ + myPets += pet + " "; +} // myPets = 'cat dog hamster hedgehog ' + // && is logical and, || is logical or if (house.size == "big" && house.colour == "blue"){ house.contains = "bear"; -- cgit v1.2.3 From 2a3d19ef73cf273e5ab0b0a6d640172b47b6bb92 Mon Sep 17 00:00:00 2001 From: hra Date: Sun, 1 Jul 2018 15:10:13 -0700 Subject: add for/of to js (change description) --- javascript.html.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/javascript.html.markdown b/javascript.html.markdown index f2dd08c8..35bcf988 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -248,7 +248,9 @@ for (var x in person){ description += person[x] + " "; } // description = 'Paul Ken 18 ' -// The for/of statement allows iteration over an iterator. +// The for/of statement allows iteration over iterable objects (including the built-in String, +// Array, e.g. the Array-like arguments or NodeList objects, TypedArray, Map and Set, +// and user-defined iterables). var myPets = ""; var pets = ["cat", "dog", "hamster", "hedgehog"]; for (var pet of pets){ -- cgit v1.2.3 From e42e4b9b22d6d1e267d5c5931dd40f050401ba44 Mon Sep 17 00:00:00 2001 From: Fake4d Date: Tue, 3 Jul 2018 16:16:17 +0200 Subject: Update bash-de.html.markdown Variable was not initialised in this stage for this loop - Removed the $ --- de-de/bash-de.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de-de/bash-de.html.markdown b/de-de/bash-de.html.markdown index 7928b136..7a0db157 100644 --- a/de-de/bash-de.html.markdown +++ b/de-de/bash-de.html.markdown @@ -180,7 +180,7 @@ esac # 'for' Schleifen iterieren über die angegebene Zahl von Argumenten: # Der Inhalt von $Variable wird dreimal ausgedruckt. -for $Variable in {1..3} +for Variable in {1..3} do echo "$Variable" done -- cgit v1.2.3 From 8c30522d58e6c006274952a75c5acd4d104c8828 Mon Sep 17 00:00:00 2001 From: Alex Grejuc Date: Tue, 10 Jul 2018 15:12:23 -0700 Subject: added info about tuples, integrated wild card use into a function definition --- haskell.html.markdown | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/haskell.html.markdown b/haskell.html.markdown index 266cf11b..cad036f1 100644 --- a/haskell.html.markdown +++ b/haskell.html.markdown @@ -124,6 +124,9 @@ last [1..5] -- 5 fst ("haskell", 1) -- "haskell" snd ("haskell", 1) -- 1 +-- pair element accessing does not work on n-tuples (i.e. triple, quadruple, etc) +snd ("snd", "can't touch this", "da na na na") -- error! see function below to get around this + ---------------------------------------------------- -- 3. Functions ---------------------------------------------------- @@ -159,8 +162,8 @@ fib 1 = 1 fib 2 = 2 fib x = fib (x - 1) + fib (x - 2) --- Pattern matching on tuples: -foo (x, y) = (x + 1, y + 2) +-- Pattern matching on tuples, using wild card (_) to bypass naming an unused value +sndOfTriple (_, y, _) = y -- Pattern matching on lists. Here `x` is the first element -- in the list, and `xs` is the rest of the list. We can write @@ -203,9 +206,9 @@ foo = (4*) . (10+) foo 5 -- 60 -- fixing precedence --- Haskell has an operator called `$`. This operator applies a function --- to a given parameter. In contrast to standard function application, which --- has highest possible priority of 10 and is left-associative, the `$` operator +-- Haskell has an operator called `$`. This operator applies a function +-- to a given parameter. In contrast to standard function application, which +-- has highest possible priority of 10 and is left-associative, the `$` operator -- has priority of 0 and is right-associative. Such a low priority means that -- the expression on its right is applied as the parameter to the function on its left. @@ -223,7 +226,7 @@ even . fib $ 7 -- false -- 5. Type signatures ---------------------------------------------------- --- Haskell has a very strong type system, and every valid expression has a type. +-- Haskell has a very strong type system, and every valid expression has a type. -- Some basic types: 5 :: Integer -- cgit v1.2.3 From 093e6b62a1aae230f965ad8d1ee2ff8a6b128055 Mon Sep 17 00:00:00 2001 From: Alex Grejuc Date: Tue, 10 Jul 2018 15:15:26 -0700 Subject: moved comment on sndOfTriple --- haskell.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/haskell.html.markdown b/haskell.html.markdown index cad036f1..6a48b60c 100644 --- a/haskell.html.markdown +++ b/haskell.html.markdown @@ -162,8 +162,8 @@ fib 1 = 1 fib 2 = 2 fib x = fib (x - 1) + fib (x - 2) --- Pattern matching on tuples, using wild card (_) to bypass naming an unused value -sndOfTriple (_, y, _) = y +-- Pattern matching on tuples +sndOfTriple (_, y, _) = y -- you can use a wild card (_) to bypass naming an unused value -- Pattern matching on lists. Here `x` is the first element -- in the list, and `xs` is the rest of the list. We can write -- cgit v1.2.3 From c421b1bd0d18ab57c88665bd14b289e75724cf37 Mon Sep 17 00:00:00 2001 From: Alex Grejuc Date: Tue, 10 Jul 2018 15:34:42 -0700 Subject: trimmed loc over 80 chars --- haskell.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/haskell.html.markdown b/haskell.html.markdown index 6a48b60c..e9ddf54d 100644 --- a/haskell.html.markdown +++ b/haskell.html.markdown @@ -125,7 +125,7 @@ fst ("haskell", 1) -- "haskell" snd ("haskell", 1) -- 1 -- pair element accessing does not work on n-tuples (i.e. triple, quadruple, etc) -snd ("snd", "can't touch this", "da na na na") -- error! see function below to get around this +snd ("snd", "can't touch this", "da na na na") -- error! see function below ---------------------------------------------------- -- 3. Functions @@ -163,7 +163,7 @@ fib 2 = 2 fib x = fib (x - 1) + fib (x - 2) -- Pattern matching on tuples -sndOfTriple (_, y, _) = y -- you can use a wild card (_) to bypass naming an unused value +sndOfTriple (_, y, _) = y -- use a wild card (_) to bypass naming unused value -- Pattern matching on lists. Here `x` is the first element -- in the list, and `xs` is the rest of the list. We can write @@ -210,7 +210,7 @@ foo 5 -- 60 -- to a given parameter. In contrast to standard function application, which -- has highest possible priority of 10 and is left-associative, the `$` operator -- has priority of 0 and is right-associative. Such a low priority means that --- the expression on its right is applied as the parameter to the function on its left. +-- the expression on its right is applied as parameter to function on its left. -- before even (fib 7) -- false -- cgit v1.2.3 From d063ea64694226c9490d5fe6da3b960449c3bfe3 Mon Sep 17 00:00:00 2001 From: Adam Bard Date: Wed, 1 Aug 2018 21:12:35 -0700 Subject: Restore lost articles I'm afraid we need these --- haskell.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haskell.html.markdown b/haskell.html.markdown index e9ddf54d..90d47c27 100644 --- a/haskell.html.markdown +++ b/haskell.html.markdown @@ -210,7 +210,7 @@ foo 5 -- 60 -- to a given parameter. In contrast to standard function application, which -- has highest possible priority of 10 and is left-associative, the `$` operator -- has priority of 0 and is right-associative. Such a low priority means that --- the expression on its right is applied as parameter to function on its left. +-- the expression on its right is applied as a parameter to the function on its left. -- before even (fib 7) -- false -- cgit v1.2.3 From 62c238fc4c65678a5affdbd27c5c26e601cbb2fb Mon Sep 17 00:00:00 2001 From: Alan Russell Date: Thu, 2 Aug 2018 14:43:03 +0100 Subject: Update ruby-ecosystem.html.markdown Update info on major versions in common use Move info on versions above info on version managers --- ruby-ecosystem.html.markdown | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/ruby-ecosystem.html.markdown b/ruby-ecosystem.html.markdown index 50eedcd0..3c80075b 100644 --- a/ruby-ecosystem.html.markdown +++ b/ruby-ecosystem.html.markdown @@ -10,6 +10,16 @@ contributors: People using Ruby generally have a way to install different Ruby versions, manage their packages (or gems), and manage their gem dependencies. +## Ruby Versions + +Ruby was created by Yukihiro "Matz" Matsumoto, who remains somewhat of a +[BDFL](https://en.wikipedia.org/wiki/Benevolent_Dictator_for_Life), although +that is changing recently. As a result, the reference implementation of Ruby is +called MRI (Matz' Reference Implementation), and when you hear a Ruby version, +it is referring to the release version of MRI. + +New major versions of Ruby are traditionally released on Christmas Day. The current major version (25 December 2017) is 2.5. The most popular stable versions are 2.4.4 and 2.3.7 (both released 28 March 2018). + ## Ruby Managers Some platforms have Ruby pre-installed or available as a package. Most rubyists @@ -29,28 +39,6 @@ The following are the popular Ruby environment managers: * [chruby](https://github.com/postmodern/chruby) - Only switches between rubies. Similar in spirit to rbenv. Unopinionated about how rubies are installed. -## Ruby Versions - -Ruby was created by Yukihiro "Matz" Matsumoto, who remains somewhat of a -[BDFL](https://en.wikipedia.org/wiki/Benevolent_Dictator_for_Life), although -that is changing recently. As a result, the reference implementation of Ruby is -called MRI (Matz' Reference Implementation), and when you hear a Ruby version, -it is referring to the release version of MRI. - -The three major version of Ruby in use are: - -* 2.0.0 - Released in February 2013. Most major libraries and frameworks support - 2.0.0. -* 1.9.3 - Released in October 2011. This is the version most rubyists use - currently. Also [retired](https://www.ruby-lang.org/en/news/2015/02/23/support-for-ruby-1-9-3-has-ended/) -* 1.8.7 - Ruby 1.8.7 has been - [retired](http://www.ruby-lang.org/en/news/2013/06/30/we-retire-1-8-7/). - -The change between 1.8.7 to 1.9.x is a much larger change than 1.9.3 to 2.0.0. -For instance, the 1.9 series introduced encodings and a bytecode VM. There -are projects still on 1.8.7, but they are becoming a small minority, as most of -the community has moved to at least 1.9.2 or 1.9.3. - ## Ruby Implementations The Ruby ecosystem enjoys many different implementations of Ruby, each with -- cgit v1.2.3 From 057511f3a7cf41f7fc524504a063c261c0ddf836 Mon Sep 17 00:00:00 2001 From: Topher Date: Wed, 8 Aug 2018 19:17:43 +0300 Subject: [lua/en] Added a note about the wonky ternary Ternaries in lua only work if the value returned when the condition evaluates to `true` is not `false` or `Nil`. --- lua.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua.html.markdown b/lua.html.markdown index 1e2d4366..2139003a 100644 --- a/lua.html.markdown +++ b/lua.html.markdown @@ -62,6 +62,10 @@ if not aBoolValue then print('twas false') end -- in C/js: ans = aBoolValue and 'yes' or 'no' --> 'no' +-- BEWARE: this only acts as a ternary value returned when the condition is true is not `false` or Nil +ans1 = aBoolValue and false or true --> true +ans2 = aBoolValue and true or false --> true + karlSum = 0 for i = 1, 100 do -- The range includes both ends. karlSum = karlSum + i -- cgit v1.2.3 From 5e4079fa338040a6ee6951a61ace90e87a925159 Mon Sep 17 00:00:00 2001 From: Topher Date: Wed, 8 Aug 2018 19:24:40 +0300 Subject: [lua/en] Fixed formatting and variable names --- lua.html.markdown | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lua.html.markdown b/lua.html.markdown index 2139003a..32174a81 100644 --- a/lua.html.markdown +++ b/lua.html.markdown @@ -62,9 +62,10 @@ if not aBoolValue then print('twas false') end -- in C/js: ans = aBoolValue and 'yes' or 'no' --> 'no' --- BEWARE: this only acts as a ternary value returned when the condition is true is not `false` or Nil -ans1 = aBoolValue and false or true --> true -ans2 = aBoolValue and true or false --> true +-- BEWARE: this only acts as a ternary if the value returned when the condition +-- evaluates to true is not `false` or Nil +iAmNotFalse = (not aBoolValue) and false or true --> true +iAmAlsoNotFalse = (not aBoolValue) and true or false --> true karlSum = 0 for i = 1, 100 do -- The range includes both ends. -- cgit v1.2.3 From dcfb420ff896fa326fddb609c669133cf24a6e88 Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Wed, 29 Aug 2018 17:06:13 +0530 Subject: Fix build error in 'build/docs/cs-cz/markdown/index.html' --- cs-cz/markdown.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cs-cz/markdown.html.markdown b/cs-cz/markdown.html.markdown index 568e4343..35becf94 100644 --- a/cs-cz/markdown.html.markdown +++ b/cs-cz/markdown.html.markdown @@ -13,7 +13,7 @@ Markdown byl vytvořen Johnem Gruberem v roce 2004. Je zamýšlen jako lehce či a psatelná syntaxe, která je jednoduše převeditelná do HTML (a dnes i do mnoha dalších formátů) -```markdown +```md +``` ## Заголовки @@ -50,7 +51,7 @@ HTML-элементы от

до

размечаются очень пр текст, который должен стать заголовком, предваряется соответствующим количеством символов "#": -```markdown +```md # Это заголовок h1 ## Это заголовок h2 ### Это заголовок h3 @@ -60,7 +61,7 @@ HTML-элементы от

до

размечаются очень пр ``` Markdown позволяет размечать заголовки

и

ещё одним способом: -```markdown +```md Это заголовок h1 ================ @@ -72,7 +73,7 @@ Markdown позволяет размечать заголовки

и

Текст легко сделать полужирным и/или курсивным: -```markdown +```md *Этот текст будет выведен курсивом.* _Так же, как этот._ @@ -87,7 +88,7 @@ __И этот тоже.__ В Github Flavored Markdown, стандарте, который используется в Github, текст также можно сделать зачёркнутым: -```markdown +```md ~~Зачёркнутый текст.~~ ``` @@ -96,7 +97,7 @@ __И этот тоже.__ Абзацами являются любые строки, следующие друг за другом. Разделяются же абзацы одной или несколькими пустыми строками: -```markdown +```md Это абзац. Я печатаю в абзаце, разве это не прикольно? А тут уже абзац №2. @@ -108,7 +109,7 @@ __И этот тоже.__ Для вставки принудительных переносов можно завершить абзац двумя дополнительными пробелами: -```markdown +```md Эта строка завершается двумя пробелами (выделите, чтобы увидеть!). Над этой строкой есть
! @@ -116,7 +117,7 @@ __И этот тоже.__ Цитаты размечаются с помощью символа «>»: -```markdown +```md > Это цитата. В цитатах можно > принудительно переносить строки, вставляя «>» в начало каждой следующей строки. А можно просто оставлять их достаточно длинными, и такие длинные строки будут перенесены автоматически. > Разницы между этими двумя подходами к переносу строк нет, коль скоро @@ -133,7 +134,7 @@ __И этот тоже.__ одного из символов «*», «+» или «-»: (символ должен быть одним и тем же для всех элементов) -```markdown +```md * Список, * Размеченный * Звёздочками @@ -154,7 +155,7 @@ __И этот тоже.__ В нумерованных списках каждая строка начинается с числа и точки вслед за ним: -```markdown +```md 1. Первый элемент 2. Второй элемент 3. Третий элемент @@ -164,7 +165,7 @@ __И этот тоже.__ любое число в начале каждого элемента, и парсер пронумерует элементы сам! Правда, злоупотреблять этим не стоит :) -```markdown +```md 1. Первый элемент 1. Второй элемент 1. Третий элемент @@ -173,7 +174,7 @@ __И этот тоже.__ Списки могут быть вложенными: -```markdown +```md 1. Введение 2. Начало работы 3. Примеры использования @@ -184,7 +185,7 @@ __И этот тоже.__ Можно даже делать списки задач. Блок ниже создаёт HTML-флажки. -```markdown +```md Для отметки флажка используйте «x» - [ ] Первая задача - [ ] Вторая задача @@ -197,7 +198,7 @@ __И этот тоже.__ Фрагменты исходного кода (обычно отмечаемые тегом ``) выделяются просто: каждая строка блока должна иметь отступ в четыре пробела либо в один символ табуляции. -```markdown +```md Это код, причём многострочный ``` @@ -205,7 +206,7 @@ __И этот тоже.__ Вы также можете делать дополнительные отступы, добавляя символы табуляции или по четыре пробела: -```markdown +```md my_array.each do |item| puts item end @@ -215,7 +216,7 @@ __И этот тоже.__ не выделяя код в блок. Для этого фрагменты кода нужно обрамлять символами «`»: -```markdown +```md Ваня даже не знал, что делает функция `go_to()`! ``` @@ -237,7 +238,7 @@ end Разделители (`
`) добавляются вставкой строки из трёх и более (одинаковых) символов «*» или «-», с пробелами или без них: -```markdown +```md *** --- - - - @@ -251,18 +252,18 @@ end текст ссылки, заключив его в квадратные скобки, и сразу после — URL-адрес, заключенный в круглые -```markdown +```md [Ссылка!](http://test.com/) ``` Также для ссылки можно указать всплывающую подсказку (`title`), используя кавычки внутри круглых скобок: -```markdown +```md [Ссылка!](http://test.com/ "Ссылка на Test.com") ``` Относительные пути тоже возможны: -```markdown +```md [Перейти к музыке](/music/). ``` @@ -290,7 +291,7 @@ Markdown также позволяет размечать ссылку в вид Разметка изображений очень похожа на разметку ссылок. Нужно всего лишь добавить перед ссылкой восклицательный знак! -```markdown +```md ![Альтернативный текст для изображения](http://imgur.com/myimage.jpg "Подсказка") ``` Изображения тоже могут быть оформлены, как сноски. @@ -301,20 +302,20 @@ Markdown также позволяет размечать ссылку в вид ## Разное ### Автоссылки -```markdown +```md Ссылка вида эквивалентна [http://testwebsite.com/](http://testwebsite.com/) ``` ### Автоссылки для адресов электронной почты -```markdown +```md ``` ### Экранирование символов -```markdown +```md Я хочу напечатать *текст, заключённый в звёздочки*, но я не хочу, чтобы он был курсивным. Тогда я делаю так: \*Текст, заключённый в звёздочки\* @@ -324,7 +325,7 @@ Markdown также позволяет размечать ссылку в вид В Github Flavored Markdown для представления клавиш на клавиатуре вы можете использовать тег ``. -```markdown +```md Ваш компьютер завис? Попробуйте нажать Ctrl+Alt+Del ``` @@ -334,7 +335,7 @@ Markdown также позволяет размечать ссылку в вид да и синтаксис имеют не слишком удобный. Но если очень нужно, размечайте таблицы так: -```markdown +```md | Столбец 1 | Столбец 2 | Столбец 3 | | :----------- | :----------: | -----------: | | Выравнивание | Выравнивание | Выравнивание | @@ -342,7 +343,7 @@ Markdown также позволяет размечать ссылку в вид ``` Или более компактно -```markdown +```md Столбец 1|Столбец 2|Столбец 3 :--|:-:|--: Выглядит|это|страшновато... -- cgit v1.2.3 From 150e8666b1094ee27de378496900f548167a4eec Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Wed, 29 Aug 2018 17:19:21 +0530 Subject: Fix build error in 'build/docs/it-it/markdown/index.html' --- it-it/markdown.html.markdown | 60 ++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/it-it/markdown.html.markdown b/it-it/markdown.html.markdown index 44801747..b0a123f1 100644 --- a/it-it/markdown.html.markdown +++ b/it-it/markdown.html.markdown @@ -28,7 +28,7 @@ Markdown varia nelle sue implementazioni da un parser all'altro. Questa guida ce ## Elementi HTML Markdown è un superset di HTML, quindi ogni file HTML è a sua volta un file Markdown valido. -```markdown +```md Potete creare gli elementi HTML da `

` a `

` facilmente, basta che inseriate un egual numero di caratteri cancelletto (#) prima del testo che volete all'interno dell'elemento -```markdown +```md # Questo è un

## Questo è un

### Questo è un

@@ -49,7 +49,7 @@ Potete creare gli elementi HTML da `

` a `

` facilmente, basta che inseria ``` Markdown inoltre fornisce due alternative per indicare gli elementi h1 e h2 -```markdown +```md Questo è un h1 ============== @@ -60,7 +60,7 @@ Questo è un h2 ## Stili di testo semplici Il testo può essere stilizzato in corsivo o grassetto usando markdown -```markdown +```md *Questo testo è in corsivo.* _Come pure questo._ @@ -74,12 +74,12 @@ __Come pure questo.__ In Github Flavored Markdown, che è utilizzato per renderizzare i file markdown su Github, è presente anche lo stile barrato: -```markdown +```md ~~Questo testo è barrato.~~ ``` ## Paragrafi -```markdown +```md I paragrafi sono una o più linee di testo adiacenti separate da una o più righe vuote. Questo è un paragrafo. Sto scrivendo in un paragrafo, non è divertente? @@ -93,7 +93,7 @@ Qui siamo nel paragrafo 3! Se volete inserire l'elemento HTML `
`, potete terminare la linea con due o più spazi e poi iniziare un nuovo paragrafo. -```markdown +```md Questa frase finisce con due spazi (evidenziatemi per vederli). C'è un
sopra di me! @@ -101,7 +101,7 @@ C'è un
sopra di me! Le citazioni sono semplici da inserire, basta usare il carattere >. -```markdown +```md > Questa è una citazione. Potete > mandare a capo manualmente le linee e inserire un `>` prima di ognuna, oppure potete usare una sola linea e lasciare che vada a capo automaticamente. > Non c'è alcuna differenza, basta che iniziate ogni riga con `>`. @@ -115,7 +115,7 @@ Le citazioni sono semplici da inserire, basta usare il carattere >. ## Liste Le liste non ordinate possono essere inserite usando gli asterischi, il simbolo più o dei trattini -```markdown +```md * Oggetto * Oggetto * Altro oggetto @@ -135,7 +135,7 @@ oppure Le liste ordinate invece, sono inserite con un numero seguito da un punto. -```markdown +```md 1. Primo oggetto 2. Secondo oggetto 3. Terzo oggetto @@ -143,7 +143,7 @@ Le liste ordinate invece, sono inserite con un numero seguito da un punto. Non dovete nemmeno mettere i numeri nell'ordine giusto, markdown li visualizzerà comunque nell'ordine corretto, anche se potrebbe non essere una buona idea. -```markdown +```md 1. Primo oggetto 1. Secondo oggetto 1. Terzo oggetto @@ -152,7 +152,7 @@ Non dovete nemmeno mettere i numeri nell'ordine giusto, markdown li visualizzer Potete inserire anche sotto liste -```markdown +```md 1. Primo oggetto 2. Secondo oggetto 3. Terzo oggetto @@ -163,7 +163,7 @@ Potete inserire anche sotto liste Sono presenti anche le task list. In questo modo è possibile creare checkbox in HTML. -```markdown +```md I box senza la 'x' sono checkbox HTML ancora da completare. - [ ] Primo task da completare. - [ ] Secondo task che deve essere completato. @@ -174,14 +174,14 @@ Il box subito sotto è una checkbox HTML spuntata. Potete inserire un estratto di codice (che utilizza l'elemento ``) indentando una linea con quattro spazi oppure con un carattere tab. -```markdown +```md Questa è una linea di codice Come questa ``` Potete inoltre inserire un altro tab (o altri quattro spazi) per indentare il vostro codice -```markdown +```md my_array.each do |item| puts item end @@ -189,7 +189,7 @@ Potete inoltre inserire un altro tab (o altri quattro spazi) per indentare il vo Codice inline può essere inserito usando il carattere backtick ` -```markdown +```md Giovanni non sapeva neppure a cosa servisse la funzione `go_to()`! ``` @@ -205,7 +205,7 @@ Se usate questa sintassi, il testo non richiederà di essere indentato, inoltre ## Linea orizzontale Le linee orizzontali (`
`) sono inserite facilmente usanto tre o più asterischi o trattini, con o senza spazi. -```markdown +```md *** --- - - - @@ -215,24 +215,24 @@ Le linee orizzontali (`
`) sono inserite facilmente usanto tre o più asteri ## Links Una delle funzionalità migliori di markdown è la facilità con cui si possono inserire i link. Mettete il testo da visualizzare fra parentesi quadre [] seguite dall'url messo fra parentesi tonde () -```markdown +```md [Cliccami!](http://test.com/) ``` Potete inoltre aggiungere al link un titolo mettendolo fra doppi apici dopo il link -```markdown +```md [Cliccami!](http://test.com/ "Link a Test.com") ``` La sintassi funziona anche con i path relativi. -```markdown +```md [Vai a musica](/music/). ``` Markdown supporta inoltre anche la possibilità di aggiungere i link facendo riferimento ad altri punti del testo. -```markdown +```md [Apri questo link][link1] per più informazioni! [Guarda anche questo link][foobar] se ti va. @@ -242,7 +242,7 @@ Markdown supporta inoltre anche la possibilità di aggiungere i link facendo rif l titolo può anche essere inserito in apici singoli o in parentesi, oppure omesso interamente. Il riferimento può essere inserito in un punto qualsiasi del vostro documento e l'identificativo del riferimento può essere lungo a piacere a patto che sia univoco. Esiste anche un "identificativo implicito" che vi permette di usare il testo del link come id. -```markdown +```md [Questo][] è un link. [Questo]: http://thisisalink.com/ @@ -252,13 +252,13 @@ Ma non è comunemente usato. ## Immagini Le immagini sono inserite come i link ma con un punto esclamativo inserito prima delle parentesi quadre! -```markdown +```md ![Qeusto è il testo alternativo per l'immagine](http://imgur.com/myimage.jpg "Il titolo opzionale") ``` E la modalità a riferimento funziona esattamente come ci si aspetta -```markdown +```md ![Questo è il testo alternativo.][myimage] [myimage]: relative/urls/cool/image.jpg "Se vi serve un titolo, lo mettete qui" @@ -266,25 +266,25 @@ E la modalità a riferimento funziona esattamente come ci si aspetta ## Miscellanea ### Auto link -```markdown +```md è equivalente ad [http://testwebsite.com/](http://testwebsite.com/) ``` ### Auto link per le email -```markdown +```md ``` ### Caratteri di escaping -```markdown +```md Voglio inserire *questo testo circondato da asterischi* ma non voglio che venga renderizzato in corsivo, quindi lo inserirò così: \*questo testo è circondato da asterischi\*. ``` ### Combinazioni di tasti In Github Flavored Markdown, potete utilizzare il tag `` per raffigurare i tasti della tastiera. -```markdown +```md Il tuo computer è crashato? Prova a premere Ctrl+Alt+Canc ``` @@ -292,7 +292,7 @@ Il tuo computer è crashato? Prova a premere ### Tabelle Le tabelle sono disponibili solo in Github Flavored Markdown e sono leggeremente complesse, ma se proprio volete inserirle fate come segue: -```markdown +```md | Col1 | Col2 | Col3 | | :------------------- | :------: | -----------------: | | Allineato a sinistra | Centrato | Allineato a destra | @@ -300,7 +300,7 @@ Le tabelle sono disponibili solo in Github Flavored Markdown e sono leggeremente ``` oppure, per lo stesso risultato -```markdown +```md Col 1 | Col2 | Col3 :-- | :-: | --: È una cosa orrenda | fatela | finire in fretta -- cgit v1.2.3 From 0b36159335327d7b217cfd9116a0adc3e27c5120 Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Wed, 29 Aug 2018 17:21:05 +0530 Subject: Fix build error in 'build/docs/es-es/markdown-es/index.html' --- es-es/markdown-es.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es-es/markdown-es.html.markdown b/es-es/markdown-es.html.markdown index 0505b4cb..e23a94ea 100644 --- a/es-es/markdown-es.html.markdown +++ b/es-es/markdown-es.html.markdown @@ -14,7 +14,7 @@ fácilmente a HTML (y, actualmente, otros formatos también). ¡Denme toda la retroalimentación que quieran! / ¡Sientanse en la libertad de hacer forks o pull requests! -```markdown +```md @@ -34,7 +34,7 @@ HTML은 마크다운의 수퍼셋입니다. 모든 HTML 파일은 유효한 마 텍스트 앞에 붙이는 우물 정 기호(#)의 갯수에 따라 `

`부터 `

`까지의 HTML 요소를 손쉽게 작성할 수 있습니다. -```markdown +```md #

입니다. ##

입니다. ###

입니다. @@ -43,7 +43,7 @@ HTML은 마크다운의 수퍼셋입니다. 모든 HTML 파일은 유효한 마 ######

입니다. ``` 또한 h1과 h2를 나타내는 다른 방법이 있습니다. -```markdown +```md h1입니다. ============= @@ -53,7 +53,7 @@ h2입니다. ## 간단한 텍스트 꾸미기 마크다운으로 쉽게 텍스트를 기울이거나 굵게 할 수 있습니다. -```markdown +```md *기울인 텍스트입니다.* _이 텍스트도 같습니다._ @@ -65,14 +65,14 @@ __이 텍스트도 같습니다.__ *__이것도 같습니다.__* ``` 깃헙 전용 마크다운에는 취소선도 있습니다. -```markdown +```md ~~이 텍스트에는 취소선이 그려집니다.~~ ``` ## 문단 문단은 하나 이상의 빈 줄로 구분되는, 한 줄 이상의 인접한 텍스트입니다. -```markdown +```md 문단입니다. 문단에 글을 쓰다니 재밌지 않나요? 이제 두 번째 문단입니다. @@ -83,7 +83,7 @@ __이 텍스트도 같습니다.__ HTML `
` 태그를 삽입하고 싶으시다면, 두 개 이상의 띄어쓰기로 문단을 끝내고 새 문단을 시작할 수 있습니다. -```markdown +```md 띄어쓰기 두 개로 끝나는 문단 (마우스로 긁어 보세요). 이 위에는 `
` 태그가 있습니다. @@ -91,7 +91,7 @@ HTML `
` 태그를 삽입하고 싶으시다면, 두 개 이상의 띄어 인용문은 > 문자로 쉽게 쓸 수 있습니다. -```markdown +```md > 인용문입니다. 수동으로 개행하고서 > 줄마다 `>`를 칠 수도 있고 줄을 길게 쓴 다음에 저절로 개행되게 내버려 둘 수도 있습니다. > `>`로 시작하기만 한다면 차이가 없습니다. @@ -103,7 +103,7 @@ HTML `
` 태그를 삽입하고 싶으시다면, 두 개 이상의 띄어 ## 목록 순서가 없는 목록은 별표, 더하기, 하이픈을 이용해 만들 수 있습니다. -```markdown +```md * 이거 * 저거 * 그거 @@ -111,7 +111,7 @@ HTML `
` 태그를 삽입하고 싶으시다면, 두 개 이상의 띄어 또는 -```markdown +```md + 이거 + 저거 + 그거 @@ -119,7 +119,7 @@ HTML `
` 태그를 삽입하고 싶으시다면, 두 개 이상의 띄어 또는 -```markdown +```md - 이거 - 저거 - 그거 @@ -127,7 +127,7 @@ HTML `
` 태그를 삽입하고 싶으시다면, 두 개 이상의 띄어 순서가 있는 목록은 숫자와 마침표입니다. -```markdown +```md 1. 하나 2. 둘 3. 셋 @@ -135,7 +135,7 @@ HTML `
` 태그를 삽입하고 싶으시다면, 두 개 이상의 띄어 숫자를 정확히 붙이지 않더라도 제대로 된 순서로 보여주겠지만, 좋은 생각은 아닙니다. -```markdown +```md 1. 하나 1. 둘 1. 셋 @@ -144,7 +144,7 @@ HTML `
` 태그를 삽입하고 싶으시다면, 두 개 이상의 띄어 목록 안에 목록이 올 수도 있습니다. -```markdown +```md 1. 하나 2. 둘 3. 셋 @@ -155,7 +155,7 @@ HTML `
` 태그를 삽입하고 싶으시다면, 두 개 이상의 띄어 심지어 할 일 목록도 있습니다. HTML 체크박스가 만들어집니다. -```markdown +```md x가 없는 박스들은 체크되지 않은 HTML 체크박스입니다. - [ ] 첫 번째 할 일 - [ ] 두 번째 할 일 @@ -168,13 +168,13 @@ x가 없는 박스들은 체크되지 않은 HTML 체크박스입니다. 띄어쓰기 네 개 혹은 탭 한 개로 줄을 들여씀으로서 (` 요소를 사용하여`) 코드를 나타낼 수 있습니다. -```markdown +```md puts "Hello, world!" ``` 탭을 더 치거나 띄어쓰기를 네 번 더 함으로써 코드를 들여쓸 수 있습니다. -```markdown +```md my_array.each do |item| puts item end @@ -182,7 +182,7 @@ x가 없는 박스들은 체크되지 않은 HTML 체크박스입니다. 인라인 코드는 백틱 문자를 이용하여 나타냅니다. ` -```markdown +```md 철수는 `go_to()` 함수가 뭘 했는지도 몰랐어! ``` @@ -202,7 +202,7 @@ end 수평선(`
`)은 셋 이상의 별표나 하이픈을 이용해 쉽게 나타낼 수 있습니다. 띄어쓰기가 포함될 수 있습니다. -```markdown +```md *** --- - - - @@ -213,19 +213,19 @@ end 마크다운의 장점 중 하나는 링크를 만들기 쉽다는 것입니다. 대괄호 안에 나타낼 텍스트를 쓰고 괄호 안에 URL을 쓰면 됩니다. -```markdown +```md [클릭](http://test.com/) ``` 괄호 안에 따옴표를 이용해 링크에 제목을 달 수도 있습니다. -```markdown +```md [클릭](http://test.com/ "test.com으로 가기") ``` 상대 경로도 유효합니다. -```markdown +```md [music으로 가기](/music/). ``` @@ -251,7 +251,7 @@ end ## 이미지 이미지는 링크와 같지만 앞에 느낌표가 붙습니다. -```markdown +```md ![이미지의 alt 속성](http://imgur.com/myimage.jpg "제목") ``` @@ -264,18 +264,18 @@ end ## 기타 ### 자동 링크 -```markdown +```md 와 [http://testwebsite.com/](http://testwebsite.com/)는 동일합니다. ``` ### 이메일 자동 링크 -```markdown +```md ``` ### 탈출 문자 -```markdown +```md *별표 사이에 이 텍스트*를 치고 싶지만 기울이고 싶지는 않다면 이렇게 하시면 됩니다. \*별표 사이에 이 텍스트\*. ``` @@ -284,7 +284,7 @@ end 깃헙 전용 마크다운에서는 `` 태그를 이용해 키보드 키를 나타낼 수 있습니다. -```markdown +```md 컴퓨터가 멈췄다면 눌러보세요. Ctrl+Alt+Del ``` @@ -292,14 +292,14 @@ end ### 표 표는 깃헙 전용 마크다운에서만 쓸 수 있고 다소 복잡하지만, 정말 쓰고 싶으시다면 -```markdown +```md | 1열 | 2열 | 3열 | | :--------| :-------: | --------: | | 왼쪽 정렬 | 가운데 정렬 | 오른쪽 정렬 | | 머시기 | 머시기 | 머시기 | ``` 혹은 -```markdown +```md 1열 | 2열 | 3열 :-- | :-: | --: 으악 너무 못생겼어 | 그만 | 둬 -- cgit v1.2.3 From 94bf9e8544b0f16bc7a94404f14dab69b4786a90 Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Wed, 29 Aug 2018 17:37:27 +0530 Subject: Fix build error in 'build/docs/es-es/visualbasic-es/index.html' --- es-es/visualbasic-es.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es-es/visualbasic-es.html.markdown b/es-es/visualbasic-es.html.markdown index c7f581c0..ca00626b 100644 --- a/es-es/visualbasic-es.html.markdown +++ b/es-es/visualbasic-es.html.markdown @@ -10,7 +10,7 @@ filename: learnvisualbasic-es.vb lang: es-es --- -```vb +``` Module Module1 Sub Main() -- cgit v1.2.3 From 61abf1c181d787c23fd529807149e872d0651b07 Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Wed, 29 Aug 2018 17:38:12 +0530 Subject: Fix build error in 'build/docs/pt-br/visualbasic-pt/index.html' --- pt-br/visualbasic-pt.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt-br/visualbasic-pt.html.markdown b/pt-br/visualbasic-pt.html.markdown index b94ab609..2a7205cd 100644 --- a/pt-br/visualbasic-pt.html.markdown +++ b/pt-br/visualbasic-pt.html.markdown @@ -8,7 +8,7 @@ lang: pt-br filename: learnvisualbasic-pt.vb --- -```vb +``` Module Module1 module Module1 -- cgit v1.2.3 From 38ac974e604b932e1be16d8e4bd87c2f46cdae88 Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Wed, 29 Aug 2018 17:45:19 +0530 Subject: Fix build error in 'build/docs/es-es/objective-c-es/index.html' --- es-es/objective-c-es.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es-es/objective-c-es.html.markdown b/es-es/objective-c-es.html.markdown index bdbce524..0e680372 100644 --- a/es-es/objective-c-es.html.markdown +++ b/es-es/objective-c-es.html.markdown @@ -13,7 +13,7 @@ Objective C es el lenguaje de programación principal utilizado por Apple para l Es un lenguaje de programación para propósito general que le agrega al lenguaje de programación C una mensajería estilo "Smalltalk". -```objective_c +```objc // Los comentarios de una sola línea inician con // /* -- cgit v1.2.3 From b57cca8587b0205cd9b9e898143d2dc237a817be Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Wed, 29 Aug 2018 17:57:09 +0530 Subject: Fix build error in 'build/docs/cypher/index.html' --- cypher.html.markdown | 68 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 51 insertions(+), 17 deletions(-) diff --git a/cypher.html.markdown b/cypher.html.markdown index b7be544a..867474a5 100644 --- a/cypher.html.markdown +++ b/cypher.html.markdown @@ -16,19 +16,29 @@ Nodes **Represents a record in a graph.** -```()``` +``` +() +``` It's an empty *node*, to indicate that there is a *node*, but it's not relevant for the query. -```(n)``` +``` +(n) +``` It's a *node* referred by the variable **n**, reusable in the query. It begins with lowercase and uses camelCase. -```(p:Person)``` +``` +(p:Person) +``` You can add a *label* to your node, here **Person**. It's like a type / a class / a category. It begins with uppercase and uses camelCase. -```(p:Person:Manager)``` +``` +(p:Person:Manager) +``` A node can have many *labels*. -```(p:Person {name : 'Théo Gauchoux', age : 22})``` +``` +(p:Person {name : 'Théo Gauchoux', age : 22}) +``` A node can have some *properties*, here **name** and **age**. It begins with lowercase and uses camelCase. The types allowed in properties : @@ -40,7 +50,9 @@ The types allowed in properties : *Warning : there isn't datetime property in Cypher ! You can use String with a specific pattern or a Numeric from a specific date.* -```p.name``` +``` +p.name +``` You can access to a property with the dot style. @@ -49,16 +61,24 @@ Relationships (or Edges) **Connects two nodes** -```[:KNOWS]``` +``` +[:KNOWS] +``` It's a *relationship* with the *label* **KNOWS**. It's a *label* as the node's label. It begins with uppercase and use UPPER_SNAKE_CASE. -```[k:KNOWS]``` +``` +[k:KNOWS] +``` The same *relationship*, referred by the variable **k**, reusable in the query, but it's not necessary. -```[k:KNOWS {since:2017}]``` +``` +[k:KNOWS {since:2017}] +``` The same *relationship*, with *properties* (like *node*), here **since**. -```[k:KNOWS*..4]``` +``` +[k:KNOWS*..4] +``` It's a structural information to use in a *path* (seen later). Here, **\*..4** says "Match the pattern, with the relationship **k** which be repeated between 1 and 4 times. @@ -67,16 +87,24 @@ Paths **The way to mix nodes and relationships.** -```(a:Person)-[:KNOWS]-(b:Person)``` +``` +(a:Person)-[:KNOWS]-(b:Person) +``` A path describing that **a** and **b** know each other. -```(a:Person)-[:MANAGES]->(b:Person)``` +``` +(a:Person)-[:MANAGES]->(b:Person) +``` A path can be directed. This path describes that **a** is the manager of **b**. -```(a:Person)-[:KNOWS]-(b:Person)-[:KNOWS]-(c:Person)``` +``` +(a:Person)-[:KNOWS]-(b:Person)-[:KNOWS]-(c:Person) +``` You can chain multiple relationships. This path describes the friend of a friend. -```(a:Person)-[:MANAGES]->(b:Person)-[:MANAGES]->(c:Person)``` +``` +(a:Person)-[:MANAGES]->(b:Person)-[:MANAGES]->(c:Person) +``` A chain can also be directed. This path describes that **a** is the boss of **b** and the big boss of **c**. Patterns often used (from Neo4j doc) : @@ -230,13 +258,19 @@ DELETE n, r Other useful clauses --- -```PROFILE``` +``` +PROFILE +``` Before a query, show the execution plan of it. -```COUNT(e)``` +``` +COUNT(e) +``` Count entities (nodes or relationships) matching **e**. -```LIMIT x``` +``` +LIMIT x +``` Limit the result to the x first results. -- cgit v1.2.3 From 926a2bdc88314eac0abbc82a1a15545435fec011 Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Wed, 29 Aug 2018 18:02:42 +0530 Subject: Revert "Fix build error in 'build/docs/es-es/objective-c-es/index.html'" This reverts commit 38ac974e604b932e1be16d8e4bd87c2f46cdae88 as the issue has already been fixed upstream. --- es-es/objective-c-es.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es-es/objective-c-es.html.markdown b/es-es/objective-c-es.html.markdown index 0e680372..bdbce524 100644 --- a/es-es/objective-c-es.html.markdown +++ b/es-es/objective-c-es.html.markdown @@ -13,7 +13,7 @@ Objective C es el lenguaje de programación principal utilizado por Apple para l Es un lenguaje de programación para propósito general que le agrega al lenguaje de programación C una mensajería estilo "Smalltalk". -```objc +```objective_c // Los comentarios de una sola línea inician con // /* -- cgit v1.2.3 From f95558ff9260d4522cabca1ca112417deb4fd905 Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Wed, 29 Aug 2018 18:03:27 +0530 Subject: Revert "Fix build error in 'build/docs/cypher/index.html'" This reverts commit b57cca8587b0205cd9b9e898143d2dc237a817be as the issue has already been fixed upstream. --- cypher.html.markdown | 68 +++++++++++++--------------------------------------- 1 file changed, 17 insertions(+), 51 deletions(-) diff --git a/cypher.html.markdown b/cypher.html.markdown index 867474a5..b7be544a 100644 --- a/cypher.html.markdown +++ b/cypher.html.markdown @@ -16,29 +16,19 @@ Nodes **Represents a record in a graph.** -``` -() -``` +```()``` It's an empty *node*, to indicate that there is a *node*, but it's not relevant for the query. -``` -(n) -``` +```(n)``` It's a *node* referred by the variable **n**, reusable in the query. It begins with lowercase and uses camelCase. -``` -(p:Person) -``` +```(p:Person)``` You can add a *label* to your node, here **Person**. It's like a type / a class / a category. It begins with uppercase and uses camelCase. -``` -(p:Person:Manager) -``` +```(p:Person:Manager)``` A node can have many *labels*. -``` -(p:Person {name : 'Théo Gauchoux', age : 22}) -``` +```(p:Person {name : 'Théo Gauchoux', age : 22})``` A node can have some *properties*, here **name** and **age**. It begins with lowercase and uses camelCase. The types allowed in properties : @@ -50,9 +40,7 @@ The types allowed in properties : *Warning : there isn't datetime property in Cypher ! You can use String with a specific pattern or a Numeric from a specific date.* -``` -p.name -``` +```p.name``` You can access to a property with the dot style. @@ -61,24 +49,16 @@ Relationships (or Edges) **Connects two nodes** -``` -[:KNOWS] -``` +```[:KNOWS]``` It's a *relationship* with the *label* **KNOWS**. It's a *label* as the node's label. It begins with uppercase and use UPPER_SNAKE_CASE. -``` -[k:KNOWS] -``` +```[k:KNOWS]``` The same *relationship*, referred by the variable **k**, reusable in the query, but it's not necessary. -``` -[k:KNOWS {since:2017}] -``` +```[k:KNOWS {since:2017}]``` The same *relationship*, with *properties* (like *node*), here **since**. -``` -[k:KNOWS*..4] -``` +```[k:KNOWS*..4]``` It's a structural information to use in a *path* (seen later). Here, **\*..4** says "Match the pattern, with the relationship **k** which be repeated between 1 and 4 times. @@ -87,24 +67,16 @@ Paths **The way to mix nodes and relationships.** -``` -(a:Person)-[:KNOWS]-(b:Person) -``` +```(a:Person)-[:KNOWS]-(b:Person)``` A path describing that **a** and **b** know each other. -``` -(a:Person)-[:MANAGES]->(b:Person) -``` +```(a:Person)-[:MANAGES]->(b:Person)``` A path can be directed. This path describes that **a** is the manager of **b**. -``` -(a:Person)-[:KNOWS]-(b:Person)-[:KNOWS]-(c:Person) -``` +```(a:Person)-[:KNOWS]-(b:Person)-[:KNOWS]-(c:Person)``` You can chain multiple relationships. This path describes the friend of a friend. -``` -(a:Person)-[:MANAGES]->(b:Person)-[:MANAGES]->(c:Person) -``` +```(a:Person)-[:MANAGES]->(b:Person)-[:MANAGES]->(c:Person)``` A chain can also be directed. This path describes that **a** is the boss of **b** and the big boss of **c**. Patterns often used (from Neo4j doc) : @@ -258,19 +230,13 @@ DELETE n, r Other useful clauses --- -``` -PROFILE -``` +```PROFILE``` Before a query, show the execution plan of it. -``` -COUNT(e) -``` +```COUNT(e)``` Count entities (nodes or relationships) matching **e**. -``` -LIMIT x -``` +```LIMIT x``` Limit the result to the x first results. -- cgit v1.2.3 From 099462b49e37edb327edb3afe01250e02c477e11 Mon Sep 17 00:00:00 2001 From: Adam Bard Date: Thu, 30 Aug 2018 19:10:56 -0700 Subject: Reinstate test --- tests/encoding.rb | 32 ++++++++++++++++++++++++++++++++ tests/yaml.rb | 21 +++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 tests/encoding.rb create mode 100644 tests/yaml.rb diff --git a/tests/encoding.rb b/tests/encoding.rb new file mode 100644 index 00000000..a0b3b184 --- /dev/null +++ b/tests/encoding.rb @@ -0,0 +1,32 @@ +#!/usr/bin/env ruby +require 'charlock_holmes' +$file_count = 0; +markdown_files = Dir["./**/*.html.markdown"] +markdown_files.each do |file| + begin + contents = File.read(file) + detection = CharlockHolmes::EncodingDetector.detect(contents) + case detection[:encoding] + when 'UTF-8' + $file_count = $file_count + 1 + when 'ISO-8859-1' + $file_count = $file_count + 1 + when /ISO-8859/ + puts "Notice: #{file} was detected as #{detection[:encoding]} encoding. Everything is probably fine." + $file_count = $file_count + 1 + else + puts "WARNING #{file} was detected as #{detection[:encoding]} encoding. Please save the file in UTF-8!" + end + rescue Exception => msg + puts msg + end +end +files_failed = markdown_files.length - $file_count +if files_failed != 0 + puts "FAILURE!!! #{files_failed} files were unable to be validated as UTF-8!" + puts "Please resave the file as UTF-8." + exit 1 +else + puts "Success. All #{$file_count} files passed UTF-8 validity checks." + exit 0 +end diff --git a/tests/yaml.rb b/tests/yaml.rb new file mode 100644 index 00000000..0ed918e0 --- /dev/null +++ b/tests/yaml.rb @@ -0,0 +1,21 @@ +#!/usr/bin/env ruby +require 'yaml'; +$file_count = 0; +markdown_files = Dir["./**/*.html.markdown"] +markdown_files.each do |file| + begin + YAML.load_file(file) + $file_count = $file_count + 1 + rescue Exception => msg + puts msg + end +end +files_failed = markdown_files.length - $file_count +if files_failed != 0 + puts "FAILURE!!! #{files_failed} files were unable to be parsed!" + puts "Please check the YAML headers for the documents that failed!" + exit 1 +else + puts "All #{$file_count} files were verified valid YAML" + exit 0 +end -- cgit v1.2.3 From f0849286f84adcfbfd0b4a64ddcdf8e88f27ae28 Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Fri, 31 Aug 2018 16:54:29 +0530 Subject: Fix build error in 'build/docs/es-es/learnsmallbasic-es/index.html' --- es-es/learnsmallbasic-es.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es-es/learnsmallbasic-es.html.markdown b/es-es/learnsmallbasic-es.html.markdown index 21208792..ff320afb 100644 --- a/es-es/learnsmallbasic-es.html.markdown +++ b/es-es/learnsmallbasic-es.html.markdown @@ -18,7 +18,7 @@ SmallBASIC fue desarrollado originalmente por Nicholas Christopoulos a finales d Versiones de SmallBASIC se han hecho para una serie dispositivos de mano antiguos, incluyendo Franklin eBookman y el Nokia 770. También se han publicado varias versiones de escritorio basadas en una variedad de kits de herramientas GUI, algunas de las cuales han desaparecido. Las plataformas actualmente soportadas son Linux y Windows basadas en SDL2 y Android basadas en NDK. También está disponible una versión de línea de comandos de escritorio, aunque no suele publicarse en formato binario. Alrededor de 2008 una gran corporación lanzó un entorno de programación BASIC con un nombre de similar. SmallBASIC no está relacionado con este otro proyecto. -```SmallBASIC +``` REM Esto es un comentario ' y esto tambien es un comentario -- cgit v1.2.3 From 478a43c1d4a230a36420cd6d4bc0a27a23f4afef Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Tue, 4 Sep 2018 18:25:57 +0530 Subject: Add language code suffix (#3206) --- fr-fr/java-fr.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fr-fr/java-fr.html.markdown b/fr-fr/java-fr.html.markdown index d0f91611..d6c68343 100644 --- a/fr-fr/java-fr.html.markdown +++ b/fr-fr/java-fr.html.markdown @@ -11,7 +11,7 @@ contributors: - ["Michael Dähnert", "https://github.com/JaXt0r"] - ["Rob Rose", "https://github.com/RobRoseKnows"] - ["Sean Nam", "https://github.com/seannam"] -filename: JavaFr.java +filename: java-fr.java translators: - ['Mathieu Gemard', 'https://github.com/mgemard'] lang: fr-fr -- cgit v1.2.3 From 4d9aff1d02c06ce45edb708366e5da0bf32d4ef0 Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Tue, 4 Sep 2018 18:29:22 +0530 Subject: Add language code suffix (#3206) --- tr-tr/c++-tr.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tr-tr/c++-tr.html.markdown b/tr-tr/c++-tr.html.markdown index 8ac6ef8b..2c841456 100644 --- a/tr-tr/c++-tr.html.markdown +++ b/tr-tr/c++-tr.html.markdown @@ -1,7 +1,7 @@ --- language: c++ lang: tr-tr -filename: learncpp.cpp +filename: learncpp-tr.cpp contributors: - ["Steven Basart", "http://github.com/xksteven"] - ["Matt Kline", "https://github.com/mrkline"] -- cgit v1.2.3 From 63924d02cc7c00d77920bfdaa5fded9ea850e95a Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Tue, 4 Sep 2018 18:29:36 +0530 Subject: Add language code suffix (#3206) --- tr-tr/git-tr.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tr-tr/git-tr.html.markdown b/tr-tr/git-tr.html.markdown index 72197050..87c1820c 100644 --- a/tr-tr/git-tr.html.markdown +++ b/tr-tr/git-tr.html.markdown @@ -12,7 +12,7 @@ contributors: - ["Milo Gilad", "http://github.com/Myl0g"] - ["Adem Budak", "https://github.com/p1v0t"] -filename: LearnGit.txt +filename: LearnGit-tr.txt --- Git dağınık versiyon kontrol ve kaynak kod yönetim sistemidir. -- cgit v1.2.3 From 7debaf3bfbe3dcb30edffb25c284011b8c649eb1 Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Tue, 4 Sep 2018 18:31:52 +0530 Subject: Add language code suffix (#3206) --- pt-br/solidity-pt.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt-br/solidity-pt.html.markdown b/pt-br/solidity-pt.html.markdown index 37d15bf2..d4555fa7 100644 --- a/pt-br/solidity-pt.html.markdown +++ b/pt-br/solidity-pt.html.markdown @@ -1,6 +1,6 @@ --- language: Solidity -filename: learnSolidity.sol +filename: learnSolidity-br.sol contributors: - ["Nemil Dalal", "https://www.nemil.com"] - ["Joseph Chow", ""] -- cgit v1.2.3 From 2e55664c992f3f5e18b5b113ce9419504a2e25d4 Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Tue, 4 Sep 2018 18:43:46 +0530 Subject: Fix YAML error (#3206) --- es-es/csharp-es.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es-es/csharp-es.html.markdown b/es-es/csharp-es.html.markdown index 5d730497..72a0f90c 100644 --- a/es-es/csharp-es.html.markdown +++ b/es-es/csharp-es.html.markdown @@ -5,7 +5,7 @@ contributors: - ["Irfan Charania", "https://github.com/irfancharania"] - ["Max Yankov", "https://github.com/golergka"] translators: - - ["Olfran Jiménez", "https://twitter.com/neslux"] + - ["Olfran Jiménez", "https://twitter.com/neslux"] lang: es-es --- -- cgit v1.2.3 From 5da3efebe49e5ef7cdfbbaf8e24d6ee679b09e37 Mon Sep 17 00:00:00 2001 From: Rholais Lii Date: Wed, 5 Sep 2018 11:53:59 -0500 Subject: Add language label --- ro-ro/elixir-ro.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ro-ro/elixir-ro.html.markdown b/ro-ro/elixir-ro.html.markdown index d8b261af..10fec3c5 100644 --- a/ro-ro/elixir-ro.html.markdown +++ b/ro-ro/elixir-ro.html.markdown @@ -7,7 +7,7 @@ contributors: - ["Ev Bogdanov", "https://github.com/evbogdanov"] translators: - ["Vitalie Lazu", "https://github.com/vitaliel"] - +lang: ro-ro filename: learnelixir-ro.ex --- -- cgit v1.2.3