summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--cs-cz/markdown.html.markdown1
-rw-r--r--d.html.markdown2
-rw-r--r--de-de/latex-de.html.markdown91
-rw-r--r--factor.html.markdown182
-rw-r--r--julia.html.markdown4
-rw-r--r--perl6.html.markdown2
-rw-r--r--php.html.markdown6
-rw-r--r--pythonstatcomp.html.markdown103
-rw-r--r--ruby.html.markdown1
-rw-r--r--tmux.html.markdown4
-rw-r--r--tr-tr/swift-tr.html.markdown13
-rw-r--r--wolfram.html.markdown137
-rw-r--r--zh-cn/tmux-cn.html.markdown253
13 files changed, 701 insertions, 98 deletions
diff --git a/cs-cz/markdown.html.markdown b/cs-cz/markdown.html.markdown
index 637f0ab6..4cba38b4 100644
--- a/cs-cz/markdown.html.markdown
+++ b/cs-cz/markdown.html.markdown
@@ -5,6 +5,7 @@ contributors:
translators:
- ["Michal Martinek", "https://github.com/MichalMartinek"]
filename: markdown.md
+lang: cs-cz
---
Markdown byl vytvořen Johnem Gruberem v roce 2004. Je zamýšlen jako lehce čitelná
diff --git a/d.html.markdown b/d.html.markdown
index 6f88cf84..edb3bff5 100644
--- a/d.html.markdown
+++ b/d.html.markdown
@@ -254,7 +254,7 @@ void main() {
// Use an index, access every array element by reference (because we're
// going to change each element) and just call parallel on the array!
foreach(i, ref elem; parallel(arr)) {
- ref = sqrt(i + 1.0);
+ elem = sqrt(i + 1.0);
}
}
```
diff --git a/de-de/latex-de.html.markdown b/de-de/latex-de.html.markdown
index 2c18b8fd..ee9c6e3e 100644
--- a/de-de/latex-de.html.markdown
+++ b/de-de/latex-de.html.markdown
@@ -6,19 +6,19 @@ contributors:
- ["Sricharan Chiruvolu", "http://sricharan.xyz"]
translators:
- ["Moritz Kammerer", "https://github.com/phxql"]
+ - ["Jerome Meinke", "https://github.com/jmeinke"]
lang: de-de
filename: latex-de.tex
---
```
-% Alle Kommentare starten fangen mit % an
-% Es gibt keine Kommentare über mehrere Zeilen
+% Alle Kommentare starten mit einem Prozentzeichen %
-% LateX ist keine "What You See Is What You Get" Textverarbeitungssoftware wie z.B.
+% LaTeX ist keine "What You See Is What You Get" Textverarbeitungssoftware wie z.B.
% MS Word oder OpenOffice Writer
-% Jedes LateX-Kommando startet mit einem Backslash (\)
+% Jedes LaTeX-Kommando startet mit einem Backslash (\)
-% LateX-Dokumente starten immer mit der Definition des Dokuments, die sie darstellen
+% LaTeX-Dokumente starten immer mit der Definition des Dokuments, die sie darstellen
% Weitere Dokumententypen sind z.B. book, report, presentations, etc.
% Optionen des Dokuments stehen zwischen den eckigen Klammern []. In diesem Fall
% wollen wir einen 12 Punkte-Font verwenden.
@@ -26,7 +26,7 @@ filename: latex-de.tex
% Als nächstes definieren wir die Pakete, die wir verwenden wollen.
% Wenn du z.B. Grafiken, farbigen Text oder Quelltext in dein Dokument einbetten möchtest,
-% musst du die Fähigkeiten von Latex durch Hinzufügen von Paketen erweitern.
+% musst du die Fähigkeiten von LaTeX durch Hinzufügen von Paketen erweitern.
% Wir verwenden die Pakete float und caption für Bilder.
\usepackage{caption}
\usepackage{float}
@@ -34,30 +34,41 @@ filename: latex-de.tex
% Mit diesem Paket können leichter Umlaute getippt werden
\usepackage[utf8]{inputenc}
+% Es gibt eigentlich keine Kommentare über mehrere Zeilen, solche kann man
+% aber selbst durch die Angabe eigener Kommandos definieren.
+% Dieses Kommando kann man später benutzen.
+\newcommand{\comment}[1]{}
+
% Es können durchaus noch weitere Optione für das Dokument gesetzt werden!
\author{Chaitanya Krishna Ande, Colton Kohnke \& Sricharan Chiruvolu}
\date{\today}
-\title{Learn LaTeX in Y Minutes!}
+\title{Learn \LaTeX\ in Y Minutes!}
% Nun kann's losgehen mit unserem Dokument.
% Alles vor dieser Zeile wird die Preamble genannt.
-\begin{document}
+\begin{document}
+
+\comment{
+ Dies ist unser selbst-definierter Befehl
+ für mehrzeilige Kommentare.
+}
+
% Wenn wir den Autor, das Datum und den Titel gesetzt haben, kann
-% LateX für uns eine Titelseite generieren
+% LaTeX für uns eine Titelseite generieren
\maketitle
-% Die meisten Paper haben ein Abstract. LateX bietet dafür einen vorgefertigen Befehl an.
+% Die meisten Paper haben ein Abstract. LaTeX bietet dafür einen vorgefertigen Befehl an.
% Das Abstract sollte in der logischen Reihenfolge, also nach dem Titel, aber vor dem
% Inhalt erscheinen.
% Dieser Befehl ist in den Dokumentenklassen article und report verfügbar.
\begin{abstract}
- LateX documentation geschrieben in LateX! Wie ungewöhnlich und garantiert nicht meine Idee!
+ \LaTeX -Documentation geschrieben in \LaTeX ! Wie ungewöhnlich und garantiert nicht meine Idee!
\end{abstract}
% Section Befehle sind intuitiv.
% Alle Titel der sections werden automatisch in das Inhaltsverzeichnis übernommen.
\section{Einleitung}
-Hi, mein Name ist Moritz und zusammen werden wir LateX erforschen!
+Hi, mein Name ist Moritz und zusammen werden wir \LaTeX\ erforschen!
\section{Noch eine section}
Das hier ist der Text für noch eine section. Ich glaube, wir brauchen eine subsection.
@@ -71,16 +82,16 @@ So ist's schon viel besser.
% Wenn wir den Stern nach section schreiben, dann unterdrückt LateX die Nummerierung.
% Das funktioniert auch bei anderen Befehlen.
-\section*{Das ist eine unnummerierte section}
-Es müssen nicht alle sections nummeriert sein!
+\section*{Das ist eine unnummerierte section}
+Es müssen nicht alle Sections nummeriert sein!
\section{Ein paar Notizen}
-LateX ist ziemlich gut darin, Text so zu platzieren, dass es gut aussieht.
+\LaTeX\ ist ziemlich gut darin, Text so zu platzieren, dass es gut aussieht.
Falls eine Zeile \\ mal \\ woanders \\ umgebrochen \\ werden \\ soll, füge
\textbackslash\textbackslash in den Code ein.\\
\section{Listen}
-Listen sind eine der einfachsten Dinge in LateX. Ich muss morgen einkaufen gehen,
+Listen sind eine der einfachsten Dinge in \LaTeX. Ich muss morgen einkaufen gehen,
also lass uns eine Einkaufsliste schreiben:
\begin{enumerate} % Dieser Befehl erstellt eine "enumerate" Umgebung.
% \item bringt enumerate dazu, eins weiterzuzählen.
@@ -96,7 +107,7 @@ also lass uns eine Einkaufsliste schreiben:
\section{Mathe}
-Einer der Haupteinsatzzwecke von LateX ist das Schreiben von akademischen
+Einer der Haupteinsatzzwecke von \LaTeX\ ist das Schreiben von akademischen
Artikeln oder Papern. Meistens stammen diese aus dem Bereich der Mathe oder
anderen Wissenschaften. Und deswegen müssen wir in der Lage sein, spezielle
Symbole zu unserem Paper hinzuzufügen! \\
@@ -106,18 +117,18 @@ Symbole für Mengen und relationen, Pfeile, Operatoren und Griechische Buchstabe
um nur ein paar zu nennen.\\
Mengen und Relationen spielen eine sehr wichtige Rolle in vielen mathematischen
-Papern. So schreibt man in LateX, dass alle y zu X gehören: $\forall$ y $\in$ X. \\
+Papern. So schreibt man in \LaTeX, dass alle y zu X gehören: $\forall$ y $\in$ X. \\
-% Achte auf die $ Zeichen vor und nach den Symbolen. Wenn wir in LateX schreiben,
+% Achte auf die $ Zeichen vor und nach den Symbolen. Wenn wir in LaTeX schreiben,
% geschieht dies standardmäßig im Textmodus. Die Mathe-Symbole existieren allerdings
% nur im Mathe-Modus. Wir können den Mathe-Modus durch das $ Zeichen aktivieren und
% ihn mit $ wieder verlassen. Variablen können auch im Mathe-Modus angezeigt werden.
Mein Lieblingsbuchstabe im Griechischen ist $\xi$. Ich mag auch $\beta$, $\gamma$ und $\sigma$.
-Bis jetzt habe ich noch keinen griechischen Buchstaben gefunden, den LateX nicht kennt!
+Bis jetzt habe ich noch keinen griechischen Buchstaben gefunden, den \LaTeX nicht kennt!
Operatoren sind ebenfalls wichtige Bestandteile von mathematischen Dokumenten:
-Trigonometrische Funktionen ($\sin$, $\cos$, $\tan$),
+Trigonometrische Funktionen ($\sin$, $\cos$, $\tan$),
Logarithmus und Exponenten ($\log$, $\exp$),
Grenzwerte ($\lim$), etc. haben vordefinierte Befehle.
Lass uns eine Gleichung schreiben: \\
@@ -127,7 +138,7 @@ $\cos(2\theta) = \cos^{2}(\theta) - \sin^{2}(\theta)$\\
Brüche (Zähler / Nenner) können so geschrieben werden:
% 10 / 7
-$^{10}/_{7}$
+$^{10}/_{7}$
% Komplexere Brüche können so geschrieben werden:
% \frac{Zähler}{Nenner}
@@ -142,19 +153,19 @@ Wir können Gleichungen auch in einer equation Umgebung verwenden.
\end{equation} % Alle \begin Befehle müssen einen \end Befehl besitzen
Wir können nun unsere Gleichung referenzieren!
-Gleichung ~\ref{eq:pythagoras} ist auch als das Theorem des Pythagoras bekannt. Dieses wird in
+Gleichung ~\ref{eq:pythagoras} ist auch als das Theorem des Pythagoras bekannt. Dieses wird in
Abschnitt ~\ref{subsec:pythagoras} behandelt. Es können sehr viele Sachen mit Labels versehen werden:
Grafiken, Gleichungen, Sections, etc.
Summen und Integrale können mit den sum und int Befehlen dargestellt werden:
-% Manche LateX-Compiler beschweren sich, wenn Leerzeilen in Gleichungen auftauchen
-\begin{equation}
+% Manche LaTeX-Compiler beschweren sich, wenn Leerzeilen in Gleichungen auftauchen
+\begin{equation}
\sum_{i=0}^{5} f_{i}
-\end{equation}
-\begin{equation}
+\end{equation}
+\begin{equation}
\int_{0}^{\infty} \mathrm{e}^{-x} \mathrm{d}x
-\end{equation}
+\end{equation}
\section{Grafiken}
@@ -164,7 +175,7 @@ Aber keine Sorge, ich muss auch jedes mal nachschauen, welche Option wie wirkt.
\begin{figure}[H] % H ist die Platzierungsoption
\centering % Zentriert die Grafik auf der Seite
% Fügt eine Grafik ein, die auf 80% der Seitenbreite einnimmt.
- %\includegraphics[width=0.8\linewidth]{right-triangle.png}
+ %\includegraphics[width=0.8\linewidth]{right-triangle.png}
% Auskommentiert, damit es nicht im Dokument auftaucht.
\caption{Dreieck mit den Seiten $a$, $b$, $c$}
\label{fig:right-triangle}
@@ -177,7 +188,7 @@ Wir können Tabellen genauso wie Grafiken einfügen.
\caption{Überschrift der Tabelle.}
% Die {} Argumente geben an, wie eine Zeile der Tabelle dargestellt werden soll.
% Auch hier muss ich jedes Mal nachschauen. Jedes. einzelne. Mal.
- \begin{tabular}{c|cc}
+ \begin{tabular}{c|cc}
Nummer & Nachname & Vorname \\ % Spalten werden durch & getrennt
\hline % Eine horizontale Linie
1 & Biggus & Dickus \\
@@ -187,36 +198,36 @@ Wir können Tabellen genauso wie Grafiken einfügen.
% \section{Links} % Kommen bald!
-\section{Verhindern, dass LateX etwas kompiliert (z.B. Quelltext)}
-Angenommen, wir wollen Quelltext in unserem LateX-Dokument. LateX soll
-in diesem Fall nicht den Quelltext als LateX-Kommandos interpretieren,
+\section{Verhindern, dass \LaTeX\ etwas kompiliert (z.B. Quelltext)}
+Angenommen, wir wollen Quelltext in unserem \LaTeX-Dokument. \LaTeX\ soll
+in diesem Fall nicht den Quelltext als \LaTeX-Kommandos interpretieren,
sondern es einfach ins Dokument schreiben. Um das hinzubekommen, verwenden
wir eine verbatim Umgebung.
% Es gibt noch weitere Pakete für Quelltexte (z.B. minty, lstlisting, etc.)
% aber verbatim ist das simpelste.
-\begin{verbatim}
+\begin{verbatim}
print("Hello World!")
a%b; % Schau dir das an! Wir können % im verbatim verwenden!
random = 4; #decided by fair random dice roll
\end{verbatim}
-\section{Kompilieren}
+\section{Kompilieren}
Ich vermute, du wunderst dich, wie du dieses tolle Dokument in ein PDF
verwandeln kannst. (Ja, dieses Dokument kompiliert wirklich!) \\
Dafür musst du folgende Schritte durchführen:
\begin{enumerate}
- \item Schreibe das Dokument. (den LateX-Quelltext).
- \item Kompiliere den Quelltext in ein PDF.
+ \item Schreibe das Dokument. (den \LaTeX -Quelltext).
+ \item Kompiliere den Quelltext in ein PDF.
Das Kompilieren sieht so ähnlich wie das hier aus (Linux): \\
- \begin{verbatim}
- $pdflatex learn-latex.tex learn-latex.pdf
+ \begin{verbatim}
+ $pdflatex learn-latex.tex learn-latex.pdf
\end{verbatim}
\end{enumerate}
-Manche LateX-Editoren kombinieren Schritt 1 und 2. Du siehst also nur Schritt 1 und Schritt
+Manche \LaTeX-Editoren kombinieren Schritt 1 und 2. Du siehst also nur Schritt 1 und Schritt
2 wird unsichtbar im Hintergrund ausgeführt.
Alle Formatierungsoptionen werden in Schritt 1 in den Quelltext geschrieben. Schritt 2 verwendet
diff --git a/factor.html.markdown b/factor.html.markdown
new file mode 100644
index 00000000..a0726420
--- /dev/null
+++ b/factor.html.markdown
@@ -0,0 +1,182 @@
+---
+language: factor
+contributors:
+ - ["hyphz", "http://github.com/hyphz/"]
+filename: learnfactor.factor
+---
+
+Factor is a modern stack-based language, based on Forth, created by Slava Pestov.
+
+Code in this file can be typed into Factor, but not directly imported because the vocabulary and import header would make the beginning thoroughly confusing.
+
+```
+! This is a comment
+
+! Like Forth, all programming is done by manipulating the stack.
+! Stating a literal value pushes it onto the stack.
+5 2 3 56 76 23 65 ! No output, but stack is printed out in interactive mode
+
+! Those numbers get added to the stack, from left to right.
+! .s prints out the stack non-destructively.
+.s ! 5 2 3 56 76 23 65
+
+! Arithmetic works by manipulating data on the stack.
+5 4 + ! No output
+
+! `.` pops the top result from the stack and prints it.
+. ! 9
+
+! More examples of arithmetic:
+6 7 * . ! 42
+1360 23 - . ! 1337
+12 12 / . ! 1
+13 2 mod . ! 1
+
+99 neg . ! -99
+-99 abs . ! 99
+52 23 max . ! 52
+52 23 min . ! 23
+
+! A number of words are provided to manipulate the stack, collectively known as shuffle words.
+
+3 dup - ! duplicate the top item (1st now equals 2nd): 3 - 3
+2 5 swap / ! swap the top with the second element: 5 / 2
+4 0 drop 2 / ! remove the top item (dont print to screen): 4 / 2
+1 2 3 nip .s ! remove the second item (similar to drop): 1 3
+1 2 clear .s ! wipe out the entire stack
+1 2 3 4 over .s ! duplicate the second item to the top: 1 2 3 4 3
+1 2 3 4 2 pick .s ! duplicate the third item to the top: 1 2 3 4 2 3
+
+! Creating Words
+! The `:` word sets Factor into compile mode until it sees the `;` word.
+: square ( n -- n ) dup * ; ! No output
+5 square . ! 25
+
+! We can view what a word does too.
+! \ suppresses evaluation of a word and pushes its identifier on the stack instead.
+\ square see ! : square ( n -- n ) dup * ;
+
+! After the name of the word to create, the declaration between brackets gives the stack effect.
+! We can use whatever names we like inside the declaration:
+: weirdsquare ( camel -- llama ) dup * ;
+
+! Provided their count matches the word's stack effect:
+: doubledup ( a -- b ) dup dup ; ! Error: Stack effect declaration is wrong
+: doubledup ( a -- a a a ) dup dup ; ! Ok
+: weirddoubledup ( i -- am a fish ) dup dup ; ! Also Ok
+
+! Where Factor differs from Forth is in the use of quotations.
+! A quotation is a block of code that is pushed on the stack as a value.
+! [ starts quotation mode; ] ends it.
+[ 2 + ] ! Quotation that adds 2 is left on the stack
+4 swap call . ! 6
+
+! And thus, higher order words. TONS of higher order words.
+2 3 [ 2 + ] dip .s ! Pop top stack value, run quotation, push it back: 4 3
+3 4 [ + ] keep .s ! Copy top stack value, run quotation, push the copy: 7 4
+1 [ 2 + ] [ 3 + ] bi .s ! Run each quotation on the top value, push both results: 3 4
+4 3 1 [ + ] [ + ] bi .s ! Quotations in a bi can pull values from deeper on the stack: 4 5 ( 1+3 1+4 )
+1 2 [ 2 + ] bi@ .s ! Run the quotation on first and second values
+2 [ + ] curry ! Inject the given value at the start of the quotation: [ 2 + ] is left on the stack
+
+! Conditionals
+! Any value is true except the built-in value f.
+! A built-in value t does exist, but its use isn't essential.
+! Conditionals are higher order words as with the combinators above.
+
+5 [ "Five is true" . ] when ! Five is true
+0 [ "Zero is true" . ] when ! Zero is true
+f [ "F is true" . ] when ! No output
+f [ "F is false" . ] unless ! F is false
+2 [ "Two is true" . ] [ "Two is false" . ] if ! Two is true
+
+! By default the conditionals consume the value under test, but starred variants
+! leave it alone if it's true:
+
+5 [ . ] when* ! 5
+f [ . ] when* ! No output, empty stack, f is consumed because it's false
+
+
+! Loops
+! You've guessed it.. these are higher order words too.
+
+5 [ . ] each-integer ! 0 1 2 3 4
+4 3 2 1 0 5 [ + . ] each-integer ! 0 2 4 6 8
+5 [ "Hello" . ] times ! Hello Hello Hello Hello Hello
+
+! Here's a list:
+{ 2 4 6 8 } ! Goes on the stack as one item
+
+! Loop through the list:
+{ 2 4 6 8 } [ 1 + . ] each ! Prints 3 5 7 9
+{ 2 4 6 8 } [ 1 + ] map ! Leaves { 3 5 7 9 } on stack
+
+! Loop reducing or building lists:
+{ 1 2 3 4 5 } [ 2 mod 0 = ] filter ! Keeps only list members for which quotation yields true: { 2 4 }
+{ 2 4 6 8 } 0 [ + ] reduce . ! Like "fold" in functional languages: prints 20 (0+2+4+6+8)
+{ 2 4 6 8 } 0 [ + ] accumulate . . ! Like reduce but keeps the intermediate values in a list: prints { 0 2 6 12 } then 20
+1 5 [ 2 * dup ] replicate . ! Loops the quotation 5 times and collects the results in a list: { 2 4 8 16 32 }
+1 [ dup 100 < ] [ 2 * dup ] produce ! Loops the second quotation until the first returns false and collects the results: { 2 4 8 16 32 64 128 }
+
+! If all else fails, a general purpose while loop:
+1 [ dup 10 < ] [ "Hello" . 1 + ] while ! Prints "Hello" 10 times
+ ! Yes, it's hard to read
+ ! That's what all those variant loops are for
+
+! Variables
+! Usually Factor programs are expected to keep all data on the stack.
+! Using named variables makes refactoring harder (and it's called Factor for a reason)
+! Global variables, if you must:
+
+SYMBOL: name ! Creates name as an identifying word
+"Bob" name set-global ! No output
+name get-global . ! "Bob"
+
+! Named local variables are considered an extension but are available
+! In a quotation..
+[| m n ! Quotation captures top two stack values into m and n
+ | m n + ] ! Read them
+
+! Or in a word..
+:: lword ( -- ) ! Note double colon to invoke lexical variable extension
+ 2 :> c ! Declares immutable variable c to hold 2
+ c . ; ! Print it out
+
+! In a word declared this way, the input side of the stack declaration
+! becomes meaningful and gives the variable names stack values are captured into
+:: double ( a -- result ) a 2 * ;
+
+! Variables are declared mutable by ending their name with a shriek
+:: mword2 ( a! -- x y ) ! Capture top of stack in mutable variable a
+ a ! Push a
+ a 2 * a! ! Multiply a by 2 and store result back in a
+ a ; ! Push new value of a
+5 mword2 ! Stack: 5 10
+
+! Lists and Sequences
+! We saw above how to push a list onto the stack
+
+0 { 1 2 3 4 } nth ! Access a particular member of a list: 1
+10 { 1 2 3 4 } nth ! Error: sequence index out of bounds
+1 { 1 2 3 4 } ?nth ! Same as nth if index is in bounds: 2
+10 { 1 2 3 4 } ?nth ! No error if out of bounds: f
+
+{ "at" "the" "beginning" } "Append" prefix ! { "Append" "at" "the" "beginning" }
+{ "Append" "at" "the" } "end" suffix ! { "Append" "at" "the" "end" }
+"in" 1 { "Insert" "the" "middle" } insert-nth ! { "Insert" "in" "the" "middle" }
+"Concat" "enate" append ! "Concatenate" - strings are sequences too
+"Concatenate" "Reverse " prepend ! "Reverse Concatenate"
+{ "Concatenate " "seq " "of " "seqs" } concat ! "Concatenate seq of seqs"
+{ "Connect" "subseqs" "with" "separators" } " " join ! "Connect subseqs with separators"
+
+! And if you want to get meta, quotations are sequences and can be dismantled..
+0 [ 2 + ] nth ! 2
+1 [ 2 + ] nth ! +
+[ 2 + ] \ - suffix ! Quotation [ 2 + - ]
+
+
+```
+
+##Ready For More?
+
+* [Factor Documentation](http://docs.factorcode.org/content/article-help.home.html)
diff --git a/julia.html.markdown b/julia.html.markdown
index ef3ea244..2810555e 100644
--- a/julia.html.markdown
+++ b/julia.html.markdown
@@ -151,12 +151,16 @@ a = Int64[] # => 0-element Int64 Array
# 1-dimensional array literals can be written with comma-separated values.
b = [4, 5, 6] # => 3-element Int64 Array: [4, 5, 6]
+b = [4; 5; 6] # => 3-element Int64 Array: [4, 5, 6]
b[1] # => 4
b[end] # => 6
# 2-dimentional arrays use space-separated values and semicolon-separated rows.
matrix = [1 2; 3 4] # => 2x2 Int64 Array: [1 2; 3 4]
+# Arrays of a particular Type
+b = Int8[4, 5, 6] # => 3-element Int8 Array: [4, 5, 6]
+
# Add stuff to the end of a list with push! and append!
push!(a,1) # => [1]
push!(a,2) # => [1,2]
diff --git a/perl6.html.markdown b/perl6.html.markdown
index 1457999a..6633b322 100644
--- a/perl6.html.markdown
+++ b/perl6.html.markdown
@@ -103,7 +103,7 @@ sub say-hello-to(Str $name) { # You can provide the type of an argument
## It can also have optional arguments:
sub with-optional($arg?) { # the "?" marks the argument optional
- say "I might return `(Any)` (Perl's "null"-like value) if I don't have
+ say "I might return `(Any)` (Perl's 'null'-like value) if I don't have
an argument passed, or I'll return my argument";
$arg;
}
diff --git a/php.html.markdown b/php.html.markdown
index 0504ced2..02249cd3 100644
--- a/php.html.markdown
+++ b/php.html.markdown
@@ -53,6 +53,8 @@ $int1 = 12; // => 12
$int2 = -12; // => -12
$int3 = 012; // => 10 (a leading 0 denotes an octal number)
$int4 = 0x0F; // => 15 (a leading 0x denotes a hex literal)
+// Binary integer literals are available since PHP 5.4.0.
+$int5 = 0b11111111; // 255 (a leading 0b denotes a binary number)
// Floats (aka doubles)
$float = 1.234;
@@ -116,11 +118,11 @@ echo 'Multiple', 'Parameters', 'Valid'; // Returns 'MultipleParametersValid'
// a valid constant name starts with a letter or underscore,
// followed by any number of letters, numbers, or underscores.
-define("FOO", "something");
+define("FOO", "something");
// access to a constant is possible by calling the choosen name without a $
echo FOO; // Returns 'something'
-echo 'This outputs '.FOO; // Returns 'This ouputs something'
+echo 'This outputs ' . FOO; // Returns 'This ouputs something'
diff --git a/pythonstatcomp.html.markdown b/pythonstatcomp.html.markdown
index 78b62e33..f8d83b98 100644
--- a/pythonstatcomp.html.markdown
+++ b/pythonstatcomp.html.markdown
@@ -9,6 +9,8 @@ This is a tutorial on how to do some typical statistical programming tasks using
```python
+
+
# 0. Getting set up ====
""" Get set up with IPython and pip install the following: numpy, scipy, pandas,
@@ -25,17 +27,17 @@ This is a tutorial on how to do some typical statistical programming tasks using
already using Python, there's a benefit to sticking with one language.
"""
-import requests # for HTTP requests (web scraping, APIs)
+import requests # for HTTP requests (web scraping, APIs)
import os
# web scraping
r = requests.get("https://github.com/adambard/learnxinyminutes-docs")
-r.status_code # if 200, request was successful
-r.text # raw page source
-print(r.text) # prettily formatted
+r.status_code # if 200, request was successful
+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")
+os.getcwd() # check what's the working directory
+f = open("learnxinyminutes.html", "wb")
f.write(r.text.encode("UTF-8"))
f.close()
@@ -44,7 +46,7 @@ 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 = open(fn, "wb")
f.write(r.text.encode("UTF-8"))
f.close()
@@ -58,7 +60,9 @@ f.close()
you've used R, you will be familiar with the idea of the "data.frame" already.
"""
-import pandas as pd, numpy as np, scipy as sp
+import pandas as pd
+import numpy as np
+import scipy as sp
pets = pd.read_csv(fn)
pets
# name age weight species
@@ -74,20 +78,20 @@ pets
pets.age
pets["age"]
-pets.head(2) # prints first 2 rows
-pets.tail(1) # prints last row
+pets.head(2) # prints first 2 rows
+pets.tail(1) # prints last row
-pets.name[1] # 'vesuvius'
-pets.species[0] # 'cat'
-pets["weight"][2] # 34
+pets.name[1] # 'vesuvius'
+pets.species[0] # 'cat'
+pets["weight"][2] # 34
# in R, you would expect to get 3 rows doing this, but here you get 2:
pets.age[0:2]
# 0 3
# 1 6
-sum(pets.age)*2 # 28
-max(pets.weight) - min(pets.weight) # 20
+sum(pets.age) * 2 # 28
+max(pets.weight) - min(pets.weight) # 20
""" If you are doing some serious linear algebra and number-crunching, you may
just want arrays, not DataFrames. DataFrames are ideal for combining columns
@@ -96,7 +100,8 @@ max(pets.weight) - min(pets.weight) # 20
# 3. Charts ====
-import matplotlib as mpl, matplotlib.pyplot as plt
+import matplotlib as mpl
+import matplotlib.pyplot as plt
%matplotlib inline
# To do data vizualization in Python, use matplotlib
@@ -105,13 +110,17 @@ plt.hist(pets.age);
plt.boxplot(pets.weight);
-plt.scatter(pets.age, pets.weight); plt.xlabel("age"); plt.ylabel("weight");
+plt.scatter(pets.age, pets.weight)
+plt.xlabel("age")
+plt.ylabel("weight");
# seaborn sits atop matplotlib and makes plots prettier
import seaborn as sns
-plt.scatter(pets.age, pets.weight); plt.xlabel("age"); plt.ylabel("weight");
+plt.scatter(pets.age, pets.weight)
+plt.xlabel("age")
+plt.ylabel("weight");
# there are also some seaborn-specific plotting functions
# notice how seaborn automatically labels the x-axis on this barplot
@@ -141,7 +150,7 @@ ggplot(aes(x="age",y="weight"), data=pets) + geom_point() + labs(title="pets")
url = "https://raw.githubusercontent.com/e99n09/R-notes/master/data/hre.csv"
r = requests.get(url)
fp = "hre.csv"
-f = open(fp,"wb")
+f = open(fp, "wb")
f.write(r.text.encode("UTF-8"))
f.close()
@@ -149,33 +158,33 @@ hre = pd.read_csv(fp)
hre.head()
"""
- Ix Dynasty Name Birth Death Election 1
-0 NaN Carolingian Charles I 2 April 742 28 January 814 NaN
-1 NaN Carolingian Louis I 778 20 June 840 NaN
-2 NaN Carolingian Lothair I 795 29 September 855 NaN
-3 NaN Carolingian Louis II 825 12 August 875 NaN
-4 NaN Carolingian Charles II 13 June 823 6 October 877 NaN
-
- Election 2 Coronation 1 Coronation 2 Ceased to be Emperor
-0 NaN 25 December 800 NaN 28 January 814
-1 NaN 11 September 813 5 October 816 20 June 840
-2 NaN 5 April 823 NaN 29 September 855
-3 NaN Easter 850 18 May 872 12 August 875
-4 NaN 29 December 875 NaN 6 October 877
-
- Descent from whom 1 Descent how 1 Descent from whom 2 Descent how 2
-0 NaN NaN NaN NaN
-1 Charles I son NaN NaN
-2 Louis I son NaN NaN
-3 Lothair I son NaN NaN
-4 Louis I son NaN NaN
+ Ix Dynasty Name Birth Death Election 1
+0 NaN Carolingian Charles I 2 April 742 28 January 814 NaN
+1 NaN Carolingian Louis I 778 20 June 840 NaN
+2 NaN Carolingian Lothair I 795 29 September 855 NaN
+3 NaN Carolingian Louis II 825 12 August 875 NaN
+4 NaN Carolingian Charles II 13 June 823 6 October 877 NaN
+
+ Election 2 Coronation 1 Coronation 2 Ceased to be Emperor
+0 NaN 25 December 800 NaN 28 January 814
+1 NaN 11 September 813 5 October 816 20 June 840
+2 NaN 5 April 823 NaN 29 September 855
+3 NaN Easter 850 18 May 872 12 August 875
+4 NaN 29 December 875 NaN 6 October 877
+
+ Descent from whom 1 Descent how 1 Descent from whom 2 Descent how 2
+0 NaN NaN NaN NaN
+1 Charles I son NaN NaN
+2 Louis I son NaN NaN
+3 Lothair I son NaN NaN
+4 Louis I son NaN NaN
"""
# clean the Birth and Death columns
-import re # module for regular expressions
+import re # module for regular expressions
-rx = re.compile(r'\d+$') # match trailing digits
+rx = re.compile(r'\d+$') # match trailing digits
""" This function applies the regular expression to an input column (here Birth,
Death), flattens the resulting list, converts it to a Series object, and
@@ -185,8 +194,9 @@ rx = re.compile(r'\d+$') # match trailing digits
- http://stackoverflow.com/questions/11860476/how-to-unlist-a-python-list
- http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.html
"""
+
def extractYear(v):
- return(pd.Series(reduce(lambda x,y: x+y,map(rx.findall,v),[])).astype(int))
+ return(pd.Series(reduce(lambda x, y: x + y, map(rx.findall, v), [])).astype(int))
hre["BirthY"] = extractYear(hre.Birth)
hre["DeathY"] = extractYear(hre.Death)
@@ -199,17 +209,17 @@ sns.lmplot("BirthY", "EstAge", data=hre, hue="Dynasty", fit_reg=False);
# use scipy to run a linear regression
from scipy import stats
-(slope,intercept,rval,pval,stderr)=stats.linregress(hre.BirthY,hre.EstAge)
+(slope, intercept, rval, pval, stderr) = stats.linregress(hre.BirthY, hre.EstAge)
# code source: http://wiki.scipy.org/Cookbook/LinearRegression
# check the slope
-slope # 0.0057672618839073328
+slope # 0.0057672618839073328
# check the R^2 value:
-rval**2 # 0.020363950027333586
+rval**2 # 0.020363950027333586
# check the p-value
-pval # 0.34971812581498452
+pval # 0.34971812581498452
# use seaborn to make a scatterplot and plot the linear regression trend line
sns.lmplot("BirthY", "EstAge", data=hre);
@@ -223,6 +233,7 @@ sns.lmplot("BirthY", "EstAge", data=hre);
To see a version of the Holy Roman Emperors analysis using R, see
- http://github.com/e99n09/R-notes/blob/master/holy_roman_emperors_dates.R
"""
+
```
If you want to learn more, get _Python for Data Analysis_ by Wes McKinney. It's a superb resource and I used it as a reference when writing this tutorial.
diff --git a/ruby.html.markdown b/ruby.html.markdown
index b7f8b4a1..3eed2d3c 100644
--- a/ruby.html.markdown
+++ b/ruby.html.markdown
@@ -594,3 +594,4 @@ Something.new.qux # => 'qux'
- [Ruby from other languages](https://www.ruby-lang.org/en/documentation/ruby-from-other-languages/)
- [Programming Ruby](http://www.amazon.com/Programming-Ruby-1-9-2-0-Programmers/dp/1937785491/) - An older [free edition](http://ruby-doc.com/docs/ProgrammingRuby/) is available online.
- [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide) - A community-driven Ruby coding style guide.
+- [Try Ruby](http://tryruby.org) - Learn the basic of Ruby programming language, interactive in the browser.
diff --git a/tmux.html.markdown b/tmux.html.markdown
index 868302a8..c9e3db6b 100644
--- a/tmux.html.markdown
+++ b/tmux.html.markdown
@@ -7,7 +7,7 @@ filename: LearnTmux.txt
---
-[tmux](http://tmux.sourceforge.net)
+[tmux](http://tmux.github.io)
is a terminal multiplexer: it enables a number of terminals
to be created, accessed, and controlled from a single screen. tmux
may be detached from a screen and continue running in the background
@@ -240,7 +240,7 @@ set -g status-right "#[fg=green] | #[fg=white]#(tmux-mem-cpu-load)#[fg=green] |
### References
-[Tmux | Home](http://tmux.sourceforge.net)
+[Tmux | Home](http://tmux.github.io)
[Tmux Manual page](http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/tmux.1?query=tmux)
diff --git a/tr-tr/swift-tr.html.markdown b/tr-tr/swift-tr.html.markdown
index c13f5ecf..15056bb8 100644
--- a/tr-tr/swift-tr.html.markdown
+++ b/tr-tr/swift-tr.html.markdown
@@ -25,14 +25,14 @@ import UIKit
//XCode işaretlemelerle kodunuzu bölümlere ayırmanızı ve sağ üstteki metot
- listesinde gruplama yapmanıza olanak sağlıyor
+//listesinde gruplama yapmanıza olanak sağlıyor
// MARK: Bölüm işareti
// TODO: Daha sonra yapılacak
// FIXME: Bu kodu düzelt
-//Swift 2 de, println ve print metotları print komutunda birleştirildi. Print
- otomatik olarak yeni satır ekliyor.
+//Swift 2 de, println ve print metotları print komutunda birleştirildi.
+//Print otomatik olarak yeni satır ekliyor.
print("Merhaba dünya") // println print olarak kullanılıyor.
print("Merhaba dünya", appendNewLine: false) // yeni bir satır eklemeden yazar.
@@ -75,7 +75,7 @@ print("Build degiskeni: \(buildDegiskeni)") // Build degeri: 7
*/
var baziOptionalString: String? = "optional" // nil olabilir.
// yukarıdakiyle aynı ama ? bir postfix (sona eklenir) operatördür. (kolay
-okunabilir)
+//okunabilir)
var someOptionalString2: Optional<String> = "optional"
@@ -104,7 +104,8 @@ if let baziOpsiyonelSabitString = baziOptionalString {
// Swift değişkenlerde herhangi bir tip saklanabilir.
// AnyObject == id
// Objective-C deki `id` den farklı olarak, AnyObject tüm değişkenlerle
- çalışabilir (Class, Int, struct, etc)
+//çalışabilir
+(Class, Int, struct, etc)
var herhangiBirObject: AnyObject = 7
herhangiBirObject = "Değer string olarak değişti, iyi bir yöntem değil ama mümkün"
@@ -234,7 +235,7 @@ func fiyatlariGetir() -> (Double, Double, Double) {
let fiyatTuple = fiyatlariGetir()
let fiyat = fiyatTuple.2 // 3.79
// _ (alt çizgi) kullanımı Tuple degerlerini veya diğer değerleri görmezden
-gelir
+//gelir
let (_, fiyat1, _) = fiyatTuple // fiyat1 == 3.69
print(fiyat1 == fiyatTuple.1) // true
print("Benzin fiyatı: \(fiyat)")
diff --git a/wolfram.html.markdown b/wolfram.html.markdown
new file mode 100644
index 00000000..4514006d
--- /dev/null
+++ b/wolfram.html.markdown
@@ -0,0 +1,137 @@
+---
+language: wolfram
+contributors:
+ - ["hyphz", "http://github.com/hyphz/"]
+filename: learnwolfram.nb
+---
+
+The Wolfram Language is the underlying language originally used in Mathematica, but now available for use in multiple contexts.
+
+Wolfram Language has several interfaces:
+* The command line kernel interface on Raspberry Pi (just called _The Wolfram Language_) which runs interactively and can't produce graphical input.
+* _Mathematica_ which is a rich text/maths editor with interactive Wolfram built in: pressing shift+Return on a "code cell" creates an output cell with the result, which is not dynamic
+* _Wolfram Workbench_ which is Eclipse interfaced to the Wolfram Language backend
+
+The code in this example can be typed in to any interface and edited with Wolfram Workbench. Loading directly into Mathematica may be awkward because the file contains no cell formatting information (which would make the file a huge mess to read as text) - it can be viewed/edited but may require some setting up.
+
+```
+(* This is a comment *)
+
+(* In Mathematica instead of using these comments you can create a text cell
+ and annotate your code with nicely typeset text and images *)
+
+(* Typing an expression returns the result *)
+2*2 (* 4 *)
+5+8 (* 13 *)
+
+(* Function Call *)
+(* Note, function names (and everything else) are case sensitive *)
+Sin[Pi/2] (* 1 *)
+
+(* Alternate Syntaxes for Function Call with one parameter *)
+Sin@(Pi/2) (* 1 *)
+(Pi/2) // Sin (* 1 *)
+
+(* Every syntax in WL has some equivalent as a function call *)
+Times[2, 2] (* 4 *)
+Plus[5, 8] (* 13 *)
+
+(* Using a variable for the first time defines it and makes it global *)
+x = 5 (* 5 *)
+x == 5 (* True, C-style assignment and equality testing *)
+x (* 5 *)
+x = x + 5 (* 10 *)
+x (* 10 *)
+Set[x, 20] (* I wasn't kidding when I said EVERYTHING has a function equivalent *)
+x (* 20 *)
+
+(* Because WL is based on a computer algebra system, *)
+(* using undefined variables is fine, they just obstruct evaluation *)
+cow + 5 (* 5 + cow, cow is undefined so can't evaluate further *)
+cow + 5 + 10 (* 15 + cow, it'll evaluate what it can *)
+% (* 15 + cow, % fetches the last return *)
+% - cow (* 15, undefined variable cow cancelled out *)
+moo = cow + 5 (* Beware, moo now holds an expression, not a number! *)
+
+(* Defining a function *)
+Double[x_] := x * 2 (* Note := to prevent immediate evaluation of the RHS
+ And _ after x to indicate no pattern matching constraints *)
+Double[10] (* 20 *)
+Double[Sin[Pi/2]] (* 2 *)
+Double @ Sin @ (Pi/2) (* 2, @-syntax avoids queues of close brackets *)
+(Pi/2) // Sin // Double(* 2, //-syntax lists functions in execution order *)
+
+(* For imperative-style programming use ; to separate statements *)
+(* Discards any output from LHS and runs RHS *)
+MyFirst[] := (Print@"Hello"; Print@"World") (* Note outer parens are critical
+ ;'s precedence is lower than := *)
+MyFirst[] (* Hello World *)
+
+(* C-Style For Loop *)
+PrintTo[x_] := For[y=0, y<x, y++, (Print[y])] (* Start, test, incr, body *)
+PrintTo[5] (* 0 1 2 3 4 *)
+
+(* While Loop *)
+x = 0; While[x < 2, (Print@x; x++)] (* While loop with test and body *)
+
+(* If and conditionals *)
+x = 8; If[x==8, Print@"Yes", Print@"No"] (* Condition, true case, else case *)
+Switch[x, 2, Print@"Two", 8, Print@"Yes"] (* Value match style switch *)
+Which[x==2, Print@"No", x==8, Print@"Yes"] (* Elif style switch *)
+
+(* Variables other than parameters are global by default, even inside functions *)
+y = 10 (* 10, global variable y *)
+PrintTo[5] (* 0 1 2 3 4 *)
+y (* 5, global y clobbered by loop counter inside PrintTo *)
+x = 20 (* 20, global variable x *)
+PrintTo[5] (* 0 1 2 3 4 *)
+x (* 20, x in PrintTo is a parameter and automatically local *)
+
+(* Local variables are declared using the Module metafunction *)
+(* Version with local variable *)
+BetterPrintTo[x_] := Module[{y}, (For[y=0, y<x, y++, (Print@y)])]
+y = 20 (* Global variable y *)
+BetterPrintTo[5] (* 0 1 2 3 4 *)
+y (* 20, that's better *)
+
+(* Module actually lets us declare any scope we like *)
+Module[{count}, count=0; (* Declare scope of this variable count *)
+ (IncCount[] := ++count); (* These functions are inside that scope *)
+ (DecCount[] := --count)]
+count (* count - global variable count is not defined *)
+IncCount[] (* 1, using the count variable inside the scope *)
+IncCount[] (* 2, incCount updates it *)
+DecCount[] (* 1, so does decCount *)
+count (* count - still no global variable by that name *)
+
+(* Lists *)
+myList = {1, 2, 3, 4} (* {1, 2, 3, 4} *)
+myList[[1]] (* 1 - note list indexes start at 1, not 0 *)
+Map[Double, myList] (* {2, 4, 6, 8} - functional style list map function *)
+Double /@ myList (* {2, 4, 6, 8} - Abbreviated syntax for above *)
+Scan[Print, myList] (* 1 2 3 4 - imperative style loop over list *)
+Fold[Plus, 0, myList] (* 10 (0+1+2+3+4) *)
+FoldList[Plus, 0, myList] (* {0, 1, 3, 6, 10} - fold storing intermediate results *)
+Append[myList, 5] (* {1, 2, 3, 4, 5} - note myList is not updated *)
+Prepend[myList, 5] (* {5, 1, 2, 3, 4} - add "myList = " if you want it to be *)
+Join[myList, {3, 4}] (* {1, 2, 3, 4, 3, 4} *)
+myList[[2]] = 5 (* {1, 5, 3, 4} - this does update myList *)
+
+(* Associations, aka Dictionaries/Hashes *)
+myHash = <|"Green" -> 2, "Red" -> 1|> (* Create an association *)
+myHash[["Green"]] (* 2, use it *)
+myHash[["Green"]] := 5 (* 5, update it *)
+myHash[["Puce"]] := 3.5 (* 3.5, extend it *)
+KeyDropFrom[myHash, "Green"] (* Wipes out key Green *)
+Keys[myHash] (* {Red} *)
+Values[myHash] (* {1} *)
+
+(* And you can't do any demo of Wolfram without showing this off *)
+Manipulate[y^2, {y, 0, 20}] (* Return a reactive user interface that displays y^2
+ and allows y to be adjusted between 0-20 with a slider.
+ Only works on graphical frontends *)
+```
+
+##Ready For More?
+
+* [Wolfram Language Documentation Center](http://reference.wolfram.com/language/)
diff --git a/zh-cn/tmux-cn.html.markdown b/zh-cn/tmux-cn.html.markdown
new file mode 100644
index 00000000..cf865dce
--- /dev/null
+++ b/zh-cn/tmux-cn.html.markdown
@@ -0,0 +1,253 @@
+---
+category: tool
+tool: tmux
+filename: LearnTmux-cn.txt
+contributors:
+ - ["mdln", "https://github.com/mdln"]
+translators:
+ - ["Arnie97", "https://github.com/Arnie97"]
+lang: zh-cn
+---
+
+
+[tmux](http://tmux.github.io)是一款终端复用工具。
+在它的帮助下,你可以在同一个控制台上建立、访问并控制多个终端。
+你可以断开与一个 tmux 终端的连接,此时程序将在后台运行,
+当你需要时,可以随时重新连接到这个终端。
+
+```
+
+ tmux [command] # 运行一条命令
+ # 如果单独使用 'tmux' 而不指定某个命令,将会建立一个新的会话
+
+ new # 创建一个新的会话
+ -s "Session" # 创建一个会话,并命名为“Session”
+ -n "Window" # 创建一个窗口,并命名为“Window”
+ -c "/dir" # 在指定的工作目录中启动会话
+
+ attach # 连接到上一次的会话(如果可用)
+ -t "#" # 连接到指定的会话
+ -d # 断开其他客户端的会话
+
+ ls # 列出打开的会话
+ -a # 列出所有打开的会话
+
+ lsw # 列出窗口
+ -a # 列出所有窗口
+ -s # 列出会话中的所有窗口
+
+ lsp # 列出窗格
+ -a # 列出所有窗格
+ -s # 列出会话中的所有窗格
+ -t "#" # 列出指定窗口中的所有窗格
+
+ kill-window # 关闭当前窗口
+ -t "#" # 关闭指定的窗口
+ -a # 关闭所有窗口
+ -a -t "#" # 关闭除指定窗口以外的所有窗口
+
+ kill-session # 关闭当前会话
+ -t "#" # 关闭指定的会话
+ -a # 关闭所有会话
+ -a -t "#" # 关闭除指定会话以外的所有会话
+
+```
+
+
+### 快捷键
+
+通过“前缀”快捷键,可以控制一个已经连入的 tmux 会话。
+
+```
+----------------------------------------------------------------------
+ (C-b) = Ctrl + b # 在使用下列快捷键之前,需要按这个“前缀”快捷键
+
+ (M-1) = Meta + 1 或 Alt + 1
+----------------------------------------------------------------------
+
+ ? # 列出所有快捷键
+ : # 进入 tmux 的命令提示符
+ r # 强制重绘当前客户端
+ c # 创建一个新窗口
+
+ ! # 将当前窗格从窗口中移出,成为为一个新的窗口
+ % # 将当前窗格分为左右两半
+ " # 将当前窗格分为上下两半
+
+ n # 切换到下一个窗口
+ p # 切换到上一个窗口
+ { # 将当前窗格与上一个窗格交换
+ } # 将当前窗格与下一个窗格交换
+
+ s # 在交互式界面中,选择并连接至另一个会话
+ w # 在交互式界面中,选择并激活一个窗口
+ 0 至 9 # 选择 0 到 9 号窗口
+
+ d # 断开当前客户端
+ D # 选择并断开一个客户端
+
+ & # 关闭当前窗口
+ x # 关闭当前窗格
+
+ Up, Down # 将焦点移动至相邻的窗格
+ Left, Right
+
+ M-1 到 M-5 # 排列窗格:
+ # 1) 水平等分
+ # 2) 垂直等分
+ # 3) 将一个窗格作为主要窗格,其他窗格水平等分
+ # 4) 将一个窗格作为主要窗格,其他窗格垂直等分
+ # 5) 平铺
+
+ C-Up, C-Down # 改变当前窗格的大小,每按一次增减一个单位
+ C-Left, C-Right
+
+ M-Up, M-Down # 改变当前窗格的大小,每按一次增减五个单位
+ M-Left, M-Right
+
+```
+
+
+### 配置 ~/.tmux.conf
+
+tmux.conf 可以在 tmux 启动时自动设置选项,类似于 .vimrc 或 init.el 的用法。
+
+```
+# tmux.conf 示例
+# 2014.10
+
+
+### 通用设置
+###########################################################################
+
+# 启用 UTF-8 编码
+setw -g utf8 on
+set-option -g status-utf8 on
+
+# 命令回滚/历史数量限制
+set -g history-limit 2048
+
+# 从 1 开始编号,而不是从 0 开始
+set -g base-index 1
+
+# 启用鼠标
+set-option -g mouse-select-pane on
+
+# 重新加载配置文件
+unbind r
+bind r source-file ~/.tmux.conf
+
+
+### 快捷键设置
+###########################################################################
+
+# 取消默认的前缀键 C-b
+unbind C-b
+
+# 设置新的前缀键 `
+set-option -g prefix `
+
+# 多次按下前缀键时,切换到上一个窗口
+bind C-a last-window
+bind ` last-window
+
+# 按下F11/F12,可以选择不同的前缀键
+bind F11 set-option -g prefix C-a
+bind F12 set-option -g prefix `
+
+# Vim 风格的快捷键绑定
+setw -g mode-keys vi
+set-option -g status-keys vi
+
+# 使用 Vim 风格的按键在窗格间移动
+bind h select-pane -L
+bind j select-pane -D
+bind k select-pane -U
+bind l select-pane -R
+
+# 循环切换不同的窗口
+bind e previous-window
+bind f next-window
+bind E swap-window -t -1
+bind F swap-window -t +1
+
+# 较易于使用的窗格分割快捷键
+bind = split-window -h
+bind - split-window -v
+unbind '"'
+unbind %
+
+# 在嵌套使用 tmux 的情况下,激活最内层的会话,以便向其发送命令
+bind a send-prefix
+
+
+### 外观主题
+###########################################################################
+
+# 状态栏颜色
+set-option -g status-justify left
+set-option -g status-bg black
+set-option -g status-fg white
+set-option -g status-left-length 40
+set-option -g status-right-length 80
+
+# 窗格边框颜色
+set-option -g pane-active-border-fg green
+set-option -g pane-active-border-bg black
+set-option -g pane-border-fg white
+set-option -g pane-border-bg black
+
+# 消息框颜色
+set-option -g message-fg black
+set-option -g message-bg green
+
+# 窗口状态栏颜色
+setw -g window-status-bg black
+setw -g window-status-current-fg green
+setw -g window-status-bell-attr default
+setw -g window-status-bell-fg red
+setw -g window-status-content-attr default
+setw -g window-status-content-fg yellow
+setw -g window-status-activity-attr default
+setw -g window-status-activity-fg yellow
+
+
+### 用户界面
+###########################################################################
+
+# 通知方式
+setw -g monitor-activity on
+set -g visual-activity on
+set-option -g bell-action any
+set-option -g visual-bell off
+
+# 自动设置窗口标题
+set-option -g set-titles on
+set-option -g set-titles-string '#H:#S.#I.#P #W #T' # 窗口编号,程序名称,是否活动
+
+# 调整状态栏
+set -g status-left "#[fg=red] #H#[fg=green]:#[fg=white]#S#[fg=green] |#[default]"
+
+# 在状态栏中显示性能计数器
+# 需要用到 https://github.com/thewtex/tmux-mem-cpu-load
+set -g status-interval 4
+set -g status-right "#[fg=green] | #[fg=white]#(tmux-mem-cpu-load)#[fg=green] | #[fg=cyan]%H:%M #[default]"
+
+```
+
+
+### 参考资料
+
+[Tmux 主页](http://tmux.github.io)
+
+[Tmux 手册](http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/tmux.1?query=tmux)
+
+[FreeBSDChina Wiki](https://wiki.freebsdchina.org/software/t/tmux)
+
+[Archlinux Wiki](https://wiki.archlinux.org/index.php/Tmux_(简体中文))
+
+[Tmux 快速教程](http://blog.jeswang.org/blog/2013/06/24/tmux-kuai-su-jiao-cheng)
+
+[如何在 tmux 状态栏中显示 CPU / 内存占用的百分比](https://stackoverflow.com/questions/11558907/is-there-a-better-way-to-display-cpu-usage-in-tmux)
+
+[管理复杂 tmux 会话的工具 - tmuxinator](https://github.com/tmuxinator/tmuxinator)