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-- | c++.html.markdown | 21 | ||||
-rw-r--r-- | julia.html.markdown | 65 | ||||
-rw-r--r-- | kotlin.html.markdown | 2 | ||||
-rw-r--r-- | latex.html.markdown | 41 | ||||
-rw-r--r-- | lua.html.markdown | 2 | ||||
-rw-r--r-- | ru-ru/forth-ru.html.markdown | 3 |
9 files changed, 92 insertions, 49 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/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/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 9394cc02..12008074 100644 --- a/kotlin.html.markdown +++ b/kotlin.html.markdown @@ -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/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, но большая часть написанного будет работать в других средах. + ``` \ Это комментарий -( Это тоже комментарий, но использыется для предоределённых слов ) +( Это тоже комментарий, но используется для предоределённых слов ) \ --------------------------------- Прекурсор -------------------------------- |