diff options
-rw-r--r-- | .github/CODEOWNERS | 5 | ||||
-rw-r--r-- | .github/ISSUE_TEMPLATE.md (renamed from ISSUE_TEMPLATE.md) | 0 | ||||
-rw-r--r-- | .github/PULL_REQUEST_TEMPLATE.md (renamed from PULL_REQUEST_TEMPLATE.md) | 2 | ||||
-rw-r--r-- | bash.html.markdown | 27 | ||||
-rw-r--r-- | c++.html.markdown | 21 | ||||
-rw-r--r-- | c.html.markdown | 48 | ||||
-rw-r--r-- | coq.html.markdown | 8 | ||||
-rw-r--r-- | de-de/nix-de.html.markdown | 3 | ||||
-rw-r--r-- | docker.html.markdown | 13 | ||||
-rw-r--r-- | es-es/typescript-es.html.markdown | 2 | ||||
-rw-r--r-- | fr-fr/typescript-fr.html.markdown | 2 | ||||
-rw-r--r-- | hd-hd/json-hd.html.markdown | 86 | ||||
-rw-r--r-- | julia.html.markdown | 65 | ||||
-rw-r--r-- | kotlin.html.markdown | 4 | ||||
-rw-r--r-- | latex.html.markdown | 41 | ||||
-rw-r--r-- | lua.html.markdown | 2 | ||||
-rw-r--r-- | pt-br/typescript-pt.html.markdown | 2 | ||||
-rw-r--r-- | ru-ru/c-ru.html.markdown | 2 | ||||
-rw-r--r-- | ru-ru/forth-ru.html.markdown | 3 | ||||
-rw-r--r-- | sv-se/nix-sv.html.markdown | 5 | ||||
-rw-r--r-- | zh-cn/java-cn.html.markdown | 4 |
21 files changed, 254 insertions, 91 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..7bc9d01b --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,5 @@ +/fr-fr/ @vendethiel
+/ru-ru/ @Menelion
+/uk-ua/ @Menelion
+/zh-cn/ @geoffliu
+/zh-tw/ @geoffliu
diff --git a/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 96278da9..96278da9 100644 --- a/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md diff --git a/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index fd9d1b31..6a496409 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,5 @@ - [ ] I solemnly swear that this is all original content of which I am the original author -- [ ] Pull request title is prepended with `[language/lang-code]` +- [ ] Pull request title is prepended with `[language/lang-code]` (example `[python/fr-fr]` or `[java/en]`) - [ ] Pull request touches only one file (or a set of logically related files with similar changes made) - [ ] Content changes are aimed at *intermediate to experienced programmers* (this is a poor format for explaining fundamental programming concepts) - [ ] If you've changed any part of the YAML Frontmatter, make sure it is formatted according to [CONTRIBUTING.md](https://github.com/adambard/learnxinyminutes-docs/blob/master/CONTRIBUTING.markdown) diff --git a/bash.html.markdown b/bash.html.markdown index 7ca4285b..11ce4e74 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -27,12 +27,12 @@ for the GNU operating system and as the default shell on most Linux distros. Nearly all examples below can be a part of a shell script or executed directly in the shell. -[Read more here.](http://www.gnu.org/software/bash/manual/bashref.html) +[Read more here.](https://www.gnu.org/software/bash/manual/bashref.html) ```bash #!/usr/bin/env bash # First line of the script is the shebang which tells the system how to execute -# the script: http://en.wikipedia.org/wiki/Shebang_(Unix) +# the script: https://en.wikipedia.org/wiki/Shebang_(Unix) # As you already figured, comments start with #. Shebang is also a comment. # Simple hello world example: @@ -198,7 +198,7 @@ then fi # Note that =~ only works within double [[ ]] square brackets, # which are subtly different from single [ ]. -# See http://www.gnu.org/software/bash/manual/bashref.html#Conditional-Constructs for more on this. +# See https://www.gnu.org/software/bash/manual/bashref.html#Conditional-Constructs for more on this. # Redefine command `ping` as alias to send only 5 packets alias ping='ping -c 5' @@ -325,6 +325,9 @@ echo "#helloworld" | tee output.out >/dev/null # WARNING: `rm` commands cannot be undone rm -v output.out error.err output-and-error.log rm -r tempDir/ # recursively delete +# You can install the `trash-cli` Python package to have `trash` +# which puts files in the system trash and doesn't delete them directly +# see https://pypi.org/project/trash-cli/ if you want to be careful # Commands can be substituted within other commands using $( ): # The following command displays the number of files and directories in the @@ -332,15 +335,15 @@ rm -r tempDir/ # recursively delete echo "There are $(ls | wc -l) items here." # The same can be done using backticks `` but they can't be nested - -#the preferred way is to use $( ). +# the preferred way is to use $( ). echo "There are `ls | wc -l` items here." # Bash uses a `case` statement that works similarly to switch in Java and C++: case "$Variable" in - #List patterns for the conditions you want to meet + # List patterns for the conditions you want to meet 0) echo "There is a zero.";; 1) echo "There is a one.";; - *) echo "It is not null.";; + *) echo "It is not null.";; # match everything esac # `for` loops iterate for as many arguments given: @@ -377,6 +380,13 @@ do cat "$Output" done +# Bash can also accept patterns, like this to `cat` +# all the Markdown files in current directory +for Output in ./*.markdown +do + cat "$Output" +done + # while loop: while [ true ] do @@ -431,6 +441,8 @@ 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 +# be aware that this -i flag means that file.txt will be changed +# -i or --in-place erase the input file (use --in-place=.backup to keep a back-up) # print to stdout all lines of file.txt which match some regex # The example prints lines which begin with "foo" and end in "bar" @@ -448,7 +460,7 @@ grep -rI "^foo.*bar$" someDir/ # recursively `grep`, but ignore binary files grep "^foo.*bar$" file.txt | grep -v "baz" # if you literally want to search for the string, -# and not the regex, use fgrep (or grep -F) +# and not the regex, use `fgrep` (or `grep -F`) fgrep "foobar" file.txt # The `trap` command allows you to execute a command whenever your script @@ -457,6 +469,7 @@ fgrep "foobar" file.txt trap "rm $TEMP_FILE; exit" SIGHUP SIGINT SIGTERM # `sudo` is used to perform commands as the superuser +# usually it will ask interactively the password of superuser NAME1=$(whoami) NAME2=$(sudo whoami) echo "Was $NAME1, then became more powerful $NAME2" diff --git a/c++.html.markdown b/c++.html.markdown index 948b52ec..6e94e03e 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -2,16 +2,16 @@ language: c++ filename: learncpp.cpp contributors: - - ["Steven Basart", "http://github.com/xksteven"] + - ["Steven Basart", "https://github.com/xksteven"] - ["Matt Kline", "https://github.com/mrkline"] - ["Geoff Liu", "http://geoffliu.me"] - - ["Connor Waters", "http://github.com/connorwaters"] - - ["Ankush Goyal", "http://github.com/ankushg07"] + - ["Connor Waters", "https://github.com/connorwaters"] + - ["Ankush Goyal", "https://github.com/ankushg07"] - ["Jatin Dhankhar", "https://github.com/jatindhankhar"] --- C++ is a systems programming language that, -[according to its inventor Bjarne Stroustrup](http://channel9.msdn.com/Events/Lang-NEXT/Lang-NEXT-2014/Keynote), +[according to its inventor Bjarne Stroustrup](https://channel9.msdn.com/Events/Lang-NEXT/Lang-NEXT-2014/Keynote), was designed to - be a "better C" @@ -37,7 +37,7 @@ one of the most widely-used programming languages. // Just like in C, your program's entry point is a function called // main with an integer return type. // This value serves as the program's exit status. -// See http://en.wikipedia.org/wiki/Exit_status for more information. +// See https://en.wikipedia.org/wiki/Exit_status for more information. int main(int argc, char** argv) { // Command line arguments are passed in by argc and argv in the same way @@ -483,7 +483,7 @@ public: void setOwner(const std::string& dogsOwner); // Override the behavior of the print function for all OwnedDogs. See - // http://en.wikipedia.org/wiki/Polymorphism_(computer_science)#Subtyping + // https://en.wikipedia.org/wiki/Polymorphism_(computer_science)#Subtyping // for a more general introduction if you are unfamiliar with // subtype polymorphism. // The override keyword is optional but makes sure you are actually @@ -616,7 +616,7 @@ boxOfBox.insert(intBox); // template<typename T> // instead. The 'class' keyword and 'typename' keywords are _mostly_ // interchangeable in this case. For the full explanation, see -// http://en.wikipedia.org/wiki/Typename +// https://en.wikipedia.org/wiki/Typename // (yes, that keyword has its own Wikipedia page). // Similarly, a template function: @@ -660,7 +660,7 @@ printMessage<10>(); // Prints "Learn C++ faster in only 10 minutes!" ///////////////////// // The standard library provides a few exception types -// (see http://en.cppreference.com/w/cpp/error/exception) +// (see https://en.cppreference.com/w/cpp/error/exception) // but any type can be thrown as an exception #include <exception> #include <stdexcept> @@ -1030,7 +1030,7 @@ sort(dog_ids.begin(), dog_ids.end(), [&weight](const int &lhs, const int &rhs) { return weight[lhs] < weight[rhs]; }); // Note we captured "weight" by reference in the above example. -// More on Lambdas in C++ : http://stackoverflow.com/questions/7627098/what-is-a-lambda-expression-in-c11 +// More on Lambdas in C++ : https://stackoverflow.com/questions/7627098/what-is-a-lambda-expression-in-c11 /////////////////////////////// // Range For (C++11 and above) @@ -1106,7 +1106,8 @@ f1 = f2; #include<tuple> -// Conceptually, Tuples are similar to old data structures (C-like structs) but instead of having named data members, +// Conceptually, Tuples are similar to old data structures (C-like structs) +// but instead of having named data members, // its elements are accessed by their order in the tuple. // We start with constructing a tuple. diff --git a/c.html.markdown b/c.html.markdown index a57be1dc..ff396d21 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -224,10 +224,18 @@ int main (int argc, char** argv) (float)i1 / i2; // => 0.5f i1 / (double)i2; // => 0.5 // Same with double f1 / f2; // => 0.5, plus or minus epsilon + // Floating-point numbers and calculations are not exact + // for instance it is not giving mathematically correct results + (0.1 + 0.1 + 0.1) != 0.3; // => 1 (true) + // and it is NOT associative + 1 + (1e123 - 1e123) != (1 + 1e123) - 1e123; // => 1 (true) + // this notation is scientific notations for numbers: 1e123 = 1*10^123 - // Modulo is there as well - 11 % 3; // => 2 + // Modulo is there as well, but be careful if arguments are negative + 11 % 3; // => 2 as 11 = 2 + 3*x (x=3) + (-11) % 3; // => -2, as one would expect + 11 % (-3); // => 2 and not -2, and it's quite counter intuitive // Comparison operators are probably familiar, but // there is no Boolean type in C. We use ints instead. @@ -236,12 +244,12 @@ int main (int argc, char** argv) // operators always yield 0 or 1.) 3 == 2; // => 0 (false) 3 != 2; // => 1 (true) - 3 > 2; // => 1 - 3 < 2; // => 0 + 3 > 2; // => 1 + 3 < 2; // => 0 2 <= 2; // => 1 2 >= 2; // => 1 - // C is not Python - comparisons don't chain. + // C is not Python - comparisons do NOT chain. // Warning: The line below will compile, but it means `(0 < a) < 2`. // This expression is always true, because (0 < a) could be either 1 or 0. // In this case it's 1, because (0 < 1). @@ -349,25 +357,30 @@ int main (int argc, char** argv) break; } /* - using "goto" in C + Using "goto" in C */ typedef enum { false, true } bool; // for C don't have bool as data type before C99 :( bool disaster = false; int i, j; - for(i=0;i<100;++i) - for(j=0;j<100;++j) + for(i=0; i<100; ++i) + for(j=0; j<100; ++j) { if((i + j) >= 150) disaster = true; if(disaster) - goto error; + goto error; // exit both for loops } - error : + error: // this is a label that you can "jump" to with "goto error;" printf("Error occurred at i = %d & j = %d.\n", i, j); /* - https://ideone.com/GuPhd6 - this will print out "Error occurred at i = 51 & j = 99." + https://ideone.com/GuPhd6 + this will print out "Error occurred at i = 51 & j = 99." + */ + /* + it is generally considered bad practice to do so, except if + you really know what you are doing. See + https://en.wikipedia.org/wiki/Spaghetti_code#Meaning */ /////////////////////////////////////// @@ -741,11 +754,12 @@ typedef void (*my_fnp_type)(char *); // Order of Evaluation /////////////////////////////////////// +// From top to bottom, top has higher precedence //---------------------------------------------------// // Operators | Associativity // //---------------------------------------------------// // () [] -> . | left to right // -// ! ~ ++ -- + = *(type)sizeof | right to left // +// ! ~ ++ -- + = *(type) sizeof | right to left // // * / % | left to right // // + - | left to right // // << >> | left to right // @@ -783,8 +797,8 @@ as the C file. /* included into files that include this header. */ #include <string.h> -/* Like c source files macros can be defined in headers and used in files */ -/* that include this header file. */ +/* Like for c source files, macros can be defined in headers */ +/* and used in files that include this header file. */ #define EXAMPLE_NAME "Dennis Ritchie" /* Function macros can also be defined. */ @@ -823,7 +837,7 @@ Best to find yourself a copy of [K&R, aka "The C Programming Language"](https:// It is *the* book about C, written by Dennis Ritchie, the creator of C, and Brian Kernighan. Be careful, though - it's ancient and it contains some inaccuracies (well, ideas that are not considered good anymore) or now-changed practices. -Another good resource is [Learn C The Hard Way](http://learncodethehardway.org/c/). +Another good resource is [Learn C The Hard Way](http://learncodethehardway.org/c/) (not free). If you have a question, read the [compl.lang.c Frequently Asked Questions](http://c-faq.com). @@ -833,4 +847,4 @@ Readable code is better than clever code and fast code. For a good, sane coding Other than that, Google is your friend. -[1] [Why isn't sizeof for a struct equal to the sum of sizeof of each member?](http://stackoverflow.com/questions/119123/why-isnt-sizeof-for-a-struct-equal-to-the-sum-of-sizeof-of-each-member) +[1] [Why isn't sizeof for a struct equal to the sum of sizeof of each member?](https://stackoverflow.com/questions/119123/why-isnt-sizeof-for-a-struct-equal-to-the-sum-of-sizeof-of-each-member) diff --git a/coq.html.markdown b/coq.html.markdown index 4c1ad690..3a924a19 100644 --- a/coq.html.markdown +++ b/coq.html.markdown @@ -61,8 +61,8 @@ Locate "+". (* Calling a function with insufficient number of arguments does not cause an error, it produces a new function. *) -Definition make_inc x y := x + y. (* make_inc is int -> int -> int *) -Definition inc_2 := make_inc 2. (* inc_2 is int -> int *) +Definition make_inc x y := x + y. (* make_inc is nat -> nat -> nat *) +Definition inc_2 := make_inc 2. (* inc_2 is nat -> nat *) Compute inc_2 3. (* Evaluates to 5 *) @@ -370,7 +370,7 @@ Close Scope string_scope. power series and results,...) • Relations : Relations (definitions and basic results) • Sorting : Sorted list (basic definitions and heapsort correctness) -• Strings : 8-bits characters and strings +• Strings : 8-bit characters and strings • Wellfounded : Well-founded relations (basic results) *) @@ -472,7 +472,7 @@ Proof. intros A B ab. destruct ab as [ a b ]. apply a. Qed. -(* We can prove easily prove simple polynomial equalities using the +(* We can easily prove simple polynomial equalities using the automated tactic ring. *) Require Import Ring. diff --git a/de-de/nix-de.html.markdown b/de-de/nix-de.html.markdown index ea02e81d..ffe8dffc 100644 --- a/de-de/nix-de.html.markdown +++ b/de-de/nix-de.html.markdown @@ -356,3 +356,6 @@ with builtins; [ * [Susan Potter - Nix Cookbook - Nix By Example] (https://ops.functionalalgebra.com/nix-by-example/) + +* [Rommel Martinez - A Gentle Introduction to the Nix Family] + (https://web.archive.org/web/20210121042658/https://ebzzry.io/en/nix/#nix) diff --git a/docker.html.markdown b/docker.html.markdown index 24f85247..1dad267a 100644 --- a/docker.html.markdown +++ b/docker.html.markdown @@ -3,9 +3,10 @@ language: docker filename: docker.bat
contributors:
- ["Ruslan López", "http://javapro.org/"]
+ - ["Michael Chen", "https://github.com/ML-Chen"]
---
-```
+```bat
:: download, install and run hello-world image
docker run hello-world
@@ -37,12 +38,12 @@ docker run hello-world :: For more examples and ideas, visit:
:: https://docs.docker.com/get-started/
-:: now lets see currently running images
+:: now let's see currently running images
docker ps
:: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
:: NAMES
-:: lets see the images we have ran previously
+:: let's see the images we have ran previously
docker ps -a
:: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
@@ -54,7 +55,7 @@ docker ps -a :: let's remove our previously generated image
docker rm happy_poincare
-:: lets test if it was really deleted
+:: let's test if it was really deleted
docker ps -a
:: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
:: NAMES
@@ -89,7 +90,7 @@ docker ps -a :: test_container
:: as you can see the name is now what we have specified
-:: retireve logs from a named container
+:: retrieve logs from a named container
docker logs test_container
:: Hello from Docker!
:: This message shows that your installation appears to be working correctly.
@@ -143,4 +144,4 @@ docker ps -a :: nifty_goldwasser
docker rm nifty_goldwasser
-```
\ No newline at end of file +```
diff --git a/es-es/typescript-es.html.markdown b/es-es/typescript-es.html.markdown index c42da4a4..fbe1290b 100644 --- a/es-es/typescript-es.html.markdown +++ b/es-es/typescript-es.html.markdown @@ -12,7 +12,7 @@ TypeScript es un lenguaje cuyo objetivo es facilitar el desarrollo de aplicacion TypeScript añade conceptos comunes como clases, módulos, interfaces, genéricos y (opcionalmente) tipeo estático a JavaScript. Es un superset de JavaScript: todo el código JavaScript es código válido en TypeScript de manera que se puede integrar fácilmente a cualquier proyecto . El compilador TypeScript emite JavaScript. -Este artículo se enfocará solo en la sintáxis extra de TypeScript, y no en [JavaScript] (../javascript/). +Este artículo se enfocará solo en la sintáxis extra de TypeScript, y no en [JavaScript] (../javascript-es/). Para probar el compilador de TypeScript, diríjase al [Área de Pruebas] (http://www.typescriptlang.org/Playground) donde podrá tipear código, y ver como se auto-completa al tiempo que ve el código emitido JavaScript. diff --git a/fr-fr/typescript-fr.html.markdown b/fr-fr/typescript-fr.html.markdown index 52d34650..8a761f61 100644 --- a/fr-fr/typescript-fr.html.markdown +++ b/fr-fr/typescript-fr.html.markdown @@ -12,7 +12,7 @@ TypeScript est un langage visant à faciliter le développement d'applications l TypeScript ajoute des concepts classiques comme les classes, les modules, les interfaces, les génériques et le typage statique (optionnel) à JavaScript. C'est une surcouche de JavaScript : tout le code JavaScript est valide en TypeScript ce qui permet de l'ajouter de façon transparente à n'importe quel projet. Le code TypeScript est transcompilé en JavaScript par le compilateur. -Cet article se concentrera seulement sur la syntaxe supplémentaire de TypeScript, plutôt que celle de [JavaScript] (../javascript/). +Cet article se concentrera seulement sur la syntaxe supplémentaire de TypeScript, plutôt que celle de [JavaScript] (../javascript-fr/). Pour tester le compilateur de TypeScript, rendez-vous au [Playground] (http://www.typescriptlang.org/Playground) où vous pourrez coder, profiter d'une autocomplétion et accéder directement au rendu JavaScript. diff --git a/hd-hd/json-hd.html.markdown b/hd-hd/json-hd.html.markdown new file mode 100644 index 00000000..dd1657cd --- /dev/null +++ b/hd-hd/json-hd.html.markdown @@ -0,0 +1,86 @@ +--- +language: json +contributors: + - ["Anna Harren", "https://github.com/iirelu"] + - ["Marco Scannadinari", "https://github.com/marcoms"] + - ["himanshu", "https://github.com/himanshu81494"] + - ["Michael Neth", "https://github.com/infernocloud"] + - ["Athanasios Emmanouilidis", "https://github.com/athanasiosem"] +translators: + - ["Namami Shanker", "https://github.com/NamamiShanker"] +lang: hd-hd +--- + +जैसन(JSON) इस अत्यंत सरल डाटा-इंटरचेंज फॉर्मेट है| जैसा [json.org](https://json.org) कहती है, ये इंसानो के पढ़ने और लिखने के लिए भी आसान है और और मशीन के लिए इसे पार्स और उतपन्न करना भी बेहद सरल है| + +जैसन(JSON) के एक अंश को इनमे से किसी एक का प्रतिनिधित्व(represent) करना चाहिए: + +* एक नाम/वैल्यू जोड़े का कलेक्शन (`{ }`). कई दूसरी भाषाओ में इसे ऑब्जेक्ट, रिकॉर्ड, स्ट्रक्ट, डिक्शनरी, हैश टेबल, कीड लिस्ट, या असोसिएटिव ऐरे का भी नाम दिया जाता है| +* वैल्यूज की एक व्यवस्थित लिस्ट(ordered list) (`[ ]`). कई दूसरी भाषाओ में इसे ऐरे, वेक्टर, लिस्ट, या सीक्वेंस भी कहा जाता है| + +जैसन(JSON) अपने शुद्धतम रूप में कमैंट्स सपोर्ट नहीं करता है, पर ज़्यादातर पारसर C स्टाइल की कमैंट्स (`//`, `/* */`) सपोर्ट करेंगे| कुछ पारसर्स अंतिम कॉमा भी स्वीकार करते हैं (जब आप किसी ऐरे के अंतिम एलिमेंट या किसी ऑब्जेक्ट की अंतिम प्रॉपर्टी के बार एक कॉमा छोड़ देते हैं), पर ऐसी गलतियों से बचना चाहिए बेहतर कम्पेटिबिलिटी के लिए| + + ये उदाहरण १०० प्रतिशत मान्य जैसन(JSON) है| किस्मत से, जैसन(JSON) डॉक्यूमेंट को पढ़ के ही आप इसे समझ जायेंगे| + +समर्थित डाटा टाइप्स: + +* स्ट्रिंग्स(Strings): `"नमस्ते"`, `"\"एक उद्धरण\""`, `"\u0abe"`, `"नयी पंक्ति|\n"` +* अंक(Numbers): `23`, `0.11`, `12e10`, `3.141e-10`, `1.23e+4` +* ऑब्जेक्ट्स(Objects): `{ "की": "मूल्य" }` +* ऐरे(Arrays): `["बहुत सारे मूल्य"]` +* विविध(Miscellaneous): `true`, `false`, `null` + +```json +{ + "की": "मूल्य", + + "की": "हमेशा दोहरे उद्धरण चिह्नों में संलग्न होना चाहिए", + "अंक": 0, + "स्ट्रिंग्स": "नमस्ते| यूनिकोड और \"एस्केप\" सीक्वेंस की अनुमति है|", + "बूलियन है?": true, + "शून्यता ": null, + + "बड़े अंक": 1.2e+100, + + "ऑब्जेक्ट्स": { + "टिप्पणी": "आपके जैसन(JSON) ऑब्जेक्ट को ज़्यादातर ऑब्जेक्ट से ही ढांचा मिलेगा|", + + "ऐरे": [0, 1, 2, 3, "ऐरे में आप कुछ भी रख सकते हैं|", 5], + + "एक और ऑब्जेक्ट": { + "टिप्पणी": "आप एक ऑब्जेक्ट दूसरे ऑब्जेक्ट के अंदर रख सकते हैं| ये बहुत उपयोगी होता है|" + } + }, + + "फ़र्ज़ी": [ + { + "पोटेशियम के स्रोत": ["केला"] + }, + [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, "नव"], + [0, 0, 0, 1] + ] + ], + + "वैकल्पिक शैली": { + "टिप्पणी": "ये देखिये!" + , "कॉमा के स्थान": "से फरक नहीं पड़ता, अगर आपने उसे अगली की से पहले लगाया है तो वो मान्य है|" + , "एक और टिप्पणी": "कितनी अच्छी बात है" + }, + + + + "खाली स्थान": "से फरक नहीं पड़ता", + + + + "ये काफी छोटा था :>": "और ख़तम| अब आपको जैसन(JSON) के बारे में सब कुछ पता है|" +} +``` + +## और जानकारी के लिए + +* [JSON.org](https://json.org) पूरा जैसन(JSON) फ्लोचार्ट के माध्यम से खूबसूरत तरह से दर्शित| +* [JSON Tutorial](https://www.youtube.com/watch?v=wI1CWzNtE-M) जैसन(JSON) का एक संक्षिप्त परिचय| diff --git a/julia.html.markdown b/julia.html.markdown index 5e9ef1b8..4d8eb497 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -11,7 +11,7 @@ Julia is a new homoiconic functional language focused on technical computing. While having the full power of homoiconic macros, first-class functions, and low-level control, Julia is as easy to learn and use as Python. -This is based on Julia 1.0.0 +This is based on Julia version 1.0.0. ```julia # Single line comments start with a hash (pound) symbol. @@ -83,7 +83,7 @@ false 1 > 10 # => false 2 <= 2 # => true 2 >= 2 # => true -# Comparisons can be chained +# Comparisons can be chained, like in Python but unlike many other languages 1 < 2 < 3 # => true 2 < 3 < 2 # => false @@ -93,28 +93,29 @@ false # Character literals are written with ' 'a' -# Strings are UTF8 encoded. Only if they contain only ASCII characters can -# they be safely indexed. -ascii("This is a string")[1] +# Strings are UTF8 encoded, so strings like "π" or "☃" are not directly equivalent +# to an array of single characters. +# Only if they contain only ASCII characters can they be safely indexed. +ascii("This is a string")[1] # => 'T' # => 'T': ASCII/Unicode U+0054 (category Lu: Letter, uppercase) -# Julia indexes from 1 +# Beware, Julia indexes everything from 1 (like MATLAB), not 0 (like most languages). # Otherwise, iterating over strings is recommended (map, for loops, etc). -# String can be compared lexicographically -"good" > "bye" # => true +# String can be compared lexicographically, in dictionnary order: +"good" > "bye" # => true "good" == "good" # => true "1 + 2 = 3" == "1 + 2 = $(1 + 2)" # => true -# $ can be used for string interpolation: +# $(..) can be used for string interpolation: "2 + 2 = $(2 + 2)" # => "2 + 2 = 4" # You can put any Julia expression inside the parentheses. # Printing is easy -println("I'm Julia. Nice to meet you!") # => I'm Julia. Nice to meet you! +println("I'm Julia. Nice to meet you!") # => I'm Julia. Nice to meet you! # Another way to format strings is the printf macro from the stdlib Printf. -using Printf -@printf "%d is less than %f\n" 4.5 5.3 # => 5 is less than 5.300000 +using Printf # this is how you load (or import) a module +@printf "%d is less than %f\n" 4.5 5.3 # => 5 is less than 5.300000 #################################################### @@ -123,7 +124,7 @@ using Printf # You don't declare variables before assigning to them. someVar = 5 # => 5 -someVar # => 5 +someVar # => 5 # Accessing a previously unassigned variable is an error try @@ -137,9 +138,10 @@ end SomeOtherVar123! = 6 # => 6 # You can also use certain unicode characters +# here ☃ is a Unicode 'snowman' characters, see http://emojipedia.org/%E2%98%83%EF%B8%8F if it displays wrongly here ☃ = 8 # => 8 -# These are especially handy for mathematical notation -2 * π # => 6.283185307179586 +# These are especially handy for mathematical notation, like the constant π +2 * π # => 6.283185307179586 # A note on naming conventions in Julia: # @@ -171,7 +173,7 @@ matrix = [1 2; 3 4] # => 2×2 Array{Int64,2}: [1 2; 3 4] b = Int8[4, 5, 6] # => 3-element Array{Int8,1}: [4, 5, 6] # Add stuff to the end of a list with push! and append! -# By convention, the exclamation mark '!'' is appended to names of functions +# By convention, the exclamation mark '!' is appended to names of functions # that modify their arguments push!(a, 1) # => [1] push!(a, 2) # => [1,2] @@ -202,10 +204,10 @@ a # => [7,2,4,3,4,5,6] # Function names that end in exclamations points indicate that they modify # their argument. arr = [5,4,6] # => 3-element Array{Int64,1}: [5,4,6] -sort(arr) # => [4,5,6] -arr # => [5,4,6] -sort!(arr) # => [4,5,6] -arr # => [4,5,6] +sort(arr) # => [4,5,6] +arr # => [5,4,6] +sort!(arr) # => [4,5,6] +arr # => [4,5,6] # Looking out of bounds is a BoundsError try @@ -238,7 +240,7 @@ a = [1:5;] # => 5-element Array{Int64,1}: [1,2,3,4,5] a2 = [1:5] # => 1-element Array{UnitRange{Int64},1}: [1:5] # You can look at ranges with slice syntax. -a[1:3] # => [1, 2, 3] +a[1:3] # => [1, 2, 3] a[2:end] # => [2, 3, 4, 5] # Remove elements from an array by index with splice! @@ -276,15 +278,15 @@ in(2, tup) # => true # You can unpack tuples into variables a, b, c = (1, 2, 3) # => (1,2,3) -a # => 1 -b # => 2 -c # => 3 +a # => 1 +b # => 2 +c # => 3 # Tuples are created even if you leave out the parentheses d, e, f = 4, 5, 6 # => (4,5,6) -d # => 4 -e # => 5 -f # => 6 +d # => 4 +e # => 5 +f # => 6 # A 1-element tuple is distinct from the value it contains (1,) == 1 # => false @@ -292,8 +294,8 @@ f # => 6 # Look how easy it is to swap two values e, d = d, e # => (5,4) -d # => 5 -e # => 4 +d # => 5 +e # => 4 # Dictionaries store mappings emptyDict = Dict() # => Dict{Any,Any} with 0 entries @@ -375,7 +377,8 @@ end # Iterable types include Range, Array, Set, Dict, and AbstractString. for animal = ["dog", "cat", "mouse"] println("$animal is a mammal") - # You can use $ to interpolate variables or expression into strings + # You can use $ to interpolate variables or expression into strings. + # In this special case, no need for parenthesis: $animal and $(animal) give the same end # => dog is a mammal # => cat is a mammal @@ -408,7 +411,7 @@ end let x = 0 while x < 4 println(x) - x += 1 # Shorthand for x = x + 1 + x += 1 # Shorthand for in place increment: x = x + 1 end end # => 0 diff --git a/kotlin.html.markdown b/kotlin.html.markdown index 5bbf6847..12008074 100644 --- a/kotlin.html.markdown +++ b/kotlin.html.markdown @@ -180,7 +180,7 @@ fun helloWorld(val name : String) { // destructuring in "for" loop for ((a, b, c) in listOf(fooData)) { - println("$a $b $c") // => 1 100 4 + println("$a $b $c") // => 1 2 4 } val mapData = mapOf("a" to 1, "b" to 2) @@ -426,7 +426,7 @@ data class Counter(var value: Int) { operator fun invoke() = println("The value of the counter is $value") } -/* You can also overload operators through an extension methods */ +/* You can also overload operators through extension methods */ // overload -Counter operator fun Counter.unaryMinus() = Counter(-this.value) diff --git a/latex.html.markdown b/latex.html.markdown index 49200968..29a9f638 100644 --- a/latex.html.markdown +++ b/latex.html.markdown @@ -2,7 +2,7 @@ language: latex contributors: - ["Chaitanya Krishna Ande", "http://icymist.github.io"] - - ["Colton Kohnke", "http://github.com/voltnor"] + - ["Colton Kohnke", "https://github.com/voltnor"] - ["Sricharan Chiruvolu", "http://sricharan.xyz"] - ["Ramanan Balakrishnan", "https://github.com/ramananbalakrishnan"] - ["Svetlana Golubeva", "https://attillax.github.io/"] @@ -181,7 +181,9 @@ Summations and Integrals are written with sum and int commands: \section{Figures} Let's insert a figure. Figure placement can get a little tricky. +Basic options are [t] for top, [b] for bottom, [h] for here (approximately). I definitely have to lookup the placement options each time. +% See https://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions for more details \begin{figure}[H] % H here denoted the placement option. \centering % centers the figure on the page @@ -198,13 +200,21 @@ We can also insert Tables in the same way as figures. \begin{table}[H] \caption{Caption for the Table.} % the {} arguments below describe how each row of the table is drawn. - % Again, I have to look these up. Each. And. Every. Time. - \begin{tabular}{c|cc} + % The basic is simple: one letter for each column, to control alignment: + % basic options are: c, l, r and p for centered, left, right and paragraph + % optionnally, you can add a | for a vertical line + % See https://en.wikibooks.org/wiki/LaTeX/Tables for more details + \begin{tabular}{c|cc} % here it means "centered | vertical line, centered centered" Number & Last Name & First Name \\ % Column rows are separated by & \hline % a horizontal line 1 & Biggus & Dickus \\ 2 & Monty & Python \end{tabular} + % it will approximately be displayed like this + % Number | Last Name First Name + % -------|--------------------------- % because of \hline + % 1 | Biggus Dickus + % 2 | Monty Python \end{table} \section{Getting \LaTeX{} to not compile something (i.e.\ Source Code)} @@ -218,7 +228,8 @@ environment. \begin{verbatim} print("Hello World!") a%b; % look! We can use % signs in verbatim. - random = 4; #decided by fair random dice roll + random = 4; #decided by fair random dice roll, https://www.xkcd.com/221/ + See https://www.explainxkcd.com/wiki/index.php/221:_Random_Number \end{verbatim} \section{Compiling} @@ -244,6 +255,7 @@ Step 2 is still happening behind the scenes\footnote{In cases, where you use references (like Eqn.~\ref{eq:pythagoras}), you may need to run Step 2 multiple times, to generate an intermediary *.aux file.}. % Also, this is how you add footnotes to your document! +% with a simple \footnote{...} command. They are numbered ¹, ², ... by default. You write all your formatting information in plain text in Step 1. The compilation part in Step 2 takes care of producing the document in the @@ -265,6 +277,27 @@ There exists two main types of links: visible URL \\ This package also produces list of thumbnails in the output pdf document and active links in the table of contents. +\section{Writing in ASCII or other encodings} + +By default, historically LaTeX accepts inputs which are pure ASCII (128), +not even extened ASCII, meaning without accents (à, è etc.) and non-Latin symbols. + +It is easy to insert accents and basic Latin symbols, with backslash shortcuts +Like \,c, \'e, \`A, \ae and \oe etc. % for ç, é, À, etc +% See https://en.wikibooks.org/wiki/LaTeX/Special_Characters#Escaped_codes for more + +To write directly in UTF-8, when compiling with pdflatex, use +\begin{verbatim} + \usepackage[utf8]{inputenc} +\end{verbatim} +The selected font has to support the glyphs used for your document, you have to add +\begin{verbatim} + \usepackage[T1]{fontenc} +\end{verbatim} + +Not that there also exists LuaTeX and XeLaTeX that were designed to have builtin +support for UTF-8 and case ease your life if you don't write in a latin alphabet. + \section{End} That's all for now! diff --git a/lua.html.markdown b/lua.html.markdown index 53e396be..4a470623 100644 --- a/lua.html.markdown +++ b/lua.html.markdown @@ -395,7 +395,7 @@ g() -- Prints out 343; nothing printed before now. I was excited to learn Lua so I could make games with the <a href="http://love2d.org/">Love 2D game engine</a>. That's the why. -I started with <a href="http://nova-fusion.com/2012/08/27/lua-for-programmers-part-1/">BlackBulletIV's Lua for programmers</a>. +I started with <a href="https://ebens.me/post/lua-for-programmers-part-1/">BlackBulletIV's Lua for programmers</a>. Next I read the official <a href="http://www.lua.org/pil/contents.html">Programming in Lua</a> book. That's the how. diff --git a/pt-br/typescript-pt.html.markdown b/pt-br/typescript-pt.html.markdown index ed76959c..7d28bf53 100644 --- a/pt-br/typescript-pt.html.markdown +++ b/pt-br/typescript-pt.html.markdown @@ -12,7 +12,7 @@ Typescript é uma linguagem que visa facilitar o desenvolvimento de aplicações Typescript acrescenta conceitos comuns como classes, módulos, interfaces, genéricos e (opcional) tipagem estática para JavaScript. É um super conjunto de JavaScript: todo o código JavaScript é TypeScript válido então ele pode ser adicionado diretamente a qualquer projeto. O compilador emite TypeScript JavaScript. -Este artigo irá se concentrar apenas na sintaxe extra do TypeScript, ao contrário de [JavaScript](javascript-pt.html.markdown). +Este artigo irá se concentrar apenas na sintaxe extra do TypeScript, ao contrário de [JavaScript](../javascript-pt/). Para testar o compilador TypeScript, vá para o [Playground](http://www.typescriptlang.org/Playground), onde você vai ser capaz de escrever código, ter auto conclusão e ver diretamente o JavaScript emitido. diff --git a/ru-ru/c-ru.html.markdown b/ru-ru/c-ru.html.markdown index ba3c19ee..cc68d620 100644 --- a/ru-ru/c-ru.html.markdown +++ b/ru-ru/c-ru.html.markdown @@ -353,7 +353,7 @@ int main() { // Это не работает, если строка является массивом // (потенциально задаваемой с помощью строкового литерала) - // который находиться в перезаписываемой части памяти: + // который находится в перезаписываемой части памяти: char foo[] = "foo"; foo[0] = 'a'; // это выполнится и строка теперь "aoo" diff --git a/ru-ru/forth-ru.html.markdown b/ru-ru/forth-ru.html.markdown index 05316578..2fc4ad7c 100644 --- a/ru-ru/forth-ru.html.markdown +++ b/ru-ru/forth-ru.html.markdown @@ -12,9 +12,10 @@ lang: ru-ru Внимание: эта материал использует реализацию Форта - Gforth, но большая часть написанного будет работать в других средах. + ``` \ Это комментарий -( Это тоже комментарий, но использыется для предоределённых слов ) +( Это тоже комментарий, но используется для предоределённых слов ) \ --------------------------------- Прекурсор -------------------------------- diff --git a/sv-se/nix-sv.html.markdown b/sv-se/nix-sv.html.markdown index 15d9456b..647575fe 100644 --- a/sv-se/nix-sv.html.markdown +++ b/sv-se/nix-sv.html.markdown @@ -365,4 +365,7 @@ with builtins; [ (https://medium.com/@MrJamesFisher/nix-by-example-a0063a1a4c55) * [Susan Potter - Nix Cookbook - Nix By Example] - (http://funops.co/nix-cookbook/nix-by-example/) + (https://ops.functionalalgebra.com/nix-by-example/) + +* [Rommel Martinez - A Gentle Introduction to the Nix Family] + (https://web.archive.org/web/20210121042658/https://ebzzry.io/en/nix/#nix) diff --git a/zh-cn/java-cn.html.markdown b/zh-cn/java-cn.html.markdown index 27003f3e..1de7f3e6 100644 --- a/zh-cn/java-cn.html.markdown +++ b/zh-cn/java-cn.html.markdown @@ -297,8 +297,8 @@ class Bicycle { // Bicycle 类的成员变量和方法 public int cadence; // Public: 任意位置均可访问 private int speed; // Private: 只在同类中可以访问 - protected int gear; // Protected: 可以在同类与子类中可以访问 - String name; // default: 可以在包内中可以访问 + protected int gear; // Protected: 可以在同类与子类中访问 + String name; // default: 可以在包内访问 // 构造函数是初始化一个对象的方式 // 以下是一个默认构造函数 |