summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CHICKEN.html.markdown16
-rw-r--r--CONTRIBUTING.markdown4
-rw-r--r--bash.html.markdown30
-rw-r--r--c++.html.markdown2
-rw-r--r--c.html.markdown53
-rw-r--r--cobol.html.markdown4
-rw-r--r--csharp.html.markdown4
-rw-r--r--dart.html.markdown12
-rw-r--r--easylang.html.markdown2
-rw-r--r--go.html.markdown7
-rw-r--r--html.html.markdown12
-rw-r--r--javascript.html.markdown2
-rw-r--r--latex.html.markdown30
-rw-r--r--lua.html.markdown6
-rw-r--r--mips.html.markdown4
-rw-r--r--nix.html.markdown5
-rw-r--r--ocaml.html.markdown2
-rw-r--r--pug.html.markdown10
-rw-r--r--purescript.html.markdown2
-rw-r--r--r.html.markdown4
-rw-r--r--rust.html.markdown24
-rw-r--r--scala.html.markdown6
-rw-r--r--set-theory.html.markdown2
-rw-r--r--swift.html.markdown2
-rwxr-xr-xvala.html.markdown12
-rw-r--r--vim.html.markdown13
-rw-r--r--visualbasic.html.markdown3
-rw-r--r--wasm.html.markdown2
-rw-r--r--zh-cn/dynamic-programming-cn.html.markdown2
-rw-r--r--zh-cn/python-cn.html.markdown3
-rw-r--r--zh-cn/red-cn.html.markdown12
31 files changed, 185 insertions, 107 deletions
diff --git a/CHICKEN.html.markdown b/CHICKEN.html.markdown
index 3f7cc2db..4ae45cac 100644
--- a/CHICKEN.html.markdown
+++ b/CHICKEN.html.markdown
@@ -362,8 +362,6 @@ sqr ;; => #<procedure (sqr x)>
;; The CHICKEN core is very minimal, but additional features are provided by library extensions known as Eggs.
;; You can install Eggs with 'chicken-install <eggname>' command.
-;; 'numbers' egg provides support for full numeric tower.
-(require-extension numbers)
;; complex numbers
3+4i ;; => 3+2i
;; Supports fractions without falling back to inexact flonums
@@ -375,12 +373,12 @@ sqr ;; => #<procedure (sqr x)>
(numerator 2/3) ;; => 2
;; 'utf8' provides unicode support
-(require-extension utf8)
+(import utf8)
"\u03BBx:(\u03BC\u0251.\u0251\u2192\u0251).xx" ;; => "λx:(μɑ.ɑ→ɑ).xx"
;; 'posix' provides file I/O and lots of other services for unix-like operating systems
;; Some of the functions are not available in Windows system,
-;; See http://wiki.call-cc.org/man/4/Unit%20posix for more details
+;; See http://wiki.call-cc.org/man/5/Module%20(chicken%20file%20posix) for more details
;; Open a file to append, open "write only" and create file if it does not exist
(define outfn (file-open "chicken-hen.txt" (+ open/append open/wronly open/creat)))
@@ -396,14 +394,14 @@ sqr ;; => #<procedure (sqr x)>
;; CHICKEN also supports SRFI (Scheme Requests For Implementation) extensions
;; See 'http://srfi.schemers.org/srfi-implementers.html" to see srfi's supported by CHICKEN
-(require-extension srfi-1) ;; list library
+(import srfi-1) ;; list library
(filter odd? '(1 2 3 4 5 6 7)) ;; => (1 3 5 7)
(count even? '(1 2 3 4 5)) ;; => 2
(take '(12 24 36 48 60) 3) ;; => (12 24 36)
(drop '(12 24 36 48 60) 2) ;; => (36 48 60)
(circular-list 'z 'q) ;; => z q z q ...
-(require-extension srfi-13) ;; string library
+(import srfi-13) ;; string library
(string-reverse "pan") ;; => "nap"
(string-index "Turkey" #\k) ;; => 3
(string-every char-upper-case? "CHICKEN") ;; => #t
@@ -448,7 +446,7 @@ sqr ;; => #<procedure (sqr x)>
; 9. Modules
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Also See http://wiki.call-cc.org/man/4/Modules
+;; Also See http://wiki.call-cc.org/man/5/Modules
;; The 'test' module exports a value named 'hello' and a macro named 'greet'
(module test (hello greet)
@@ -509,11 +507,11 @@ sqr ;; => #<procedure (sqr x)>
```
## Further Reading
-* [CHICKEN User's Manual](http://wiki.call-cc.org/man/4/The%20User%27s%20Manual).
+* [CHICKEN User's Manual](https://wiki.call-cc.org/manual).
* [R5RS standards](http://www.schemers.org/Documents/Standards/R5RS)
## Extra Info
-* [For programmers of other languages](http://wiki.call-cc.org/chicken-for-programmers-of-other-languages)
+* [For programmers of other languages](https://wiki.call-cc.org/chicken-for-programmers-of-other-languages)
* [Compare CHICKEN syntax with other languages](http://plr.sourceforge.net/cgi-bin/plr/launch.py)
diff --git a/CONTRIBUTING.markdown b/CONTRIBUTING.markdown
index 3dfd38ce..8d2a8320 100644
--- a/CONTRIBUTING.markdown
+++ b/CONTRIBUTING.markdown
@@ -16,7 +16,7 @@ review them more effectively and/or individually.
## Style Guidelines
-- **Keep lines of under 80 chars**
+- **Keep lines under 80 chars**
+ Try to keep **line length in code blocks to 80 characters or fewer**.
+ Otherwise, the text will overflow and look odd.
- **Prefer example to exposition**
@@ -78,7 +78,7 @@ lang: ep-ep
If you want to add yourself to contributors, keep in mind that contributors get
equal billing, and the first contributor usually wrote the whole article. Please
-use your judgement when deciding if your contribution constitutes a substantial
+use your judgment when deciding if your contribution constitutes a substantial
addition or not.
## Building the site locally
diff --git a/bash.html.markdown b/bash.html.markdown
index 4ed638e6..8fdfdf08 100644
--- a/bash.html.markdown
+++ b/bash.html.markdown
@@ -179,6 +179,19 @@ echo "Always executed" && echo "Only executed if first command does NOT fail"
# => Always executed
# => Only executed if first command does NOT fail
+# A single ampersand & after a command runs it in the background. A background command's
+# output is printed to the terminal, but it cannot read from the input.
+sleep 30 &
+# List background jobs
+jobs # => [1]+ Running sleep 30 &
+# Bring the background job to the foreground
+fg
+# Ctrl-C to kill the process, or Ctrl-Z to pause it
+# Resume a background process after it has been paused with Ctrl-Z
+bg
+# Kill job number 2
+kill %2
+# %1, %2, etc. can be used for fg and bg as well
# To use && and || with if statements, you need multiple pairs of square brackets:
if [ "$Name" == "Steve" ] && [ "$Age" -eq 15 ]
@@ -221,7 +234,8 @@ ls -l # Lists every file and directory on a separate line
ls -t # Sorts the directory contents by last-modified date (descending)
ls -R # Recursively `ls` this directory and all of its subdirectories
-# Results of the previous command can be passed to the next command as input.
+# Results (stdout) of the previous command can be passed as input (stdin) to the next command
+# using a pipe |. Commands chained in this way are called a "pipeline", and are run concurrently.
# The `grep` command filters the input with provided patterns.
# That's how we can list .txt files in the current directory:
ls -l | grep "\.txt"
@@ -261,7 +275,7 @@ cd # also goes to home directory
cd .. # go up one directory
# (^^say, from /home/username/Downloads to /home/username)
cd /home/username/Documents # change to specified directory
-cd ~/Documents/.. # still in home directory..isn't it??
+cd ~/Documents/.. # now in home directory (if ~/Documents exists)
cd - # change to last directory
# => /home/username/Documents
@@ -276,9 +290,13 @@ mkdir -p myNewDir/with/intermediate/directories
# if the intermediate directories didn't already exist, running the above
# command without the `-p` flag would return an error
-# You can redirect command input and output (stdin, stdout, and stderr).
+# You can redirect command input and output (stdin, stdout, and stderr)
+# using "redirection operators". Unlike a pipe, which passes output to a command,
+# a redirection operator has a command's input come from a file or stream, or
+# sends its output to a file or stream.
+
# Read from stdin until ^EOF$ and overwrite hello.py with the lines
-# between "EOF":
+# between "EOF" (which are called a "here document"):
cat > hello.py << EOF
#!/usr/bin/env python
from __future__ import print_function
@@ -300,6 +318,8 @@ python hello.py 2> "error.err" # redirect error output to error.err
python hello.py > "output-and-error.log" 2>&1
# redirect both output and errors to output-and-error.log
+# &1 means file descriptor 1 (stdout), so 2>&1 redirects stderr (2) to the current
+# destination of stdout (1), which has been redirected to output-and-error.log.
python hello.py > /dev/null 2>&1
# redirect all output and errors to the black hole, /dev/null, i.e., no output
@@ -434,7 +454,7 @@ tail -n 10 file.txt
# prints first 10 lines of file.txt
head -n 10 file.txt
-# sort file.txt's lines
+# print file.txt's lines in sorted order
sort file.txt
# report or omit repeated lines, with -d it reports them
diff --git a/c++.html.markdown b/c++.html.markdown
index 4399d946..038c3900 100644
--- a/c++.html.markdown
+++ b/c++.html.markdown
@@ -946,7 +946,7 @@ mymap.insert(pair<char,int>('Z',26));
// To iterate
map<char,int>::iterator it;
for (it=mymap.begin(); it!=mymap.end(); ++it)
- std::cout << it->first << "->" << it->second << std::cout;
+ std::cout << it->first << "->" << it->second << std::endl;
// Output:
// A->1
// Z->26
diff --git a/c.html.markdown b/c.html.markdown
index 7405c7ab..90b5ed2d 100644
--- a/c.html.markdown
+++ b/c.html.markdown
@@ -162,19 +162,25 @@ int main (int argc, char** argv)
int my_int_array[20]; // This array occupies 4 * 20 = 80 bytes
// (assuming 4-byte words)
- // You can initialize an array to 0 thusly:
- char my_array[20] = {0};
+ // You can initialize an array of twenty ints that all equal 0 thusly:
+ int my_array[20] = {0};
// where the "{0}" part is called an "array initializer".
- // NOTE that you get away without explicitly declaring the size of the array,
- // IF you initialize the array on the same line. So, the following declaration
- // is equivalent:
- char my_array[] = {0};
- // BUT, then you have to evaluate the size of the array at run-time, like this:
+ // All elements (if any) past the ones in the initializer are initialized to 0:
+ int my_array[5] = {1, 2};
+ // So my_array now has five elements, all but the first two of which are 0:
+ // [1, 2, 0, 0, 0]
+ // NOTE that you get away without explicitly declaring the size
+ // of the array IF you initialize the array on the same line:
+ int my_array[] = {0};
+ // NOTE that, when not declaring the size, the size of the array is the number
+ // of elements in the initializer. With "{0}", my_array is now of size one: [0]
+ // To evaluate the size of the array at run-time, divide its byte size by the
+ // byte size of its element type:
size_t my_array_size = sizeof(my_array) / sizeof(my_array[0]);
- // WARNING If you adopt this approach, you should evaluate the size *before*
- // you begin passing the array to function (see later discussion), because
- // arrays get "downgraded" to raw pointers when they are passed to functions
- // (so the statement above will produce the wrong result inside the function).
+ // WARNING You should evaluate the size *before* you begin passing the array
+ // to functions (see later discussion) because arrays get "downgraded" to
+ // raw pointers when they are passed to functions (so the statement above
+ // will produce the wrong result inside the function).
// Indexing an array is like other languages -- or,
// rather, other languages are like C
@@ -572,7 +578,8 @@ the function are copies of the original arguments (except arrays). Anything you
do to the arguments in the function do not change the value of the original
argument where the function was called.
-Use pointers if you need to edit the original argument values.
+Use pointers if you need to edit the original argument values (arrays are always
+passed in as pointers).
Example: in-place string reversal
*/
@@ -583,9 +590,11 @@ void str_reverse(char *str_in)
char tmp;
size_t ii = 0;
size_t len = strlen(str_in); // `strlen()` is part of the c standard library
- // NOTE: length returned by `strlen` DOESN'T include the
- // terminating NULL byte ('\0')
- for (ii = 0; ii < len / 2; ii++) { // in C99 you can directly declare type of `ii` here
+ // NOTE: length returned by `strlen` DOESN'T
+ // include the terminating NULL byte ('\0')
+ // in C99 and newer versions, you can directly declare loop control variables
+ // in the loop's parentheses. e.g., `for (size_t ii = 0; ...`
+ for (ii = 0; ii < len / 2; ii++) {
tmp = str_in[ii];
str_in[ii] = str_in[len - ii - 1]; // ii-th char from end
str_in[len - ii - 1] = tmp;
@@ -700,7 +709,7 @@ struct rectangle {
void function_1()
{
- struct rectangle my_rec;
+ struct rectangle my_rec = { 1, 2 }; // Fields can be initialized immediately
// Access struct members with .
my_rec.width = 10;
@@ -724,6 +733,16 @@ int area(rect r)
return r.width * r.height;
}
+// Typedefs can also be defined right during struct definition
+typedef struct {
+ int width;
+ int height;
+} rect;
+// Like before, doing this means one can type
+rect r;
+// instead of having to type
+struct rectangle r;
+
// if you have large structs, you can pass them "by pointer" to avoid copying
// the whole struct:
int areaptr(const rect *r)
@@ -876,7 +895,7 @@ enum traffic_light_state {GREEN, YELLOW, RED};
Node createLinkedList(int *vals, int len);
/* Beyond the above elements, other definitions should be left to a C source */
-/* file. Excessive includes or definitions should, also not be contained in */
+/* file. Excessive includes or definitions should also not be contained in */
/* a header file but instead put into separate headers or a C file. */
#endif /* End of the if precompiler directive. */
diff --git a/cobol.html.markdown b/cobol.html.markdown
index 1b33f9cc..1c858396 100644
--- a/cobol.html.markdown
+++ b/cobol.html.markdown
@@ -14,7 +14,7 @@ organizations.
*COBOL has significant differences between legacy (COBOL-85)
*and modern (COBOL-2002 and COBOL-2014) versions.
*Legacy versions require columns 1-6 to be blank (they are used
- *to store the index number of the punched card..)
+ *to store the index number of the punched card).
*A '*' in column 7 means a comment.
*In legacy COBOL, a comment can only be a full line.
*Modern COBOL doesn't require fixed columns and uses *> for
@@ -106,7 +106,7 @@ organizations.
PROCEDURE DIVISION.
FIRST-PARA.
DISPLAY 'THIS IS IN FIRST-PARA'.
- PERFORM THIRD-PARA THRU FOURTH-PARA. *>skip second-para and perfrom 3rd & 4th
+ PERFORM THIRD-PARA THRU FOURTH-PARA. *>skip second-para and perform 3rd & 4th
*> then after performing third and fourth,
*> return here and continue the program until STOP RUN.
diff --git a/csharp.html.markdown b/csharp.html.markdown
index ddb0c62a..c85acb1b 100644
--- a/csharp.html.markdown
+++ b/csharp.html.markdown
@@ -760,7 +760,7 @@ on a new line! ""Wow!"", the masses cried";
Gitane // 43
}
// We defined this type inside a Bicycle class, so it is a nested type
- // Code outside of this class should reference this type as Bicycle.Brand
+ // Code outside of this class should reference this type as Bicycle.BikeBrand
public BikeBrand Brand; // After declaring an enum type, we can declare the field of this type
@@ -1348,4 +1348,4 @@ namespace Csharp7
* [LINQ Pocket Reference](http://shop.oreilly.com/product/9780596519254.do)
* [Windows Forms Programming in C#](http://www.amazon.com/Windows-Forms-Programming-Chris-Sells/dp/0321116208)
* [freeCodeCamp - C# Tutorial for Beginners](https://www.youtube.com/watch?v=GhQdlIFylQ8)
- \ No newline at end of file
+
diff --git a/dart.html.markdown b/dart.html.markdown
index b215474a..69e1623d 100644
--- a/dart.html.markdown
+++ b/dart.html.markdown
@@ -77,13 +77,11 @@ example1() {
nested1();
}
-/// Anonymous functions don't include a name but can take number of arguments
+/// Anonymous functions don't include a name
example2() {
- //// Explicit return type.
- nested1(Function<void> fn) {
+ nested1(fn) {
fn();
}
-
nested1(() => print("Example2 nested 1"));
}
@@ -717,6 +715,6 @@ main() {
## Further Reading
Dart has a comprehensive web-site. It covers API reference, tutorials, articles and more, including a
-useful Try Dart online.
-[https://www.dartlang.org](https://www.dartlang.org)
-[https://try.dartlang.org](https://try.dartlang.org)
+useful DartPad (a cloud-based Dart coding playground).
+[https://dart.dev/](https://dart.dev)
+[https://dartpad.dev/](https://dartpad.dev)
diff --git a/easylang.html.markdown b/easylang.html.markdown
index fc494e6c..ba33dbf2 100644
--- a/easylang.html.markdown
+++ b/easylang.html.markdown
@@ -121,7 +121,7 @@ print str_ord "A"
print str_chr 65
#
# set number format
-numb_fmt 0 4
+numfmt 0 4
print sqrt 2
print pi
print logn 10
diff --git a/go.html.markdown b/go.html.markdown
index 86b0f21b..dfbfc374 100644
--- a/go.html.markdown
+++ b/go.html.markdown
@@ -475,8 +475,9 @@ documentation](http://golang.org/pkg/) and the source code comes up!
Another great resource to learn Go is [Go by example](https://gobyexample.com/).
There are many excellent conference talks and video tutorials on Go available on YouTube, and here are three playlists of the very best, tailored for beginners, intermediate, and advanced Gophers respectively:
-* [Golang University 101](https://www.youtube.com/playlist?list=PLEcwzBXTPUE9V1o8mZdC9tNnRZaTgI-1P) introduces fundamental Go concepts and shows you how to use the Go tools to create and manage Go code
-* [Golang University 201](https://www.youtube.com/playlist?list=PLEcwzBXTPUE_5m_JaMXmGEFgduH8EsuTs) steps it up a notch, explaining important techniques like testing, web services, and APIs
-* [Golang University 301](https://www.youtube.com/watch?v=YHRO5WQGh0k&list=PLEcwzBXTPUE8KvXRFmmfPEUmKoy9LfmAf) dives into more advanced topics like the Go scheduler, implementation of maps and channels, and optimisation techniques
+
+- [Golang University 101](https://www.youtube.com/playlist?list=PLEcwzBXTPUE9V1o8mZdC9tNnRZaTgI-1P) introduces fundamental Go concepts and shows you how to use the Go tools to create and manage Go code
+- [Golang University 201](https://www.youtube.com/playlist?list=PLEcwzBXTPUE_5m_JaMXmGEFgduH8EsuTs) steps it up a notch, explaining important techniques like testing, web services, and APIs
+- [Golang University 301](https://www.youtube.com/watch?v=YHRO5WQGh0k&list=PLEcwzBXTPUE8KvXRFmmfPEUmKoy9LfmAf) dives into more advanced topics like the Go scheduler, implementation of maps and channels, and optimisation techniques
Go Mobile adds support for mobile platforms (Android and iOS). You can write all-Go native mobile apps or write a library that contains bindings from a Go package, which can be invoked via Java (Android) and Objective-C (iOS). Check out the [Go Mobile page](https://github.com/golang/go/wiki/Mobile) for more information.
diff --git a/html.html.markdown b/html.html.markdown
index b8212776..e9226a61 100644
--- a/html.html.markdown
+++ b/html.html.markdown
@@ -8,11 +8,11 @@ translators:
- ["Dimitri Kokkonis", "https://github.com/kokkonisd"]
---
-HTML stands for HyperText Markup Language.
+HTML stands for Hypertext Markup Language.
-It is a language which allows us to write pages for the world wide web.
+It is a language which allows us to write pages for the World Wide Web.
It is a markup language, it enables us to write webpages using code to indicate
-how text and data should be displayed. In fact, html files are simple text
+how text and data should be displayed. In fact, HTML files are simple text
files.
What is this markup? It is a method of organising the page's data by
@@ -171,6 +171,6 @@ HTML is written in files ending with `.html` or `.htm`. The mime type is
**HTML is NOT a programming language**
## To Learn More
-* [wikipedia](https://en.wikipedia.org/wiki/HTML)
-* [HTML tutorial](https://developer.mozilla.org/en-US/docs/Web/HTML)
-* [W3School](http://www.w3schools.com/html/html_intro.asp)
+* [Wikipedia](https://en.wikipedia.org/wiki/HTML)
+* [HTML Tutorial](https://developer.mozilla.org/en-US/docs/Web/HTML)
+* [W3Schools](http://www.w3schools.com/html/html_intro.asp)
diff --git a/javascript.html.markdown b/javascript.html.markdown
index 3c0e6d4f..b290b553 100644
--- a/javascript.html.markdown
+++ b/javascript.html.markdown
@@ -590,7 +590,7 @@ if (Object.create === undefined){ // don't overwrite it if it exists
// ES6 Additions
// The "let" keyword allows you to define variables in a lexical scope,
-// as opposed to a block scope like the var keyword does.
+// as opposed to a function scope like the var keyword does.
let name = "Billy";
// Variables defined with let can be reassigned new values.
diff --git a/latex.html.markdown b/latex.html.markdown
index 29a9f638..34c4b78d 100644
--- a/latex.html.markdown
+++ b/latex.html.markdown
@@ -95,8 +95,9 @@ to the source code.
Separate paragraphs by empty lines.
-You need to add a backslash after abbreviations (if not followed by a comma), because otherwise the spacing after the dot is too large:
-E.g., i.e., etc.\ are are such abbreviations.
+You need to add a tilde after abbreviations (if not followed by a comma) for a
+non-breaking space, because otherwise the spacing after the dot is too large:
+E.g., i.e., etc.~are are such abbreviations.
\section{Lists}
Lists are one of the easiest things to create in \LaTeX! I need to go shopping
@@ -140,8 +141,7 @@ about!
Operators are essential parts of a mathematical document:
trigonometric functions ($\sin$, $\cos$, $\tan$),
logarithms and exponentials ($\log$, $\exp$),
-limits ($\lim$), etc.\
-have pre-defined LaTeX commands.
+limits ($\lim$), etc.~have pre-defined LaTeX commands.
Let's write an equation to see how it's done:
$\cos(2\theta) = \cos^{2}(\theta) - \sin^{2}(\theta)$
@@ -200,24 +200,24 @@ 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.
- % The basic is simple: one letter for each column, to control alignment:
+ % The basics are 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
+ % optionally, 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 &
+ Number & First Name & Last 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
+ % Number | First Name Last Name
% -------|--------------------------- % because of \hline
% 1 | Biggus Dickus
% 2 | Monty Python
\end{table}
-\section{Getting \LaTeX{} to not compile something (i.e.\ Source Code)}
+\section{Getting \LaTeX{} to not compile something (i.e.~Source Code)}
Let's say we want to include some code into our \LaTeX{} document,
we would then need \LaTeX{} to not try and interpret that text and
instead just print it to the document. We do this with a verbatim
@@ -236,7 +236,7 @@ environment.
By now you're probably wondering how to compile this fabulous document
and look at the glorious glory that is a \LaTeX{} pdf.
-(yes, this document actually does compile).
+(Yes, this document actually does compile).
Getting to the final document using \LaTeX{} consists of the following
steps:
@@ -274,13 +274,13 @@ There exists two main types of links: visible URL \\
% You can not add extra-spaces or special symbols into shadowing text since it
% will cause mistakes during the compilation
-This package also produces list of thumbnails in the output pdf document and
+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.
+but not extended 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
@@ -295,8 +295,8 @@ The selected font has to support the glyphs used for your document, you have to
\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.
+Since LuaTeX and XeLaTeX were designed with built-in support for UTF-8, making
+life easier for writing in non-Latin alphabets.
\section{End}
@@ -317,6 +317,6 @@ That's all for now!
## More on LaTeX
-* The amazing LaTeX wikibook: [https://en.wikibooks.org/wiki/LaTeX](https://en.wikibooks.org/wiki/LaTeX)
+* The amazing LaTeX Wikibook: [https://en.wikibooks.org/wiki/LaTeX](https://en.wikibooks.org/wiki/LaTeX)
* An actual tutorial: [http://www.latex-tutorial.com/](http://www.latex-tutorial.com/)
* A quick guide for learning LaTeX: [Learn LaTeX in 30 minutes](https://www.overleaf.com/learn/latex/Learn_LaTeX_in_30_minutes)
diff --git a/lua.html.markdown b/lua.html.markdown
index e32a275d..ac7883b2 100644
--- a/lua.html.markdown
+++ b/lua.html.markdown
@@ -391,6 +391,12 @@ g() -- Prints out 343; nothing printed before now.
--]]
```
+
+## Community
+
+If you need support join the official Lua [mailing list](https://www.lua.org/lua-l.html), [irc channel](http://lua-users.org/wiki/IrcChannel), or [forum](https://luaforum.com).
+
+
## References
I was excited to learn Lua so I could make games
diff --git a/mips.html.markdown b/mips.html.markdown
index 4977cc65..7f679082 100644
--- a/mips.html.markdown
+++ b/mips.html.markdown
@@ -293,7 +293,7 @@ gateways and routers.
fact_done:
lw $s0, ($sp)
- lw $ra, ($sp) # Restore the PC
+ lw $ra, 4($sp) # Restore the PC
addi $sp, $sp, 8
jr $ra
@@ -357,7 +357,7 @@ gateways and routers.
li $t1, 5 # Length of the list
loop:
- bgt $t0, $t1, end_loop
+ bge $t0, $t1, end_loop
lw $a0, ($s0)
li $v0, 1
diff --git a/nix.html.markdown b/nix.html.markdown
index dde5dbec..1d5a7778 100644
--- a/nix.html.markdown
+++ b/nix.html.markdown
@@ -373,5 +373,8 @@ with builtins; [
* [James Fisher - Nix by example - Part 1: The Nix expression language]
(https://medium.com/@MrJamesFisher/nix-by-example-a0063a1a4c55)
+* [Susan Potter - Nix Cookbook - Nix By Example]
+ (https://ops.functionalalgebra.com/nix-by-example/)
+
* [Rommel Martinez - A Gentle Introduction to the Nix Family]
- (https://ebzzry.io/en/nix/#nix)
+ (https://web.archive.org/web/20210121042658/https://ebzzry.io/en/nix/#nix)
diff --git a/ocaml.html.markdown b/ocaml.html.markdown
index b631df0a..70668611 100644
--- a/ocaml.html.markdown
+++ b/ocaml.html.markdown
@@ -201,7 +201,7 @@ let (~/) x = 1.0 /. x ;;
(* Lists are enclosed in square brackets, items are separated by
semicolons. *)
-let my_list = [1; 2; 3] ;;
+let my_list = [1; 2; 3] ;; (* Has type "int list". *)
(* Tuples are (optionally) enclosed in parentheses, items are separated
by commas. *)
diff --git a/pug.html.markdown b/pug.html.markdown
index 0187f1e0..1bc49f64 100644
--- a/pug.html.markdown
+++ b/pug.html.markdown
@@ -183,9 +183,9 @@ style
include styles/theme.css
//- ---MIXIN---
-mixin basic()
+mixin basic
div Hello
-+basic("Bob")
++basic
//- <div>Hello</div>
mixin comment(name, comment)
@@ -193,7 +193,11 @@ mixin comment(name, comment)
span.comment-name= name
div.comment-text= comment
+comment("Bob", "This is Awesome")
-//- <div>Hello</div>
+//-
+ <div>
+ <span class="comment-name">Bob</span>
+ <div class="comment-text">This is Awesome</div>
+ </div>
```
diff --git a/purescript.html.markdown b/purescript.html.markdown
index c848c2a4..8cf1c1dd 100644
--- a/purescript.html.markdown
+++ b/purescript.html.markdown
@@ -1,5 +1,5 @@
---
-language: purescript
+language: PureScript
filename: purescript.purs
contributors:
- ["Fredrik Dyrkell", "http://www.lexicallyscoped.com"]
diff --git a/r.html.markdown b/r.html.markdown
index 79af40ce..e90d5a97 100644
--- a/r.html.markdown
+++ b/r.html.markdown
@@ -377,8 +377,8 @@ vec[6] # NA
# You can find the length of your vector with length()
length(vec) # 4
# You can perform operations on entire vectors or subsets of vectors
-vec * 4 # 16 20 24 28
-vec[2:3] * 5 # 25 30
+vec * 4 # 32 36 40 44
+vec[2:3] * 5 # 45 50
any(vec[2:3] == 8) # FALSE
# and R has many built-in functions to summarize vectors
mean(vec) # 9.5
diff --git a/rust.html.markdown b/rust.html.markdown
index 9cb44d04..9e07e005 100644
--- a/rust.html.markdown
+++ b/rust.html.markdown
@@ -89,11 +89,16 @@ fn main() {
println!("{} {}", f, x); // 1.3 hello world
// A `String` – a heap-allocated string
+ // Stored as a `Vec<u8>` and always hold a valid UTF-8 sequence,
+ // which is not null terminated.
let s: String = "hello world".to_string();
// A string slice – an immutable view into another string
- // The string buffer can be statically allocated like in a string literal
- // or contained in another object (in this case, `s`)
+ // This is basically an immutable pair of pointers to a string – it doesn’t
+ // actually contain the contents of a string, just a pointer to
+ // the begin and a pointer to the end of a string buffer,
+ // statically allocated or contained in another object (in this case, `s`).
+ // The string slice is like a view `&[u8]` into `Vec<T>`.
let s_slice: &str = &s;
println!("{} {}", s, s_slice); // hello world hello world
@@ -205,6 +210,21 @@ fn main() {
let another_foo = Foo { bar: 1 };
println!("{:?}", another_foo.frobnicate()); // Some(1)
+ // Function pointer types //
+
+ fn fibonacci(n: u32) -> u32 {
+ match n {
+ 0 => 1,
+ 1 => 1,
+ _ => fibonacci(n - 1) + fibonacci(n - 2),
+ }
+ }
+
+ type FunctionPointer = fn(u32) -> u32;
+
+ let fib : FunctionPointer = fibonacci;
+ println!("Fib: {}", fib(4));
+
/////////////////////////
// 3. Pattern matching //
/////////////////////////
diff --git a/scala.html.markdown b/scala.html.markdown
index 08fd37e4..d2d45dc9 100644
--- a/scala.html.markdown
+++ b/scala.html.markdown
@@ -481,7 +481,7 @@ class SaintBernard extends Dog {
def bite = false
}
-scala> b
+scala> val b = new SaintBernard
res0: SaintBernard = SaintBernard@3e57cd70
scala> b.breed
res1: String = Saint Bernard
@@ -599,7 +599,7 @@ List("Dom", "Bob", "Natalia") foreach println
s.map(sq)
-val sSquared = s. map(sq)
+val sSquared = s.map(sq)
sSquared.filter(_ < 10)
@@ -717,7 +717,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 a scala file using an object, with a
+// Your program's entry point is defined in a scala file using an object, with a
// single method, main:
object Application {
def main(args: Array[String]): Unit = {
diff --git a/set-theory.html.markdown b/set-theory.html.markdown
index c6e72960..d55ab7d5 100644
--- a/set-theory.html.markdown
+++ b/set-theory.html.markdown
@@ -13,7 +13,7 @@ Set theory is a branch of mathematics that studies sets, their operations, and t
* the union operator, `∪`, pronounced "cup", means "or";
* the intersection operator, `∩`, pronounced "cap", means "and";
* the exclusion operator, `\`, means "without";
-* the compliment operator, `'`, means "the inverse of";
+* the complement operator, `'`, means "the inverse of";
* the cross operator, `×`, means "the Cartesian product of".
### Qualifiers
diff --git a/swift.html.markdown b/swift.html.markdown
index 0e68e65f..e46dcc75 100644
--- a/swift.html.markdown
+++ b/swift.html.markdown
@@ -654,7 +654,7 @@ class Rect: Shape {
// but still want to run code before and after getting or setting
// a property, you can use `willSet` and `didSet`
var identifier: String = "defaultID" {
- // the `willSet` arg will be the variable name for the new value
+ // the `someIdentifier` arg will be the variable name for the new value
willSet(someIdentifier) {
print(someIdentifier)
}
diff --git a/vala.html.markdown b/vala.html.markdown
index 393578b0..06d6dedc 100755
--- a/vala.html.markdown
+++ b/vala.html.markdown
@@ -483,7 +483,7 @@ pointer_obj->some_data; // Returns some_data
delete pointer_obj;
int more = 57;
-int* more_pointer = &i; // & = address-of
+int* more_pointer = &more; // & = address-of
int indirection_demo = more_pointer*; // indirection
// Profiles: affect which Vala features are avaliable and which libraries the
@@ -494,10 +494,10 @@ int indirection_demo = more_pointer*; // indirection
// Use "--profile=whatever" when compiling.
```
-* More Vala documentation can be found [here](https://valadoc.org/).
+* More [Vala documentation](https://valadoc.org/).
* [Alternate construction syntax](https://wiki.gnome.org/Projects/Vala/Tutorial#GObject-Style_Construction) similar to GObject
-* More on contract programming [here](http://en.wikipedia.org/wiki/Contract_programming)
-* Collections library can be found [here](https://wiki.gnome.org/Projects/Vala/Tutorial#Collections)
+* More on [contract programming](http://en.wikipedia.org/wiki/Contract_programming)
+* [Collections library](https://wiki.gnome.org/Projects/Vala/Tutorial#Collections)
* [Multithreading](https://wiki.gnome.org/Projects/Vala/Tutorial#Multi-Threading)
-* Read about building GUIs with GTK+ and Vala [here](http://archive.is/7C7bw).
-* D-Bus [integration](https://wiki.gnome.org/Projects/Vala/Tutorial#D-Bus_Integration)
+* Read about [building GUIs with GTK+ and Vala](http://archive.is/7C7bw).
+* [D-Bus integration](https://wiki.gnome.org/Projects/Vala/Tutorial#D-Bus_Integration)
diff --git a/vim.html.markdown b/vim.html.markdown
index 55649cb2..00a44807 100644
--- a/vim.html.markdown
+++ b/vim.html.markdown
@@ -111,14 +111,21 @@ Vim is based on the concept on **modes**.
<esc> # 'Escapes' from whichever mode you're in, into Command mode
# Copying and pasting text
+ # Operations use the vim register by default
+ # Think of it as vim's private clipboard
+ # Yank ~ copy text into vim register
y # Yank whatever is selected
yy # Yank the current line
+
+ # Delete ~ yank text and delete from file
d # Delete whatever is selected
dd # Delete the current line
- p # Paste the copied text after the current cursor position
- P # Paste the copied text before the current cursor position
- x # Deleting character under current cursor position
+
+ p # Paste text in vim register after the current cursor position
+ P # Paste text in vim register before the current cursor position
+
+ x # Delete character under current cursor position
```
## The 'Grammar' of vim
diff --git a/visualbasic.html.markdown b/visualbasic.html.markdown
index 221c1eb3..a253af48 100644
--- a/visualbasic.html.markdown
+++ b/visualbasic.html.markdown
@@ -102,7 +102,8 @@ Module Module1
Console.WriteLine("Hello, What is your name? ") 'Ask the user their name.
username = Console.ReadLine() 'Stores the users name.
Console.WriteLine("Hello " + username) 'Output is Hello 'Their name'
- Console.ReadLine() 'Outputs the above.
+ Console.ReadLine() 'Pauses the execution for user to read
+
'The above will ask you a question followed by printing your answer.
'Other variables include Integer and we use Integer for whole numbers.
End Sub
diff --git a/wasm.html.markdown b/wasm.html.markdown
index 81344abe..4de7107f 100644
--- a/wasm.html.markdown
+++ b/wasm.html.markdown
@@ -42,7 +42,7 @@ contributors:
;; To set them to a value, we can use <type>.const:
(local.set $int_32 (i32.const 16))
- (local.set $int_32 (i64.const 128))
+ (local.set $int_64 (i64.const 128))
(local.set $float_32 (f32.const 3.14))
(local.set $float_64 (f64.const 1.28))
)
diff --git a/zh-cn/dynamic-programming-cn.html.markdown b/zh-cn/dynamic-programming-cn.html.markdown
index b75c5404..7864c22a 100644
--- a/zh-cn/dynamic-programming-cn.html.markdown
+++ b/zh-cn/dynamic-programming-cn.html.markdown
@@ -15,7 +15,7 @@ translators:
动态规划是一种实用的技巧,它可以用来解决一系列特定问题。它的思路很简单,如果你对某个给定的输入解决了一个问题,那么你可以保存已有信息,以避免重复计算,节约计算时间。
-记住,只有那些没有办法记住历史的才被迫做更多的苦力。(Fibonacci就是一个显然的例子)
+记住,如果忘记历史,就要被迫做更多的苦力。斐波那契数列就是一个显然的例子。
## 解决问题的方式
diff --git a/zh-cn/python-cn.html.markdown b/zh-cn/python-cn.html.markdown
index 6c5556fc..4469443f 100644
--- a/zh-cn/python-cn.html.markdown
+++ b/zh-cn/python-cn.html.markdown
@@ -129,12 +129,13 @@ None # => None
"etc" is None # => False
None is None # => True
-# None,0,空字符串,空列表,空字典都算是False
+# None,0,空字符串,空列表,空字典,空元组都算是False
# 所有其他值都是True
bool(0) # => False
bool("") # => False
bool([]) # => False
bool({}) # => False
+bool(()) # => False
####################################################
diff --git a/zh-cn/red-cn.html.markdown b/zh-cn/red-cn.html.markdown
index 85812990..7fee007e 100644
--- a/zh-cn/red-cn.html.markdown
+++ b/zh-cn/red-cn.html.markdown
@@ -150,11 +150,11 @@ msg: either a > 0 [
]
print ["a 是 " msg lf]
-; util
+; until
; 循环执行一段代码块,直到满足给定的条件为止。
-; util 没有返回值,所以它不能用在表示式中。
+; UNTIL 在最后一次循环执行完最后一个表达式后,总是返回真值 'true'。
c: 5
-util [
+until [
prin "o"
c: c - 1
c = 0 ; 终止循环的条件
@@ -193,15 +193,15 @@ print twice b ; 输出 6
## 更进一步
-Red 相关的源码信息在 [Red 语言主页](http://www.red-lang.org)。
+Red 相关的源码信息在 [Red 语言主页](https://www.red-lang.org)。
源代码的 [github 库](https://github.com/red/red)。
-Red/System 特性在 [这里](http://static.red-lang.org/red-system-specs-light.html)。
+Red/System 特性在 [这里](https://static.red-lang.org/red-system-specs-light.html)。
想要了解更多关于 Rebol 和 Red 的信息,加入 [Gitter 聊天室](https://gitter.im/red/red)。如果你无法加入,也可以给我们发[邮件](mailto:red-langNO_SPAM@googlegroups.com)。
-也可以在 [Stack Overflow](stackoverflow.com/questions/tagged/red) 上查阅、提交问题。
+也可以在 [Stack Overflow](https://stackoverflow.com/questions/tagged/red) 上查阅、提交问题。
也许你现在就要试一试 Red ?可以在线尝试 [try Rebol and Red site](http://tryrebol.esperconsultancy.nl)。