From ff3b464026313e6ca2a11a9671c27c43b340da8f Mon Sep 17 00:00:00 2001 From: Elena Bolshakova Date: Fri, 28 Nov 2014 11:36:41 +0300 Subject: [PATCH 001/685] [perl/ru] Russian translation for Perl 5 --- ru-ru/perl-ru.html.markdown | 169 ++++++++++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 ru-ru/perl-ru.html.markdown diff --git a/ru-ru/perl-ru.html.markdown b/ru-ru/perl-ru.html.markdown new file mode 100644 index 00000000..9e9c7748 --- /dev/null +++ b/ru-ru/perl-ru.html.markdown @@ -0,0 +1,169 @@ +--- +category: language +language: perl +filename: learnperl-ru.pl +contributors: + - ["Korjavin Ivan", "http://github.com/korjavin"] +translators: + - ["Elena Bolshakova", "http://github.com/liruoko"] +lang: ru-ru +--- + +Perl 5 -- высокоуровневый мощный язык с 25-летней историей. +Особенно хорош для обработки разнообразных текстовых данных. + +Perl 5 работает более чем на 100 платформах, от портативных устройств +до мейнфреймов, и подходит как для быстрого прототипирования, +так и для крупных проектов. + +```perl +# Комментарии начинаются с символа решетки. + + +#### Типы переменных в Perl + +# Скалярные переменные начинаются с знака доллара $. +# Имя переменной состоит из букв, цифр и знаков подчеркивания, +# начиная с буквы или подчеркивания. + +### В Perl три основных типа переменных: скаляры, массивы, хеши. + +## Скаляры +# Скаляр хранит отдельное значение: +my $animal = "camel"; +my $answer = 42; + +# Скаляры могут быть строками, целыми и вещественными числами. +# Когда требуется, Perl автоматически выполняет преобразования к нужному типу. + +## Массивы +# Массив хранит список значений: +my @animals = ("camel", "llama", "owl"); +my @numbers = (23, 42, 69); +my @mixed = ("camel", 42, 1.23); + + +## Хеши +# Хеш хранит набор пар ключ/значение: + +my %fruit_color = ("apple", "red", "banana", "yellow"); + +# Можно использовать оператор "=>" для большей наглядности: + +my %fruit_color = ( + apple => "red", + banana => "yellow", + ); + +# Важно: вставка и поиск в хеше выполняются за константное время, +# независимо от его размера. + +# Скаляры, массивы и хеши подробно описаны в разделе perldata +# (perldoc perldata). + +# Более сложные структуры данных можно получить, если использовать ссылки. +# С помощью ссылок можно получить массив массивов хешей, в которых хранятся другие хеши. + +#### Условные операторы и циклы + +# В Perl есть большинсво привычных условных и циклических конструкций. + +if ( $var ) { + ... +} elsif ( $var eq 'bar' ) { + ... +} else { + ... +} + +unless ( condition ) { + ... + } +# Это более читаемый вариант для "if (!condition)" + +# Специфические Perl-овые пост-условия: +print "Yow!" if $zippy; +print "We have no bananas" unless $bananas; + +# while + while ( condition ) { + ... + } + + +# for, foreach +for ($i = 0; $i <= $max; $i++) { + ... + } + +foreach (@array) { + print "This element is $_\n"; + } + +for my $el (@array) { + print "This element is $el\n"; + } + +#### Регулярные выражения + +# Регулярные выражения занимают важное место вPerl-е, +# и подробно описаны в разделах документации perlrequick, perlretut и других. +# Вкратце: + +# Сопоставление с образцом +if (/foo/) { ... } # выполняется, если $_ содержит "foo" +if ($a =~ /foo/) { ... } # выполняется, если $a содержит "foo" + +# Простые замены + +$a =~ s/foo/bar/; # заменяет foo на bar в строке $a +$a =~ s/foo/bar/g; # заменяет ВСЕ ВХОЖДЕНИЯ foo на bar в строке $a + + +#### Файлы и ввод-вывод + +# Открыть файл на чтение или запись можно с помощью функции "open()". + +open(my $in, "<", "input.txt") or die "Can't open input.txt: $!"; +open(my $out, ">", "output.txt") or die "Can't open output.txt: $!"; +open(my $log, ">>", "my.log") or die "Can't open my.log: $!"; + +# Читать из файлового дескриптора можно с помощью оператора "<>". +# В скалярном контексте он читает одру строку из файла, в списковом -- +# читает сразу весь файл, сохраняя по одной строке в элементе массива: + +my $line = <$in>; +my @lines = <$in>; + +#### Подпрограммы (функции) + +# Объявить функцию просто: + +sub logger { + my $logmessage = shift; + open my $logfile, ">>", "my.log" or die "Could not open my.log: $!"; + print $logfile $logmessage; +} + +# Теперь можно использовать эту функцию так же, как и встроенные: + +logger("We have a logger subroutine!"); +``` + +#### Perl-модули + +Perl-овые модули предоставляют широкий набор функциональности, +так что вы можете не изобретать заново велосипеды, а просто скачать +нужный модуль с CPAN (http://www.cpan.org/). +Некоторое количество самых полезных модулей включено в стандартную +поставку Perl. + +Раздел документации perlfaq содержит вопросы и ответы о многих частых +задачах, и часто предлагает подходящие CPAN-модули. + +#### Смотрите также + + - [perl-tutorial](http://perl-tutorial.org/) + - [обучающий раздел на www.perl.com](http://www.perl.org/learn.html) + - [perldoc в вебе](http://perldoc.perl.org/) + - встроенная справка : `perldoc perlintro` From 4196b7addd156b3b7f1621c0c0a1e38654897acf Mon Sep 17 00:00:00 2001 From: e99n09 Date: Sun, 8 Mar 2015 20:21:26 -0400 Subject: [PATCH 002/685] Create statcomppython This is a tutorial on how to use Python for the stuff people normally do in R, MATLAB, or Stata. It's designed for someone comfortable with programming, basically familiar with Python, and experienced with a statistical programming language. Scraping the web, reading CSV files, summarizing columns, basic charts and plotting options, plus an extended data cleaning and exploratory data analysis example using a table of Holy Roman Emperors. --- statcomppython | 234 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 statcomppython diff --git a/statcomppython b/statcomppython new file mode 100644 index 00000000..1f71bf6e --- /dev/null +++ b/statcomppython @@ -0,0 +1,234 @@ +--- +language: Statistical computing with Python +contributors: + - ["e99n09", "https://github.com/e99n09"] +filename: statcomppython.py +--- + +This is a tutorial on how to do some typical statistical programming tasks using Python. It's intended for people basically familiar with Python and experienced at statistical programming in a language like R, Stata, SAS, SPSS, or MATLAB. + +```python + +# 0. Getting set up ==== + +""" Get set up with IPython and pip install the following: numpy, scipy, pandas, + matplotlib, seaborn, requests. + Make sure to do this tutorial in the IPython notebook so that you get + the inline plots and easy documentation lookup. +""" + +# 1. Data acquisition ==== + +""" One reason people choose Python over R is that they intend to interact a lot + with the web, either by scraping pages directly or requesting data through + an API. You can do those things in R, but in the context of a project + already using Python, there's a benefit to sticking with one language. +""" + +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 +# save the page source in a file: +os.getcwd() # check what's the working directory +f = open("learnxinyminutes.html","wb") +f.write(r.text.encode("UTF-8")) +f.close() + +# downloading a csv +fp = "https://raw.githubusercontent.com/adambard/learnxinyminutes-docs/master/" +fn = "pets.csv" +r = requests.get(fp + fn) +print(r.text) +f = open(fn,"wb") +f.write(r.text.encode("UTF-8")) +f.close() + +""" for more on the requests module, including APIs, see + http://docs.python-requests.org/en/latest/user/quickstart/ +""" + +# 2. Reading a CSV file ==== + +""" Wes McKinney's pandas package gives you 'DataFrame' objects in Python. If + 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 +pets = pd.read_csv(fn) +pets +# name age weight species +# 0 fluffy 3 14 cat +# 1 vesuvius 6 23 fish +# 2 rex 5 34 dog + +""" R users: note that Python, like most normal programming languages, starts + indexing from 0. R is the unusual one for starting from 1. +""" + +# two different ways to print out a column +pets.age +pets["age"] + +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 + +# 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 + +""" If you are doing some serious linear algebra and number-crunching, you may + just want arrays, not DataFrames. DataFrames are ideal for combining columns + of different types. +""" + +# 3. Charts ==== + +import matplotlib as mpl, matplotlib.pyplot as plt +%matplotlib inline + +# To do data vizualization in Python, use matplotlib + +plt.hist(pets.age); + +plt.boxplot(pets.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"); + +# there are also some seaborn-specific plotting functions +# notice how seaborn automatically labels the x-axis on this barplot +sns.barplot(pets["age"]) + +# R veterans can still use ggplot +from ggplot import * +ggplot(aes(x="age",y="weight"), data=pets) + geom_point() + labs(title="pets") +# source: https://pypi.python.org/pypi/ggplot + +# there's even a d3.js port: https://github.com/mikedewar/d3py + +# 4. Simple data cleaning and exploratory analysis ==== + +""" Here's a more complicated example that demonstrates a basic data + cleaning workflow leading to the creation of some exploratory plots + and the running of a linear regression. + The data set was transcribed from Wikipedia by hand. It contains + all the Holy Roman Emperors and the important milestones in their lives + (birth, death, coronation, etc.). + The goal of the analysis will be to explore whether a relationship + exists between emperor birth year and emperor lifespan. + data source: https://en.wikipedia.org/wiki/Holy_Roman_Emperor +""" + +# load some data on Holy Roman Emperors +url = "https://raw.githubusercontent.com/e99n09/R-notes/master/data/hre.csv" +r = requests.get(url) +fp = "hre.csv" +f = open(fp,"wb") +f.write(r.text.encode("UTF-8")) +f.close() + +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 +""" + +# clean the Birth and Death columns + +import re # module for regular expressions + +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 + finally converts the type of the Series object from string to integer. For + more information into what different parts of the code do, see: + - https://docs.python.org/2/howto/regex.html + - 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)) + +hre["BirthY"] = extractYear(hre.Birth) +hre["DeathY"] = extractYear(hre.Death) + +# make a column telling estimated age +hre["EstAge"] = hre.DeathY.astype(int) - hre.BirthY.astype(int) + +# simple scatterplot, no trend line, color represents dynasty +sns.lmplot("BirthY", "EstAge", data=hre, hue="Dynasty", fit_reg=False); + +# use scipy to run a linear regression +from scipy import stats +(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 + +# check the R^2 value: +rval**2 # 0.020363950027333586 + +# check the p-value +pval # 0.34971812581498452 + +# use seaborn to make a scatterplot and plot the linear regression trend line +sns.lmplot("BirthY", "EstAge", data=hre); + +""" For more information on seaborn, see + - http://web.stanford.edu/~mwaskom/software/seaborn/ + - https://github.com/mwaskom/seaborn + For more information on SciPy, see + - http://wiki.scipy.org/SciPy + - http://wiki.scipy.org/Cookbook/ + 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. + +You can also find plenty of interactive IPython tutorials on subjects specific to your interests, like Cam Davidson-Pilon's Probabilistic Programming and Bayesian Methods for Hackers. + +Some more modules to research: + - text analysis and natural language processing: nltk, http://www.nltk.org + - social network analysis: igraph, http://igraph.org/python/ From e65582d459e5770d1a3ac3c5e5826dc10b546344 Mon Sep 17 00:00:00 2001 From: e99n09 Date: Sun, 8 Mar 2015 22:34:12 -0400 Subject: [PATCH 003/685] Update and rename statcomppython to pythonstatcomp.markdown.html --- statcomppython => pythonstatcomp.markdown.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename statcomppython => pythonstatcomp.markdown.html (99%) diff --git a/statcomppython b/pythonstatcomp.markdown.html similarity index 99% rename from statcomppython rename to pythonstatcomp.markdown.html index 1f71bf6e..78b62e33 100644 --- a/statcomppython +++ b/pythonstatcomp.markdown.html @@ -2,7 +2,7 @@ language: Statistical computing with Python contributors: - ["e99n09", "https://github.com/e99n09"] -filename: statcomppython.py +filename: pythonstatcomp.py --- This is a tutorial on how to do some typical statistical programming tasks using Python. It's intended for people basically familiar with Python and experienced at statistical programming in a language like R, Stata, SAS, SPSS, or MATLAB. From 01d17a3ea485c8b1d73145e1c2886fb3b2dde5b8 Mon Sep 17 00:00:00 2001 From: Geoff Liu Date: Thu, 12 Mar 2015 12:56:58 -0600 Subject: [PATCH 004/685] First attempt at page text translation --- template-translations.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 template-translations.yaml diff --git a/template-translations.yaml b/template-translations.yaml new file mode 100644 index 00000000..15149fd5 --- /dev/null +++ b/template-translations.yaml @@ -0,0 +1,15 @@ +default: + title: Learn X in Y minutes + where: Where + codeLink: "Get the code:" + shareText: Share this page + suggestionsText: "Got a suggestion? A correction, perhaps? Open an Issue on the Github Repo, or make a pull request yourself!" + contributorText: "Originally contributed by %s, and updated by %d contributors" + +zh_CN: + title: Y分钟速成X + where: 当 + codeLink: 源代码下载: + shareText: 分享此页 + suggestionsText: "有建议?或者发现什么错误?在Github上开一个issue,或者你自己也可以写一个pull request!" + contributorText: "原著%s,并由%d个好心人修改。" From 74226d7153043c2e8dc7213b11d506ce4269a8a6 Mon Sep 17 00:00:00 2001 From: Geoff Liu Date: Thu, 12 Mar 2015 13:00:13 -0600 Subject: [PATCH 005/685] minor naming change --- template-translations.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/template-translations.yaml b/template-translations.yaml index 15149fd5..019bed1a 100644 --- a/template-translations.yaml +++ b/template-translations.yaml @@ -1,15 +1,15 @@ default: title: Learn X in Y minutes where: Where - codeLink: "Get the code:" - shareText: Share this page - suggestionsText: "Got a suggestion? A correction, perhaps? Open an Issue on the Github Repo, or make a pull request yourself!" - contributorText: "Originally contributed by %s, and updated by %d contributors" + getCode: "Get the code:" + share: Share this page + suggestions: "Got a suggestion? A correction, perhaps? Open an Issue on the Github Repo, or make a pull request yourself!" + contributor: "Originally contributed by %s, and updated by %d contributors." zh_CN: title: Y分钟速成X where: 当 - codeLink: 源代码下载: - shareText: 分享此页 - suggestionsText: "有建议?或者发现什么错误?在Github上开一个issue,或者你自己也可以写一个pull request!" - contributorText: "原著%s,并由%d个好心人修改。" + getCode: 源代码下载: + share: 分享此页 + suggestions: "有建议?或者发现什么错误?在Github上开一个issue,或者你自己也可以写一个pull request!" + contributor: "原著%s,并由%d个好心人修改。" From 4e8f60600f9f178c8f5cf80f56caef1fac73e0df Mon Sep 17 00:00:00 2001 From: Geoff Liu Date: Thu, 12 Mar 2015 13:08:44 -0600 Subject: [PATCH 006/685] . --- template-translations.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/template-translations.yaml b/template-translations.yaml index 019bed1a..f7c02aea 100644 --- a/template-translations.yaml +++ b/template-translations.yaml @@ -1,14 +1,14 @@ default: title: Learn X in Y minutes - where: Where + where: Where X= getCode: "Get the code:" share: Share this page suggestions: "Got a suggestion? A correction, perhaps? Open an Issue on the Github Repo, or make a pull request yourself!" contributor: "Originally contributed by %s, and updated by %d contributors." zh_CN: - title: Y分钟速成X - where: 当 + title: X分钟速成Y + where: 当Y= getCode: 源代码下载: share: 分享此页 suggestions: "有建议?或者发现什么错误?在Github上开一个issue,或者你自己也可以写一个pull request!" From 61510ee92caaca9c841da6e40c8e1d680d1b7e34 Mon Sep 17 00:00:00 2001 From: Geoff Liu Date: Sat, 28 Mar 2015 23:45:05 -0600 Subject: [PATCH 007/685] minor change --- template-translations.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-translations.yaml b/template-translations.yaml index f7c02aea..527de122 100644 --- a/template-translations.yaml +++ b/template-translations.yaml @@ -8,7 +8,7 @@ default: zh_CN: title: X分钟速成Y - where: 当Y= + where: 其中 Y= getCode: 源代码下载: share: 分享此页 suggestions: "有建议?或者发现什么错误?在Github上开一个issue,或者你自己也可以写一个pull request!" From a3818d119ea677e1992fa05d5ab130a012086a56 Mon Sep 17 00:00:00 2001 From: Chaitanya Krishna Ande Date: Thu, 23 Apr 2015 13:54:52 +0200 Subject: [PATCH 008/685] initial version for latex --- latex.html.markdown | 133 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 latex.html.markdown diff --git a/latex.html.markdown b/latex.html.markdown new file mode 100644 index 00000000..cc1d99cb --- /dev/null +++ b/latex.html.markdown @@ -0,0 +1,133 @@ +--- +language: latex +contributors: + - ["Chaitanya Krishna Ande", "http://icymist.github.io"] +filename: learn-latex.tex +--- + +LaTeX is known to create aesthetically pleasing documents without you worrying +about the formatting. It is also great if one wants to create documents +containing a lot of mathematics. Getting a good document is very easy, but +getting it to behave exactly the way you want can be a bit hairy. + + +```latex +% All comment lines start with % +% There are no multi-line comments + +% LaTeX is NOT a ``What You See Is What You Get'' word processing software like +% MS Word, or OpenOffice Writer + +% Getting to the final document using LaTeX consists of the following steps: +% 1. Write the document in plain text +% 2. Compile plain text document to produce a pdf +% The compilation step looks something like this: +% $ pdflatex your-tex-file.tex your-tex-file.pdf +% A number of LaTeX editors combine both Step 1 and Step 2 in the same piece of +% software. So, you get to see Step 1, but not Step 2 completely. +% Step 2 is still happening behind the scenes. + +% 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 +% format you defined in Step 1. + +% For Step 1, it is best if you get a good text editor +% On Windows, probably Notepad++ +% For Step 2, you will need to get a TeX distribution +% Windows: MikTeX +% MacOS: MacTeX +% Linux: Should be available from your package manager + +% Let's get to the final pdf document as soon as possible + +% Choose the kind of document you want to write. +% You can replace article with book, report, etc. +\documentclass{article} +% begin the document +\begin{document} +% end the document +\end{document} +% Compile to pdf +% Now, you already have a final document which of course it is empty. +% Everything that you write is between the +% \begin{document} +% \end{document} + +% Start a new document from here. +% Let's do a decent document +\documentclass{article} +% required for inserting images +\usepackage{graphicx} +% begin the document +\begin{document} +% set the title (optional) +\title{Title of the document} +% set the author (optional) +\author{Chaitanya Krishna Ande} + +% make the title (optional) +\maketitle + +% start the first section +\section{Introduction} + +% write your text +This is the introduction. + +% start another section +\section{Another section} +This is the text for another section. + +% another section with subsection +\section{Section with sub-section} +Text for the section. +\subsection{Sub-section} +Let's discuss the Pythagoras theorem. +\subsubsection{Pythagoras Theorm} +% for cross-reference +\label{subsec:pythagoras} + +% notice how the sections and sub-sections are automatically numbered + +% Some math +% Inline math within $ $ +For a right angled triangle (see Fig.~\ref{fig:right-triangle}) with sides $a$, $b$ and $c$, where $c$ is the +hypotenuse, the following holds: +% Display math with the equation 'environment' +\begin{equation} + c^2 = a^2 + b^2. + % for cross-reference + \label{eq:pythagoras} +\end{equation} + +% Let's cross-reference the equation +Eqn.~\ref{eq:pythagoras} is also known as the Pythagoras Theorem which is also +the subject of Sec.~\ref{subsec:pythagoras}. + +\subsubsection{Figure} +Let's insert a Figure. + +\begin{figure} + \centering + \includegraphics[width=0.8\linewidth]{right-triangle.png} + \caption{Right triangle with sides a, b, c} + \label{fig:right-triangle} +\end{figure} + + +\subsubsection{Table} +Let's insert a Table. + +\begin{table} +\caption{Caption for the Table.} +\begin{tabular}{ccc} +Number & Last Name & First Name \\ +\hline +1 & Biggus & Dickus \\ +2 & Monty & Python +\end{tabular} +\end{table} + +% end the document +\end{document} +``` From be761f49ef2b99302e8f1d86c4a7d9e3e0b8cbe4 Mon Sep 17 00:00:00 2001 From: Jack Union Date: Sun, 7 Jun 2015 12:03:50 +0300 Subject: [PATCH 009/685] css/ru translation --- ru-ru/css-ru.html.markdown | 250 +++++++++++++++++++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 ru-ru/css-ru.html.markdown diff --git a/ru-ru/css-ru.html.markdown b/ru-ru/css-ru.html.markdown new file mode 100644 index 00000000..2e2d40b7 --- /dev/null +++ b/ru-ru/css-ru.html.markdown @@ -0,0 +1,250 @@ +--- +language: css +contributors: + - ["Mohammad Valipour", "https://github.com/mvalipour"] + - ["Marco Scannadinari", "https://github.com/marcoms"] + - ["Geoffrey Liu", "https://github.com/g-liu"] +filename: learncss-ru.css +lang: ru-ru +--- + +В свои ранние дни веб состоял в основном из чистого текста. С развитием браузеров +веб-страницы с графическими элементами стали обычным делом. +CSS - язык, разграничивающий содержимое (HTML) и внешний вид веб-страниц. + +Если коротко, то CSS предоставляет синтаксис, позволяющий выбирать различные +HTML элементы и определять их внешний вид. + +Как и у других языков, у CSS много версий. Мы описываем CSS2.0 - не самую новую, +но самую поддерживаемую и распространенную версию. + +**ВАЖНО:** Так как результатом применения CSS является изменение внешнего вида +элементов, постарайтесь использовать CSS-песочницы при изучении языка. +Например [dabblet](http://dabblet.com/). +В данной статье рассматриваются в первую очередь синтаксис и общие рекомендации. + + +```css +/* Для комментариев используется слеш-астериск, как на этой строчке. + В CSS нет однострочных комментариев; все комментарии записываются таким способом */ + +/* #################### + ## СЕЛЕКТОРЫ + #################### */ + +/* Выражения в CSS очень просты */ +селектор { атрибут: значение; /* другие атрибуты...*/ } + +/* селекторы используются для выбора элементов на странице + +Чтобы выбрать все элементы, используйте астериск: */ +* { color:red; } + +/* +Если на странице присутствует такой элемент: + +
+*/ + +/* его можно выбрать по одному классу */ +.some-class { } + +/* или по обоим классам */ +.some-class.class2 { } + +/* по названию тега */ +div { } + +/* по идентификатору */ +#someId { } + +/* по имеющемуся атрибуту */ +[attr] { font-size:smaller; } + +/* или по атрибуту с определенным значением */ +[attr='value'] { font-size:smaller; } + +/* можно выбрать атрибуты, начинающиеся с определенного значения (CSS3) */ +[attr^='val'] { font-size:smaller; } + +/* или заканчивающиеся определенным значением (CSS3) */ +[attr$='ue'] { font-size:smaller; } + +/* содержащие отделенное пробелами значение в названии атрибута (CSS3) */ +[otherAttr~='foo'] { font-size:smaller; } + +/* можно выбрать атрибут как с точным, так и со стоящим после значения “-” (U+002D) */ +[otherAttr|='en'] { font-size:smaller; } + + +/* Более того, все это можно использовать вместе - между разными частями +не должно быть пробелов, иначе селектор будет иметь совершенно иное значение */ +div.some-class[attr$='ue'] { } + +/* Вы можете выбрать элемент по его родителю */ + +/* прямой потомок другого элемента (выбранного с помощью селектора) */ +div.some-parent > .class-name {} + +/* потомок любого родителя в дереве элементов + следующая строка означает: "любой элемент класса "class-name", + являющийся потомком div-элемента класса "some-parent" + НЕЗАВИСИМО ОТ УРОВНЯ ВЛОЖЕННОСТИ" */ +div.some-parent .class-name {} + +/* важно: этот же селектор без пробелов имеет иное значение + можете догадаться, какое? */ +div.some-parent.class-name {} + +/* вы можете выбрать элемент по первому предшествующему + родственному элементу */ +.i-am-before + .this-element { } + +/* или любому предшествующему родственнику перед элементом */ +.i-am-any-before ~ .this-element {} + + +/* Существуют псевдо-классы, позволяющие изменять внешний вид элемента + в зависимости от событий, произошедших с элементом */ + +/* например, когда курсор наведен на элемент */ +element:hover {} + +/* когда пользователь проходил по ссылке ранее */ +element:visited {} + +/* или еще не проходил по ней */ +element:link {} + +/* выбранное поле воода (input) */ +element:focus {} + + +/* #################### + ## АТРИБУТЫ + #################### */ + +selector { + + /* Единицы измерения */ + width: 50%; /* проценты */ + font-size: 2em; /* умножается на высоту шрифта (2em - в два раза больше) */ + width: 200px; /* пиксели */ + font-size: 20pt; /* пункты */ + width: 5cm; /* сантиметры */ + min-width: 50mm; /* милиметры */ + max-width: 5in; /* дюймы */ + height: 0.2vh; /* умножается на высоту окна браузера (CSS3) */ + width: 0.4vw; /* умножается на ширину окна браузера (CSS3) */ + min-height: 0.1vmin; /* наименьшее из vh и vw (CSS3) */ + max-width: 0.3vmax; /* наибольшее из vh и vw (CSS3) */ + + /* Цвета */ + background-color: #F6E; /* сокращенная запись шестнадцатеричного кода */ + background-color: #F262E2; /* стандартная запись шестнадцатеричного кода */ + background-color: tomato; /* название цвета */ + background-color: rgb(255, 255, 255); /* цветовая модель rgb */ + background-color: rgb(10%, 20%, 50%); /* цветовая модель rgb в процентах */ + background-color: rgba(255, 0, 0, 0.3); /* цветовая модель rgb (последний аргумент отвечает за прозрачность цвета) (CSS3) */ + background-color: transparent; /* прозрачный цвет */ + background-color: hsl(0, 100%, 50%); /* в формате hsl (CSS3) */ + background-color: hsla(0, 100%, 50%, 0.3); /* в формате hsl (последний аргумент отвечает за непрозрачность цвета) (CSS3) */ + + + /* Изображения */ + background-image: url(/path-to-image/image.jpg); /* кавычки внутри url() опциональны */ + + /* Шрифты */ + font-family: Arial; + font-family: "Courier New"; /* если в названии есть пробелы, заключите его в кавычки */ + font-family: "Courier New", Trebuchet, Arial, sans-serif; /* если шрифт не найден, + будет использован следующий за ним в списке */ +} + +``` + +## Использование + +Сохраните готовый файл с расширением .css + +```xml + + + + + + + + + +
+
+ +``` + +## Приоритет + +Как вы заметили, внешний вид элемента может определяться несколькими селекторами, +а значение атрибута элемента может быть установлено больше одного раза. +В подобных случаях одно из значений оказывается приоритетнее остальных. + +Если взять следующую таблицу стилей: + +```css +/*A*/ +p.class1[attr='value'] + +/*B*/ +p.class1 {} + +/*C*/ +p.class2 {} + +/*D*/ +p {} + +/*E*/ +p { property: value !important; } + +``` + +и следующую разметку: + +```xml +

+

+``` + +Приоритет стилей будет таким: +Помните: приоритет выставляется для **атрибута**, а не для всего блока стилей. + +* `E` имеет наивысший приоритет благодаря ключевому слову `!important`. + Используйте только в случае крайней необходимости. +* `F` идет следующим, так как является встроенным стилем. +* `A` следующий, как самый конкретизированный. + конкретизированный == большее количество определителей. + В этом примере 3 определителя: 1 тег `p` + + название класса `class1` + 1 атрибут `attr='value'` +* `C` следующий. Несмотря на одинаковое с `B` количество определителей, + `C` определен позже. +* Затем `B` +* И последний `D`. + +## Совместимость + +Несмотря на то, что большая часть функций CSS2 (а также CSS3) подеррживается всеми +браузерами и устройствами, не забывайте проверять совместимость CSS-правил +с современными браузерами. + +[QuirksMode CSS](http://www.quirksmode.org/css/) замечательно подходит для этого. + +To run a quick compatibility check, [CanIUse](http://caniuse.com) is a great resource. + +## Ресурсы для самостоятельного изучения + +* [Understanding Style Precedence in CSS: Specificity, Inheritance, and the Cascade](http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/) +* [QuirksMode CSS](http://www.quirksmode.org/css/) +* [Z-Index - The stacking context](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Understanding_z_index/The_stacking_context) From 30cff7bcefd708638e99c7a9917ca2534fb38fd5 Mon Sep 17 00:00:00 2001 From: Elena Bolshakova Date: Wed, 10 Jun 2015 11:00:00 +0300 Subject: [PATCH 010/685] typo --- ru-ru/perl-ru.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ru-ru/perl-ru.html.markdown b/ru-ru/perl-ru.html.markdown index 9e9c7748..e9ba6ff8 100644 --- a/ru-ru/perl-ru.html.markdown +++ b/ru-ru/perl-ru.html.markdown @@ -106,7 +106,7 @@ for my $el (@array) { #### Регулярные выражения -# Регулярные выражения занимают важное место вPerl-е, +# Регулярные выражения занимают важное место в Perl-е, # и подробно описаны в разделах документации perlrequick, perlretut и других. # Вкратце: From 676568cca8731d0dbb2d2bdeff08cc092d283177 Mon Sep 17 00:00:00 2001 From: Elena Bolshakova Date: Wed, 10 Jun 2015 11:27:02 +0300 Subject: [PATCH 011/685] [perl/ru]: basic info on Unicode support; use strict; use warnings; --- ru-ru/perl-ru.html.markdown | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/ru-ru/perl-ru.html.markdown b/ru-ru/perl-ru.html.markdown index e9ba6ff8..0e68116c 100644 --- a/ru-ru/perl-ru.html.markdown +++ b/ru-ru/perl-ru.html.markdown @@ -161,6 +161,32 @@ Perl-овые модули предоставляют широкий набор Раздел документации perlfaq содержит вопросы и ответы о многих частых задачах, и часто предлагает подходящие CPAN-модули. + +#### Unicode + +Вам наверняка понадобится работать с не-ASCII текстами. +Добавьте эти прагмы в начало скрипта: + +```perl +use utf8; +use open ':std' => ':utf8'; +``` + +Подробнее читайте в perldoc, разделы perlunicode и open. + + +#### strict, warnings + +Прагмы strict и warnings включают полезные проверки во время компиляции: + +```perl +use strict; +use warnings; +``` + +Подробнее смотрите perldoc strict и perldoc warnings. + + #### Смотрите также - [perl-tutorial](http://perl-tutorial.org/) From 938720074b8b18a9ada93fb8a040b9ca1a813747 Mon Sep 17 00:00:00 2001 From: Ian Bertolacci Date: Mon, 17 Aug 2015 14:19:41 -0700 Subject: [PATCH 012/685] Update to Chapel A reader/writer sync example was missing a "Reader: " notem --- chapel.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapel.html.markdown b/chapel.html.markdown index c8489371..8a88a652 100644 --- a/chapel.html.markdown +++ b/chapel.html.markdown @@ -960,7 +960,7 @@ proc main(){ begin { // Reader task writeln( "Reader: waiting to read." ); var read_sync = someSyncVar$; - writeln( "value is ", read_sync ); + writeln( "Reader: value is ", read_sync ); } begin { // Writer task @@ -1100,4 +1100,4 @@ Notable arguments: * `--fast`: enables a number of optimizations and disables array bounds checks. Should only enable when application is stable. * `--set =`: set config param `` to `` at compile-time. * `--main-module `: use the main() procedure found in the module `` as the executable's main. - * `--module-dir `: includes `` in the module search path. \ No newline at end of file + * `--module-dir `: includes `` in the module search path. From a9febbeb223269f4cfa88287aeb13b0688537504 Mon Sep 17 00:00:00 2001 From: JustBlah Date: Thu, 24 Sep 2015 17:11:45 +0300 Subject: [PATCH 013/685] +Translation, *Russian auto-translate text fixed + Added more English to Russian translation * Auto translated Russian text changed to have more sense and readability --- ru-ru/objective-c-ru.html.markdown | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ru-ru/objective-c-ru.html.markdown b/ru-ru/objective-c-ru.html.markdown index ddff2e5c..7209b3bb 100644 --- a/ru-ru/objective-c-ru.html.markdown +++ b/ru-ru/objective-c-ru.html.markdown @@ -381,20 +381,20 @@ if ([myClass respondsToSelector:selectorVar]) { // Проверяет содер NSLog(@"MyClass не содержит метод: %@", NSStringFromSelector(selectedVar)); } -// Имплементируйте методы в файле МойКласс.m: +// Имплементируйте методы в файле MyClass.m: @implementation MyClass { long distance; // Переменная экземпляра с закрытым (private) доступом NSNumber height; } -// To access a public variable from the interface file, use '_' followed by variable name: -_count = 5; // References "int count" from MyClass interface -// Access variables defined in implementation file: -distance = 18; // References "long distance" from MyClass implementation -// To use @property variable in implementation, use @synthesize to create accessor variable: -@synthesize roString = _roString; // _roString available now in @implementation +// Для доступа к public переменной, объявленной в интерфейсе используйте '_' перед названием переменной: +_count = 5; // Ссылается на "int count" из интерфейса MyClass +// Получение доступа к переменной, объявленной в имлементации происходит следующим образом: +distance = 18; // Ссылается на "long distance" из имлементации MyClass +// Для использования в иплементации переменной, объявленной в интерфейсе с помощью @property, следует использовать @synthesize для создания переменной аксессора: +@synthesize roString = _roString; // Теперь _roString доступна в @implementation (имплементации интерфейса) -// Called before calling any class methods or instantiating any objects +// Вызывается в первую очередь, перед вызовом других медотов класса или инициализации других объектов + (void)initialize { if (self == [MyClass class]) { @@ -505,10 +505,10 @@ distance = 18; // References "long distance" from MyClass implementation @end -// Теперь, если мы хотели создать грузовой объект, мы должны вместо создания подкласса класса Car, как это будет -// изменять функциональность Car чтобы вести себя подобно грузовику. Но давайте посмотрим, если мы хотим только добавить -// функциональность в существующий Car. Хороший пример должен быть чистить автомобиль. Итак мы создадим -// категорию для добавления его очистительных методов: +// Теперь, если мы хотим создать объект Truck - грузовик, мы должны создать подкласс класса Car, что +// изменит функционал Car и позволит вести себя подобно грузовику. Но что если мы хотим только добавить +// определенный функционал в уже существующий класс Car? Например - чистка автомобиля. Мы просто создадим +// категорию, которая добавит несколько методов для чистки автомобиля в класс Car: // @interface ИмяФайла: Car+Clean.h (ИмяБазовогоКласса+ИмяКатегории.h) #import "Car.h" // Убедитесь в том, что базовый класс импортирован для расширения. @@ -794,7 +794,7 @@ MyClass *arcMyClass = [[MyClass alloc] init]; // weakVar-свойство автоматически примет значение nil, // во избежание падения приложения @property (strong) MyClass *strongVar; // 'strong' принимает право на владение -// объектом. Гарантирует, что объект останится в памяти для использования +// объектом. Гарантирует, что объект останется в памяти для использования // Для обычных переменных (не объявленных с помощью @property), используйте // следующий способ: From 652285e9dfe2df2dbbc61b49abdc0ca22bf435f6 Mon Sep 17 00:00:00 2001 From: JustBlah Date: Thu, 24 Sep 2015 17:23:49 +0300 Subject: [PATCH 014/685] Multiline commentary split Long commentary was split into two strings --- ru-ru/objective-c-ru.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ru-ru/objective-c-ru.html.markdown b/ru-ru/objective-c-ru.html.markdown index 7209b3bb..bebd36d3 100644 --- a/ru-ru/objective-c-ru.html.markdown +++ b/ru-ru/objective-c-ru.html.markdown @@ -391,7 +391,8 @@ if ([myClass respondsToSelector:selectorVar]) { // Проверяет содер _count = 5; // Ссылается на "int count" из интерфейса MyClass // Получение доступа к переменной, объявленной в имлементации происходит следующим образом: distance = 18; // Ссылается на "long distance" из имлементации MyClass -// Для использования в иплементации переменной, объявленной в интерфейсе с помощью @property, следует использовать @synthesize для создания переменной аксессора: +// Для использования в иплементации переменной, объявленной в интерфейсе с помощью @property, +// следует использовать @synthesize для создания переменной аксессора: @synthesize roString = _roString; // Теперь _roString доступна в @implementation (имплементации интерфейса) // Вызывается в первую очередь, перед вызовом других медотов класса или инициализации других объектов From 5282918d9959ba5f02f952bff500f205db9f6dd5 Mon Sep 17 00:00:00 2001 From: Taff Date: Tue, 29 Sep 2015 01:31:50 +0800 Subject: [PATCH 015/685] fix error --- zh-cn/haskell-cn.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zh-cn/haskell-cn.html.markdown b/zh-cn/haskell-cn.html.markdown index 8904970f..b0b1183f 100644 --- a/zh-cn/haskell-cn.html.markdown +++ b/zh-cn/haskell-cn.html.markdown @@ -200,13 +200,13 @@ foo 5 -- 75 -- 你可以使用 `$` 来移除多余的括号。 -- 修改前 -(even (fib 7)) -- true +(even (fib 7)) -- False -- 修改后 -even . fib $ 7 -- true +even . fib $ 7 -- False -- 等价地 -even $ fib 7 -- true +even $ fib 7 -- False ---------------------------------------------------- -- 5. 类型声明 From 510eeb7684748afc83eb14e27d95a6b6c65deff4 Mon Sep 17 00:00:00 2001 From: willianjusten Date: Wed, 30 Sep 2015 22:40:46 -0300 Subject: [PATCH 016/685] [javascript pt-br] : first part --- pt-br/javascript-pt.html.markdown | 533 ++++++++++++++++++++++++++++++ 1 file changed, 533 insertions(+) create mode 100644 pt-br/javascript-pt.html.markdown diff --git a/pt-br/javascript-pt.html.markdown b/pt-br/javascript-pt.html.markdown new file mode 100644 index 00000000..c4115b3e --- /dev/null +++ b/pt-br/javascript-pt.html.markdown @@ -0,0 +1,533 @@ +--- +language: javascript +contributors: + - ["Adam Brenecki", "http://adam.brenecki.id.au"] + - ["Ariel Krakowski", "http://www.learneroo.com"] +filename: javascript.js +--- + +JavaScript foi criada por Brendan Eich, funcionário da Netscape, em 1995. Ela +foi originalmente criada para ser uma linguagem de script para websites, +complementando o uso de Java para aplicações web mais complexas, mas a sua +integração com páginas web e seu suporte nativo nos browsers fez com que +ela se tornasse mais comum que Java no frontend web. + +Javascript não é somente limitado a browsers web, no entanto: existe o Node.js, +que é um projeto que fornece um interpretador baseado no motor V8 do Google +Chrome e está se tornando cada vez mais famoso. + + +Feedback são muito apreciados! Você me encontrar em +[@adambrenecki](https://twitter.com/adambrenecki), ou +[adam@brenecki.id.au](mailto:adam@brenecki.id.au). + +```js +// Comentários são como em C. Comentários de uma linha começam com duas barras, +/* e comentários de múltplas linhas começam com barra-asterisco + e fecham com asterisco-barra */ + +// comandos podem ser terminados com ; +facaAlgo(); + +// ... mas eles não precisam ser, assim como o ponto-e-vírgula é automaticamente +// inserido quando há uma nova linha, exceto alguns casos. +facaAlgo() + +// Porque esses casos podem causar resultados inesperados, vamos continuar +// a usar ponto-e-vírgula neste guia. + +/////////////////////////////////// +// 1. Numbers, Strings and Operators + +// JavaScript has one number type (which is a 64-bit IEEE 754 double). +// Doubles have a 52-bit mantissa, which is enough to store integers +// up to about 9✕10¹⁵ precisely. +3; // = 3 +1.5; // = 1.5 + +// Some basic arithmetic works as you'd expect. +1 + 1; // = 2 +0.1 + 0.2; // = 0.30000000000000004 +8 - 1; // = 7 +10 * 2; // = 20 +35 / 5; // = 7 + +// Including uneven division. +5 / 2; // = 2.5 + +// Bitwise operations also work; when you perform a bitwise operation your float +// is converted to a signed int *up to* 32 bits. +1 << 2; // = 4 + +// Precedence is enforced with parentheses. +(1 + 3) * 2; // = 8 + +// There are three special not-a-real-number values: +Infinity; // result of e.g. 1/0 +-Infinity; // result of e.g. -1/0 +NaN; // result of e.g. 0/0 + +// There's also a boolean type. +true; +false; + +// Strings are created with ' or ". +'abc'; +"Hello, world"; + +// Negation uses the ! symbol +!true; // = false +!false; // = true + +// Equality is === +1 === 1; // = true +2 === 1; // = false + +// Inequality is !== +1 !== 1; // = false +2 !== 1; // = true + +// More comparisons +1 < 10; // = true +1 > 10; // = false +2 <= 2; // = true +2 >= 2; // = true + +// Strings are concatenated with + +"Hello " + "world!"; // = "Hello world!" + +// and are compared with < and > +"a" < "b"; // = true + +// Type coercion is performed for comparisons with double equals... +"5" == 5; // = true +null == undefined; // = true + +// ...unless you use === +"5" === 5; // = false +null === undefined; // = false + +// ...which can result in some weird behaviour... +13 + !0; // 14 +"13" + !0; // '13true' + +// You can access characters in a string with `charAt` +"This is a string".charAt(0); // = 'T' + +// ...or use `substring` to get larger pieces. +"Hello world".substring(0, 5); // = "Hello" + +// `length` is a property, so don't use (). +"Hello".length; // = 5 + +// There's also `null` and `undefined`. +null; // used to indicate a deliberate non-value +undefined; // used to indicate a value is not currently present (although + // `undefined` is actually a value itself) + +// false, null, undefined, NaN, 0 and "" are falsy; everything else is truthy. +// Note that 0 is falsy and "0" is truthy, even though 0 == "0". + +/////////////////////////////////// +// 2. Variables, Arrays and Objects + +// Variables are declared with the `var` keyword. JavaScript is dynamically +// typed, so you don't need to specify type. Assignment uses a single `=` +// character. +var someVar = 5; + +// if you leave the var keyword off, you won't get an error... +someOtherVar = 10; + +// ...but your variable will be created in the global scope, not in the scope +// you defined it in. + +// Variables declared without being assigned to are set to undefined. +var someThirdVar; // = undefined + +// There's shorthand for performing math operations on variables: +someVar += 5; // equivalent to someVar = someVar + 5; someVar is 10 now +someVar *= 10; // now someVar is 100 + +// and an even-shorter-hand for adding or subtracting 1 +someVar++; // now someVar is 101 +someVar--; // back to 100 + +// Arrays are ordered lists of values, of any type. +var myArray = ["Hello", 45, true]; + +// Their members can be accessed using the square-brackets subscript syntax. +// Array indices start at zero. +myArray[1]; // = 45 + +// Arrays are mutable and of variable length. +myArray.push("World"); +myArray.length; // = 4 + +// Add/Modify at specific index +myArray[3] = "Hello"; + +// JavaScript's objects are equivalent to "dictionaries" or "maps" in other +// languages: an unordered collection of key-value pairs. +var myObj = {key1: "Hello", key2: "World"}; + +// Keys are strings, but quotes aren't required if they're a valid +// JavaScript identifier. Values can be any type. +var myObj = {myKey: "myValue", "my other key": 4}; + +// Object attributes can also be accessed using the subscript syntax, +myObj["my other key"]; // = 4 + +// ... or using the dot syntax, provided the key is a valid identifier. +myObj.myKey; // = "myValue" + +// Objects are mutable; values can be changed and new keys added. +myObj.myThirdKey = true; + +// If you try to access a value that's not yet set, you'll get undefined. +myObj.myFourthKey; // = undefined + +/////////////////////////////////// +// 3. Logic and Control Structures + +// The syntax for this section is almost identical to Java's. + +// The `if` structure works as you'd expect. +var count = 1; +if (count == 3){ + // evaluated if count is 3 +} else if (count == 4){ + // evaluated if count is 4 +} else { + // evaluated if it's not either 3 or 4 +} + +// As does `while`. +while (true){ + // An infinite loop! +} + +// Do-while loops are like while loops, except they always run at least once. +var input; +do { + input = getInput(); +} while (!isValid(input)) + +// The `for` loop is the same as C and Java: +// initialisation; continue condition; iteration. +for (var i = 0; i < 5; i++){ + // will run 5 times +} + +// && is logical and, || is logical or +if (house.size == "big" && house.colour == "blue"){ + house.contains = "bear"; +} +if (colour == "red" || colour == "blue"){ + // colour is either red or blue +} + +// && and || "short circuit", which is useful for setting default values. +var name = otherName || "default"; + + +// The `switch` statement checks for equality with `===`. +// use 'break' after each case +// or the cases after the correct one will be executed too. +grade = 'B'; +switch (grade) { + case 'A': + console.log("Great job"); + break; + case 'B': + console.log("OK job"); + break; + case 'C': + console.log("You can do better"); + break; + default: + console.log("Oy vey"); + break; +} + + +/////////////////////////////////// +// 4. Functions, Scope and Closures + +// JavaScript functions are declared with the `function` keyword. +function myFunction(thing){ + return thing.toUpperCase(); +} +myFunction("foo"); // = "FOO" + +// Note that the value to be returned must start on the same line as the +// `return` keyword, otherwise you'll always return `undefined` due to +// automatic semicolon insertion. Watch out for this when using Allman style. +function myFunction() +{ + return // <- semicolon automatically inserted here + { + thisIsAn: 'object literal' + } +} +myFunction(); // = undefined + +// JavaScript functions are first class objects, so they can be reassigned to +// different variable names and passed to other functions as arguments - for +// example, when supplying an event handler: +function myFunction(){ + // this code will be called in 5 seconds' time +} +setTimeout(myFunction, 5000); +// Note: setTimeout isn't part of the JS language, but is provided by browsers +// and Node.js. + +// Function objects don't even have to be declared with a name - you can write +// an anonymous function definition directly into the arguments of another. +setTimeout(function(){ + // this code will be called in 5 seconds' time +}, 5000); + +// JavaScript has function scope; functions get their own scope but other blocks +// do not. +if (true){ + var i = 5; +} +i; // = 5 - not undefined as you'd expect in a block-scoped language + +// This has led to a common pattern of "immediately-executing anonymous +// functions", which prevent temporary variables from leaking into the global +// scope. +(function(){ + var temporary = 5; + // We can access the global scope by assiging to the "global object", which + // in a web browser is always `window`. The global object may have a + // different name in non-browser environments such as Node.js. + window.permanent = 10; +})(); +temporary; // raises ReferenceError +permanent; // = 10 + +// One of JavaScript's most powerful features is closures. If a function is +// defined inside another function, the inner function has access to all the +// outer function's variables, even after the outer function exits. +function sayHelloInFiveSeconds(name){ + var prompt = "Hello, " + name + "!"; + // Inner functions are put in the local scope by default, as if they were + // declared with `var`. + function inner(){ + alert(prompt); + } + setTimeout(inner, 5000); + // setTimeout is asynchronous, so the sayHelloInFiveSeconds function will + // exit immediately, and setTimeout will call inner afterwards. However, + // because inner is "closed over" sayHelloInFiveSeconds, inner still has + // access to the `prompt` variable when it is finally called. +} +sayHelloInFiveSeconds("Adam"); // will open a popup with "Hello, Adam!" in 5s + +/////////////////////////////////// +// 5. More about Objects; Constructors and Prototypes + +// Objects can contain functions. +var myObj = { + myFunc: function(){ + return "Hello world!"; + } +}; +myObj.myFunc(); // = "Hello world!" + +// When functions attached to an object are called, they can access the object +// they're attached to using the `this` keyword. +myObj = { + myString: "Hello world!", + myFunc: function(){ + return this.myString; + } +}; +myObj.myFunc(); // = "Hello world!" + +// What this is set to has to do with how the function is called, not where +// it's defined. So, our function doesn't work if it isn't called in the +// context of the object. +var myFunc = myObj.myFunc; +myFunc(); // = undefined + +// Inversely, a function can be assigned to the object and gain access to it +// through `this`, even if it wasn't attached when it was defined. +var myOtherFunc = function(){ + return this.myString.toUpperCase(); +} +myObj.myOtherFunc = myOtherFunc; +myObj.myOtherFunc(); // = "HELLO WORLD!" + +// We can also specify a context for a function to execute in when we invoke it +// using `call` or `apply`. + +var anotherFunc = function(s){ + return this.myString + s; +} +anotherFunc.call(myObj, " And Hello Moon!"); // = "Hello World! And Hello Moon!" + +// The `apply` function is nearly identical, but takes an array for an argument +// list. + +anotherFunc.apply(myObj, [" And Hello Sun!"]); // = "Hello World! And Hello Sun!" + +// This is useful when working with a function that accepts a sequence of +// arguments and you want to pass an array. + +Math.min(42, 6, 27); // = 6 +Math.min([42, 6, 27]); // = NaN (uh-oh!) +Math.min.apply(Math, [42, 6, 27]); // = 6 + +// But, `call` and `apply` are only temporary. When we want it to stick, we can +// use `bind`. + +var boundFunc = anotherFunc.bind(myObj); +boundFunc(" And Hello Saturn!"); // = "Hello World! And Hello Saturn!" + +// `bind` can also be used to partially apply (curry) a function. + +var product = function(a, b){ return a * b; } +var doubler = product.bind(this, 2); +doubler(8); // = 16 + +// When you call a function with the `new` keyword, a new object is created, and +// made available to the function via the this keyword. Functions designed to be +// called like that are called constructors. + +var MyConstructor = function(){ + this.myNumber = 5; +} +myNewObj = new MyConstructor(); // = {myNumber: 5} +myNewObj.myNumber; // = 5 + +// Every JavaScript object has a 'prototype'. When you go to access a property +// on an object that doesn't exist on the actual object, the interpreter will +// look at its prototype. + +// Some JS implementations let you access an object's prototype on the magic +// property `__proto__`. While this is useful for explaining prototypes it's not +// part of the standard; we'll get to standard ways of using prototypes later. +var myObj = { + myString: "Hello world!" +}; +var myPrototype = { + meaningOfLife: 42, + myFunc: function(){ + return this.myString.toLowerCase() + } +}; + +myObj.__proto__ = myPrototype; +myObj.meaningOfLife; // = 42 + +// This works for functions, too. +myObj.myFunc(); // = "hello world!" + +// Of course, if your property isn't on your prototype, the prototype's +// prototype is searched, and so on. +myPrototype.__proto__ = { + myBoolean: true +}; +myObj.myBoolean; // = true + +// There's no copying involved here; each object stores a reference to its +// prototype. This means we can alter the prototype and our changes will be +// reflected everywhere. +myPrototype.meaningOfLife = 43; +myObj.meaningOfLife; // = 43 + +// We mentioned that `__proto__` was non-standard, and there's no standard way to +// change the prototype of an existing object. However, there are two ways to +// create a new object with a given prototype. + +// The first is Object.create, which is a recent addition to JS, and therefore +// not available in all implementations yet. +var myObj = Object.create(myPrototype); +myObj.meaningOfLife; // = 43 + +// The second way, which works anywhere, has to do with constructors. +// Constructors have a property called prototype. This is *not* the prototype of +// the constructor function itself; instead, it's the prototype that new objects +// are given when they're created with that constructor and the new keyword. +MyConstructor.prototype = { + myNumber: 5, + getMyNumber: function(){ + return this.myNumber; + } +}; +var myNewObj2 = new MyConstructor(); +myNewObj2.getMyNumber(); // = 5 +myNewObj2.myNumber = 6 +myNewObj2.getMyNumber(); // = 6 + +// Built-in types like strings and numbers also have constructors that create +// equivalent wrapper objects. +var myNumber = 12; +var myNumberObj = new Number(12); +myNumber == myNumberObj; // = true + +// Except, they aren't exactly equivalent. +typeof myNumber; // = 'number' +typeof myNumberObj; // = 'object' +myNumber === myNumberObj; // = false +if (0){ + // This code won't execute, because 0 is falsy. +} +if (Number(0)){ + // This code *will* execute, because Number(0) is truthy. +} + +// However, the wrapper objects and the regular builtins share a prototype, so +// you can actually add functionality to a string, for instance. +String.prototype.firstCharacter = function(){ + return this.charAt(0); +} +"abc".firstCharacter(); // = "a" + +// This fact is often used in "polyfilling", which is implementing newer +// features of JavaScript in an older subset of JavaScript, so that they can be +// used in older environments such as outdated browsers. + +// For instance, we mentioned that Object.create isn't yet available in all +// implementations, but we can still use it with this polyfill: +if (Object.create === undefined){ // don't overwrite it if it exists + Object.create = function(proto){ + // make a temporary constructor with the right prototype + var Constructor = function(){}; + Constructor.prototype = proto; + // then use it to create a new, appropriately-prototyped object + return new Constructor(); + } +} +``` + +## Further Reading + +The [Mozilla Developer +Network](https://developer.mozilla.org/en-US/docs/Web/JavaScript) provides +excellent documentation for JavaScript as it's used in browsers. Plus, it's a +wiki, so as you learn more you can help others out by sharing your own +knowledge. + +MDN's [A re-introduction to +JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript) +covers much of the concepts covered here in more detail. This guide has quite +deliberately only covered the JavaScript language itself; if you want to learn +more about how to use JavaScript in web pages, start by learning about the +[Document Object +Model](https://developer.mozilla.org/en-US/docs/Using_the_W3C_DOM_Level_1_Core) + +[Learn Javascript by Example and with Challenges](http://www.learneroo.com/modules/64/nodes/350) is a variant of this reference with built-in challenges. + +[JavaScript Garden](http://bonsaiden.github.io/JavaScript-Garden/) is an in-depth +guide of all the counter-intuitive parts of the language. + +[JavaScript: The Definitive Guide](http://www.amazon.com/gp/product/0596805527/) is a classic guide / reference book. + +In addition to direct contributors to this article, some content is adapted +from Louie Dinh's Python tutorial on this site, and the [JS +Tutorial](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript) +on the Mozilla Developer Network. From ed2bc5a84c4dfc1af45c05ea8b1a20122ac72620 Mon Sep 17 00:00:00 2001 From: willianjusten Date: Thu, 1 Oct 2015 22:23:18 -0300 Subject: [PATCH 017/685] =?UTF-8?q?[javascript=20pt-br]=20:=201.=20N=C3=BA?= =?UTF-8?q?meros,=20Strings=20e=20Operadores?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt-br/javascript-pt.html.markdown | 75 ++++++++++++++++--------------- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/pt-br/javascript-pt.html.markdown b/pt-br/javascript-pt.html.markdown index c4115b3e..72f4cf0f 100644 --- a/pt-br/javascript-pt.html.markdown +++ b/pt-br/javascript-pt.html.markdown @@ -37,96 +37,99 @@ facaAlgo() // a usar ponto-e-vírgula neste guia. /////////////////////////////////// -// 1. Numbers, Strings and Operators +// 1. Números, Strings e Operadores -// JavaScript has one number type (which is a 64-bit IEEE 754 double). -// Doubles have a 52-bit mantissa, which is enough to store integers -// up to about 9✕10¹⁵ precisely. +// Javascript tem um tipo de número (que é o 64-bit IEEE 754 double). +// Doublas tem uma mantissa 52-bit, que é suficiente para guardar inteiros +// acima de 9✕10¹⁵ precisamente. 3; // = 3 1.5; // = 1.5 -// Some basic arithmetic works as you'd expect. +// A aritmética básica funciona seria de esperar. 1 + 1; // = 2 0.1 + 0.2; // = 0.30000000000000004 8 - 1; // = 7 10 * 2; // = 20 35 / 5; // = 7 -// Including uneven division. +// Inclusive divisão desigual. 5 / 2; // = 2.5 -// Bitwise operations also work; when you perform a bitwise operation your float -// is converted to a signed int *up to* 32 bits. +// Operadores Bitwise também funcionam; quando você faz uma operação bitwise +// seu float é convertido para um int de até 32 bits. 1 << 2; // = 4 -// Precedence is enforced with parentheses. +// A precedência é aplicada com parênteses. (1 + 3) * 2; // = 8 // There are three special not-a-real-number values: -Infinity; // result of e.g. 1/0 --Infinity; // result of e.g. -1/0 -NaN; // result of e.g. 0/0 +// Existem três especiais valores não-é-número-real: +Infinity; // resultado de 1/0 +-Infinity; // resultado de -1/0 +NaN; // resultado de 0/0 -// There's also a boolean type. +// Existe também o tipo booleano. true; false; -// Strings are created with ' or ". +// Strings são criados com ' ou ". 'abc'; -"Hello, world"; +"Olá, mundo"; // Negation uses the ! symbol +// Negação usa o símbolo ! !true; // = false !false; // = true -// Equality is === +// Igualdade é === 1 === 1; // = true 2 === 1; // = false -// Inequality is !== +// Desigualdade é !== 1 !== 1; // = false 2 !== 1; // = true -// More comparisons +// Mais comparações 1 < 10; // = true 1 > 10; // = false 2 <= 2; // = true 2 >= 2; // = true -// Strings are concatenated with + -"Hello " + "world!"; // = "Hello world!" +// Strings são concatenadas com + +"Olá " + "mundo!"; // = "Olá mundo!" -// and are compared with < and > +// e comparadas com < e > "a" < "b"; // = true -// Type coercion is performed for comparisons with double equals... +// A coerção de tipos é feita para comparações com dois iguais... "5" == 5; // = true null == undefined; // = true -// ...unless you use === +// ...a menos que use === "5" === 5; // = false null === undefined; // = false -// ...which can result in some weird behaviour... +// ...que irá resultar num comportamento estranho... 13 + !0; // 14 "13" + !0; // '13true' -// You can access characters in a string with `charAt` -"This is a string".charAt(0); // = 'T' +// Você pode acessar caracteres de uma String usando o `charAt` +"Isto é uma String".charAt(0); // = 'I' -// ...or use `substring` to get larger pieces. -"Hello world".substring(0, 5); // = "Hello" +// ...ou usar `substring` para pegar pedaços maiores. +"Olá mundo".substring(0, 3); // = "Olá" -// `length` is a property, so don't use (). -"Hello".length; // = 5 +// `length` é uma propriedade, portanto não use (). +"Olá".length; // = 3 -// There's also `null` and `undefined`. -null; // used to indicate a deliberate non-value -undefined; // used to indicate a value is not currently present (although - // `undefined` is actually a value itself) +// Existe também o `null` e o `undefined`. +null; // usado para indicar um valor não considerado +undefined; // usado para indicar um valor que não é a atualmente definido + // (entretando `undefined` é usado como um próprio valor -// false, null, undefined, NaN, 0 and "" are falsy; everything else is truthy. -// Note that 0 is falsy and "0" is truthy, even though 0 == "0". +// false, null, undefined, NaN, 0 and "" são valores falsy; +// qualquer outro valor é truthy +// Note que 0 é falsy e "0" é truthy, até mesmo 0 == "0". /////////////////////////////////// // 2. Variables, Arrays and Objects From 716e0ced466ef98f7fb9d78d15a5ab606b6b755c Mon Sep 17 00:00:00 2001 From: willianjusten Date: Thu, 1 Oct 2015 23:48:05 -0300 Subject: [PATCH 018/685] =?UTF-8?q?[javascript=20pt-br]=20:=202.=20Vari?= =?UTF-8?q?=C3=A1veis,=20Arrays=20e=20Objetos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt-br/javascript-pt.html.markdown | 57 ++++++++++++++++--------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/pt-br/javascript-pt.html.markdown b/pt-br/javascript-pt.html.markdown index 72f4cf0f..6667a77d 100644 --- a/pt-br/javascript-pt.html.markdown +++ b/pt-br/javascript-pt.html.markdown @@ -132,62 +132,65 @@ undefined; // usado para indicar um valor que não é a atualmente definido // Note que 0 é falsy e "0" é truthy, até mesmo 0 == "0". /////////////////////////////////// -// 2. Variables, Arrays and Objects +// 2. Variáveis, Arrays e Objetos -// Variables are declared with the `var` keyword. JavaScript is dynamically -// typed, so you don't need to specify type. Assignment uses a single `=` -// character. +// Variáveis são declarados com a palavra-chave `var`. O Javascript é +// dinâmicamente tipado, portanto você não precisa especificar o tipo. +// Atribuições usam um simples caracter de `=`. var someVar = 5; -// if you leave the var keyword off, you won't get an error... +// se você deixar de colocar a palavra-chave var, você não receber um erro... someOtherVar = 10; -// ...but your variable will be created in the global scope, not in the scope -// you defined it in. +// ...mas sua variável será criada no escopo global, não no escopo em que você +// definiu ela. -// Variables declared without being assigned to are set to undefined. +// Variáveis declaradas sem receberem um valor são definidas como `undefined`. var someThirdVar; // = undefined -// There's shorthand for performing math operations on variables: -someVar += 5; // equivalent to someVar = someVar + 5; someVar is 10 now -someVar *= 10; // now someVar is 100 +// Existe um shorthad para operações matemáticas em variáveis: +someVar += 5; // equivalente a someVar = someVar + 5; someVar é 10 agora +someVar *= 10; // agora someVar é 100 -// and an even-shorter-hand for adding or subtracting 1 +// e um para adição e subtração de 1 someVar++; // now someVar is 101 someVar--; // back to 100 -// Arrays are ordered lists of values, of any type. -var myArray = ["Hello", 45, true]; +// Arrays são listas ordenadas de valores, de qualquer tipo. +var myArray = ["Olá", 45, true]; -// Their members can be accessed using the square-brackets subscript syntax. -// Array indices start at zero. +// Seus membros podem ser acessados usando a sintaxe de colchetes. +// O indíce de um Array começa pelo 0. myArray[1]; // = 45 -// Arrays are mutable and of variable length. +// Arrays são mutáveis e de tamanho variável. myArray.push("World"); myArray.length; // = 4 -// Add/Modify at specific index +// Adicionar/modificar em um índice específico myArray[3] = "Hello"; -// JavaScript's objects are equivalent to "dictionaries" or "maps" in other -// languages: an unordered collection of key-value pairs. -var myObj = {key1: "Hello", key2: "World"}; +// Objetos de Javascript são equivalentes aos dicionários ou maps de outras +// linguagens: uma coleção não ordenada de pares chave-valor. +var myObj = {chave1: "Olá", chave2: "Mundo"}; -// Keys are strings, but quotes aren't required if they're a valid -// JavaScript identifier. Values can be any type. +// Chaves são strings, mas as aspas não são necessárias se elas são +// identificadores válidos no Javascript. Valores podem ser de qualquer tipo. var myObj = {myKey: "myValue", "my other key": 4}; -// Object attributes can also be accessed using the subscript syntax, +// Atributos de objetos também podem ser acessados com a sintaxe de colchetes. myObj["my other key"]; // = 4 -// ... or using the dot syntax, provided the key is a valid identifier. +// ... ou usando a sintaxe de ponto, passando a chave que é um identificador +// válido. myObj.myKey; // = "myValue" -// Objects are mutable; values can be changed and new keys added. +// Objetos são mutáveis, valores podem ser modificados e novas chaves +// adicionadas. myObj.myThirdKey = true; -// If you try to access a value that's not yet set, you'll get undefined. +// Se você tentar acessar um valor que não foi determinado ainda, você irá +// receber `undefined`. myObj.myFourthKey; // = undefined /////////////////////////////////// From 32caaabe05e2d920c4be42c278e2e6d51ddea6ed Mon Sep 17 00:00:00 2001 From: willianjusten Date: Fri, 2 Oct 2015 01:05:31 -0300 Subject: [PATCH 019/685] =?UTF-8?q?[javascript=20pt-br]=20:=203.=20L=C3=B3?= =?UTF-8?q?gica=20e=20Estruturas=20de=20Controle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt-br/javascript-pt.html.markdown | 42 ++++++++++++++++--------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/pt-br/javascript-pt.html.markdown b/pt-br/javascript-pt.html.markdown index 6667a77d..14d82146 100644 --- a/pt-br/javascript-pt.html.markdown +++ b/pt-br/javascript-pt.html.markdown @@ -194,52 +194,54 @@ myObj.myThirdKey = true; myObj.myFourthKey; // = undefined /////////////////////////////////// -// 3. Logic and Control Structures +// 3. Lógica e Estruturas de Controle -// The syntax for this section is almost identical to Java's. +// A sintaxe para essa seção é quase idêntica a maioria das linguagens. // The `if` structure works as you'd expect. -var count = 1; +// A estrutura `if` funciona como deveria ser. +var count = 1 if (count == 3){ - // evaluated if count is 3 + // executa se count é 3 } else if (count == 4){ - // evaluated if count is 4 + // executa se count é 4 } else { - // evaluated if it's not either 3 or 4 + // executa se count não é 3 nem 4 } -// As does `while`. +// Como se faz `while`. while (true){ - // An infinite loop! + // Um loop infinito! } -// Do-while loops are like while loops, except they always run at least once. -var input; +// Os loops do-while são como os loops de while, exceto quando eles sempre +// executam pelo menos uma vez. do { input = getInput(); } while (!isValid(input)) // The `for` loop is the same as C and Java: // initialisation; continue condition; iteration. + +// O loop `for` é o mesmo de C e Java: +// inicialização, condição de continuar; iteração for (var i = 0; i < 5; i++){ - // will run 5 times + // vai rodar cinco vezes } -// && is logical and, || is logical or +// && é o `e` lógico , || é o `ou` lógico if (house.size == "big" && house.colour == "blue"){ house.contains = "bear"; } -if (colour == "red" || colour == "blue"){ - // colour is either red or blue +if (cor == "red" || cor == "blue"){ + // cor é vermelha OU azul } -// && and || "short circuit", which is useful for setting default values. -var name = otherName || "default"; +// && e || "pequeno circuito", é útil para determinar valores padrões. +var name = otherName || "padrão"; - -// The `switch` statement checks for equality with `===`. -// use 'break' after each case -// or the cases after the correct one will be executed too. +// O `switch` checa pela igualdade com `===`. +// Use `break` após cada `case` grade = 'B'; switch (grade) { case 'A': From 2534c71c4f5cc8f6b806914857da11b8ae89f45d Mon Sep 17 00:00:00 2001 From: willianjusten Date: Fri, 2 Oct 2015 01:23:46 -0300 Subject: [PATCH 020/685] =?UTF-8?q?[javascript=20pt-br]=20:=20Fun=C3=A7?= =?UTF-8?q?=C3=B5es,=20Escopos=20e=20Closures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt-br/javascript-pt.html.markdown | 79 ++++++++++++++++--------------- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/pt-br/javascript-pt.html.markdown b/pt-br/javascript-pt.html.markdown index 14d82146..08448d0b 100644 --- a/pt-br/javascript-pt.html.markdown +++ b/pt-br/javascript-pt.html.markdown @@ -209,7 +209,7 @@ if (count == 3){ // executa se count não é 3 nem 4 } -// Como se faz `while`. +// Como se faz um `while`. while (true){ // Um loop infinito! } @@ -224,7 +224,7 @@ do { // initialisation; continue condition; iteration. // O loop `for` é o mesmo de C e Java: -// inicialização, condição de continuar; iteração +// inicialização, condição para continuar; iteração for (var i = 0; i < 5; i++){ // vai rodar cinco vezes } @@ -260,79 +260,84 @@ switch (grade) { /////////////////////////////////// -// 4. Functions, Scope and Closures +// 4. Funções, Escopos e Closures -// JavaScript functions are declared with the `function` keyword. +// Funções Javascript são declaradas com a palavra-chave `function`. function myFunction(thing){ return thing.toUpperCase(); } myFunction("foo"); // = "FOO" -// Note that the value to be returned must start on the same line as the -// `return` keyword, otherwise you'll always return `undefined` due to -// automatic semicolon insertion. Watch out for this when using Allman style. +// Repare que o valor a ser retornado deve começar na mesma linha que +// a palavra-chave `return`, senão você sempre irá retornar `undefined` +// visto que o ponto-e-vírgula é inserido automáticamente nas quebras de +// linha. Preste atenção quando usar o estilo Allman. function myFunction() { - return // <- semicolon automatically inserted here + return // <- ponto-e-vírgula adicionado automaticamente aqui { thisIsAn: 'object literal' } } myFunction(); // = undefined -// JavaScript functions are first class objects, so they can be reassigned to -// different variable names and passed to other functions as arguments - for -// example, when supplying an event handler: +// Funções Javascript são objetos de primeira classe, portanto elas podem +// ser atribuídas a nomes de variáveis e serem passadas para outras funções +// como argumentos - por exemplo, quando criamos um manipulador de eventos: function myFunction(){ - // this code will be called in 5 seconds' time + // este código será chamado em 5 segundos } setTimeout(myFunction, 5000); -// Note: setTimeout isn't part of the JS language, but is provided by browsers -// and Node.js. +// Nota: `setTimeout` não é parte da linguagem Javascript, mas é provido pelos +// browsers e o Node.js. -// Function objects don't even have to be declared with a name - you can write -// an anonymous function definition directly into the arguments of another. +// Objetos de funções não precisam nem serem declarados com nome - você pode +// escrever a definição de uma função anônima diretamente nos argumentos de +// outra função. setTimeout(function(){ - // this code will be called in 5 seconds' time + // este código será chamado em 5 segundos }, 5000); -// JavaScript has function scope; functions get their own scope but other blocks -// do not. +// O Javascript tem escopo de função; as funções tem seu próprio escopo, +// mas outros blocos não. if (true){ var i = 5; } -i; // = 5 - not undefined as you'd expect in a block-scoped language +i; // = 5 - não `undefined` como você esperaria numa linguagem de blogo-escopo -// This has led to a common pattern of "immediately-executing anonymous -// functions", which prevent temporary variables from leaking into the global -// scope. +// Isso levou a padrão comum chamado de IIFE (Imediately Invoked Function +// Expression) ou (Expressão de Função Invocada Imediatamente), que previne +// que variáveis temporárias vazem para o escopo global. (function(){ var temporary = 5; - // We can access the global scope by assiging to the "global object", which - // in a web browser is always `window`. The global object may have a - // different name in non-browser environments such as Node.js. + // Nós podemos acessar o escopo global definindo o "objeto global", que + // no browser vai ser sempre `window`. O objeto global pode ter um nome + // diferente para ambiente não-browser como o Node.js. window.permanent = 10; })(); -temporary; // raises ReferenceError +temporary; // levanta um erro de referência inexiste permanent; // = 10 -// One of JavaScript's most powerful features is closures. If a function is -// defined inside another function, the inner function has access to all the -// outer function's variables, even after the outer function exits. +// Uma das principais características do Javascript é a closure. Que é +// uma função definida dentro de outra função, a função interna pode acessar +// todas as variáveis da função externa, mesmo depois da função de fora +// finalizar sua execução. function sayHelloInFiveSeconds(name){ var prompt = "Hello, " + name + "!"; - // Inner functions are put in the local scope by default, as if they were - // declared with `var`. + + // Funções internas são colocadas no escopo local por padrão, assim como + // se fossem declaradas com `var`. function inner(){ alert(prompt); } setTimeout(inner, 5000); - // setTimeout is asynchronous, so the sayHelloInFiveSeconds function will - // exit immediately, and setTimeout will call inner afterwards. However, - // because inner is "closed over" sayHelloInFiveSeconds, inner still has - // access to the `prompt` variable when it is finally called. + // `setTimeout` é assíncrono, portanto a função `sayHelloInFiveSeconds` + // vai sair imediatamente, e o `setTimeout` irá chamar a interna depois. + // Entretanto. como a interna é fechada dentro de "sayHelloInFiveSeconds", + // a interna permanece podendo acessar a variável `prompt` quando depois + // de chamada. } -sayHelloInFiveSeconds("Adam"); // will open a popup with "Hello, Adam!" in 5s +sayHelloInFiveSeconds("Adam"); // Vai abrir um popup com "Hello, Adam!" em 5s /////////////////////////////////// // 5. More about Objects; Constructors and Prototypes From 93c8348f3e25cbe2274e8762b3759c61e4375cdc Mon Sep 17 00:00:00 2001 From: Adolfo Jayme Barrientos Date: Fri, 2 Oct 2015 08:30:17 -0500 Subject: [PATCH 021/685] [visualbasic/es] Create Spanish translation of VB tutorial --- es-es/visualbasic-es.html.markdown | 286 +++++++++++++++++++++++++++++ 1 file changed, 286 insertions(+) create mode 100644 es-es/visualbasic-es.html.markdown diff --git a/es-es/visualbasic-es.html.markdown b/es-es/visualbasic-es.html.markdown new file mode 100644 index 00000000..0702c01e --- /dev/null +++ b/es-es/visualbasic-es.html.markdown @@ -0,0 +1,286 @@ +--- +language: Visual Basic +contributors: + - ["Brian Martin", "http://brianmartin.biz"] +translators: + - ["Adolfo Jayme Barrientos", "https://github.com/fitojb"] +author: Brian Martin +author_url: http://brianmartin.biz +filename: learnvisualbasic-es.vb +lang: es-es +--- + +```vb +Module Module1 + + Sub Main() + ' Un vistazo rápido a las aplicaciones de consola de Visual Basic antes + ' de que profundicemos en el tema. + ' El apóstrofo inicia una línea de comentario. + ' Para explorar este tutorial dentro del Compilador de Visual Basic, + ' he creado un sistema de navegación. + ' Dicho sistema se explicará a medida que avancemos en este + ' tutorial; gradualmente entenderás lo que significa todo. + Console.Title = ("Aprende X en Y minutos") + Console.WriteLine("NAVEGACIÓN") 'Mostrar + Console.WriteLine("") + Console.ForegroundColor = ConsoleColor.Green + Console.WriteLine("1. Salida «Hola, mundo»") + Console.WriteLine("2. Entrada «Hola, mundo»") + Console.WriteLine("3. Calcular números enteros") + Console.WriteLine("4. Calcular números decimales") + Console.WriteLine("5. Una calculadora funcional") + Console.WriteLine("6. Uso de bucles «Do While»") + Console.WriteLine("7. Uso de bucles «For While»") + Console.WriteLine("8. Declaraciones condicionales") + Console.WriteLine("9. Selecciona una bebida") + Console.WriteLine("50. Acerca de") + Console.WriteLine("Elige un número de la lista anterior") + Dim selection As String = Console.ReadLine + Select Case selection + Case "1" 'Salida «hola, mundo» + Console.Clear() 'Limpia la consola y abre la subrutina privada + SalidaHolaMundo() 'Abre la subrutina privada nombrada + Case "2" 'Entrada «hola, mundo» + Console.Clear() + EntradaHolaMundo() + Case "3" 'Calcular números enteros + Console.Clear() + CalcularNumerosEnteros() + Case "4" 'Calcular números decimales + Console.Clear() + CalcularNumerosDecimales() + Case "5" 'Una calculadora funcional + Console.Clear() + CalculadoraFuncional() + Case "6" 'Uso de bucles «Do While» + Console.Clear() + UsoBuclesDoWhile() + Case "7" 'Uso de bucles «For While» + Console.Clear() + UsoBuclesFor() + Case "8" 'Declaraciones condicionales + Console.Clear() + DeclaracionCondicional() + Case "9" 'Declaración «If/Else» + Console.Clear() + DeclaracionIfElse() 'Selecciona una bebida + Case "50" 'Cuadro de mensaje «Acerca de» + Console.Clear() + Console.Title = ("Aprende X en Y minutos :: Acerca de") + MsgBox("Tutorial escrito por Brian Martin (@BrianMartinn") + Console.Clear() + Main() + Console.ReadLine() + + End Select + End Sub + + 'Uno - He usado números para guiarme por el sistema de navegación anterior + 'cuando regrese posteriormente a implementarlo. + + 'Usamos subrutinas privadas para separar distintas secciones del programa. + Private Sub SalidaHolaMundo() + 'Título de la aplicación de consola + Console.Title = "Salida «Hola, mundo» | Aprende X en Y minutos" + 'Usa Console.Write("") o Console.WriteLine("") para mostrar salidas. + 'Seguido por Console.Read(), o bien, Console.Readline() + 'Console.ReadLine() muestra la salida en la consola. + Console.WriteLine("Hola, mundo") + Console.ReadLine() + End Sub + + 'Dos + Private Sub EntradaHolaMundo() + Console.Title = "«Hola, mundo, soy...» | Aprende X en Y minutos" + ' Variables + ' Los datos que introduzca un usuario deben almacenarse. + ' Las variables también empiezan por Dim y terminan por As VariableType. + + ' En este tutorial queremos conocer tu nombre y hacer que el programa + ' responda a este. + Dim nombredeusuario As String + 'Usamos «string» porque es una variable basada en texto. + Console.WriteLine("Hola, ¿cómo te llamas? ") 'Preguntar nombre de usuario. + nombredeusuario = Console.ReadLine() 'Almacenar nombre del usuario. + Console.WriteLine("Hola, " + nombredeusuario) 'La salida es Hola, nombre + Console.ReadLine() 'Muestra lo anterior. + 'El código anterior te hará una pregunta y mostrará la respuesta. + 'Entre otras variables está Integer, la cual usaremos para números enteros. + End Sub + + 'Tres + Private Sub CalcularNumerosEnteros() + Console.Title = "Calcular números enteros | Aprende X en Y minutos" + Console.Write("Primer número: ") 'Escribe un núm. entero, 1, 2, 104, etc + Dim a As Integer = Console.ReadLine() + Console.Write("Segundo número: ") 'Escribe otro número entero. + Dim b As Integer = Console.ReadLine() + Dim c As Integer = a + b + Console.WriteLine(c) + Console.ReadLine() + 'Lo anterior es una calculadora sencilla + End Sub + + 'Cuatro + Private Sub CalcularNumerosDecimales() + Console.Title = "Calcular con tipo doble | Aprende X en Y minutos" + 'Por supuesto, nos gustaría sumar decimales. + 'Por ello podríamos cambiar del tipo Integer al Double. + + 'Escribe un número fraccionario, 1.2, 2.4, 50.1, 104.9 etc + Console.Write("Primer número: ") + Dim a As Double = Console.ReadLine + Console.Write("Segundo número: ") 'Escribe el segundo número. + Dim b As Double = Console.ReadLine + Dim c As Double = a + b + Console.WriteLine(c) + Console.ReadLine() + 'Este programa puede sumar 1.1 y 2.2 + End Sub + + 'Cinco + Private Sub CalculadoraFuncional() + Console.Title = "La calculadora funcional | Aprende X en Y minutos" + 'Pero si quieres que la calculadora reste, divida, multiplique y + 'sume. + 'Copia y pega lo anterior. + Console.Write("Primer número: ") + Dim a As Double = Console.ReadLine + Console.Write("Segundo número: ") + Dim b As Integer = Console.ReadLine + Dim c As Integer = a + b + Dim d As Integer = a * b + Dim e As Integer = a - b + Dim f As Integer = a / b + + 'Mediante las líneas siguientes podremos restar, + 'multiplicar y dividir los valores a y b + Console.Write(a.ToString() + " + " + b.ToString()) + 'Queremos dar un margen izquierdo de 3 espacios a los resultados. + Console.WriteLine(" = " + c.ToString.PadLeft(3)) + Console.Write(a.ToString() + " * " + b.ToString()) + Console.WriteLine(" = " + d.ToString.PadLeft(3)) + Console.Write(a.ToString() + " - " + b.ToString()) + Console.WriteLine(" = " + e.ToString.PadLeft(3)) + Console.Write(a.ToString() + " / " + b.ToString()) + Console.WriteLine(" = " + f.ToString.PadLeft(3)) + Console.ReadLine() + + End Sub + + 'Seis + Private Sub UsoBuclesDoWhile() + 'Igual que la subrutina privada anterior + 'Esta vez preguntaremos al usuario si quiere continuar (¿sí o no?) + 'Usamos el bucle Do While porque no sabemos si el usuario quiere + 'usar el programa más de una vez. + Console.Title = "Uso de bucles «Do While» | Aprende X en Y minutos" + Dim respuesta As String 'Usamos la variable «String» porque la resp. es texto + Do 'Comenzamos el programa con + Console.Write("Primer número: ") + Dim a As Double = Console.ReadLine + Console.Write("Segundo número: ") + Dim b As Integer = Console.ReadLine + Dim c As Integer = a + b + Dim d As Integer = a * b + Dim e As Integer = a - b + Dim f As Integer = a / b + + Console.Write(a.ToString() + " + " + b.ToString()) + Console.WriteLine(" = " + c.ToString.PadLeft(3)) + Console.Write(a.ToString() + " * " + b.ToString()) + Console.WriteLine(" = " + d.ToString.PadLeft(3)) + Console.Write(a.ToString() + " - " + b.ToString()) + Console.WriteLine(" = " + e.ToString.PadLeft(3)) + Console.Write(a.ToString() + " / " + b.ToString()) + Console.WriteLine(" = " + f.ToString.PadLeft(3)) + Console.ReadLine() + 'Preguntar si el usuario quiere continuar. Desafortunadamente, + 'distingue entre mayúsculas y minúsculas. + Console.Write("¿Quieres continuar? (s / n)") + 'El programa toma la variable, la muestra y comienza de nuevo. + respuesta = Console.ReadLine + 'La orden que hará funcionar esta variable es en este caso «s» + Loop While respuesta = "s" + + End Sub + + 'Siete + Private Sub UsoBuclesFor() + 'A veces el programa debe ejecutarse solo una vez. + 'En este programa contaremos a partir de 10. + + Console.Title = "Uso de bucles «For» | Aprende X en Y minutos" + 'Declarar Variable y desde qué número debe contar en Step -1, + 'Step -2, Step -3, etc. + For i As Integer = 10 To 0 Step -1 + Console.WriteLine(i.ToString) 'Muestra el valor del contador + Next i 'Calcular el valor nuevo + Console.WriteLine("Iniciar") '¡¡Comencemos el programa, nene!! + Console.ReadLine() '¡¡ZAS!! - Quizá me he emocionado bastante :) + End Sub + + 'Ocho + Private Sub DeclaracionCondicional() + Console.Title = "Declaraciones condicionales | Aprende X en Y minutos" + Dim nombredeUsuario As String = Console.ReadLine + Console.WriteLine("Hola, ¿cómo te llamas? ") 'Preguntar nombre de usuario. + nombredeUsuario = Console.ReadLine() 'Almacena el nombre de usuario. + If nombredeUsuario = "Adam" Then + Console.WriteLine("Hola, Adam") + Console.WriteLine("Gracias por crear este útil sitio web") + Console.ReadLine() + Else + Console.WriteLine("Hola, " + nombredeUsuario) + Console.WriteLine("¿Has visitado www.learnxinyminutes.com?") + Console.ReadLine() 'Termina y muestra la declaración anterior. + End If + End Sub + + 'Nueve + Private Sub DeclaracionIfElse() + Console.Title = "Declaración «If / Else» | Aprende X en Y minutos" + 'A veces es importante considerar más de dos alternativas. + 'A veces, algunas de estas son mejores. + 'Cuando esto sucede, necesitaríamos más de una declaración «if». + 'Una declaración «if» es adecuada para máquinas expendedoras. + 'En las que el usuario escribe un código (A1, A2, A3) para elegir. + 'Pueden combinarse todas las elecciones en una sola declaración «if». + + Dim seleccion As String = Console.ReadLine 'Valor de la selección + Console.WriteLine("A1. para 7Up") + Console.WriteLine("A2. para Fanta") + Console.WriteLine("A3. para Dr. Pepper") + Console.WriteLine("A4. para Coca-Cola") + Console.ReadLine() + If selection = "A1" Then + Console.WriteLine("7up") + Console.ReadLine() + ElseIf selection = "A2" Then + Console.WriteLine("fanta") + Console.ReadLine() + ElseIf selection = "A3" Then + Console.WriteLine("dr. pepper") + Console.ReadLine() + ElseIf selection = "A4" Then + Console.WriteLine("coca-cola") + Console.ReadLine() + Else + Console.WriteLine("Selecciona un producto") + Console.ReadLine() + End If + + End Sub + +End Module + +``` + +## Referencias + +Aprendí Visual Basic en la aplicación de consola. Esta me permitió entender los principios de la programación para, posteriormente, aprender otros lenguajes con facilidad. + +He creado un tutorial de Visual Basic más exhaustivo para quienes quieran saber más. + +Toda la sintaxis es válida. Copia el código y pégalo en el compilador de Visual Basic y ejecuta (F5) el programa. From acc9a73c018a28a9c8ead7b108dd1fdfee7a797b Mon Sep 17 00:00:00 2001 From: ksami Date: Fri, 2 Oct 2015 22:08:27 +0800 Subject: [PATCH 022/685] [bash/en] Improved descriptions --- bash.html.markdown | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bash.html.markdown b/bash.html.markdown index 08182c2c..d4f3d424 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -51,7 +51,7 @@ echo $Variable echo "$Variable" echo '$Variable' # When you use the variable itself — assign it, export it, or else — you write -# its name without $. If you want to use variable's value, you should use $. +# its name without $. If you want to use the variable's value, you should use $. # Note that ' (single quote) won't expand the variables! # String substitution in variables @@ -70,11 +70,11 @@ echo ${Foo:-"DefaultValueIfFooIsMissingOrEmpty"} # Builtin variables: # There are some useful builtin variables, like -echo "Last program return value: $?" +echo "Last program's return value: $?" echo "Script's PID: $$" -echo "Number of arguments: $#" -echo "Scripts arguments: $@" -echo "Scripts arguments separated in different variables: $1 $2..." +echo "Number of arguments passed to script: $#" +echo "All arguments passed to script: $@" +echo "Script's arguments separated into different variables: $1 $2..." # Reading a value from input: echo "What's your name?" @@ -108,8 +108,8 @@ fi # Expressions are denoted with the following format: echo $(( 10 + 5 )) -# Unlike other programming languages, bash is a shell — so it works in a context -# of current directory. You can list files and directories in the current +# Unlike other programming languages, bash is a shell so it works in the context +# of a current directory. You can list files and directories in the current # directory with the ls command: ls From 0ad95b119d1f0135bf3a9fd55cebf24d63692c11 Mon Sep 17 00:00:00 2001 From: Michele Orselli Date: Fri, 2 Oct 2015 18:24:45 +0200 Subject: [PATCH 023/685] adds some new php operators --- php.html.markdown | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/php.html.markdown b/php.html.markdown index 52ea2a95..53be5391 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -215,6 +215,14 @@ assert($a !== $d); assert(1 === '1'); assert(1 !== '1'); +// spaceship operator since PHP 7 +$a = 100; +$b = 1000; + +echo $a <=> $a; // 0 since they are equal +echo $a <=> $b; // -1 since $a < $b +echo $b <=> $a; // 1 since $b > $a + // Variables can be converted between types, depending on their usage. $integer = 1; @@ -264,6 +272,18 @@ if (false) { // ternary operator print (false ? 'Does not get printed' : 'Does'); +// ternary shortcut operator since PHP 5.3 +// equivalent of "$x ? $x : 'Does'"" +$x = false; +print($x ?: 'Does'); + +// null coalesce operator since php 7 +$a = null; +$b = 'Does print'; +echo $a ?? 'a is not set'; // prints 'a is not set' +echo $b ?? 'b is not set'; // prints 'Does print' + + $x = 0; if ($x === '0') { print 'Does not print'; From 57ea4af17c7ab17e9c32096c2579e0a985e44781 Mon Sep 17 00:00:00 2001 From: Ian Bertolacci Date: Fri, 2 Oct 2015 10:31:25 -0600 Subject: [PATCH 024/685] Updated info for Chapel 1.12.0 --- chapel.html.markdown | 196 +++++++++++++++++++++---------------------- 1 file changed, 98 insertions(+), 98 deletions(-) diff --git a/chapel.html.markdown b/chapel.html.markdown index 8a88a652..1d0abe6e 100644 --- a/chapel.html.markdown +++ b/chapel.html.markdown @@ -27,7 +27,7 @@ writeln( "There are ", 3, " commas (\",\") in this line of code" ); stdout.writeln( "This goes to standard output, just like plain writeln() does"); stderr.writeln( "This goes to standard error" ); -// Variables don't have to be explicitly typed as long as +// Variables don't have to be explicitly typed as long as // the compiler can figure out the type that it will hold. var myVar = 10; // 10 is an int, so myVar is implicitly an int myVar = -10; @@ -65,9 +65,9 @@ const almostPi: real = 22.0/7.0; param compileTimeConst: int = 16; // The config modifier allows values to be set at the command line -// and is much easier than the usual getOpts debacle +// and is much easier than the usual getOpts debacle // config vars and consts can be changed through the command line at run time -config var varCmdLineArg: int = -123; +config var varCmdLineArg: int = -123; config const constCmdLineArg: int = 777; // Set with --VarName=Value or --VarName Value at run time @@ -119,9 +119,9 @@ a *= thatInt; // Times-equals ( a = a * thatInt; ) b &&= thatBool; // Logical-and-equals ( b = b && thatBool; ) a <<= 3; // Left-bit-shift-equals ( a = a << 10; ) // and many, many more. -// Unlike other C family languages there are no +// Unlike other C family languages there are no // pre/post-increment/decrement operators like -// ++j, --j, j++, j-- +// ++j, --j, j++, j-- // Swap operator var old_this = thisInt; @@ -155,7 +155,7 @@ writeln( (a,b,thisInt,thatInt,thisBool,thatBool) ); // Type aliasing type chroma = int; // Type of a single hue -type RGBColor = 3*chroma; // Type representing a full color +type RGBColor = 3*chroma; // Type representing a full color var black: RGBColor = ( 0,0,0 ); var white: RGBColor = ( 255, 255, 255 ); @@ -198,7 +198,7 @@ select( inputOption ){ writeln( "Chose 'otherOption'" ); writeln( "Which has a body" ); } - otherwise { + otherwise { writeln( "Any other Input" ); writeln( "the otherwise case doesn't need a do if the body is one line" ); } @@ -221,7 +221,7 @@ do{ writeln( jSum ); // For loops are much like those in python in that they iterate over a range. -// Ranges themselves are types, and can be stuffed into variables +// Ranges themselves are types, and can be stuffed into variables // (more about that later) for i in 1..10 do write( i , ", ") ; writeln( ); @@ -240,28 +240,28 @@ for x in 1..10 { } // Ranges and Domains -// For-loops and arrays both use ranges and domains to +// For-loops and arrays both use ranges and domains to // define an index set that can be iterated over. // Ranges are single dimensional -// Domains can be multi-dimensional and can +// Domains can be multi-dimensional and can // represent indices of different types as well. // They are first-class citizen types, and can be assigned into variables var range1to10: range = 1..10; // 1, 2, 3, ..., 10 var range2to11 = 2..11; // 2, 3, 4, ..., 11 var rangeThistoThat: range = thisInt..thatInt; // using variables -var rangeEmpty: range = 100..-100 ; // this is valid but contains no indices +var rangeEmpty: range = 100..-100 ; // this is valid but contains no indices -// Ranges can be unbounded -var range1toInf: range(boundedType=BoundedRangeType.boundedLow) = 1.. ; +// Ranges can be unbounded +var range1toInf: range(boundedType=BoundedRangeType.boundedLow) = 1.. ; // 1, 2, 3, 4, 5, ... -// Note: the range(boundedType= ... ) is only +// Note: the range(boundedType= ... ) is only // necessary if we explicitly type the variable var rangeNegInfto1 = ..1; // ..., -4, -3, -2, -1, 0, 1 // Ranges can be strided using the 'by' operator. var range2to10by2: range(stridable=true) = 2..10 by 2; // 2, 4, 6, 8, 10 -// Note: the range(stridable=true) is only +// Note: the range(stridable=true) is only // necessary if we explicitly type the variable // Use by to create a reverse range @@ -275,9 +275,9 @@ var rangeCountBy: range(stridable=true) = -5..#12 by 2; // -5, -3, -1, 1, 3, 5 writeln( rangeCountBy ); // Can query properties of the range -// Print the first index, last index, number of indices, +// Print the first index, last index, number of indices, // stride, and ask if 2 is include in the range -writeln( ( rangeCountBy.first, rangeCountBy.last, rangeCountBy.length, +writeln( ( rangeCountBy.first, rangeCountBy.last, rangeCountBy.length, rangeCountBy.stride, rangeCountBy.member( 2 ) ) ); for i in rangeCountBy{ @@ -309,7 +309,7 @@ stringSet += "b"; stringSet += "c"; stringSet += "a"; // Redundant add "a" stringSet -= "c"; // Remove "c" -writeln( stringSet ); +writeln( stringSet ); // Both ranges and domains can be sliced to produce a range or domain with the // intersection of indices @@ -332,13 +332,13 @@ var intArray2: [{1..10}] int; //equivalent for i in 1..10 do intArray[i] = -i; writeln( intArray ); -// We cannot access intArray[0] because it exists outside +// We cannot access intArray[0] because it exists outside // of the index set, {1..10}, we defined it to have. // intArray[11] is illegal for the same reason. var realDomain: domain(2) = {1..5,1..7}; var realArray: [realDomain] real; -var realArray2: [1..5,1..7] real; // Equivalent +var realArray2: [1..5,1..7] real; // Equivalent var realArray3: [{1..5,1..7}] real; // Equivalent for i in 1..5 { @@ -350,7 +350,7 @@ for i in 1..5 { } // Arrays have domains as members that we can iterate over -for idx in realArray.domain { // Again, idx is a 2*int tuple +for idx in realArray.domain { // Again, idx is a 2*int tuple realArray[idx] = 1 / realArray[idx[1],idx[2]]; // Access by tuple and list } @@ -377,7 +377,7 @@ var thatArray : [{0..5}] int; // Simply assign one to the other. // This copies thisArray into thatArray, instead of just creating a reference. // Modifying thisArray does not also modify thatArray. -thatArray = thisArray; +thatArray = thisArray; thatArray[1] = -1; writeln( (thisArray, thatArray) ); @@ -389,12 +389,12 @@ writeln( (thisArray, thatArray) ); var thisPlusThat = thisArray + thatArray; writeln( thisPlusThat ); -// Arrays and loops can also be expressions, where loop +// Arrays and loops can also be expressions, where loop // body's expression is the result of each iteration. var arrayFromLoop = for i in 1..10 do i; writeln( arrayFromLoop ); -// An expression can result in nothing, +// An expression can result in nothing, // such as when filtering with an if-expression var evensOrFives = for i in 1..10 do if (i % 2 == 0 || i % 5 == 0) then i; @@ -407,7 +407,7 @@ var evensOrFivesAgain = [ i in 1..10 ] if (i % 2 == 0 || i % 5 == 0) then i; // Or over the values of the array arrayFromLoop = [ value in arrayFromLoop ] value + 1; -// Note: this notation can get somewhat tricky. For example: +// Note: this notation can get somewhat tricky. For example: // evensOrFives = [ i in 1..10 ] if (i % 2 == 0 || i % 5 == 0) then i; // would break. // The reasons for this are explained in depth when discussing zipped iterators. @@ -431,7 +431,7 @@ proc addThree( n ) { doublePrint( addThree( fibonacci( 20 ) ) ); // Can also take 'unlimited' number of parameters -proc maxOf( x ...?k ) { +proc maxOf( x ...?k ) { // x refers to a tuple of one type, with k elements var maximum = x[1]; for i in 2..k do maximum = if (maximum < x[i]) then x[i] else maximum; @@ -439,7 +439,7 @@ proc maxOf( x ...?k ) { } writeln( maxOf( 1, -10, 189, -9071982, 5, 17, 20001, 42 ) ); -// The ? operator is called the query operator, and is used to take +// The ? operator is called the query operator, and is used to take // undetermined values (like tuple or array sizes, and generic types). // Taking arrays as parameters. @@ -463,7 +463,7 @@ writeln( defaultsProc( x=11 ) ); writeln( defaultsProc( x=12, y=5.432 ) ); writeln( defaultsProc( y=9.876, x=13 ) ); -// Intent modifiers on the arguments convey how +// Intent modifiers on the arguments convey how // those arguments are passed to the procedure // in: copy arg in, but not out // out: copy arg out, but not in @@ -489,18 +489,18 @@ writeln( "Outside After: ", (inVar, outVar, inoutVar, refVar) ); // Similarly we can define intents on the return type // refElement returns a reference to an element of array proc refElement( array : [?D] ?T, idx ) ref : T { - return array[ idx ]; // returns a reference to + return array[ idx ]; // returns a reference to } var myChangingArray : [1..5] int = [1,2,3,4,5]; writeln( myChangingArray ); -// Store reference to element in ref variable -ref refToElem = refElement( myChangingArray, 5 ); +// Store reference to element in ref variable +ref refToElem = refElement( myChangingArray, 5 ); writeln( refToElem ); refToElem = -2; // modify reference which modifies actual value in array writeln( refToElem ); writeln( myChangingArray ); -// This makes more practical sense for class methods where references to +// This makes more practical sense for class methods where references to // elements in a data-structure are returned via a method or iterator // We can query the type of arguments to generic procedures @@ -520,7 +520,7 @@ genericProc( 1.0+2.0i, 3.0+4.0i ); // We can also enforce a form of polymorphism with the 'where' clause // This allows the compiler to decide which function to use. -// Note: that means that all information needs to be known at compile-time. +// Note: that means that all information needs to be known at compile-time. // The param modifier on the arg is used to enforce this constraint. proc whereProc( param N : int ): void where ( N > 0 ) { @@ -534,7 +534,7 @@ proc whereProc( param N : int ): void whereProc( 10 ); whereProc( -1 ); -// whereProc( 0 ) would result in a compiler error because there +// whereProc( 0 ) would result in a compiler error because there // are no functions that satisfy the where clause's condition. // We could have defined a whereProc without a where clause that would then have // served as a catch all for all the other cases (of which there is only one). @@ -543,7 +543,7 @@ whereProc( -1 ); // We can define the unary operators: // + - ! ~ // and the binary operators: -// + - * / % ** == <= >= < > << >> & | ˆ by +// + - * / % ** == <= >= < > << >> & | ˆ by // += -= *= /= %= **= &= |= ˆ= <<= >>= <=> // Boolean exclusive or operator @@ -569,14 +569,14 @@ Note: You could break everything if you get careless with your overloads. This here will break everything. Don't do it. proc +( left: int, right: int ): int{ return left - right; -} +} */ -// Iterators are a sisters to the procedure, and almost +// Iterators are a sisters to the procedure, and almost // everything about procedures also applies to iterators -// However, instead of returning a single value, +// However, instead of returning a single value, // iterators yield many values to a loop. -// This is useful when a complicated set or order of iterations is needed but +// This is useful when a complicated set or order of iterations is needed but // allows the code defining the iterations to be separate from the loop body. iter oddsThenEvens( N: int ): int { for i in 1..N by 2 do @@ -601,15 +601,15 @@ for i in absolutelyNothing( 10 ){ writeln( "Woa there! absolutelyNothing yielded ", i ); } -// We can zipper together two or more iterators (who have the same number -// of iterations) using zip() to create a single zipped iterator, where each -// iteration of the zipped iterator yields a tuple of one value yielded +// We can zipper together two or more iterators (who have the same number +// of iterations) using zip() to create a single zipped iterator, where each +// iteration of the zipped iterator yields a tuple of one value yielded // from each iterator. // Ranges have implicit iterators -for (positive, negative) in zip( 1..5, -5..-1) do +for (positive, negative) in zip( 1..5, -5..-1) do writeln( (positive, negative) ); -// Zipper iteration is quite important in the assignment of arrays, +// Zipper iteration is quite important in the assignment of arrays, // slices of arrays, and array/loop expressions. var fromThatArray : [1..#5] int = [1,2,3,4,5]; var toThisArray : [100..#5] int; @@ -629,10 +629,10 @@ for (i, j) in zip( toThisArray.domain, -100..#5 ){ } writeln( toThisArray ); -// This is all very important in undestanding why the statement +// This is all very important in undestanding why the statement // var iterArray : [1..10] int = [ i in 1..10 ] if ( i % 2 == 1 ) then j; // exhibits a runtime error. -// Even though the domain of the array and the loop-expression are +// Even though the domain of the array and the loop-expression are // the same size, the body of the expression can be though of as an iterator. // Because iterators can yield nothing, that iterator yields a different number // of things than the domain of the array or loop, which is not allowed. @@ -641,8 +641,8 @@ writeln( toThisArray ); // They currently lack privatization class MyClass { // Member variables - var memberInt : int; - var memberBool : bool = true; + var memberInt : int; + var memberBool : bool = true; // Classes have default constructors that don't need to be coded (see below) // Our explicitly defined constructor @@ -659,28 +659,28 @@ class MyClass { proc setMemberInt( val: int ){ this.memberInt = val; } - + proc setMemberBool( val: bool ){ this.memberBool = val; } - proc getMemberInt( ): int{ + proc getMemberInt( ): int{ return this.memberInt; } proc getMemberBool( ): bool { return this.memberBool; } - + } - + // Construct using default constructor, using default values var myObject = new MyClass( 10 ); myObject = new MyClass( memberInt = 10 ); // Equivalent writeln( myObject.getMemberInt( ) ); // ... using our values var myDiffObject = new MyClass( -1, true ); - myDiffObject = new MyClass( memberInt = -1, + myDiffObject = new MyClass( memberInt = -1, memberBool = true ); // Equivalent writeln( myDiffObject ); @@ -689,7 +689,7 @@ var myOtherObject = new MyClass( 1.95 ); myOtherObject = new MyClass( val = 1.95 ); // Equivalent writeln( myOtherObject.getMemberInt( ) ); -// We can define an operator on our class as well but +// We can define an operator on our class as well but // the definition has to be outside the class definition proc +( A : MyClass, B : MyClass) : MyClass { return new MyClass( memberInt = A.getMemberInt( ) + B.getMemberInt( ), @@ -715,46 +715,46 @@ class GenericClass { type classType; var classDomain: domain(1); var classArray: [classDomain] classType; - + // Explicit constructor proc GenericClass( type classType, elements : int ){ this.classDomain = {1..#elements}; } - + // Copy constructor - // Note: We still have to put the type as an argument, but we can + // Note: We still have to put the type as an argument, but we can // default to the type of the other object using the query (?) operator // Further, we can take advantage of this to allow our copy constructor // to copy classes of different types and cast on the fly - proc GenericClass( other : GenericClass(?otherType), + proc GenericClass( other : GenericClass(?otherType), type classType = otherType ) { this.classDomain = other.classDomain; // Copy and cast - for idx in this.classDomain do this[ idx ] = other[ idx ] : classType; + for idx in this.classDomain do this[ idx ] = other[ idx ] : classType; } - - // Define bracket notation on a GenericClass + + // Define bracket notation on a GenericClass // object so it can behave like a normal array // i.e. objVar[ i ] or objVar( i ) proc this( i : int ) ref : classType { return this.classArray[ i ]; } - - // Define an implicit iterator for the class + + // Define an implicit iterator for the class // to yield values from the array to a loop // i.e. for i in objVar do .... iter these( ) ref : classType { for i in this.classDomain do yield this[i]; } - + } var realList = new GenericClass( real, 10 ); -// We can assign to the member array of the object using the bracket +// We can assign to the member array of the object using the bracket // notation that we defined ( proc this( i: int ){ ... } ) for i in realList.classDomain do realList[i] = i + 1.0; -// We can iterate over the values in our list with the iterator +// We can iterate over the values in our list with the iterator // we defined ( iter these( ){ ... } ) for value in realList do write( value, ", " ); writeln( ); @@ -777,23 +777,23 @@ writeln( ); module OurModule { // We can use modules inside of other modules. use Time; // Time is one of the standard modules. - + // We'll use this procedure in the parallelism section. proc countdown( seconds: int ){ for i in 1..seconds by -1 { writeln( i ); sleep( 1 ); } - } - - // Submodules of OurModule + } + + // Submodules of OurModule // It is possible to create arbitrarily deep module nests. module ChildModule { proc foo(){ writeln( "ChildModule.foo()"); } } - + module SiblingModule { proc foo(){ writeln( "SiblingModule.foo()" ); @@ -806,7 +806,7 @@ module OurModule { use OurModule; // At this point we have not used ChildModule or SiblingModule so their symbols -// (i.e. foo ) are not available to us. +// (i.e. foo ) are not available to us. // However, the module names are, and we can explicitly call foo() through them. SiblingModule.foo(); // Calls SiblingModule.foo() @@ -821,13 +821,13 @@ foo(); // Less explicit call on ChildModule.foo() proc main(){ // Parallelism - // In other languages, parallelism is typically done with + // In other languages, parallelism is typically done with // complicated libraries and strange class structure hierarchies. // Chapel has it baked right into the language. - // A begin statement will spin the body of that statement off + // A begin statement will spin the body of that statement off // into one new task. - // A sync statement will ensure that the progress of the main + // A sync statement will ensure that the progress of the main // task will not progress until the children have synced back up. sync { begin { // Start of new task's body @@ -848,7 +848,7 @@ proc main(){ printFibb( 20 ); // new task printFibb( 10 ); // new task printFibb( 5 ); // new task - { + { // This is a nested statement body and thus is a single statement // to the parent statement and is executed by a single task writeln( "this gets" ); @@ -867,26 +867,26 @@ proc main(){ // NOTE! coforall should be used only for creating tasks! // Using it to iterating over a structure is very a bad idea! - // forall loops are another parallel loop, but only create a smaller number + // forall loops are another parallel loop, but only create a smaller number // of tasks, specifically --dataParTasksPerLocale=number of task forall i in 1..100 { write( i, ", "); } writeln( ); - // Here we see that there are sections that are in order, followed by + // Here we see that there are sections that are in order, followed by // a section that would not follow ( e.g. 1, 2, 3, 7, 8, 9, 4, 5, 6, ). // This is because each task is taking on a chunk of the range 1..10 // (1..3, 4..6, or 7..9) doing that chunk serially, but each task happens // in parallel. // Your results may depend on your machine and configuration - // For both the forall and coforall loops, the execution of the + // For both the forall and coforall loops, the execution of the // parent task will not continue until all the children sync up. // forall loops are particularly useful for parallel iteration over arrays. // Lets run an experiment to see how much faster a parallel loop is use Time; // Import the Time module to use Timer objects - var timer: Timer; + var timer: Timer; var myBigArray: [{1..4000,1..4000}] real; // Large array we will write into // Serial Experiment @@ -906,7 +906,7 @@ proc main(){ timer.stop( ); // Stop timer writeln( "Parallel: ", timer.elapsed( ) ); // Print elapsed time timer.clear( ); - // You may have noticed that (depending on how many cores you have) + // You may have noticed that (depending on how many cores you have) // that the parallel loop went faster than the serial loop // The bracket style loop-expression described @@ -926,15 +926,15 @@ proc main(){ writeln( uranium.read() ); var replaceWith = 239; - var was = uranium.exchange( replaceWith ); + var was = uranium.exchange( replaceWith ); writeln( "uranium was ", was, " but is now ", replaceWith ); var isEqualTo = 235; if ( uranium.compareExchange( isEqualTo, replaceWith ) ) { - writeln( "uranium was equal to ", isEqualTo, + writeln( "uranium was equal to ", isEqualTo, " so replaced value with ", replaceWith ); } else { - writeln( "uranium was not equal to ", isEqualTo, + writeln( "uranium was not equal to ", isEqualTo, " so value stays the same... whatever it was" ); } @@ -989,14 +989,14 @@ proc main(){ } } - // Heres an example of using atomics and a synch variable to create a + // Heres an example of using atomics and a synch variable to create a // count-down mutex (also known as a multiplexer) var count: atomic int; // our counter var lock$: sync bool; // the mutex lock count.write( 2 ); // Only let two tasks in at a time. lock$.writeXF( true ); // Set lock$ to full (unlocked) - // Note: The value doesnt actually matter, just the state + // Note: The value doesnt actually matter, just the state // (full:unlocked / empty:locked) // Also, writeXF() fills (F) the sync var regardless of its state (X) @@ -1005,10 +1005,10 @@ proc main(){ do{ lock$; // Read lock$ (wait) }while ( count.read() < 1 ); // Keep waiting until a spot opens up - + count.sub(1); // decrement the counter lock$.writeXF( true ); // Set lock$ to full (signal) - + // Actual 'work' writeln( "Task #", task, " doing work." ); sleep( 2 ); @@ -1027,13 +1027,13 @@ proc main(){ // 'maxloc' gives max value and index of the max value // Note: We have to zip the array and domain together with the zip iterator - var (theMaxValue, idxOfMax) = maxloc reduce zip(listOfValues, + var (theMaxValue, idxOfMax) = maxloc reduce zip(listOfValues, listOfValues.domain); - + writeln( (sumOfValues, maxValue, idxOfMax, listOfValues[ idxOfMax ] ) ); // Scans apply the operation incrementally and return an array of the - // value of the operation at that index as it progressed through the + // value of the operation at that index as it progressed through the // array from array.domain.low to array.domain.high var runningSumOfValues = + scan listOfValues; var maxScan = max scan listOfValues; @@ -1046,14 +1046,14 @@ Who is this tutorial for? ------------------------- This tutorial is for people who want to learn the ropes of chapel without having to hear about what fiber mixture the ropes are, or how they were braided, or how the braid configurations differ between one another. -It won't teach you how to develop amazingly performant code, and it's not exhaustive. +It won't teach you how to develop amazingly performant code, and it's not exhaustive. Refer to the [language specification](http://chapel.cray.com/language.html) and the [module documentation](http://chapel.cray.com/docs/latest/) for more details. Occasionally check back here and on the [Chapel site](http://chapel.cray.com) to see if more topics have been added or more tutorials created. ### What this tutorial is lacking: - * Exposition of the standard modules + * Exposition of the [standard modules](http://chapel.cray.com/docs/latest/modules/modules.html) * Multiple Locales (distributed memory system) * Records * Parallel iterators @@ -1061,11 +1061,11 @@ Occasionally check back here and on the [Chapel site](http://chapel.cray.com) to Your input, questions, and discoveries are important to the developers! ----------------------------------------------------------------------- -The Chapel language is still in-development (version 1.11.0), so there are occasional hiccups with performance and language features. +The Chapel language is still in-development (version 1.12.0), so there are occasional hiccups with performance and language features. The more information you give the Chapel development team about issues you encounter or features you would like to see, the better the language becomes. Feel free to email the team and other developers through the [sourceforge email lists](https://sourceforge.net/p/chapel/mailman). -If you're really interested in the development of the compiler or contributing to the project, +If you're really interested in the development of the compiler or contributing to the project, [check out the master Github repository](https://github.com/chapel-lang/chapel). It is under the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0). @@ -1074,10 +1074,10 @@ Installing the Compiler Chapel can be built and installed on your average 'nix machine (and cygwin). [Download the latest release version](https://github.com/chapel-lang/chapel/releases/) -and its as easy as +and its as easy as - 1. `tar -xvf chapel-1.11.0.tar.gz` - 2. `cd chapel-1.11.0` + 1. `tar -xvf chapel-1.12.0.tar.gz` + 2. `cd chapel-1.12.0` 3. `make` 4. `source util/setchplenv.bash # or .sh or .csh or .fish` From 795583521a81868ac96db53533fab4dd0c6a7285 Mon Sep 17 00:00:00 2001 From: Eric McCormick Date: Fri, 2 Oct 2015 13:50:07 -0500 Subject: [PATCH 025/685] fixed missing ! to create an actual comment ... which was causing everything subsequently to be rendered as code block, as the triple back tick (which should be inside a comment) wasn't being escaped as part of a comment --- markdown.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown.html.markdown b/markdown.html.markdown index 6d19710f..acb808ea 100644 --- a/markdown.html.markdown +++ b/markdown.html.markdown @@ -160,7 +160,7 @@ def foobar end \`\`\` -<-- The above text doesn't require indenting, plus Github will use syntax + From fb43ef2942f29ece285be3e8944c91bde6306095 Mon Sep 17 00:00:00 2001 From: Dhwani Shah Date: Fri, 2 Oct 2015 14:12:15 -0500 Subject: [PATCH 026/685] Added example of when string concatenation can also be helpful with combination of strings with html tags as this is important to understand when templating say output code from a database transaction. --- php.html.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/php.html.markdown b/php.html.markdown index 3fcce264..86fb14e5 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -102,6 +102,8 @@ END; // String concatenation is done with . echo 'This string ' . 'is concatenated'; +// Strings concatenation can also be combined with html elements +echo 'This string is' . '' . 'bold with strong tags ' . '.' /******************************** From 8e388cd3344b90cfdc02741359850a2352a8f9b7 Mon Sep 17 00:00:00 2001 From: Dhwani Shah Date: Fri, 2 Oct 2015 14:30:45 -0500 Subject: [PATCH 027/685] Added section on how to declare and initialize both single varible and multiple varibles with the same value. Important concept for large structured programs. Seperated this a little bit. --- java.html.markdown | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/java.html.markdown b/java.html.markdown index 928eb39f..0f5b39af 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -47,10 +47,30 @@ public class LearnJava { /////////////////////////////////////// - // Types & Variables + // Variables /////////////////////////////////////// - + + /* + * Variable Declaration + */ // Declare a variable using + int fooInt; + // Declare multiple variables of same type , , + int fooInt1, fooInt2, fooInt3; + + /* + * Variable Initialization + */ + + // Initialize a variable using = + int fooInt = 1; + // Initialize multiple variables of same type with same value , , = + int fooInt1, fooInt2, fooInt3; + fooInt1 = fooInt2 = fooInt3 = 1; + + /* + * Variable types + */ // Byte - 8-bit signed two's complement integer // (-128 <= byte <= 127) byte fooByte = 100; From 231cd629cab3553d126f8cca04a034c995c4668f Mon Sep 17 00:00:00 2001 From: Dhwani Shah Date: Fri, 2 Oct 2015 14:45:25 -0500 Subject: [PATCH 028/685] Update java.html.markdown --- java.html.markdown | 104 ++++++--------------------------------------- 1 file changed, 14 insertions(+), 90 deletions(-) diff --git a/java.html.markdown b/java.html.markdown index 0f5b39af..745741f8 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -1,18 +1,3 @@ ---- -language: java -contributors: - - ["Jake Prather", "http://github.com/JakeHP"] - - ["Jakukyo Friel", "http://weakish.github.io"] - - ["Madison Dickson", "http://github.com/mix3d"] - - ["Simon Morgan", "http://sjm.io/"] -filename: LearnJava.java ---- - -Java is a general-purpose, concurrent, class-based, object-oriented computer -programming language. -[Read more here.](http://docs.oracle.com/javase/tutorial/java/) - -```java // Single-line comments start with // /* Multi-line comments look like this. @@ -47,30 +32,10 @@ public class LearnJava { /////////////////////////////////////// - // Variables + // Types & Variables /////////////////////////////////////// - - /* - * Variable Declaration - */ + // Declare a variable using - int fooInt; - // Declare multiple variables of same type , , - int fooInt1, fooInt2, fooInt3; - - /* - * Variable Initialization - */ - - // Initialize a variable using = - int fooInt = 1; - // Initialize multiple variables of same type with same value , , = - int fooInt1, fooInt2, fooInt3; - fooInt1 = fooInt2 = fooInt3 = 1; - - /* - * Variable types - */ // Byte - 8-bit signed two's complement integer // (-128 <= byte <= 127) byte fooByte = 100; @@ -437,26 +402,26 @@ class PennyFarthing extends Bicycle { // Example - Food: public interface Edible { - public void eat(); // Any class that implements this interface, must + public void eat(); // Any class that implements this interface, must // implement this method. } public interface Digestible { - public void digest(); + public void digest(); } // We can now create a class that implements both of these interfaces. public class Fruit implements Edible, Digestible { @Override - public void eat() { - // ... - } + public void eat() { + // ... + } @Override - public void digest() { - // ... - } + public void digest() { + // ... + } } // In Java, you can extend only one class, but you can implement many @@ -464,51 +429,10 @@ public class Fruit implements Edible, Digestible { public class ExampleClass extends ExampleClassParent implements InterfaceOne, InterfaceTwo { @Override - public void InterfaceOneMethod() { - } + public void InterfaceOneMethod() { + } @Override - public void InterfaceTwoMethod() { - } + public void InterfaceTwoMethod() { + } } -``` - -## Further Reading - -The links provided here below are just to get an understanding of the topic, feel free to Google and find specific examples. - -**Official Oracle Guides**: - -* [Java Tutorial Trail from Sun / Oracle](http://docs.oracle.com/javase/tutorial/index.html) - -* [Java Access level modifiers](http://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html) - -* [Object-Oriented Programming Concepts](http://docs.oracle.com/javase/tutorial/java/concepts/index.html): - * [Inheritance](http://docs.oracle.com/javase/tutorial/java/IandI/subclasses.html) - * [Polymorphism](http://docs.oracle.com/javase/tutorial/java/IandI/polymorphism.html) - * [Abstraction](http://docs.oracle.com/javase/tutorial/java/IandI/abstract.html) - -* [Exceptions](http://docs.oracle.com/javase/tutorial/essential/exceptions/index.html) - -* [Interfaces](http://docs.oracle.com/javase/tutorial/java/IandI/createinterface.html) - -* [Generics](http://docs.oracle.com/javase/tutorial/java/generics/index.html) - -* [Java Code Conventions](http://www.oracle.com/technetwork/java/codeconv-138413.html) - -**Online Practice and Tutorials** - -* [Learneroo.com - Learn Java](http://www.learneroo.com) - -* [Codingbat.com](http://codingbat.com/java) - - -**Books**: - -* [Head First Java](http://www.headfirstlabs.com/books/hfjava/) - -* [Thinking in Java](http://www.mindview.net/Books/TIJ/) - -* [Objects First with Java](http://www.amazon.com/Objects-First-Java-Practical-Introduction/dp/0132492660) - -* [Java The Complete Reference](http://www.amazon.com/gp/product/0071606300) From c7240369b6465f2a736cb61d1bff89c971e76929 Mon Sep 17 00:00:00 2001 From: Dhwani Shah Date: Fri, 2 Oct 2015 14:47:17 -0500 Subject: [PATCH 029/685] Update java.html.markdown --- java.html.markdown | 80 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 68 insertions(+), 12 deletions(-) diff --git a/java.html.markdown b/java.html.markdown index 745741f8..928eb39f 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -1,3 +1,18 @@ +--- +language: java +contributors: + - ["Jake Prather", "http://github.com/JakeHP"] + - ["Jakukyo Friel", "http://weakish.github.io"] + - ["Madison Dickson", "http://github.com/mix3d"] + - ["Simon Morgan", "http://sjm.io/"] +filename: LearnJava.java +--- + +Java is a general-purpose, concurrent, class-based, object-oriented computer +programming language. +[Read more here.](http://docs.oracle.com/javase/tutorial/java/) + +```java // Single-line comments start with // /* Multi-line comments look like this. @@ -402,26 +417,26 @@ class PennyFarthing extends Bicycle { // Example - Food: public interface Edible { - public void eat(); // Any class that implements this interface, must + public void eat(); // Any class that implements this interface, must // implement this method. } public interface Digestible { - public void digest(); + public void digest(); } // We can now create a class that implements both of these interfaces. public class Fruit implements Edible, Digestible { @Override - public void eat() { - // ... - } + public void eat() { + // ... + } @Override - public void digest() { - // ... - } + public void digest() { + // ... + } } // In Java, you can extend only one class, but you can implement many @@ -429,10 +444,51 @@ public class Fruit implements Edible, Digestible { public class ExampleClass extends ExampleClassParent implements InterfaceOne, InterfaceTwo { @Override - public void InterfaceOneMethod() { - } + public void InterfaceOneMethod() { + } @Override - public void InterfaceTwoMethod() { - } + public void InterfaceTwoMethod() { + } } +``` + +## Further Reading + +The links provided here below are just to get an understanding of the topic, feel free to Google and find specific examples. + +**Official Oracle Guides**: + +* [Java Tutorial Trail from Sun / Oracle](http://docs.oracle.com/javase/tutorial/index.html) + +* [Java Access level modifiers](http://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html) + +* [Object-Oriented Programming Concepts](http://docs.oracle.com/javase/tutorial/java/concepts/index.html): + * [Inheritance](http://docs.oracle.com/javase/tutorial/java/IandI/subclasses.html) + * [Polymorphism](http://docs.oracle.com/javase/tutorial/java/IandI/polymorphism.html) + * [Abstraction](http://docs.oracle.com/javase/tutorial/java/IandI/abstract.html) + +* [Exceptions](http://docs.oracle.com/javase/tutorial/essential/exceptions/index.html) + +* [Interfaces](http://docs.oracle.com/javase/tutorial/java/IandI/createinterface.html) + +* [Generics](http://docs.oracle.com/javase/tutorial/java/generics/index.html) + +* [Java Code Conventions](http://www.oracle.com/technetwork/java/codeconv-138413.html) + +**Online Practice and Tutorials** + +* [Learneroo.com - Learn Java](http://www.learneroo.com) + +* [Codingbat.com](http://codingbat.com/java) + + +**Books**: + +* [Head First Java](http://www.headfirstlabs.com/books/hfjava/) + +* [Thinking in Java](http://www.mindview.net/Books/TIJ/) + +* [Objects First with Java](http://www.amazon.com/Objects-First-Java-Practical-Introduction/dp/0132492660) + +* [Java The Complete Reference](http://www.amazon.com/gp/product/0071606300) From 63793af2e955f8a8abe698c4a70809cfbff63452 Mon Sep 17 00:00:00 2001 From: Dhwani Shah Date: Fri, 2 Oct 2015 14:54:09 -0500 Subject: [PATCH 030/685] Added section on how to declare and initialize both single varible and multiple varibles with the same value. Important concept for large structured programs. Seperated this a little bit. --- java.html.markdown | 24 ++++++++++++++++++++++-- php.html.markdown | 4 +--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/java.html.markdown b/java.html.markdown index 928eb39f..1aa06570 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -47,10 +47,30 @@ public class LearnJava { /////////////////////////////////////// - // Types & Variables + // Variables /////////////////////////////////////// - + + /* + * Variable Declaration + */ // Declare a variable using + int fooInt; + // Declare multiple variables of the same type , , + int fooInt1, fooInt2, fooInt3; + + /* + * Variable Initialization + */ + + // Initialize a variable using = + int fooInt = 1; + // Initialize multiple variables of same type with same value , , = + int fooInt1, fooInt2, fooInt3; + fooInt1 = fooInt2 = fooInt3 = 1; + + /* + * Variable types + */ // Byte - 8-bit signed two's complement integer // (-128 <= byte <= 127) byte fooByte = 100; diff --git a/php.html.markdown b/php.html.markdown index 86fb14e5..1c2204fd 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -101,9 +101,7 @@ $sgl_quotes END; // String concatenation is done with . -echo 'This string ' . 'is concatenated'; -// Strings concatenation can also be combined with html elements -echo 'This string is' . '' . 'bold with strong tags ' . '.' +echo 'This string ' . 'is concatenated'; /******************************** From 4e139ae2f528a08eb47427ea790bd176092e1bf0 Mon Sep 17 00:00:00 2001 From: Dhwani Shah Date: Fri, 2 Oct 2015 14:57:39 -0500 Subject: [PATCH 031/685] unneeded change fixed --- php.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php.html.markdown b/php.html.markdown index 1c2204fd..d4131992 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -101,7 +101,7 @@ $sgl_quotes END; // String concatenation is done with . -echo 'This string ' . 'is concatenated'; +echo 'This string ' . 'is concatenated'; /******************************** @@ -689,4 +689,4 @@ If you're coming from a language with good package management, check out [Composer](http://getcomposer.org/). For common standards, visit the PHP Framework Interoperability Group's -[PSR standards](https://github.com/php-fig/fig-standards). +[PSR standards](https://github.com/php-fig/fig-standards). \ No newline at end of file From 18058567c4e7570ca7fd053299eefd0d36658329 Mon Sep 17 00:00:00 2001 From: Matteo Taroli Date: Fri, 2 Oct 2015 22:17:16 +0200 Subject: [PATCH 032/685] Add French translation for Perl 5 --- fr-fr/perl-fr.html.markdown | 166 ++++++++++++++++++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 fr-fr/perl-fr.html.markdown diff --git a/fr-fr/perl-fr.html.markdown b/fr-fr/perl-fr.html.markdown new file mode 100644 index 00000000..7a061da7 --- /dev/null +++ b/fr-fr/perl-fr.html.markdown @@ -0,0 +1,166 @@ +--- +name: perl +category: language +language: perl +filename: learnperl-fr.pl +contributors: + - ["Korjavin Ivan", "http://github.com/korjavin"] +translators: + - ["Matteo Taroli", "http://www.matteotaroli.be"] +lang: fr-fr +--- +Perl 5 est un langage de programmation riche en fonctionnalité, avec plus de 25 ans de développement. + +Perl 5 fonctionne sur plus de 100 plateformes, allant des pc portables aux mainframes et +est autant adapté à un prototypage rapide qu'à des projets de grande envergure. + +```perl +# Les commentaires en une ligne commencent par un dièse + + +#### Types de variables de Perl + +# Les variables comment par un symbole précisant le type. +# Un nom de variable valide commence par une lettre ou un underscore, +# suivi d'un nombre quelconque de lettres, chiffres ou underscores. + +### Perl a trois types principaux de variables: $scalaire, @tableau and %hash + +## Scalaires +# Un scalaire représente une valeure unique : +my $animal = "chameau"; +my $reponse = 42; + +# Les valeurs scalaires peuvent être des strings, des entiers ou des nombres à virgule flottante +# et Perl les convertira automatiquement entre elles quand nécessaire. + +## Tableaux +# Un tableau représente une liste de valeurs : +my @animaux = ("chameau", "lama", "chouette"); +my @nombres = (23, 42, 69); +my @melange = ("chameau", 42, 1.23); + +## Hashes +# Un hash représente un ensemble de paires de clé/valeur : +my %fruit_couleur = ("pomme", "rouge", "banane", "jaune"); + +# Vous pouvez utiliser des espaces et l'opérateur "=>" pour les disposer plus joliment : + +my %fruit_couleur = ( + pomme => "rouge", + banane => "jaune" +); + +# Les scalaires, tableaux et hashes sont plus amplement documentés dans le perldata +# (perldoc perldata) + +# Des types de données plus complexes peuvent être construits en utilisant des références, +# vous permettant de construire des listes et des hashes à l'intérieur d'autres listes et hashes. + +#### Conditions et boucles + +# Perl possède la plupart des conditions et boucles habituelles. + +if ($var) { + ... +} elsif ($var eq 'bar') { + ... +} else { + ... +} + +unless (condition) { + ... +} +# Ceci est fourni en tant que version plus lisible de "if (!condition)" + +# la postcondition à la sauce Perl + +print "Yow!" if $zippy; +print "Nous n'avons pas de banane." unless $bananes; + +# while +while (condition) { + ... +} + +# boucle for et iteration +for (my $i = 0; $i < $max; $i++) { + print "l'index est $i"; +} + +for (my $i = 0; $i < @elements; $i++) { + print "L'élément courant est " . $elements[$i]; +} + +for my $element (@elements) { + print $element; +} + +# implicitement + +for (@elements) { + print; +} + + +#### Expressions régulières + +# Le support des expressions régulières par Perl est aussi large que profond +# et est sujet à une longue documentation sur perlrequick, perlretut et ailleurs. +# Cependant, pour faire court : + +# Simple correspondance +if (/foo/) { ... } # vrai si $_ contient "foo" +if ($a =~ /foo/) { ... } # vrai si $a contient "foo" + +# Simple substitution + +$a =~ s/foo/bar/; # remplace foo par bar dans $a +$a =~ s/foo/bar/g; # remplace TOUTES LES INSTANCES de foo par bar dans $a + + +#### Fichiers and E/S + +# Vous pouvez ouvrir un fichier pour y écrire ou pour le lire avec la fonction "open()". + +open(my $in, "<", "input.txt") or die "Impossible d'ouvrir input.txt: $!"; +open(my $out, ">", "output.txt") or die "Impossible d'ouvrir output.txt: $!"; +open(my $log, ">>", "my.log") or die "Impossible d'ouvrir my.log: $!"; + +# Vous pouvez lire depuis un descripteur de fichier grâce à l'opérateur "<>". +# Dans un contexte scalaire, il lit une seule ligne depuis le descripteur de fichier +# et dans un contexte de liste, il lit le fichier complet, assignant chaque ligne à un +# élément de la liste : + +my $ligne = <$in> +my $lignes = <$in> + +#### Ecrire des sous-programmes + +# Ecrire des sous-programmes est facile : + +sub logger { + my $logmessage = shift; + + open my $logfile, ">>", "my.log" or die "Impossible d'ouvrir my.log: $!"; + + print $logfile $logmessage; +} + +# Maintenant, nous pouvons utiliser le sous-programme comme n'importe quelle fonction intégrée : + +logger("On a un sous-programme de logging!!"); +``` + +#### Utiliser des modules Perl + +Les modules Perl fournissent une palette de fonctionnalités vous évitant de réinventer la roue et peuvent être téléchargés depuis CPAN (http://www.cpan.org/). Un certain nombre de modules populaires sont inclus dans la distribution même de Perl. + +Perlfaq contiens des questions et réponses liées aux tâches habituelles et propose souvent des suggestions quant aux bons modules à utiliser. + +#### Pour en savoir plus + - [perl-tutorial](http://perl-tutorial.org/) + - [Learn at www.perl.com](http://www.perl.org/learn.html) + - [perldoc](http://perldoc.perl.org/) + - and perl built-in : `perldoc perlintro` From 7184d7b61d99d2de93e19edb129ea3d17809be7f Mon Sep 17 00:00:00 2001 From: Zachary Ferguson Date: Fri, 2 Oct 2015 17:24:36 -0400 Subject: [PATCH 033/685] Changed [python3/en] Compared is and ==. Noted that tuples of length 1 require an ending comma. Discussed that keys of dictionaries have to be immutable. Added that elements of a set have to be immutable. Included an explanation of returning multiple values with tuple assignments. Added some clarifying remarks to comments. --- python3.html.markdown | 51 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/python3.html.markdown b/python3.html.markdown index b3acb122..d70c5462 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -4,6 +4,7 @@ contributors: - ["Louie Dinh", "http://pythonpracticeprojects.com"] - ["Steven Basart", "http://github.com/xksteven"] - ["Andre Polykanine", "https://github.com/Oire"] + - ["Zachary Ferguson", "http://github.com/zfergus2"] filename: learnpython3.py --- @@ -36,7 +37,7 @@ Note: This article applies to Python 3 specifically. Check out [here](http://lea 8 - 1 # => 7 10 * 2 # => 20 -# Except division which returns floats by default +# Except division which returns floats, real numbers, by default 35 / 5 # => 7.0 # Result of integer division truncated down both for positive and negative. @@ -51,13 +52,13 @@ Note: This article applies to Python 3 specifically. Check out [here](http://lea # Modulo operation 7 % 3 # => 1 -# Exponentiation (x to the yth power) +# Exponentiation (x**y, x to the yth power) 2**4 # => 16 # Enforce precedence with parentheses (1 + 3) * 2 # => 8 -# Boolean values are primitives +# Boolean values are primitives (Note: the capitalization) True False @@ -95,6 +96,16 @@ False or True #=> True 1 < 2 < 3 # => True 2 < 3 < 2 # => False +# (is vs. ==) is checks if two variable refer to the same object, but == checks +# if the objects pointed to have the same values. +a = [1, 2, 3, 4] # Point a at a new list, [1, 2, 3, 4] +b = a # Point b at what a is pointing to +b is a # => True, a and b refer to the same object +b == a # => True, a's and b's objects are equal +b = [1, 2, 3, 4] # Point a at a new list, [1, 2, 3, 4] +b is a # => False, a and b do not refer to the same object +b == a # => True, a's and b's objects are equal + # Strings are created with " or ' "This is a string." 'This is also a string.' @@ -145,6 +156,10 @@ bool({}) #=> False # Python has a print function print("I'm Python. Nice to meet you!") +# By default the print function also prints out a newline at the end. +# Use the optional argument end to change the end character. +print("I'm Python. Nice to meet you!", end="") + # No need to declare variables before assigning to them. # Convention is to use lower_case_with_underscores some_var = 5 @@ -191,6 +206,9 @@ li[::-1] # => [3, 4, 2, 1] # Use any combination of these to make advanced slices # li[start:end:step] +# Make a one layer deep copy using slices +li2 = li[:] # => li2 = [1, 2, 4, 3] but (li2 is li) will result in false. + # Remove arbitrary elements from a list with "del" del li[2] # li is now [1, 2, 3] @@ -213,6 +231,12 @@ tup = (1, 2, 3) tup[0] # => 1 tup[0] = 3 # Raises a TypeError +# Note that a tuple of length one has to have a comma after the last element but +# tuples of other lengths, even zero, do not. +type((1)) # => +type((1,)) # => +type(()) # => + # You can do most of the list operations on tuples too len(tup) # => 3 tup + (4, 5, 6) # => (1, 2, 3, 4, 5, 6) @@ -232,6 +256,12 @@ empty_dict = {} # Here is a prefilled dictionary filled_dict = {"one": 1, "two": 2, "three": 3} +# Note keys for dictionaries have to be immutable types. This is to ensure that +# the key can be converted to a constant hash value for quick look-ups. +# Immutable types include ints, floats, strings, tuples. +invalid_dict = {[1,2,3]: "123"} # => Raises a TypeError: unhashable type: 'list' +valid_dict = {(1,2,3):[1,2,3]} # Values can be of any type, however. + # Look up values with [] filled_dict["one"] # => 1 @@ -278,6 +308,10 @@ empty_set = set() # Initialize a set with a bunch of values. Yeah, it looks a bit like a dict. Sorry. some_set = {1, 1, 2, 2, 3, 4} # some_set is now {1, 2, 3, 4} +# Similar to keys of a dictionary, elements of a set have to be immutable. +invalid_set = {[1], 1} # => Raises a TypeError: unhashable type: 'list' +valid_set = {(1,), 1} + # Can set new variables to a set filled_set = some_set @@ -299,6 +333,7 @@ filled_set | other_set # => {1, 2, 3, 4, 5, 6} 10 in filled_set # => False + #################################################### ## 3. Control Flow and Iterables #################################################### @@ -464,6 +499,16 @@ all_the_args(*args) # equivalent to foo(1, 2, 3, 4) all_the_args(**kwargs) # equivalent to foo(a=3, b=4) all_the_args(*args, **kwargs) # equivalent to foo(1, 2, 3, 4, a=3, b=4) +# Returning multiple values (with tuple assignments) +def swap(x, y): + return y, x # Return multiple values as a tuple + # (Note: parenthesis have been excluded but can be included) +# return (y, x) # Just as valid as the above example. + +x = 1 +y = 2 +x, y = swap(x, y) # => x = 2, y = 1 +# (x, y) = swap(x,y) # Again parenthesis have been excluded but can be included. # Function Scope x = 5 From e77db2429dcc3422517763edf69efa3aaf234c05 Mon Sep 17 00:00:00 2001 From: Deivuh Date: Fri, 2 Oct 2015 16:47:19 -0600 Subject: [PATCH 034/685] Added es-es translation to Swift --- es-es/swift-es.html.markdown | 584 +++++++++++++++++++++++++++++++++++ 1 file changed, 584 insertions(+) create mode 100644 es-es/swift-es.html.markdown diff --git a/es-es/swift-es.html.markdown b/es-es/swift-es.html.markdown new file mode 100644 index 00000000..81191841 --- /dev/null +++ b/es-es/swift-es.html.markdown @@ -0,0 +1,584 @@ +--- +language: swift +contributors: + - ["Grant Timmerman", "http://github.com/grant"] + - ["Christopher Bess", "http://github.com/cbess"] + - ["Joey Huang", "http://github.com/kamidox"] + - ["Anthony Nguyen", "http://github.com/anthonyn60"] +translators: + - ["David Hsieh", "http://github.com/deivuh"] +lang: es-es +filename: learnswift.swift +--- + +Swift es un lenguaje de programación para el desarrollo en iOS y OS X creado por Apple. Diseñado para coexistir con Objective-C y ser más resistente contra el código erroneo, Swift fue introducido en el 2014 en el WWDC, la conferencia de desarrolladores de Apple. + +Swift is a programming language for iOS and OS X development created by Apple. Designed to coexist with Objective-C and to be more resilient against erroneous code, Swift was introduced in 2014 at Apple's developer conference WWDC. It is built with the LLVM compiler included in Xcode 6+. + +The official [Swift Programming Language](https://itunes.apple.com/us/book/swift-programming-language/id881256329) book from Apple is now available via iBooks. +El libro oficial de Apple, [Swift Programming Language](https://itunes.apple.com/us/book/swift-programming-language/id881256329), se encuentra disponible en iBooks. + +Véase también la guía oficial de Apple, [getting started guide](https://developer.apple.com/library/prerelease/ios/referencelibrary/GettingStarted/RoadMapiOS/index.html), el cual tiene un completo tutorial de Swift. + + +```swift +// Importar un módulo +import UIKit + +// +// MARK: Básicos +// + +// XCode soporta referencias para anotar tu código y agregarlos a lista de la barra de saltos. +// MARK: Marca de sección +// TODO: Hacer algo pronto +// FIXME: Arreglar este código + +// En Swift 2, println y print fueron combinados en un solo método print. Print añade una nueva línea automáticamente. +print("Hola, mundo") // println ahora es print +print("Hola, mundo", appendNewLine: false) // print sin agregar una nueva línea + +// Valores de variables (var) pueden cambiar después de ser asignados +// Valores de constrantes (let) no pueden cambiarse después de ser asignados + +var myVariable = 42 +let øπΩ = "value" // nombres de variable unicode +let π = 3.1415926 +let convenience = "keyword" // nombre de variable contextual +let weak = "keyword"; let override = "another keyword" // declaraciones pueden ser separadas por punto y coma +let `class` = "keyword" // Acentos abiertos permite utilizar palabras clave como nombres de variable +let explicitDouble: Double = 70 +let intValue = 0007 // 7 +let largeIntValue = 77_000 // 77000 +let label = "some text " + String(myVariable) // Conversión (casting) +let piText = "Pi = \(π), Pi 2 = \(π * 2)" // Interpolación de string + +// Valos específicos de la construcción (build) +// utiliza la configuración -D +#if false + print("No impreso") + let buildValue = 3 +#else + let buildValue = 7 +#endif +print("Build value: \(buildValue)") // Build value: 7 + +/* + Las opcionales son un aspecto del lenguaje Swift que permite el almacenamiento de un valor `Some` (algo) o `None` (nada). + + Debido a que Swift requiere que cada propiedad tenga un valor, hasta un valor 'nil' debe de ser explicitamente almacenado como un valor opcional. + + Optional es un enum. +*/ +var someOptionalString: String? = "opcional" // Puede ser nil +// Al igual que lo anterior, pero ? es un operador postfix (sufijo) +var someOptionalString2: Optional = "opcional" + +if someOptionalString != nil { + // No soy nil + if someOptionalString!.hasPrefix("opt") { + print("Tiene el prefijo") + } + + let empty = someOptionalString?.isEmpty +} +someOptionalString = nil + +// Opcional implícitamente desenvuelto +var unwrappedString: String! = "Un valor esperado." +// Al igual que lo anterior, pero ! es un operador postfix (sufijo) +var unwrappedString2: ImplicitlyUnwrappedOptional = "Un valor esperado." + +if let someOptionalStringConstant = someOptionalString { + // tiene valor `Some` (algo), no nil + if !someOptionalStringConstant.hasPrefix("ok") { + // No tiene el prefijo + } +} + +// Swift tiene soporte de almacenamiento para cualquier tipo de valor. +// AnyObject == id +// A diferencia de Objective-C `id`, AnyObject funciona con cualquier valor (Class, Int, struct, etc) +var anyObjectVar: AnyObject = 7 +anyObjectVar = "Cambiado a un valor string, no es buena práctica, pero posible." + +/* + Comentar aquí + + /* + Comentarios anidados también son soportados + */ +*/ + +// +// MARK: Colecciones +// + +/* + Tipos Array (arreglo) y Dictionary (diccionario) son structs (estructuras). Así que `let` y `var` también indican si son mudables (var) o inmutables (let) durante la declaración de sus tipos. +*/ + +// Array (arreglo) +var shoppingList = ["catfish", "water", "lemons"] +shoppingList[1] = "bottle of water" +let emptyArray = [String]() // let == inmutable +let emptyArray2 = Array() // igual que lo anterior +var emptyMutableArray = [String]() // var == mudable + + +// Dictionary (diccionario) +var occupations = [ + "Malcolm": "Captain", + "kaylee": "Mechanic" +] +occupations["Jayne"] = "Public Relations" +let emptyDictionary = [String: Float]() // let == inmutable +let emptyDictionary2 = Dictionary() // igual que lo anterior +var emptyMutableDictionary = [String: Float]() // var == mudable + + +// +// MARK: Flujo de control +// + +// Ciclo for (array) +let myArray = [1, 1, 2, 3, 5] +for value in myArray { + if value == 1 { + print("Uno!") + } else { + print("No es uno!") + } +} + +// Ciclo for (dictionary) +var dict = ["uno": 1, "dos": 2] +for (key, value) in dict { + print("\(key): \(value)") +} + +// Ciclo for (range) +for i in -1...shoppingList.count { + print(i) +} +shoppingList[1...2] = ["steak", "peacons"] +// Utilizar ..< para excluir el último valor + +// Ciclo while +var i = 1 +while i < 1000 { + i *= 2 +} + +// Ciclo do-while +do { + print("Hola") +} while 1 == 2 + +// Switch +// Muy potente, se puede pensar como declaraciones `if` +// Very powerful, think `if` statements with con azúcar sintáctico +// Soportan String, instancias de objetos, y primitivos (Int, Double, etc) +let vegetable = "red pepper" +switch vegetable { +case "celery": + let vegetableComment = "Add some raisins and make ants on a log." +case "cucumber", "watercress": + let vegetableComment = "That would make a good tea sandwich." +case let localScopeValue where localScopeValue.hasSuffix("pepper"): + let vegetableComment = "Is it a spicy \(localScopeValue)?" +default: // required (in order to cover all possible input) + let vegetableComment = "Everything tastes good in soup." +} + + +// +// MARK: Funciones +// + +// Funciones son un tipo de primera-clase, quiere decir que pueden ser anidados +// en funciones y pueden ser pasados como parámetros + +// Función en documentación de cabeceras Swift (formato reStructedText) + +/** + Una operación de saludo + + - Una viñeta en la documentación + - Otra viñeta en la documentación + + :param: name Un nombre + :param: day Un día + :returns: Un string que contiene el valor de name y day +*/ +func greet(name: String, day: String) -> String { + return "Hola \(name), hoy es \(day)." +} +greet("Bob", "Martes") + +// Similar a lo anterior, a excepción del compartamiento de los parámetros de la función +func greet2(requiredName: String, externalParamName localParamName: String) -> String { + return "Hola \(requiredName), hoy es el día \(localParamName)" +} +greet2(requiredName:"John", externalParamName: "Domingo") + +// Función que devuelve múltiples valores en una tupla +func getGasPrices() -> (Double, Double, Double) { + return (3.59, 3.69, 3.79) +} +let pricesTuple = getGasPrices() +let price = pricesTuple.2 // 3.79 +// Ignorar tupla (u otros) valores utilizando _ (guión bajo) +let (_, price1, _) = pricesTuple // price1 == 3.69 +print(price1 == pricesTuple.1) // true +print("Gas price: \(price)") + +// Cantidad variable de argumentos +func setup(numbers: Int...) { + // Es un arreglo + let number = numbers[0] + let argCount = numbers.count +} + +// Pasando y devolviendo funciones +func makeIncrementer() -> (Int -> Int) { + func addOne(number: Int) -> Int { + return 1 + number + } + return addOne +} +var increment = makeIncrementer() +increment(7) + +// Pasando como referencia +func swapTwoInts(inout a: Int, inout b: Int) { + let tempA = a + a = b + b = tempA +} +var someIntA = 7 +var someIntB = 3 +swapTwoInts(&someIntA, &someIntB) +print(someIntB) // 7 + + +// +// MARK: Closures +// +var numbers = [1, 2, 6] + +// Las funciones son un caso especial de closure ({}) + +// Ejemplo de closure. +// `->` Separa los argumentos del tipo de retorno +// `in` Separa la cabecera del cuerpo del closure +numbers.map({ + (number: Int) -> Int in + let result = 3 * number + return result +}) + +// Cuando se conoce el tipo, cono en lo anterior, se puede hacer esto +numbers = numbers.map({ number in 3 * number }) +// o esto +//numbers = numbers.map({ $0 * 3 }) + +print(numbers) // [3, 6, 18] + +// Closure restante +numbers = sorted(numbers) { $0 > $1 } + +print(numbers) // [18, 6, 3] + +// Bastante corto, debido a que el operador < infiere los tipos + +numbers = sorted(numbers, < ) + +print(numbers) // [3, 6, 18] + +// +// MARK: Estructuras +// + +// Las estructuras y las clases tienen capacidades similares +struct NamesTable { + let names = [String]() + + // Subscript personalizado + subscript(index: Int) -> String { + return names[index] + } +} + +// Las estructuras tienen un inicializador designado autogenerado (implícitamente) +let namesTable = NamesTable(names: ["Me", "Them"]) +let name = namesTable[1] +print("Name is \(name)") // Name is Them + +// +// MARK: Clases +// + +// Las clases, las estructuras y sus miembros tienen tres niveles de control de acceso +// Éstos son: internal (predeterminado), public, private + +public class Shape { + public func getArea() -> Int { + return 0; + } +} + +// Todos los métodos y las propiedades de una clase son public (públicas) +// Si solo necesitas almacenar datos en un objecto estructurado, +// debes de utilizar `struct` + +internal class Rect: Shape { + var sideLength: Int = 1 + + // Getter y setter personalizado + private var perimeter: Int { + get { + return 4 * sideLength + } + set { + // `newValue` es una variable implícita disponible para los setters + sideLength = newValue / 4 + } + } + + // Lazily loading (inicialización bajo demanda) a una propiedad + // subShape queda como nil (sin inicializar) hasta que getter es llamado + lazy var subShape = Rect(sideLength: 4) + + // Si no necesitas un getter y setter personalizado + // pero aún quieres ejecutar código antes y después de hacer get o set + // a una propiedad, puedes utilizar `willSet` y `didSet` + var identifier: String = "defaultID" { + // El argumento `willSet` será el nombre de variable para el nuevo valor + willSet(someIdentifier) { + print(someIdentifier) + } + } + + init(sideLength: Int) { + self.sideLength = sideLength + // Siempre poner super.init de último al momento de inicializar propiedades personalizadas + super.init() + } + + func shrink() { + if sideLength > 0 { + --sideLength + } + } + + override func getArea() -> Int { + return sideLength * sideLength + } +} + +// Una clase simple `Square` que extiende de `Rect` +class Square: Rect { + convenience init() { + self.init(sideLength: 5) + } +} + +var mySquare = Square() +print(mySquare.getArea()) // 25 +mySquare.shrink() +print(mySquare.sideLength) // 4 + +// Conversión de tipo de instancia +let aShape = mySquare as Shape + +// Comparar instancias, no es igual a == que compara objetos (equal to) +if mySquare === mySquare { + print("Yep, it's mySquare") +} + +// Inicialización (init) opcional +class Circle: Shape { + var radius: Int + override func getArea() -> Int { + return 3 * radius * radius + } + + // Un signo de interrogación como sufijo después de `init` es un init opcional + // que puede devolver nil + init?(radius: Int) { + self.radius = radius + super.init() + + if radius <= 0 { + return nil + } + } +} + +var myCircle = Circle(radius: 1) +print(myCircle?.getArea()) // Optional(3) +print(myCircle!.getArea()) // 3 +var myEmptyCircle = Circle(radius: -1) +print(myEmptyCircle?.getArea()) // "nil" +if let circle = myEmptyCircle { + // no será ejecutado debido a que myEmptyCircle es nil + print("circle is not nil") +} + + +// +// MARK: Enums +// + + +// Los enums pueden ser opcionalmente de un tipo específico o de su propio tipo +// Al igual que las clases, pueden contener métodos + +enum Suit { + case Spades, Hearts, Diamonds, Clubs + func getIcon() -> String { + switch self { + case .Spades: return "♤" + case .Hearts: return "♡" + case .Diamonds: return "♢" + case .Clubs: return "♧" + } + } +} + +// Los valores de enum permite la sintaxis corta, sin necesidad de poner el tipo del enum +// cuando la variable es declarada de manera explícita +var suitValue: Suit = .Hearts + +// Enums de tipo no-entero requiere asignaciones de valores crudas directas +enum BookName: String { + case John = "John" + case Luke = "Luke" +} +print("Name: \(BookName.John.rawValue)") + +// Enum con valores asociados +enum Furniture { + // Asociación con Int + case Desk(height: Int) + // Asociación con String e Int + case Chair(String, Int) + + func description() -> String { + switch self { + case .Desk(let height): + return "Desk with \(height) cm" + case .Chair(let brand, let height): + return "Chair of \(brand) with \(height) cm" + } + } +} + +var desk: Furniture = .Desk(height: 80) +print(desk.description()) // "Desk with 80 cm" +var chair = Furniture.Chair("Foo", 40) +print(chair.description()) // "Chair of Foo with 40 cm" + + +// +// MARK: Protocolos +// + +// `protocol` puede requerir que los tipos tengan propiedades +// de instancia específicas, métodos de instancia, métodos de tipo, +// operadores, y subscripts + + +protocol ShapeGenerator { + var enabled: Bool { get set } + func buildShape() -> Shape +} + +// Protocolos declarados con @objc permiten funciones opcionales, +// que te permite evaluar conformidad +@objc protocol TransformShape { + optional func reshaped() + optional func canReshape() -> Bool +} + +class MyShape: Rect { + var delegate: TransformShape? + + func grow() { + sideLength += 2 + + // Pon un signo de interrogación después de la propiedad opcional, método, o + // subscript para ignorar un valor nil y devolver nil en lugar de + // tirar un error de tiempo de ejecución ("optional chaining") + if let allow = self.delegate?.canReshape?() { + // test for delegate then for method + self.delegate?.reshaped?() + } + } +} + + +// +// MARK: Otros +// + +// `extension`: Agrega funcionalidades a tipos existentes + +// Square ahora se "conforma" al protocolo `Printable` +extension Square: Printable { + var description: String { + return "Area: \(self.getArea()) - ID: \(self.identifier)" + } +} + +print("Square: \(mySquare)") + +// También puedes hacer extend a tipos prefabricados (built-in) +extension Int { + var customProperty: String { + return "This is \(self)" + } + + func multiplyBy(num: Int) -> Int { + return num * self + } +} + +print(7.customProperty) // "This is 7" +print(14.multiplyBy(3)) // 42 + +// Generics: Similar Java y C#. Utiliza la palabra clave `where` para especificar +// los requerimientos de los genéricos. + +func findIndex(array: [T], valueToFind: T) -> Int? { + for (index, value) in enumerate(array) { + if value == valueToFind { + return index + } + } + return nil +} +let foundAtIndex = findIndex([1, 2, 3, 4], 3) +print(foundAtIndex == 2) // true + +// Operadores: +// Operadores personalizados puede empezar con los siguientes caracteres: +// / = - + * % < > ! & | ^ . ~ +// o +// Caracteres unicode: math, symbol, arrow, dingbat, y line/box. +prefix operator !!! {} + +// Un operador prefix que triplica la longitud del lado cuando es utilizado +prefix func !!! (inout shape: Square) -> Square { + shape.sideLength *= 3 + return shape +} + +// Valor actual +print(mySquare.sideLength) // 4 + +// Cambiar la longitud del lado utilizando el operador !!!, incrementa el tamaño por 3 +!!!mySquare +print(mySquare.sideLength) // 12 +``` From f64a678b5c357f6ae9a82bfdb8feca8520c4d2b0 Mon Sep 17 00:00:00 2001 From: Deivuh Date: Fri, 2 Oct 2015 16:53:39 -0600 Subject: [PATCH 035/685] Fixed Swift/es-es line lengths --- es-es/swift-es.html.markdown | 63 ++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 25 deletions(-) diff --git a/es-es/swift-es.html.markdown b/es-es/swift-es.html.markdown index 81191841..86f0aab6 100644 --- a/es-es/swift-es.html.markdown +++ b/es-es/swift-es.html.markdown @@ -11,12 +11,10 @@ lang: es-es filename: learnswift.swift --- -Swift es un lenguaje de programación para el desarrollo en iOS y OS X creado por Apple. Diseñado para coexistir con Objective-C y ser más resistente contra el código erroneo, Swift fue introducido en el 2014 en el WWDC, la conferencia de desarrolladores de Apple. - -Swift is a programming language for iOS and OS X development created by Apple. Designed to coexist with Objective-C and to be more resilient against erroneous code, Swift was introduced in 2014 at Apple's developer conference WWDC. It is built with the LLVM compiler included in Xcode 6+. - -The official [Swift Programming Language](https://itunes.apple.com/us/book/swift-programming-language/id881256329) book from Apple is now available via iBooks. -El libro oficial de Apple, [Swift Programming Language](https://itunes.apple.com/us/book/swift-programming-language/id881256329), se encuentra disponible en iBooks. +Swift es un lenguaje de programación para el desarrollo en iOS y OS X creado +por Apple. Diseñado para coexistir con Objective-C y ser más resistente contra +el código erroneo, Swift fue introducido en el 2014 en el WWDC, la conferencia +de desarrolladores de Apple. Véase también la guía oficial de Apple, [getting started guide](https://developer.apple.com/library/prerelease/ios/referencelibrary/GettingStarted/RoadMapiOS/index.html), el cual tiene un completo tutorial de Swift. @@ -29,14 +27,16 @@ import UIKit // MARK: Básicos // -// XCode soporta referencias para anotar tu código y agregarlos a lista de la barra de saltos. +// XCode soporta referencias para anotar tu código y agregarlos a lista de la +// barra de saltos. // MARK: Marca de sección // TODO: Hacer algo pronto // FIXME: Arreglar este código -// En Swift 2, println y print fueron combinados en un solo método print. Print añade una nueva línea automáticamente. +// En Swift 2, println y print fueron combinados en un solo método print. +// Print añade una nueva línea automáticamente. print("Hola, mundo") // println ahora es print -print("Hola, mundo", appendNewLine: false) // print sin agregar una nueva línea +print("Hola, mundo", appendNewLine: false) // print sin agregar nueva línea // Valores de variables (var) pueden cambiar después de ser asignados // Valores de constrantes (let) no pueden cambiarse después de ser asignados @@ -45,8 +45,11 @@ var myVariable = 42 let øπΩ = "value" // nombres de variable unicode let π = 3.1415926 let convenience = "keyword" // nombre de variable contextual -let weak = "keyword"; let override = "another keyword" // declaraciones pueden ser separadas por punto y coma -let `class` = "keyword" // Acentos abiertos permite utilizar palabras clave como nombres de variable +// Las declaraciones pueden ser separadas por punto y coma (;) +let weak = "keyword"; let override = "another keyword" +// Los acentos abiertos (``) permiten utilizar palabras clave como nombres de +// variable +let `class` = "keyword" let explicitDouble: Double = 70 let intValue = 0007 // 7 let largeIntValue = 77_000 // 77000 @@ -64,9 +67,12 @@ let piText = "Pi = \(π), Pi 2 = \(π * 2)" // Interpolación de string print("Build value: \(buildValue)") // Build value: 7 /* - Las opcionales son un aspecto del lenguaje Swift que permite el almacenamiento de un valor `Some` (algo) o `None` (nada). + Las opcionales son un aspecto del lenguaje Swift que permite el + almacenamiento de un valor `Some` (algo) o `None` (nada). - Debido a que Swift requiere que cada propiedad tenga un valor, hasta un valor 'nil' debe de ser explicitamente almacenado como un valor opcional. + Debido a que Swift requiere que cada propiedad tenga un valor, + hasta un valor 'nil' debe de ser explicitamente almacenado como un + valor opcional. Optional es un enum. */ @@ -98,7 +104,8 @@ if let someOptionalStringConstant = someOptionalString { // Swift tiene soporte de almacenamiento para cualquier tipo de valor. // AnyObject == id -// A diferencia de Objective-C `id`, AnyObject funciona con cualquier valor (Class, Int, struct, etc) +// A diferencia de Objective-C `id`, AnyObject funciona con cualquier +// valor (Class, Int, struct, etc) var anyObjectVar: AnyObject = 7 anyObjectVar = "Cambiado a un valor string, no es buena práctica, pero posible." @@ -115,7 +122,9 @@ anyObjectVar = "Cambiado a un valor string, no es buena práctica, pero posible. // /* - Tipos Array (arreglo) y Dictionary (diccionario) son structs (estructuras). Así que `let` y `var` también indican si son mudables (var) o inmutables (let) durante la declaración de sus tipos. + Tipos Array (arreglo) y Dictionary (diccionario) son structs (estructuras). + Así que `let` y `var` también indican si son mudables (var) o + inmutables (let) durante la declaración de sus tipos. */ // Array (arreglo) @@ -216,7 +225,8 @@ func greet(name: String, day: String) -> String { } greet("Bob", "Martes") -// Similar a lo anterior, a excepción del compartamiento de los parámetros de la función +// Similar a lo anterior, a excepción del compartamiento de los parámetros +// de la función func greet2(requiredName: String, externalParamName localParamName: String) -> String { return "Hola \(requiredName), hoy es el día \(localParamName)" } @@ -362,7 +372,8 @@ internal class Rect: Shape { init(sideLength: Int) { self.sideLength = sideLength - // Siempre poner super.init de último al momento de inicializar propiedades personalizadas + // Siempre poner super.init de último al momento de inicializar propiedades + // personalizadas super.init() } @@ -447,8 +458,8 @@ enum Suit { } } -// Los valores de enum permite la sintaxis corta, sin necesidad de poner el tipo del enum -// cuando la variable es declarada de manera explícita +// Los valores de enum permite la sintaxis corta, sin necesidad de poner +// el tipo del enum cuando la variable es declarada de manera explícita var suitValue: Suit = .Hearts // Enums de tipo no-entero requiere asignaciones de valores crudas directas @@ -508,9 +519,10 @@ class MyShape: Rect { func grow() { sideLength += 2 - // Pon un signo de interrogación después de la propiedad opcional, método, o - // subscript para ignorar un valor nil y devolver nil en lugar de - // tirar un error de tiempo de ejecución ("optional chaining") + // Pon un signo de interrogación después de la propiedad opcional, + // método, o subscript para ignorar un valor nil y devolver nil + // en lugar de tirar un error de tiempo de ejecución + // ("optional chaining") if let allow = self.delegate?.canReshape?() { // test for delegate then for method self.delegate?.reshaped?() @@ -548,8 +560,8 @@ extension Int { print(7.customProperty) // "This is 7" print(14.multiplyBy(3)) // 42 -// Generics: Similar Java y C#. Utiliza la palabra clave `where` para especificar -// los requerimientos de los genéricos. +// Generics: Similar Java y C#. Utiliza la palabra clave `where` para +// especificar los requerimientos de los genéricos. func findIndex(array: [T], valueToFind: T) -> Int? { for (index, value) in enumerate(array) { @@ -578,7 +590,8 @@ prefix func !!! (inout shape: Square) -> Square { // Valor actual print(mySquare.sideLength) // 4 -// Cambiar la longitud del lado utilizando el operador !!!, incrementa el tamaño por 3 +// Cambiar la longitud del lado utilizando el operador !!!, +// incrementa el tamaño por 3 !!!mySquare print(mySquare.sideLength) // 12 ``` From b98afb4be5e5457b1f42b57eaa20599fabb461fa Mon Sep 17 00:00:00 2001 From: Jesus Tinoco Date: Sat, 3 Oct 2015 10:43:25 +0200 Subject: [PATCH 036/685] Fixing typo in python3-es.html.markdown --- es-es/python3-es.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/es-es/python3-es.html.markdown b/es-es/python3-es.html.markdown index 1c69481a..3b997145 100644 --- a/es-es/python3-es.html.markdown +++ b/es-es/python3-es.html.markdown @@ -97,7 +97,7 @@ not False # => True None # => None # No uses el símbolo de igualdad `==` para comparar objetos con None -# Usa `is` en lugar de +# Usa `is` en su lugar "etc" is None #=> False None is None #=> True @@ -383,7 +383,7 @@ def keyword_args(**kwargs): keyword_args(pie="grande", lago="ness") #=> {"pie": "grande", "lago": "ness"} -# You can do both at once, if you like# Puedes hacer ambas a la vez si quieres +# Puedes hacer ambas a la vez si quieres def todos_los_argumentos(*args, **kwargs): print args print kwargs @@ -511,7 +511,7 @@ def duplicar_numeros(iterable): for i in iterable: yield i + i -# Un generador cera valores sobre la marcha. +# Un generador crea valores sobre la marcha. # En vez de generar y retornar todos los valores de una vez, crea uno en cada iteración. # Esto significa que valores más grandes que 15 no serán procesados en 'duplicar_numeros'. # Fíjate que 'range' es un generador. Crear una lista 1-900000000 tomaría mucho tiempo en crearse. From b917d1524a06ca94b73d885bb678a4f4cd00a808 Mon Sep 17 00:00:00 2001 From: Jesus Tinoco Date: Sat, 3 Oct 2015 10:50:48 +0200 Subject: [PATCH 037/685] Typos fixed in ruby-es.html.markdown --- es-es/ruby-es.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/es-es/ruby-es.html.markdown b/es-es/ruby-es.html.markdown index 66a5d0fe..1cf334e3 100644 --- a/es-es/ruby-es.html.markdown +++ b/es-es/ruby-es.html.markdown @@ -19,7 +19,7 @@ Nadie los usa. Tu tampoco deberías =end -# Lo primero y principal: Todo es un objeto +# En primer lugar: Todo es un objeto # Los números son objetos @@ -97,13 +97,13 @@ y #=> 10 # Por convención, usa snake_case para nombres de variables snake_case = true -# Usa nombres de variables descriptivos +# Usa nombres de variables descriptivas ruta_para_la_raiz_de_un_projecto = '/buen/nombre/' ruta = '/mal/nombre/' # Los símbolos (son objetos) # Los símbolos son inmutables, constantes reusables representadas internamente por un -# valor entero. Son usalmente usados en vez de strings para expresar eficientemente +# valor entero. Son normalmente usados en vez de strings para expresar eficientemente # valores específicos y significativos :pendiente.class #=> Symbol @@ -130,7 +130,7 @@ arreglo = [1, "hola", false] #=> => [1, "hola", false] arreglo[0] #=> 1 arreglo[12] #=> nil -# Tal como la aritmética, el acceso como variable[índice] +# Al igual que en aritmética, el acceso como variable[índice] # es sólo azúcar sintáctica # para llamar el método [] de un objeto arreglo.[] 0 #=> 1 From 97c3800ea0ae11769c3661f3ab2cfa926e03d866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joa=CC=83o=20Costa?= Date: Sat, 3 Oct 2015 16:18:03 +0100 Subject: [PATCH 038/685] Add pt-pt translation for Scala tutorial --- pt-pt/scala-pt.html.markdown | 651 +++++++++++++++++++++++++++++++++++ 1 file changed, 651 insertions(+) create mode 100644 pt-pt/scala-pt.html.markdown diff --git a/pt-pt/scala-pt.html.markdown b/pt-pt/scala-pt.html.markdown new file mode 100644 index 00000000..68f7b12a --- /dev/null +++ b/pt-pt/scala-pt.html.markdown @@ -0,0 +1,651 @@ +--- +language: Scala +filename: learnscala.scala +contributors: + - ["George Petrov", "http://github.com/petrovg"] + - ["Dominic Bou-Samra", "http://dbousamra.github.com"] + - ["Geoff Liu", "http://geoffliu.me"] + - ["Ha-Duong Nguyen", "http://reference-error.org"] +translators: + - ["João Costa", "http://joaocosta.eu"] +lang: pt-pt +filename: learn-pt.scala +--- + +Scala - a linguagem escalável + +```scala + +/* + Prepare tudo: + + 1) Faça Download do Scala - http://www.scala-lang.org/downloads + 2) Faça unzip/untar para onde preferir e coloque o subdirectório `bin` na + variável de ambiente `PATH` + 3) Inicie a REPL de Scala correndo o comando `scala`. Deve aparecer: + + scala> + + Isto é chamado de REPL (Read-Eval-Print Loop / Lê-Avalia-Imprime Repete). + Pode escrever qualquer expressão de Scala e o resultado será imprimido. + Vamos mostrar ficheiros de Scala mais à frente neste tutorial mas, para já, + vamos começar com os básicos. + +*/ + + +///////////////////////////////////////////////// +// 1. Basicos +///////////////////////////////////////////////// + +// Uma linha de comentários é marcada com duas barras + +/* + Comentários de multiplas linhas, como se pode ver neste exemplo, são assim. +*/ + +// Imprimir, forçando uma nova linha no final +println("Hello world!") +println(10) + +// Imprimir, sem forçar uma nova linha no final +print("Hello world") + +// Valores são declarados com var ou val. +// As declarações val são imutáveis, enquanto que vars são mutáveis. +// A immutabilidade é uma propriedade geralmente vantajosa. +val x = 10 // x é agora 10 +x = 20 // erro: reatribuição de um val +var y = 10 +y = 20 // y é agora 12 + +/* + Scala é uma linguagem estaticamente tipada, no entanto, nas declarações acima + não especificamos um tipo. Isto é devido a uma funcionalidade chamada + inferência de tipos. Na maior parte dos casos, o compilador de scala consegue + inferir qual o tipo de uma variável, pelo que não o temos de o declarar sempre. + Podemos declarar o tipo de uma variável da seguinte forma: +*/ +val z: Int = 10 +val a: Double = 1.0 + +// Note a conversão automática de Int para Double: o resultado é 10.0, não 10 +val b: Double = 10 + +// Valores booleanos +true +false + +// Operações booleanas +!true // false +!false // true +true == false // false +10 > 5 // true + +// A matemática funciona da maneira habitual +1 + 1 // 2 +2 - 1 // 1 +5 * 3 // 15 +6 / 2 // 3 +6 / 4 // 1 +6.0 / 4 // 1.5 + + +// Avaliar expressões na REPL dá o tipo e valor do resultado + +1 + 7 + +/* A linha acima resulta em: + + scala> 1 + 7 + res29: Int = 8 + + Isto significa que o resultado de avaliar 1 + 7 é um objecto do tipo Int com + o valor 8. + + Note que "res29" é um nome de uma variavel gerado sequencialmente para + armazenar os resultados das expressões que escreveu, por isso o resultado + pode ser ligeiramente diferente. +*/ + +"Strings em scala são rodeadas por aspas" +'a' // Um caracter de Scala +// 'Strings entre plicas não existem' <= Isto causa um erro + +// Strings tem os métodos de Java habituais definidos +"olá mundo".length +"olá mundo".substring(2, 6) +"olá mundo".replace("á", "é") + +// Para além disso, também possuem métodos de Scala. +// Ver: scala.collection.immutable.StringOps +"olá mundo".take(5) +"olá mundo".drop(5) + +// Interpolação de Strings: repare no prefixo "s" +val n = 45 +s"Temos $n maçãs" // => "Temos 45 maçãs" + +// Expressões dentro de Strings interpoladas também são possíveis +val a = Array(11, 9, 6) +s"A minha segunda filha tem ${a(0) - a(2)} anos." // => "A minha segunda filha tem 5 anos." +s"Temos o dobro de ${n / 2.0} em maçãs." // => "Temos o dobro de 22.5 em maçãs." +s"Potência de 2: ${math.pow(2, 2)}" // => "Potência de 2: 4" + +// Strings interpoladas são formatadas com o prefixo "f" +f"Potência de 5: ${math.pow(5, 2)}%1.0f" // "Potência de 5: 25" +f"Raíz quadrada 122: ${math.sqrt(122)}%1.4f" // "Raíz quadrada de 122: 11.0454" + +// Strings prefixadas com "raw" ignoram caracteres especiais +raw"Nova linha: \n. Retorno: \r." // => "Nova Linha: \n. Retorno: \r." + +// Alguns caracteres tem de ser "escapados", e.g. uma aspa dentro de uma string: +"Esperaram fora do \"Rose and Crown\"" // => "Esperaram fora do "Rose and Crown"" + +// Strings rodeadas por três aspas podem-se estender por varias linhas e conter aspas +val html = """
+

Carrega aqui, Zé

+ +
""" + + +///////////////////////////////////////////////// +// 2. Funções +///////////////////////////////////////////////// + +// Funções são definidas como: +// +// def nomeDaFuncao(args...): TipoDeRetorno = { corpo... } +// +// Se vem de linugagens mais tradicionais, repare na omissão da palavra +// return keyword. Em Scala, a ultima expressão de um bloco é o seu +// valor de retorno +def somaQuadrados(x: Int, y: Int): Int = { + val x2 = x * x + val y2 = y * y + x2 + y2 +} + +// As { } podem ser omitidas se o corpo da função for apenas uma expressão: +def somaQuadradosCurto(x: Int, y: Int): Int = x * x + y * y + +// A sintaxe para chamar funções deve ser familiar: +somaQuadrados(3, 4) // => 25 + +// Na maior parte dos casos (sendo funções recursivas a principal excepção), o +// tipo de retorno da função pode ser omitido, sendo que a inferencia de tipos +// é aplicada aos valores de retorno +def quadrado(x: Int) = x * x // O compilador infere o tipo de retorno Int + +// Funções podem ter parâmetros por omissão: +def somaComOmissão(x: Int, y: Int = 5) = x + y +somaComOmissão(1, 2) // => 3 +somaComOmissão(1) // => 6 + + +// Funções anónimas são definidas da seguinte forma: +(x: Int) => x * x + +// Ao contrário de defs, o tipo de input de funções anónimas pode ser omitido +// se o contexto o tornar óbvio. Note que o tipo "Int => Int" representa uma +// funão que recebe Int e retorna Int. +val quadrado: Int => Int = x => x * x + +// Funcões anónimas são chamadas como funções normais: +quadrado(10) // => 100 + +// Se cada argumento de uma função anónima for usado apenas uma vez, existe +// uma forma ainda mais curta de os definir. Estas funções anónumas são +// extremamente comuns, como será visto na secção sobre estruturas de dados. +val somaUm: Int => Int = _ + 1 +val somaEstranha: (Int, Int) => Int = (_ * 2 + _ * 3) + +somaUm(5) // => 6 +somaEstranha(2, 4) // => 16 + + +// O código return existe em Scala, mas apenas retorna do def mais interior +// que o rodeia. +// AVISO: Usar return em Scala deve ser evitado, pois facilmente leva a erros. +// Não tem qualquer efeito em funções anónimas, por exemplo: +def foo(x: Int): Int = { + val funcAnon: Int => Int = { z => + if (z > 5) + return z // Esta linha faz com que z seja o retorno de foo! + else + z + 2 // Esta linha define o retorno de funcAnon + } + funcAnon(x) // Esta linha define o valor de retorno de foo +} + + +///////////////////////////////////////////////// +// 3. Controlo de fluxo +///////////////////////////////////////////////// + +1 to 5 +val r = 1 to 5 +r.foreach(println) + +r foreach println +// NB: Scala é bastante brando no que toca a pontos e parentisis - estude as +// regras separadamente. Isto permite escrever APIs e DSLs bastante legiveis + +(5 to 1 by -1) foreach (println) + +// Ciclos while +var i = 0 +while (i < 10) { println("i " + i); i += 1 } + +while (i < 10) { println("i " + i); i += 1 } // Sim, outra vez. O que aconteceu? Porquê? + +i // Mostra o valor de i. Note que o while é um ciclo no sentido clássico - + // executa sequencialmente enquanto muda uma variável. Ciclos while são + // rápidos, por vezes até mais que ciclos de Java, mas combinadores e + // compreensões (usados anteriormente) são mais fáceis de entender e + // paralelizar + +// Um ciclo do while +do { + println("x ainda é menor que 10") + x = x + 1 +} while (x < 10) + +// A forma idiomática em Scala de definir acções recorrentes é através de +// recursão em cauda. +// Funções recursivas necessitam de um tipo de retorno definido explicitamente. +// Neste caso, é Unit. +def mostraNumerosEntre(a: Int, b: Int): Unit = { + print(a) + if (a < b) + mostraNumerosEntre(a + 1, b) +} +mostraNumerosEntre(1, 14) + + +// Condicionais + +val x = 10 + +if (x == 1) println("yeah") +if (x == 10) println("yeah") +if (x == 11) println("yeah") +if (x == 11) println ("yeah") else println("nay") + +println(if (x == 10) "yeah" else "nope") +val text = if (x == 10) "yeah" else "nope" + + +///////////////////////////////////////////////// +// 4. Estruturas de dados +///////////////////////////////////////////////// + +val a = Array(1, 2, 3, 5, 8, 13) +a(0) +a(3) +a(21) // Lança uma excepção + +val m = Map("fork" -> "tenedor", "spoon" -> "cuchara", "knife" -> "cuchillo") +m("fork") +m("spoon") +m("bottle") // Lança uma excepção + +val safeM = m.withDefaultValue("no lo se") +safeM("bottle") + +val s = Set(1, 3, 7) +s(0) +s(1) + +/* Veja a documentação de mapas de scala em - + * http://www.scala-lang.org/api/current/index.html#scala.collection.immutable.Map + * e verifique que a consegue aceder + */ + + +// Tuplos + +(1, 2) + +(4, 3, 2) + +(1, 2, "três") + +(a, 2, "três") + +// Porquê ter isto? +val divideInts = (x: Int, y: Int) => (x / y, x % y) + +divideInts(10, 3) // A função divideInts returna o resultado e o resto + +// Para aceder aos elementos de um tuplo, pode-se usar _._n, onde n é o indice +// (começado em 1) do elemento +val d = divideInts(10, 3) + +d._1 + +d._2 + + +///////////////////////////////////////////////// +// 5. Programação Orientada a Objectos +///////////////////////////////////////////////// + +/* + Aparte: Até agora tudo o que fizemos neste tutorial foram expressões simples + (valores, funções, etc). Estas expressões são suficientes para executar no + interpretador da linha de comandos para testes rápidos, mas não podem existir + isoladas num ficheiro de Scala. Por exemplo, não é possivel correr um + ficheiro scala que apenas contenha "val x = 5". Em vez disso, as únicas + construções de topo permitidas são: + + - object + - class + - case class + - trait + + Vamos agora explicar o que são: +*/ + +// Classes são semelhantes a classes noutras linguagens. Os argumentos do +// construtor são declarados após o nome da classe, sendo a inicialização feita +// no corpo da classe. +class Cão(rc: String) { + // Código de construção + var raça: String = rc + + // Define um método chamado "ladra", que retorna uma String + def ladra = "Woof, woof!" + + // Valores e métodos são assumidos como públicos, mas é possivel usar + // os códigos "protected" and "private". + private def dormir(horas: Int) = + println(s"Vou dormir por $horas horas") + + // Métodos abstractos são métodos sem corpo. Se descomentarmos a próxima + // linha, a classe Cão é declarada como abstracta + // abstract class Cão(...) { ... } + // def persegue(oQue: String): String +} + +val oMeuCão = new Cão("greyhound") +println(oMeuCão.raça) // => "greyhound" +println(oMeuCão.ladra) // => "Woof, woof!" + + +// O termo "object" cria um tipo e uma instancia singleton desse tipo. É comum +// que classes de Scala possuam um "objecto companheiro", onde o comportamento +// por instância é capturado nas classes, equanto que o comportamento +// relacionado com todas as instancias dessa classe ficam no objecto. +// A diferença é semelhante a métodos de classes e métodos estáticos noutras +// linguagens. Note que objectos e classes podem ter o mesmo nome. +object Cão { + def raçasConhecidas = List("pitbull", "shepherd", "retriever") + def criarCão(raça: String) = new Cão(raça) +} + + +// Case classes são classes com funcionalidades extra incluidas. Uma questão +// comum de iniciantes de scala é quando devem usar classes e quando devem usar +// case classes. A linha é difusa mas, em geral, classes tendem a concentrar-se +// em encapsulamento, polimorfismo e comportamento. Os valores nestas classes +// tendem a ser privados, sendo apenas exposotos métodos. O propósito principal +// das case classes é armazenarem dados imutáveis. Geralmente possuem poucos +// métods, sendo que estes raramente possuem efeitos secundários. +case class Pessoa(nome: String, telefone: String) + +// Cria uma nova instancia. De notar que case classes não precisam de "new" +val jorge = Pessoa("Jorge", "1234") +val cátia = Pessoa("Cátia", "4567") + +// Case classes trazem algumas vantagens de borla, como acessores: +jorge.telefone // => "1234" + +// Igualdade por campo (não é preciso fazer override do .equals) +Pessoa("Jorge", "1234") == Pessoa("Cátia", "1236") // => false + +// Cópia simples +// outroJorge == Person("jorge", "9876") +val outroJorge = jorge.copy(telefone = "9876") + +// Entre outras. Case classes também suportam correspondência de padrões de +// borla, como pode ser visto de seguida. + + +// Traits em breve! + + +///////////////////////////////////////////////// +// 6. Correspondência de Padrões +///////////////////////////////////////////////// + +// A correspondência de padrões é uma funcionalidade poderosa e bastante +// utilizada em Scala. Eis como fazer correspondência de padrões numa case class: +// Nota: Ao contrário de outras linguagens, cases em scala não necessitam de +// breaks, a computação termina no primeiro sucesso. + +def reconhecePessoa(pessoa: Pessoa): String = pessoa match { + // Agora, especifique os padrões: + case Pessoa("Jorge", tel) => "Encontramos o Jorge! O seu número é " + tel + case Pessoa("Cátia", tel) => "Encontramos a Cátia! O seu número é " + tel + case Pessoa(nome, tel) => "Econtramos alguém : " + nome + ", telefone : " + tel +} + +val email = "(.*)@(.*)".r // Define uma regex para o próximo exemplo. + +// A correspondência de padrões pode parecer familiar aos switches em linguagens +// derivadas de C, mas é muto mais poderoso. Em Scala, é possível fazer +// correspondências com muito mais: +def correspondeTudo(obj: Any): String = obj match { + // Pode-se corresponder valores: + case "Olá mundo" => "Recebi uma string Olá mundo." + + // Corresponder por tipo: + case x: Double => "Recebi um Double: " + x + + // Corresponder tendo em conta condições especificas: + case x: Int if x > 10000 => "Recebi um número bem grande!" + + // Fazer correspondências com case classes (visto anteriormente): + case Pessoa(nome, tel) => s"Recebi o contacto para $nome!" + + // Fazer correspondência com expressões regulares: + case email(nome, dominio) => s"Recebi o endereço de email $nome@$dominio" + + // Corresponder tuplos: + case (a: Int, b: Double, c: String) => s"Recebi o tuplo: $a, $b, $c" + + // Corresponder estruturas de dados: + case List(1, b, c) => s"Recebi uma lista de 3 elementos começada em 1: 1, $b, $c" + + // Combinar padrões: + case List(List((1, 2, "YAY"))) => "Recebi uma lista de lista de triplo" +} + +// Na realidade, é possível fazer correspondência com qualquer objecto que +// defina o método "unapply". Esta funcionalidade é tão poderosa que permite +// definir funções sob a forma de padrões: +val funcPaddrao: Pessoa => String = { + case Pessoa("Jorge", tel) => s"Número do Jorge: $tel" + case Pessoa(nome, tel) => s"Número de alguém: $tel" +} + + +///////////////////////////////////////////////// +// 7. Programação Funcional +///////////////////////////////////////////////// + +// Scala permite que funções e métodos retornem, ou recebam como parámetros, +// outras funções ou métodos + +val soma10: Int => Int = _ + 10 // Função que recebe um Int e retorna um Int +List(1, 2, 3) map soma10 // List(11, 12, 13) - soma10 é aplicado a cada elemento + +// Funções anónimas também podem ser usadas +List(1, 2, 3) map (x => x + 10) + +// Sendo que o símbolo _ também pode ser usado se a função anónima só receber +// um argumento. Este fica com o valor da variável +List(1, 2, 3) map (_ + 10) + +// Se tanto o bloco como a função apenas receberem um argumento, o próprio +// _ pode ser omitido +List("Dom", "Bob", "Natalia") foreach println + + +// Combinadores + +s.map(quadrado) + +val sQuadrado = s.map(quadrado) + +sQuadrado.filter(_ < 10) + +sQuadrado.reduce (_+_) + +// O método filter recebe um predicado (uma função de A => Boolean) e escolhe +// todos os elementos que satisfazem o predicado +List(1, 2, 3) filter (_ > 2) // List(3) +case class Pessoa(nome: String, idade: Int) +List( + Pessoa(nome = "Dom", idade = 23), + Pessoa(nome = "Bob", idade = 30) +).filter(_.idade > 25) // List(Pessoa("Bob", 30)) + + +// O método foreach recebe uma função de A => Unit, executando essa função em +// cada elemento da colecção +val aListOfNumbers = List(1, 2, 3, 4, 10, 20, 100) +aListOfNumbers foreach (x => println(x)) +aListOfNumbers foreach println + +// Compreensões For + +for { n <- s } yield quadrado(n) + +val nQuadrado2 = for { n <- s } yield quadrado(n) + +for { n <- nQuadrado2 if n < 10 } yield n + +for { n <- s; nQuadrado = n * n if nQuadrado < 10} yield nQuadrado + +/* Nota: isto não são ciclos for: A semântica de um ciclo é 'repetir', enquanto + que uma compreensão define a relação entre dois conjuntos de dados. */ + + +///////////////////////////////////////////////// +// 8. Implicitos +///////////////////////////////////////////////// + +/* AVISO IMPORTANTE: Implicitos são um conjunto de funcionalidades muito + * poderosas em Scala, que podem ser fácilmente abusadas. Iniciantes devem + * resistir a tentação de usá-los até que compreendam não só como funcionam, + * mas também as melhores práticas. Apenas incluimos esta secção no tutorial + * devido a estes serem tão comuns em bibliotecas de Scala que muitas delas + * se tornam impossíveis de usar sem conhecer implicitos. Este capítulo serve + * para compreender como trabalhar com implicitos, não como declará-los. +*/ + +// Qualquer valor (vals, funções, objectos, etc) pode ser declarado como +// implicito usando a palavra "implicit". Vamos usar a classe Cão da secção 5 +// nestes exemplos + +implicit val oMeuIntImplicito = 100 +implicit def aMinhaFunçãoImplicita(raça: String) = new Cão("Golden " + raça) + +// Por si só, a palavra implicit não altera o comportamento de um valor, sendo +// que estes podem ser usados da forma habitual. +oMeuIntImplicito + 2 // => 102 +aMinhaFunçãoImplicita("Pitbull").raça // => "Golden Pitbull" + +// A diferença é que estes valores podem ser utilizados quando outro pedaço de +// código "necessite" de uma valor implicito. Um exemplo são argumentos +// implicitos de funções: +def enviaCumprimentos(aQuem: String)(implicit quantos: Int) = + s"Olá $aQuem, $quantos cumprimentos para ti e para os teus!" + +// Se dermos um valor a "quantos", a função comporta-se normalmente +enviaCumprimentos("João")(1000) // => "Olá João, 1000 cumprimentos para ti e para os teus!" + +// Mas, se omitirmos o parâmetro implicito, um valor implicito do mesmo tipo é +// usado, neste caso, "oMeuInteiroImplicito" +enviaCumprimentos("Joana") // => "Olá Joana, 100 cumprimentos para ti e para os teus!" + +// Parâmentros implicitos de funções permitem-nos simular classes de tipos de +// outras linguagens funcionais. Isto é tão comum que tem a sua própria notação. +// As seguintes linhas representam a mesma coisa +// def foo[T](implicit c: C[T]) = ... +// def foo[T : C] = ... + + +// Outra situação em que o compilador prouca um implicito é se encontrar uma +// expressão +// obj.método(...) +// mas "obj" não possuir um método chamado "método". Neste cso, se houver uma +// conversão implicita A => B, onde A é o tipo de obj, e B possui um método +// chamado "método", a conversão é aplicada. Ou seja, tendo +// aMinhaFunçãoImplicita definida, podemos dizer +"Retriever".raça // => "Golden Retriever" +"Sheperd".ladra // => "Woof, woof!" + +// Neste caso, a String é primeiro convertida para Cão usando a nossa funão, +// sendo depois chamado o método apropriado. Esta é uma funcionalidade +// incrivelmente poderosa, sendo que deve ser usada com cautela. Na verdade, +// ao definir a função implicita, o compilador deve lançar um aviso a insisitir +// que só deve definir a função se souber o que está a fazer. + + +///////////////////////////////////////////////// +// 9. Misc +///////////////////////////////////////////////// + +// Importar coisas +import scala.collection.immutable.List + +// Importar todos os "sub pacotes" +import scala.collection.immutable._ + +// Importar multiplas classes numa linha +import scala.collection.immutable.{List, Map} + +// Renomear uma classe importada usando '=>' +import scala.collection.immutable.{List => ImmutableList} + +// Importar todas as classes excepto algumas. Set e Map são excluidos: +import scala.collection.immutable.{Map => _, Set => _, _} + +// O ponto de entrada de um programa em Scala é definido por un ficheiro .scala +// com um método main: +object Aplicação { + def main(args: Array[String]): Unit = { + // código aqui. + } +} + +// Ficheiros podem conter várias classes o objectos. Compilar com scalac + + + + +// Input e output + +// Ler um ficheiro linha a linha +import scala.io.Source +for(linha <- Source.fromFile("ficheiro.txt").getLines()) + println(linha) + +// Escrever um ficheiro usando o PrintWriter de Java +val writer = new PrintWriter("ficheiro.txt") +writer.write("Escrevendo linha por linha" + util.Properties.lineSeparator) +writer.write("Outra linha aqui" + util.Properties.lineSeparator) +writer.close() + +``` + +## Mais recursos + +* [Scala for the impatient](http://horstmann.com/scala/) +* [Twitter Scala school](http://twitter.github.io/scala_school/) +* [The scala documentation](http://docs.scala-lang.org/) +* [Try Scala in your browser](http://scalatutorials.com/tour/) +* Join the [Scala user group](https://groups.google.com/forum/#!forum/scala-user) From 2e05ec8d955b62fef844bd460f5bb455e351d1d0 Mon Sep 17 00:00:00 2001 From: edholland Date: Fri, 2 Oct 2015 02:26:04 +0200 Subject: [PATCH 039/685] Add clarification on bind / match with = op in erlang. Fixes #1139 --- erlang.html.markdown | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/erlang.html.markdown b/erlang.html.markdown index 8b67a76a..d0af7f05 100644 --- a/erlang.html.markdown +++ b/erlang.html.markdown @@ -25,6 +25,7 @@ filename: learnerlang.erl %% 1. Variables and pattern matching. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% In Erlang new variables are bound with an `=` statement. Num = 42. % All variable names must start with an uppercase letter. % Erlang has single-assignment variables; if you try to assign a different @@ -32,9 +33,11 @@ Num = 42. % All variable names must start with an uppercase letter. Num = 43. % ** exception error: no match of right hand side value 43 % In most languages, `=` denotes an assignment statement. In Erlang, however, -% `=` denotes a pattern-matching operation. `Lhs = Rhs` really means this: -% evaluate the right side (`Rhs`), and then match the result against the -% pattern on the left side (`Lhs`). +% `=` denotes a pattern-matching operation. When an empty variable is used on the +% left hand side of the `=` operator to is bound (assigned), but when a bound +% varaible is used on the left hand side the following behaviour is observed. +% `Lhs = Rhs` really means this: evaluate the right side (`Rhs`), and then +% match the result against the pattern on the left side (`Lhs`). Num = 7 * 6. % Floating-point number. From 61597e603f78dc0645517a13b0b258236e5a3563 Mon Sep 17 00:00:00 2001 From: Ed Holland Date: Fri, 2 Oct 2015 01:11:10 +0100 Subject: [PATCH 040/685] Add section on eunit in erlang doc --- erlang.html.markdown | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/erlang.html.markdown b/erlang.html.markdown index 8b67a76a..31cdcdab 100644 --- a/erlang.html.markdown +++ b/erlang.html.markdown @@ -299,6 +299,39 @@ CalculateArea ! {circle, 2}. % 12.56000000000000049738 % The shell is also a process; you can use `self` to get the current pid. self(). % <0.41.0> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% 5. Testing with EUnit +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Unit tests can be written using EUnits's test generators and assert macros +-module(fib). + -export([fib/1]). + -include_lib("eunit/include/eunit.hrl"). + + fib(0) -> 1; + fib(1) -> 1; + fib(N) when N > 1 -> fib(N-1) + fib(N-2). + + fib_test_() -> + [?_assert(fib(0) =:= 1), + ?_assert(fib(1) =:= 1), + ?_assert(fib(2) =:= 2), + ?_assert(fib(3) =:= 3), + ?_assert(fib(4) =:= 5), + ?_assert(fib(5) =:= 8), + ?_assertException(error, function_clause, fib(-1)), + ?_assert(fib(31) =:= 2178309) + ]. + +% EUnit will automatically export to a test() fucntion to allo running the tests +% in the erlang shell +fib:test() + +% The popular erlang build tool Rebar is also compatible with EUnit +% ``` +% rebar eunit +% ``` + ``` ## References From 466b51d9fa4a223014b0d1d79d3d55709c32373d Mon Sep 17 00:00:00 2001 From: willianjusten Date: Sat, 3 Oct 2015 13:49:07 -0300 Subject: [PATCH 041/685] [javascript pt-br] : 5. More about Objects; Constructors and Prototypes --- pt-br/javascript-pt.html.markdown | 134 +++++++++++++++--------------- 1 file changed, 69 insertions(+), 65 deletions(-) diff --git a/pt-br/javascript-pt.html.markdown b/pt-br/javascript-pt.html.markdown index 08448d0b..097a1a8e 100644 --- a/pt-br/javascript-pt.html.markdown +++ b/pt-br/javascript-pt.html.markdown @@ -340,75 +340,74 @@ function sayHelloInFiveSeconds(name){ sayHelloInFiveSeconds("Adam"); // Vai abrir um popup com "Hello, Adam!" em 5s /////////////////////////////////// -// 5. More about Objects; Constructors and Prototypes +// 5. Mais sobre Objetos; Construtores e Prototypes -// Objects can contain functions. +// Objetos podem conter funções. var myObj = { myFunc: function(){ - return "Hello world!"; + return "Olá mundo!"; } }; -myObj.myFunc(); // = "Hello world!" +myObj.myFunc(); // = "Olá mundo!" -// When functions attached to an object are called, they can access the object -// they're attached to using the `this` keyword. +// Quando uma função ligada a um objeto é chamada, ela pode acessar o objeto +// da qual foi ligada usando a palavra-chave `this`. myObj = { - myString: "Hello world!", + myString: "Olá mundo!", myFunc: function(){ return this.myString; } }; -myObj.myFunc(); // = "Hello world!" +myObj.myFunc(); // = "Olá mundo!" -// What this is set to has to do with how the function is called, not where -// it's defined. So, our function doesn't work if it isn't called in the -// context of the object. +// O `this` só funciona para dentro do escopo do objeto, portanto, se chamarmos +// um método do objeto fora de seu escopo, este não irá funcionar. var myFunc = myObj.myFunc; myFunc(); // = undefined -// Inversely, a function can be assigned to the object and gain access to it -// through `this`, even if it wasn't attached when it was defined. +// Inversamente, uma função pode ser atribuída a um objeto e ganhar a acesso +// através do `this`, até mesmo se ela não for chamada quando foi definida. var myOtherFunc = function(){ return this.myString.toUpperCase(); } myObj.myOtherFunc = myOtherFunc; -myObj.myOtherFunc(); // = "HELLO WORLD!" +myObj.myOtherFunc(); // = "OLÁ MUNDO!" -// We can also specify a context for a function to execute in when we invoke it -// using `call` or `apply`. +// Nós podemos também especificar um contexto onde a função irá executar, +// usando o `call` ou `apply`. var anotherFunc = function(s){ return this.myString + s; } -anotherFunc.call(myObj, " And Hello Moon!"); // = "Hello World! And Hello Moon!" +anotherFunc.call(myObj, " E Olá Lua!"); // = "Olá mundo! E Olá Lua!" -// The `apply` function is nearly identical, but takes an array for an argument -// list. +// A função `apply` é praticamente a mesma coisa, mas ela pega um array +// como lista de argumentos. -anotherFunc.apply(myObj, [" And Hello Sun!"]); // = "Hello World! And Hello Sun!" +anotherFunc.apply(myObj, [" E Olá Sol!"]); // = "Olá mundo! E Olá Sol!" -// This is useful when working with a function that accepts a sequence of -// arguments and you want to pass an array. +// Isto é util quando trabalhamos com uma função que aceita uma sequência de +// argumentos e você quer passar um array. Math.min(42, 6, 27); // = 6 Math.min([42, 6, 27]); // = NaN (uh-oh!) Math.min.apply(Math, [42, 6, 27]); // = 6 -// But, `call` and `apply` are only temporary. When we want it to stick, we can -// use `bind`. +// Mas, o `call` e `apply` são somente temporários. Quando você quiser que +// permaneça sempre no escopo, use `bind`. var boundFunc = anotherFunc.bind(myObj); -boundFunc(" And Hello Saturn!"); // = "Hello World! And Hello Saturn!" +boundFunc(" E Olá Saturno!"); // = "Olá mundo! E Olá Saturno!" -// `bind` can also be used to partially apply (curry) a function. +// `bind` também pode ser usado para parcialmente aplicar (curry) uma função. var product = function(a, b){ return a * b; } var doubler = product.bind(this, 2); doubler(8); // = 16 -// When you call a function with the `new` keyword, a new object is created, and -// made available to the function via the this keyword. Functions designed to be -// called like that are called constructors. +// Quando você invoca uma função com a palavra-chave `new`, um novo objeto +// é criado, e fica disponível para a função pela palavra-chave `this`. +// Funções são desenhadas para serem invocadas como se invocam os construtores. var MyConstructor = function(){ this.myNumber = 5; @@ -416,15 +415,17 @@ var MyConstructor = function(){ myNewObj = new MyConstructor(); // = {myNumber: 5} myNewObj.myNumber; // = 5 -// Every JavaScript object has a 'prototype'. When you go to access a property -// on an object that doesn't exist on the actual object, the interpreter will -// look at its prototype. +// Todo objeto JavaScript possui um `prototype`. Quando você tenta acessar +// uma propriedade de um objeto que não existe no objeto atual, o interpretador +// vai olhar imediatamente para o seu prototype. + +// Algumas implementações em JS deixam você acessar o objeto prototype com a +// propriedade mágica `__proto__`. Enquanto isso é util para explicar +// prototypes, não é parte de um padrão; nós vamos falar de algumas formas de +// usar prototypes depois. -// Some JS implementations let you access an object's prototype on the magic -// property `__proto__`. While this is useful for explaining prototypes it's not -// part of the standard; we'll get to standard ways of using prototypes later. var myObj = { - myString: "Hello world!" + myString: "Olá Mundo!" }; var myPrototype = { meaningOfLife: 42, @@ -437,34 +438,36 @@ myObj.__proto__ = myPrototype; myObj.meaningOfLife; // = 42 // This works for functions, too. -myObj.myFunc(); // = "hello world!" +// Isto funciona para funções, também. +myObj.myFunc(); // = "olá mundo!" -// Of course, if your property isn't on your prototype, the prototype's -// prototype is searched, and so on. +// É claro, se sua propriedade não está em seu prototype, +// o prototype do prototype será procurado e por aí vai. myPrototype.__proto__ = { myBoolean: true }; myObj.myBoolean; // = true -// There's no copying involved here; each object stores a reference to its -// prototype. This means we can alter the prototype and our changes will be -// reflected everywhere. +// Não há cópia envolvida aqui; cada objeto guarda uma referência do +// prototype. Isso significa que podemos alterar o prototype e nossas mudanças +// serão refletidas em qualquer lugar. myPrototype.meaningOfLife = 43; myObj.meaningOfLife; // = 43 -// We mentioned that `__proto__` was non-standard, and there's no standard way to -// change the prototype of an existing object. However, there are two ways to -// create a new object with a given prototype. -// The first is Object.create, which is a recent addition to JS, and therefore -// not available in all implementations yet. +// Nós mencionamos que o `__proto__` não é uma forma padrão, e não há uma +// forma padrão de mudar o prototype de um objeto já existente. Entretanto, +// existem duas formas de se criar um objeto com um dado prototype. + +// A primeira forma é `Object.create`, que é uma adição recente do JS, +// e ainda não está disponível em todas as implementações. var myObj = Object.create(myPrototype); myObj.meaningOfLife; // = 43 -// The second way, which works anywhere, has to do with constructors. -// Constructors have a property called prototype. This is *not* the prototype of -// the constructor function itself; instead, it's the prototype that new objects -// are given when they're created with that constructor and the new keyword. +// A segunda forma, que funciona em qualquer lugar, é feita com construtores. +// Construtores tem uma propriedade chamada prototype. Este *não* é o prototype +// do construtor em si; ao invés disso, ele é o prototype dos novos objetos +// criados pelo construtor. MyConstructor.prototype = { myNumber: 5, getMyNumber: function(){ @@ -476,42 +479,43 @@ myNewObj2.getMyNumber(); // = 5 myNewObj2.myNumber = 6 myNewObj2.getMyNumber(); // = 6 -// Built-in types like strings and numbers also have constructors that create -// equivalent wrapper objects. +// Tipos originais da linguagem como strings e números também possuem +// construtores equivalentes. var myNumber = 12; var myNumberObj = new Number(12); myNumber == myNumberObj; // = true -// Except, they aren't exactly equivalent. +// Exceto, que eles não são totalmente equivalentes. typeof myNumber; // = 'number' typeof myNumberObj; // = 'object' myNumber === myNumberObj; // = false if (0){ - // This code won't execute, because 0 is falsy. + // O código não vai executar, porque 0 é um valor falso. } if (Number(0)){ - // This code *will* execute, because Number(0) is truthy. + // O código *vai* executar, porque `Number(0)` é um valor verdadeiro. } -// However, the wrapper objects and the regular builtins share a prototype, so -// you can actually add functionality to a string, for instance. +// Entretanto, esses objetos encapsulados e as funções originais compartilham +// um mesmo prototype, portanto você pode adicionar funcionalidades a uma string, +// por exemplo. String.prototype.firstCharacter = function(){ return this.charAt(0); } "abc".firstCharacter(); // = "a" -// This fact is often used in "polyfilling", which is implementing newer -// features of JavaScript in an older subset of JavaScript, so that they can be -// used in older environments such as outdated browsers. +// Esse fato é usado para criar os chamados `polyfills`, que implementam +// uma nova característica do Javascript em uma versão mais velha, para que +// assim funcionem em ambientes mais velhos como browsers ultrapassados. -// For instance, we mentioned that Object.create isn't yet available in all -// implementations, but we can still use it with this polyfill: +// Havíamos mencionado que `Object.create` não estava ainda disponível em +// todos as implementações, mas nós podemos usá-lo com esse polyfill: if (Object.create === undefined){ // don't overwrite it if it exists Object.create = function(proto){ - // make a temporary constructor with the right prototype + // faz um construtor temporário com o prototype certo var Constructor = function(){}; Constructor.prototype = proto; - // then use it to create a new, appropriately-prototyped object + // então utiliza o new para criar um objeto prototype apropriado return new Constructor(); } } From 46d509077f10fc9b04aaf69829526d4b8297798d Mon Sep 17 00:00:00 2001 From: willianjusten Date: Sat, 3 Oct 2015 14:03:54 -0300 Subject: [PATCH 042/685] [javascript pt-br] : Leitura Adicional --- pt-br/javascript-pt.html.markdown | 39 ++++++++++++++++--------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/pt-br/javascript-pt.html.markdown b/pt-br/javascript-pt.html.markdown index 097a1a8e..f4b5ed2c 100644 --- a/pt-br/javascript-pt.html.markdown +++ b/pt-br/javascript-pt.html.markdown @@ -521,30 +521,31 @@ if (Object.create === undefined){ // don't overwrite it if it exists } ``` -## Further Reading +## Leitura Adicional -The [Mozilla Developer -Network](https://developer.mozilla.org/en-US/docs/Web/JavaScript) provides -excellent documentation for JavaScript as it's used in browsers. Plus, it's a -wiki, so as you learn more you can help others out by sharing your own -knowledge. +O [Mozilla Developer +Network](https://developer.mozilla.org/en-US/docs/Web/JavaScript) dispõe de uma +excelente documentação sobre Javascript e seu uso nos browsers. E mais, +é uma wiki, portanto conforme você vai aprendendo, mais você pode ir ajudando +os outros compartilhando do seu conhecimento. -MDN's [A re-introduction to -JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript) -covers much of the concepts covered here in more detail. This guide has quite -deliberately only covered the JavaScript language itself; if you want to learn -more about how to use JavaScript in web pages, start by learning about the +[Uma re-introdução do JavaScript pela MDN] +(https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript) +cobre muito dos conceitos abordados aqui em mais detalhes. Este guia fala +somente sobre a linguagem JavaScript em si; se você quiser aprender mais +sobre e como usar o JavaScript em páginas na web, comece aprendendo sobre [Document Object Model](https://developer.mozilla.org/en-US/docs/Using_the_W3C_DOM_Level_1_Core) -[Learn Javascript by Example and with Challenges](http://www.learneroo.com/modules/64/nodes/350) is a variant of this reference with built-in challenges. +[Aprenda Javascript por Exemplos e com Desafios](http://www.learneroo.com/modules/64/nodes/350) é uma +variação desse guia com desafios. -[JavaScript Garden](http://bonsaiden.github.io/JavaScript-Garden/) is an in-depth -guide of all the counter-intuitive parts of the language. +[JavaScript Garden](http://bonsaiden.github.io/JavaScript-Garden/) é um guia +profundo de todas as partes do JavaScript. -[JavaScript: The Definitive Guide](http://www.amazon.com/gp/product/0596805527/) is a classic guide / reference book. +[JavaScript: The Definitive Guide](http://www.amazon.com/gp/product/0596805527/) é o guia clássico +/ livro de referência. -In addition to direct contributors to this article, some content is adapted -from Louie Dinh's Python tutorial on this site, and the [JS -Tutorial](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript) -on the Mozilla Developer Network. +Parte desse artigo foi adaptado do tutorial de Python do Louie Dinh que está +nesse site e do [Tutorial de JS](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript) +da Mozilla Developer Network. From 261f7a249f13f3f13f5619f2a3202d0273010df2 Mon Sep 17 00:00:00 2001 From: DPS Date: Sat, 3 Oct 2015 20:00:47 +0200 Subject: [PATCH 043/685] [git/de] fixed typo --- de-de/git-de.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de-de/git-de.html.markdown b/de-de/git-de.html.markdown index c7b6ad86..43939129 100644 --- a/de-de/git-de.html.markdown +++ b/de-de/git-de.html.markdown @@ -48,7 +48,7 @@ Ein Repository besteht in Git aus dem .git-Verzeichnis und dem Arbeitsverzeichni ### .git-Verzeichnis (Teil des Repositorys) -Das .git-Verzeichnis enth? alle Einstellung, Logs, Branches, den HEAD und mehr. +Das .git-Verzeichnis enthält alle Einstellung, Logs, Branches, den HEAD und mehr. [Ausführliche Übersicht](http://gitready.com/advanced/2009/03/23/whats-inside-your-git-directory.html) ### Arbeitsverzeichnis (Teil des Repositorys) From 4719d4707cbda05daab4e05e1c85655ff7abf2fd Mon Sep 17 00:00:00 2001 From: DPS Date: Sat, 3 Oct 2015 20:20:03 +0200 Subject: [PATCH 044/685] [go/de] fixed typo --- de-de/go-de.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de-de/go-de.html.markdown b/de-de/go-de.html.markdown index 83d59c8b..765372e0 100644 --- a/de-de/go-de.html.markdown +++ b/de-de/go-de.html.markdown @@ -312,7 +312,7 @@ Dokumentation lesen. Auch zu empfehlen ist die Spezifikation von Go, die nach heutigen Standards sehr kurz und auch gut verständlich formuliert ist. Auf der Leseliste von Go-Neulingen ist außerdem der Quelltext der [Go standard Bibliothek](http://golang.org/src/pkg/). -Gut documentiert, demonstriert sie leicht zu verstehendes und im idiomatischen Stil +Gut dokumentiert, demonstriert sie leicht zu verstehendes und im idiomatischen Stil verfasstes Go. Erreichbar ist der Quelltext auch durch das Klicken der Funktionsnamen in der [offiziellen Dokumentation von Go](http://golang.org/pkg/). From 6f29bcc20175a348f3b1dd606d8a0ace5d48fe54 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Sat, 3 Oct 2015 15:39:37 -0700 Subject: [PATCH 045/685] Update Python-fr.html.markdown Add Link to Python3 English article. --- fr-fr/python-fr.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fr-fr/python-fr.html.markdown b/fr-fr/python-fr.html.markdown index 58a036ba..26cab55f 100644 --- a/fr-fr/python-fr.html.markdown +++ b/fr-fr/python-fr.html.markdown @@ -15,7 +15,7 @@ Je suis tombé amoureux de Python de par la clarté de sa syntaxe. C'est pratiqu Vos retours sont grandement appréciés. Vous pouvez me contacter sur Twitter [@louiedinh](http://twitter.com/louiedinh) ou par e-mail: louiedinh [at] [google's email service] NB: Cet artice s'applique spécifiquement à Python 2.7, mais devrait s'appliquer pour toute version Python 2.x -Vous pourrez bientôt trouver un article pour Python 3! +Vous pourrez bientôt trouver un article pour Python 3 an Français. Pour le moment vous pouvez jettez un coup d'oeil à l'article [Python 3 en Anglais](http://learnxinyminutes.com/docs/python3/). ```python # Une ligne simple de commentaire commence par un dièse From 998fdfdfcdff05cb0721841215addbcdd94d30b0 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Sat, 3 Oct 2015 15:40:41 -0700 Subject: [PATCH 046/685] typo --- fr-fr/python-fr.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fr-fr/python-fr.html.markdown b/fr-fr/python-fr.html.markdown index 26cab55f..5a03ecfc 100644 --- a/fr-fr/python-fr.html.markdown +++ b/fr-fr/python-fr.html.markdown @@ -15,7 +15,7 @@ Je suis tombé amoureux de Python de par la clarté de sa syntaxe. C'est pratiqu Vos retours sont grandement appréciés. Vous pouvez me contacter sur Twitter [@louiedinh](http://twitter.com/louiedinh) ou par e-mail: louiedinh [at] [google's email service] NB: Cet artice s'applique spécifiquement à Python 2.7, mais devrait s'appliquer pour toute version Python 2.x -Vous pourrez bientôt trouver un article pour Python 3 an Français. Pour le moment vous pouvez jettez un coup d'oeil à l'article [Python 3 en Anglais](http://learnxinyminutes.com/docs/python3/). +Vous pourrez bientôt trouver un article pour Python 3 en Français. Pour le moment vous pouvez jettez un coup d'oeil à l'article [Python 3 en Anglais](http://learnxinyminutes.com/docs/python3/). ```python # Une ligne simple de commentaire commence par un dièse From 0d2863186231324b14e8d3a1d25aa8e44078aa68 Mon Sep 17 00:00:00 2001 From: willianjusten Date: Sat, 3 Oct 2015 21:03:58 -0300 Subject: [PATCH 047/685] Sync pt with original js --- pt-br/javascript-pt.html.markdown | 3 --- 1 file changed, 3 deletions(-) diff --git a/pt-br/javascript-pt.html.markdown b/pt-br/javascript-pt.html.markdown index f4b5ed2c..e39c6c8e 100644 --- a/pt-br/javascript-pt.html.markdown +++ b/pt-br/javascript-pt.html.markdown @@ -492,9 +492,6 @@ myNumber === myNumberObj; // = false if (0){ // O código não vai executar, porque 0 é um valor falso. } -if (Number(0)){ - // O código *vai* executar, porque `Number(0)` é um valor verdadeiro. -} // Entretanto, esses objetos encapsulados e as funções originais compartilham // um mesmo prototype, portanto você pode adicionar funcionalidades a uma string, From 4206b4ccd04c8343e6becd58a2c9549e9593cbd6 Mon Sep 17 00:00:00 2001 From: David Stockton Date: Sat, 3 Oct 2015 19:35:42 -0600 Subject: [PATCH 048/685] Correct usage of "it's" in javascript doc --- json.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json.html.markdown b/json.html.markdown index f57b82b8..47a8cb21 100644 --- a/json.html.markdown +++ b/json.html.markdown @@ -49,7 +49,7 @@ going to be 100% valid JSON. Luckily, it kind of speaks for itself. "alternative style": { "comment": "check this out!" - , "comma position": "doesn't matter - as long as its before the value, then its valid" + , "comma position": "doesn't matter - as long as it's before the value, then it's valid" , "another comment": "how nice" }, From eb35f7748a11e04f15cb9901a86702f881155b14 Mon Sep 17 00:00:00 2001 From: David Stockton Date: Sat, 3 Oct 2015 19:40:02 -0600 Subject: [PATCH 049/685] Fix usage of "it's" in example comment for chapel --- chapel.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chapel.html.markdown b/chapel.html.markdown index c8489371..05e5b867 100644 --- a/chapel.html.markdown +++ b/chapel.html.markdown @@ -1074,14 +1074,14 @@ Installing the Compiler Chapel can be built and installed on your average 'nix machine (and cygwin). [Download the latest release version](https://github.com/chapel-lang/chapel/releases/) -and its as easy as +and it's as easy as 1. `tar -xvf chapel-1.11.0.tar.gz` 2. `cd chapel-1.11.0` 3. `make` 4. `source util/setchplenv.bash # or .sh or .csh or .fish` -You will need to `source util/setchplenv.EXT` from within the Chapel directory (`$CHPL_HOME`) every time your terminal starts so its suggested that you drop that command in a script that will get executed on startup (like .bashrc). +You will need to `source util/setchplenv.EXT` from within the Chapel directory (`$CHPL_HOME`) every time your terminal starts so it's suggested that you drop that command in a script that will get executed on startup (like .bashrc). Chapel is easily installed with Brew for OS X @@ -1100,4 +1100,4 @@ Notable arguments: * `--fast`: enables a number of optimizations and disables array bounds checks. Should only enable when application is stable. * `--set =`: set config param `` to `` at compile-time. * `--main-module `: use the main() procedure found in the module `` as the executable's main. - * `--module-dir `: includes `` in the module search path. \ No newline at end of file + * `--module-dir `: includes `` in the module search path. From 2ede63f54cb59b99c0d3da712814f5556a979660 Mon Sep 17 00:00:00 2001 From: David Stockton Date: Sat, 3 Oct 2015 19:41:52 -0600 Subject: [PATCH 050/685] Fix incorrect "its" to "it is" in visual basic doc --- visualbasic.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/visualbasic.html.markdown b/visualbasic.html.markdown index 00d61843..f9906e96 100644 --- a/visualbasic.html.markdown +++ b/visualbasic.html.markdown @@ -236,7 +236,7 @@ Module Module1 'Nine Private Sub IfElseStatement() Console.Title = "If / Else Statement | Learn X in Y Minutes" - 'Sometimes its important to consider more than two alternatives. + 'Sometimes it is important to consider more than two alternatives. 'Sometimes there are a good few others. 'When this is the case, more than one if statement would be required. 'An if statement is great for vending machines. Where the user enters a code. From 9bc553c46ce9b7154ec7c82451d71608f4beda82 Mon Sep 17 00:00:00 2001 From: Pushkar Sharma Date: Sun, 4 Oct 2015 10:12:55 +0530 Subject: [PATCH 051/685] Update c++.html.markdown Regarding issue #1216, Better explaining the Reference 'fooRef'. --- c++.html.markdown | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/c++.html.markdown b/c++.html.markdown index 4acc1b9d..bbd2f9a9 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -245,7 +245,13 @@ cout << fooRef; // Prints "I am foo. Hi!" // Doesn't reassign "fooRef". This is the same as "foo = bar", and // foo == "I am bar" // after this line. +cout << &fooRef << endl; //Prints address of fooRef fooRef = bar; +cout << &fooRef << endl; //Prints address of fooRef, AGAIN +cout << fooRef; // Prints "I am bar" + +//The address of fooRef remains the same, i.e. it is still referring to foo. + const string& barRef = bar; // Create a const reference to bar. // Like C, const values (and pointers and references) cannot be modified. From c7e552c448c5a562a3ff5f442a7ed834aec04d9e Mon Sep 17 00:00:00 2001 From: Pushkar Sharma Date: Sun, 4 Oct 2015 10:34:31 +0530 Subject: [PATCH 052/685] Variable size array, user size input added. #1170 Fixed Issue #1170 Variable size array, user size input added. --- c.html.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/c.html.markdown b/c.html.markdown index 8e631de4..36621a9e 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -130,7 +130,9 @@ int main(void) { // can be declared as well. The size of such an array need not be a compile // time constant: printf("Enter the array size: "); // ask the user for an array size - char buf[0x100]; + int size; + scanf("%d", &size); + char buf[size]; fgets(buf, sizeof buf, stdin); // strtoul parses a string to an unsigned integer From 9b00510c452a24197f7b8d30dee1a5f170e3cdee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerson=20L=C3=A1zaro?= Date: Sun, 4 Oct 2015 00:09:26 -0500 Subject: [PATCH 053/685] =?UTF-8?q?[c++/es]=20a=C3=B1adido?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- es-es/c++-es.html.markdown | 829 +++++++++++++++++++++++++++++++++++++ 1 file changed, 829 insertions(+) create mode 100644 es-es/c++-es.html.markdown diff --git a/es-es/c++-es.html.markdown b/es-es/c++-es.html.markdown new file mode 100644 index 00000000..bcc775e5 --- /dev/null +++ b/es-es/c++-es.html.markdown @@ -0,0 +1,829 @@ +--- +language: c++ +filename: learncpp.cpp +contributors: + - ["Steven Basart", "http://github.com/xksteven"] + - ["Matt Kline", "https://github.com/mrkline"] + - ["Geoff Liu", "http://geoffliu.me"] + - ["Connor Waters", "http://github.com/connorwaters"] +translators: + - ["Gerson Lázaro", "https://gersonlazaro.com"] +lang: es-es +--- + +C++ es un lenguaje de programación de sistemas que, +[de acuerdo a su inventor Bjarne Stroustrup](http://channel9.msdn.com/Events/Lang-NEXT/Lang-NEXT-2014/Keynote), +fue diseñado para + +- ser un "mejor C" +- soportar abstracción de datos +- soportar programación orientada a objetos +- soportar programación genérica + +Aunque su sintaxis puede ser más difícil o compleja que los nuevos lenguajes, +es ampliamente utilizado, ya que compila instrucciones nativas que pueden ser +directamente ejecutadas por el procesador y ofrece un estricto control sobre +el hardware (como C), mientras ofrece características de alto nivel como +genericidad, excepciones, y clases. Esta combinación de velocidad y +funcionalidad hace de C ++ uno de los lenguajes de programación más utilizados. + +```c++ +//////////////////// +// Comparación con C +//////////////////// + +// C ++ es _casi_ un superconjunto de C y comparte su sintaxis básica para las +// declaraciones de variables, tipos primitivos y funciones. + +// Al igual que en C, el punto de entrada de tu programa es una función llamada +// main con un retorno de tipo entero. +// Este valor sirve como código de salida del programa. +// Mira http://en.wikipedia.org/wiki/Exit_status para mayor información. +int main(int argc, char** argv) +{ + // Los argumentos de la línea de comandos se pasan por argc y argv de la + // misma manera que en C. + // argc indica el número de argumentos, + // y argv es un arreglo de strings de estilo C (char*) + // representando los argumentos. + // El primer argumento es el nombre con el que el programa es llamado. + // argc y argv pueden omitirse si no te preocupan los argumentos, + // dejando la definición de la función como int main () + + // Un estado de salida 0 indica éxito. + return 0; +} + +// Sin embargo, C ++ varía en algunas de las siguientes maneras: + +// En C++, los caracteres literales son caracteres +sizeof('c') == sizeof(char) == 1 + +// En C, los caracteres literales son enteros +sizeof('c') == sizeof(int) + + +// C++ tiene prototipado estricto +void func(); // función que no acepta argumentos + +// En C +void func(); // función que puede aceptar cualquier número de argumentos + +// Use nullptr en lugar de NULL en C++ +int* ip = nullptr; + +// Las cabeceras (headers) estándar de C están disponibles en C ++, +// pero tienen el prefijo "c" y no tienen sufijo .h. +#include + +int main() +{ + printf("Hola mundo!\n"); + return 0; +} + +////////////////////////// +// Sobrecarga de funciones +////////////////////////// + +// C++ soporta sobrecarga de funciones +// siempre que cada función tenga diferentes parámetros. + +void print(char const* myString) +{ + printf("String %s\n", myString); +} + +void print(int myInt) +{ + printf("Mi entero es %d", myInt); +} + +int main() +{ + print("Hello"); // Resolves to void print(const char*) + print(15); // Resolves to void print(int) +} + +//////////////////////////////////// +// Argumentos de función por defecto +//////////////////////////////////// + +// Puedes proporcionar argumentos por defecto para una función si no son +// proporcionados por quien la llama. + +void doSomethingWithInts(int a = 1, int b = 4) +{ + // Hacer algo con los enteros aqui +} + +int main() +{ + doSomethingWithInts(); // a = 1, b = 4 + doSomethingWithInts(20); // a = 20, b = 4 + doSomethingWithInts(20, 5); // a = 20, b = 5 +} + +// Los argumentos predeterminados deben estar al final de la lista de argumentos. + +void invalidDeclaration(int a = 1, int b) // Error! +{ +} + +///////////////////// +// Espacios de nombre +///////////////////// + +// Espacios de nombres proporcionan ámbitos separados para variable, función y +// otras declaraciones. +// Los espacios de nombres se pueden anidar. + +namespace First { + namespace Nested { + void foo() + { + printf("Esto es First::Nested::foo\n"); + } + } // fin del nombre de espacio Nested +} // fin del nombre de espacio First + +namespace Second { + void foo() + { + printf("Esto es Second::foo\n") + } +} + +void foo() +{ + printf("Este es global: foo\n"); +} + +int main() +{ + + // Incluye todos los símbolos del espacio de nombre Second en el ámbito + // actual. Tenga en cuenta que simplemente foo() no funciona, ya que ahora + // es ambigua si estamos llamando a foo en espacio de nombres Second o en + // el nivel superior. + using namespace Second; + + Second::foo(); // imprime "Esto es Second::foo" + First::Nested::foo(); // imprime "Esto es First::Nested::foo" + ::foo(); // imprime "Este es global: foo" +} + +///////////////// +// Entrada/Salida +///////////////// + +// La entrada y salida de C++ utiliza flujos (streams) +// cin, cout, y cerr representan a stdin, stdout, y stderr. +// << es el operador de inserción >> es el operador de extracción. + + +#include // Incluir para el flujo de entrada/salida + +using namespace std; // Los streams estan en std namespace (libreria estandar) + +int main() +{ + int myInt; + + // Imprime a la stdout (o terminal/pantalla) + cout << "Ingresa tu número favorito:\n"; + // Toma una entrada + cin >> myInt; + + // cout puede también ser formateado + cout << "Tu número favorito es " << myInt << "\n"; + // imprime "Tu número favorito es " + + cerr << "Usado para mensajes de error"; +} +//////////////////// +// Cadenas (Strings) +//////////////////// + +// Las cadenas en C++ son objetos y tienen muchas funciones +#include + +using namespace std; // Strings también estan en namespace std + +string myString = "Hola"; +string myOtherString = " Mundo"; + +// + es usado para concatenar. +cout << myString + myOtherString; // "Hola Mundo" + +cout << myString + " Tu"; // "Hola Tu" + +// Las cadenas en C++ son mutables y tienen valor semántico. +myString.append(" Perro"); +cout << myString; // "Hola Perro" + + +////////////// +// Referencias +////////////// + +// Además de punteros como los de C, +// C++ tiene _references_. +// Estos tipos de puntero no pueden ser reasignados una vez establecidos +// Y no pueden ser nulos. +// También tienen la misma sintaxis que la propia variable: +// No es necesaria * para eliminar la referencia y +// & (dirección) no se utiliza para la asignación. + +using namespace std; + +string foo = "Yo soy foo"; +string bar = "Yo soy bar"; + +string& fooRef = foo; // Crea una referencia a foo. +fooRef += ". Hola!"; // Modifica foo través de la referencia +cout << fooRef; // Imprime "Yo soy foo. Hola!" + +// No trate de reasignar "fooRef". Esto es lo mismo que "foo = bar", y +// foo == "Yo soy bar" +// después de esta linea. +fooRef = bar; + +const string& barRef = bar; // Crea una referencia constante a bar. +// Como en C, los valores constantes (y punteros y referencias) no pueden ser +// modificados. +barRef += ". Hola!"; // Error, referencia constante no puede ser modificada. + +// Sidetrack: Antes de hablar más sobre referencias, hay que introducir un +// concepto llamado objeto temporal. Supongamos que tenemos el siguiente código: +string tempObjectFun() { ... } +string retVal = tempObjectFun(); + +// Lo que pasa en la segunda línea es en realidad: +// - Un objeto de cadena es retornado desde tempObjectFun +// - Una nueva cadena se construye con el objeto devuelto como argumento al +// constructor +// - El objeto devuelto es destruido +// El objeto devuelto se llama objeto temporal. Objetos temporales son +// creados cada vez que una función devuelve un objeto, y es destruido en el +// fin de la evaluación de la expresión que encierra (Bueno, esto es lo que la +// norma dice, pero los compiladores están autorizados a cambiar este +// comportamiento. Busca "return value optimization" para ver mas detalles). +// Así que en este código: +foo(bar(tempObjectFun())) + +// Suponiendo que foo y bar existen, el objeto retornado de tempObjectFun es +// pasado al bar, y se destruye antes de llamar foo. + +// Ahora, de vuelta a las referencias. La excepción a la regla "en el extremo +// de la expresión encerrada" es si un objeto temporal se une a una +// referencia constante, en cuyo caso su vida se extiende al ámbito actual: + +void constReferenceTempObjectFun() { + // ConstRef obtiene el objeto temporal, y es válido hasta el final de esta +  // función. + const string& constRef = tempObjectFun(); + ... +} + +// Otro tipo de referencia introducida en C ++ 11 es específicamente para +// objetos temporales. No se puede tener una variable de este tipo, pero tiene +// prioridad en resolución de sobrecarga: + +void someFun(string& s) { ... } // Referencia regular +void someFun(string&& s) { ... } // Referencia a objeto temporal + +string foo; +someFun(foo); // Llama la función con referencia regular +someFun(tempObjectFun()); // Llama la versión con referencia temporal + +// Por ejemplo, puedes ver estas dos versiones de constructores para +// std::basic_string: +basic_string(const basic_string& other); +basic_string(basic_string&& other); + +// La idea es que si estamos construyendo una nueva cadena de un objeto temporal +// (que va a ser destruido pronto de todos modos), podemos tener un constructor +// mas eficiente que "rescata" partes de esa cadena temporal. Usted verá este +// Concepto denominado "movimiento semántico". + +//////////////////////////////////////////// +// Clases y programación orientada a objetos +//////////////////////////////////////////// + +// Primer ejemplo de clases +#include + +// Declara una clase. +// Las clases son usualmente declaradas en archivos de cabeceras (.h o .hpp) +class Dog { + // Variables y funciones de la clase son privados por defecto. + std::string name; + int weight; + +// Todos los miembros siguientes de este son públicos +// Hasta que se encuentre "private" o "protected". +// All members following this are public +// until "private:" or "protected:" is found. +public: + + // Constructor por defecto + Dog(); + + // Declaraciones de funciones de la clase (implementaciones a seguir) +    // Nota que usamos std::string aquí en lugar de colocar +    // using namespace std; +    // arriba. +    // Nunca ponga una declaración "using namespace" en un encabezado. + void setName(const std::string& dogsName); + + void setWeight(int dogsWeight); + // Funciones que no modifican el estado del objeto + // Deben marcarse como const. + // Esto le permite llamarlas si se envia una referencia constante al objeto. + // También tenga en cuenta que las funciones deben ser declaradas + // explícitamente como _virtual_ para que sea reemplazada en las clases + // derivadas. + // Las funciones no son virtuales por defecto por razones de rendimiento. + virtual void print() const; + + // Las funciones también se pueden definir en el interior + // del cuerpo de la clase. + // Funciones definidas como tales están entre líneas automáticamente. + void bark() const { std::cout << name << " barks!\n"; } + + // Junto a los constructores, C++ proporciona destructores. + // Estos son llamados cuando un objeto se elimina o está fuera del ámbito. + // Esto permite paradigmas potentes como RAII + // (mira abajo) + // El destructor debe ser virtual si una clase es dervada desde el; + // Si no es virtual, entonces la clase derivada destructor + // No será llamada si el objeto se destruye a través de una referencia de + // la clase base o puntero. + virtual ~Dog(); + + + +}; // Un punto y coma debe seguir la definición de clase. + +// Las funciones de una clase son normalmente implementados en archivos .cpp. +Dog::Dog() +{ + std::cout << "Un perro ha sido construido\n"; +} + +// Objetos (tales como cadenas) deben ser pasados por referencia +// Si los estas modificando o referencia constante en caso contrario. +void Dog::setName(const std::string& dogsName) +{ + name = dogsName; +} + +void Dog::setWeight(int dogsWeight) +{ + weight = dogsWeight; +} + +// Nota que "virtual" sólo se necesita en la declaración, no en la definición. +void Dog::print() const +{ + std::cout << "El perro es " << name << " y pesa " << weight << "kg\n"; +} + +Dog::~Dog() +{ + cout << "Adiós " << name << "\n"; +} + +int main() { + Dog myDog; // imprime "Un perro ha sido construido" + myDog.setName("Barkley"); + myDog.setWeight(10); + myDog.print(); // imprime "El perro es Barkley y pesa 10 kg" + return 0; +} // imprime "Adiós Barkley" + +// Herencia: + +// Esta clase hereda todo lo público y protegido de la clase Dog +class OwnedDog : public Dog { + + void setOwner(const std::string& dogsOwner); + + // Reemplaza el comportamiento de la función de impresión + // de todos los OwnedDogs. Mira + // http://en.wikipedia.org/wiki/Polymorphism_(computer_science)#Subtyping + // Para una introducción más general si no está familiarizado con el + // polimorfismo de subtipo. + // La palabra clave override es opcional, pero asegura que estás + // reemplazando el método de una clase base. + void print() const override; + +private: + std::string owner; +}; + +// Mientras tanto, en el archivo .cpp correspondiente: + +void OwnedDog::setOwner(const std::string& dogsOwner) +{ + owner = dogsOwner; +} + +void OwnedDog::print() const +{ + Dog::print(); // Llama a la función de impresión en la clase base Dog + std::cout << "El perro es de " << owner << "\n"; + // Imprime "El perro es y pesa " + // "El perro es de " +} + +//////////////////////////////////////////// +// Inicialización y sobrecarga de operadores +//////////////////////////////////////////// + +// En C ++ se puede sobrecargar el comportamiento +// de los operadores como +, -, *, /, etc. +// Esto se hace mediante la definición de una función que es llamada +// cada vez que se utiliza el operador. + +#include +using namespace std; + +class Point { +public: + // Las variables de la clase pueden dar valores por defecto de esta manera. + double x = 0; + double y = 0; + + // Define un constructor por defecto que no hace nada + // pero inicializa el punto al valor por defecto (0, 0) + Point() { }; + + // The following syntax is known as an initialization list + // and is the proper way to initialize class member values + Point (double a, double b) : + x(a), + y(b) + { /* No hace nada excepto inicializar los valores */ } + + // Sobrecarga el operador + + Point operator+(const Point& rhs) const; + + // Sobrecarga el operador += + Point& operator+=(const Point& rhs); + + // También tendría sentido añadir los operadores - y -=, +    // Pero vamos a omitirlos por razones de brevedad. +}; + +Point Point::operator+(const Point& rhs) const +{ + // Crea un nuevo punto que es la suma de este y rhs. + return Point(x + rhs.x, y + rhs.y); +} + +Point& Point::operator+=(const Point& rhs) +{ + x += rhs.x; + y += rhs.y; + return *this; +} + +int main () { + Point up (0,1); + Point right (1,0); + // Llama al operador + de Point + // Point llama la función + con right como parámetro + Point result = up + right; + // Prints "Result is upright (1,1)" + cout << "Result is upright (" << result.x << ',' << result.y << ")\n"; + return 0; +} + +///////////////////////// +// Plantillas (Templates) +///////////////////////// + +// Las plantillas en C++ se utilizan sobre todo en la programación genérica, +// a pesar de que son mucho más poderoso que los constructores genéricos +// en otros lenguajes. Ellos también soportan especialización explícita y +// parcial y clases de tipo estilo funcional; de hecho, son un lenguaje +// funcional Turing-completo incrustado en C ++! + +// Empezamos con el tipo de programación genérica que podría estar +// familiarizado. +// Para definir una clase o función que toma un parámetro de tipo: +template +class Box { +public: + // En este caso, T puede ser usado como cualquier otro tipo. + void insert(const T&) { ... } +}; + +// Durante la compilación, el compilador realmente genera copias de cada +// plantilla con parámetros sustituidos, por lo que la definición completa +// de la clase debe estar presente en cada invocación. +// Es por esto que usted verá clases de plantilla definidas +// Enteramente en archivos de cabecera. + +//Para crear una instancia de una clase de plantilla en la pila: +Box intBox; + +y puedes utilizarlo como era de esperar: +intBox.insert(123); + +// Puedes, por supuesto, anidar plantillas: +Box > boxOfBox; +boxOfBox.insert(intBox); + +// Hasta C++11, había que colocar un espacio entre los dos '>'s, +// de lo contrario '>>' serían analizados como el operador de desplazamiento +// a la derecha. + + +// A veces verás +// template +// en su lugar. La palabra clave "class" y las palabras clave "typename" son +// mayormente intercambiables en este caso. Para la explicación completa, mira +// http://en.wikipedia.org/wiki/Typename +// (sí, esa palabra clave tiene su propia página de Wikipedia). + +// Del mismo modo, una plantilla de función: +template +void barkThreeTimes(const T& input) +{ + input.bark(); + input.bark(); + input.bark(); +} + +// Observe que no se especifica nada acerca de los tipos de parámetros aquí. +// El compilador generará y comprobará cada invocación de la plantilla, +// por lo que la función anterior funciona con cualquier tipo "T" +// que tenga un método 'bark' constante! + + +Dog fluffy; +fluffy.setName("Fluffy") +barkThreeTimes(fluffy); // Imprime "Fluffy barks" 3 veces. + +Los parámetros de la plantilla no tienen que ser las clases: +template +void printMessage() { + cout << "Aprende C++ en " << Y << " minutos!" << endl; +} + +// Y usted puede especializar explícitamente plantillas +// para código más eficiente. +// Por supuesto, la mayor parte del mundo real que utiliza una especialización +// no son tan triviales como esta. +// Tenga en cuenta que usted todavía tiene que declarar la función (o clase) +// como plantilla incluso si ha especificado de forma explícita todos +// los parámetros. + +template<> +void printMessage<10>() { + cout << "Aprende C++ rapido en solo 10 minutos!" << endl; +} + +printMessage<20>(); // Prints "Aprende C++ en 20 minutos!" +printMessage<10>(); // Prints "Aprende C++ rapido en solo 10 minutos!" + + +///////////////////// +// Manejador de excepciones +///////////////////// + +// La biblioteca estándar proporciona algunos tipos de excepción +// (mira http://en.cppreference.com/w/cpp/error/exception) +// pero cualquier tipo puede ser lanzado como una excepción +#include +#include + +//Todas las excepciones lanzadas dentro del bloque _try_ pueden ser +// capturados por los siguientes manejadores _catch_. +try { + // No asignar excepciones en el heap usando _new_. + throw std::runtime_error("Ocurrió un problema"); +} + +// Captura excepciones por referencia const si son objetos +catch (const std::exception& ex) +{ + std::cout << ex.what(); +} +******************************************************************************** +// Captura cualquier excepción no capturada por bloques _catch_ anteriores +catch (...) +{ + std::cout << "Excepción desconocida capturada"; + throw; // Re-lanza la excepción +} + +/////// +// RAII +/////// + +// RAII significa "Resource Acquisition Is Initialization" +// (Adquisición de recursos es inicialización). +// A menudo se considera el paradigma más poderoso en C++ +// Y el concepto es simple: un constructor de un objeto +// Adquiere recursos de ese objeto y el destructor les libera. + +// Para entender cómo esto es útil, +// Considere una función que utiliza un identificador de archivo C: +void doSomethingWithAFile(const char* filename) +{ + // Para empezar, asuma que nada puede fallar. + + FILE* fh = fopen(filename, "r"); // Abre el archivo en modo lectura + + doSomethingWithTheFile(fh); + doSomethingElseWithIt(fh); + + fclose(fh); // Cierra el manejador de archivos +} + +// Por desgracia, las cosas se complican rápidamente por el control de errores. +// Supongamos que fopen puede fallar, y que doSomethingWithTheFile y +// DoSomethingElseWithIt retornan códigos de error si fallan. +// (Excepciones son la mejor forma de manejar los fallos, +// pero algunos programadores, especialmente los que tienen un fondo C, +// estan en desacuerdo sobre la utilidad de las excepciones). +// Ahora tenemos que comprobar cada llamado por fallos y cerrar el manejador +// del archivo si se ha producido un problema. +bool doSomethingWithAFile(const char* filename) +{ + FILE* fh = fopen(filename, "r"); // Abre el archivo en modo lectura + if (fh == nullptr) // El puntero retornado es nulo o falla. + return false; // Reporta el fallo a quien hizo el llamado. + + // Asume que cada función retorna falso si falla + if (!doSomethingWithTheFile(fh)) { + fclose(fh); // Cierre el manejador de archivo para que no se filtre. + return false; // Propaga el error. + } + if (!doSomethingElseWithIt(fh)) { + fclose(fh); // Cierre el manejador de archivo para que no se filtre. + return false; // Propaga el error. + } + + fclose(fh); // Cierre el archivo. + return true; // Indica que todo funcionó correctamente. +} + +// Programadores C suelen limpiar esto un poco usando goto: +bool doSomethingWithAFile(const char* filename) +{ + FILE* fh = fopen(filename, "r"); + if (fh == nullptr) + return false; + + if (!doSomethingWithTheFile(fh)) + goto failure; + + if (!doSomethingElseWithIt(fh)) + goto failure; + + fclose(fh); // Cierre el archivo. + return true; // Indica que todo funcionó correctamente. + +failure: + fclose(fh); + return false; // Propagate el error +} + +// Si las funciones indican errores mediante excepciones, +// Las cosas son un poco más claras, pero pueden optimizarse mas. +void doSomethingWithAFile(const char* filename) +{ + FILE* fh = fopen(filename, "r"); // Abrir el archivo en modo lectura + if (fh == nullptr) + throw std::runtime_error("No puede abrirse el archivo."); + + try { + doSomethingWithTheFile(fh); + doSomethingElseWithIt(fh); + } + catch (...) { + fclose(fh); // Asegúrese de cerrar el archivo si se produce un error. + throw; // Luego vuelve a lanzar la excepción. + } + + fclose(fh); // Cierra el archivo +} + +// Compare esto con el uso de la clase de flujo de archivos de C++ (fstream) +// fstream utiliza su destructor para cerrar el archivo. +// Los destructores son llamados automáticamente +// cuando un objeto queda fuera del ámbito. +void doSomethingWithAFile(const std::string& filename) +{ + // ifstream es la abreviatura de el input file stream + std::ifstream fh(filename); // Abre el archivo + + // Hacer algo con el archivo + doSomethingWithTheFile(fh); + doSomethingElseWithIt(fh); + +} // El archivo se cierra automáticamente aquí por el destructor + + +// Esto tiene ventajas _enormes_: +// 1. No importa lo que pase, +// El recurso (en este caso el manejador de archivo) será limpiado. +// Una vez que escribes el destructor correctamente, +// Es _imposible_ olvidar cerrar el identificador y permitir +// fugas del recurso. +// 2. Tenga en cuenta que el código es mucho más limpio. +// El destructor se encarga de cerrar el archivo detrás de cámaras +// Sin que tenga que preocuparse por ello. +// 3. El código es seguro. +// Una excepción puede ser lanzado en cualquier lugar de la función +// y la limpieza ocurrirá. + +// Todo el código idiomático C++ utiliza RAII ampliamente para todos los +// recursos. +// Otros ejemplos incluyen +// - Memoria usando unique_ptr y shared_ptr +// - Contenedores (Containers) - la biblioteca estándar linked list, +// vector (es decir, array con auto-cambio de tamaño), hash maps, etc. +// Destruimos todos sus contenidos de forma automática +// cuando quedan fuera del ámbito. +// - Mutex utilizando lock_guard y unique_lock + + +///////////////////// +// Cosas divertidas +///////////////////// + +// Aspectos de C ++ que pueden sorprender a los recién llegados +// (e incluso algunos veteranos). +// Esta sección es, por desgracia, salvajemente incompleta; +// C++ es uno de los lenguajes con los que mas facil te disparas en el pie. + +// Tu puedes sobreescribir métodos privados! +class Foo { + virtual void bar(); +}; +class FooSub : public Foo { + virtual void bar(); // Sobreescribe Foo::bar! +}; + + +// 0 == false == NULL (La mayoria de las veces)! +bool* pt = new bool; +*pt = 0; // Establece los puntos de valor de 'pt' en falso. +pt = 0; // Establece 'pt' al apuntador nulo. Ambas lineas compilan sin error. + +// nullptr se supone que arregla un poco de ese tema: +int* pt2 = new int; +*pt2 = nullptr; // No compila +pt2 = nullptr; // Establece pt2 como null. + +// Hay una excepción para los valores bool. +// Esto es para permitir poner a prueba punteros nulos con if (!ptr), +// pero como consecuencia se puede asignar nullptr a un bool directamente! +*pt = nullptr; // Esto todavía compila, a pesar de que '*pt' es un bool! + +// '=' != '=' != '='! +// Llama Foo::Foo(const Foo&) o alguna variante (mira movimientos semanticos) +// copia del constructor. +Foo f2; +Foo f1 = f2; + +// Llama Foo::Foo(const Foo&) o variante, pero solo copia el 'Foo' parte de +// 'fooSub'. Cualquier miembro extra de 'fooSub' se descarta. Este +// comportamiento horrible se llama "Corte de objetos." +FooSub fooSub; +Foo f1 = fooSub; + +// Llama a Foo::operator=(Foo&) o variantes. +Foo f1; +f1 = f2; + + +// Cómo borrar realmente un contenedor: +class Foo { ... }; +vector v; +for (int i = 0; i < 10; ++i) + v.push_back(Foo()); +// La siguiente línea establece el tamaño de v en 0, +// pero los destructores no son llamados y los recursos no se liberan! + +v.empty(); +v.push_back(Foo()); // Nuevo valor se copia en el primer Foo que insertamos + +// En verdad destruye todos los valores en v. +// Consulta la sección acerca de los objetos temporales para la +// explicación de por qué esto funciona. +v.swap(vector()); + +``` +Otras lecturas: + +Una referencia del lenguaje hasta a la fecha se puede encontrar en + + +Recursos adicionales se pueden encontrar en From 224d4e9c7f8b13da852662edcf57f83d7f78c278 Mon Sep 17 00:00:00 2001 From: Jesus Tinoco Date: Sun, 4 Oct 2015 13:17:50 +0200 Subject: [PATCH 054/685] Fixing typo in git-es.html.markdown --- es-es/git-es.html.markdown | 64 +++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/es-es/git-es.html.markdown b/es-es/git-es.html.markdown index 73853a9d..f370aa4d 100644 --- a/es-es/git-es.html.markdown +++ b/es-es/git-es.html.markdown @@ -11,15 +11,15 @@ lang: es-es --- Git es un sistema de control de versiones distribuido diseñado para manejar -cualquier tipo de proyecto ya sea largos o pequeños, con velocidad y eficiencia. +cualquier tipo de proyect,o ya sea largo o pequeño, con velocidad y eficiencia. Git realiza esto haciendo "snapshots" del proyecto, con ello permite versionar y administrar nuestro código fuente. ## Versionamiento, conceptos. -### Que es el control de versiones? -El control de versiones es un sistema que guarda todos los cambios realizados a +### Qué es el control de versiones? +El control de versiones es un sistema que guarda todos los cambios realizados en uno o varios archivos, a lo largo del tiempo. ### Versionamiento centralizado vs Versionamiento Distribuido. @@ -31,15 +31,15 @@ uno o varios archivos, a lo largo del tiempo. + El versionamiento distribuido no tiene una estructura definida, incluso se puede mantener el estilo de los repositorios SVN con git. -[Informacion adicional](http://git-scm.com/book/es/Empezando-Acerca-del-control-de-versiones) +[Información adicional](http://git-scm.com/book/es/Empezando-Acerca-del-control-de-versiones) -### Por que usar Git? +### Por qué usar Git? * Se puede trabajar sin conexion. * Colaborar con otros es sencillo!. -* Derivar, Crear ramas del proyecto (aka: Branching) es facil!. +* Derivar, Crear ramas del proyecto (aka: Branching) es fácil!. * Combinar (aka: Merging) -* Git es rapido. +* Git es rápido. * Git es flexible. ## Arquitectura de Git. @@ -48,10 +48,10 @@ uno o varios archivos, a lo largo del tiempo. Un repositorio es un conjunto de archivos, directorios, registros, cambios (aka: comits), y encabezados (aka: heads). Imagina que un repositorio es una clase, -y que sus atributos otorgan acceso al historial del elemento, ademas de otras +y que sus atributos otorgan acceso al historial del elemento, además de otras cosas. -Un repositorio esta compuesto por la carpeta .git y un "arbol de trabajo". +Un repositorio esta compuesto por la carpeta .git y un "árbol de trabajo". ### Directorio .git (componentes del repositorio) @@ -62,38 +62,38 @@ y mas. ### Directorio de trabajo (componentes del repositorio) -Es basicamente los directorios y archivos dentro del repositorio. La mayorioa de +Es basicamente los directorios y archivos dentro del repositorio. La mayoría de las veces se le llama "directorio de trabajo". -### Inidice (componentes del directorio .git) +### Índice (componentes del directorio .git) -El inidice es la area de inicio en git. Es basicamente la capa que separa el +El índice es el área de inicio en git. Es basicamente la capa que separa el directorio de trabajo, del repositorio en git. Esto otorga a los desarrolladores -mas poder sobre lo que envia y recibe en el repositorio. +mas poder sobre lo que envía y recibe en el repositorio. ### Commit (aka: cambios) Un commit es una captura de un conjunto de cambios, o modificaciones hechas en el directorio de trabajo. Por ejemplo, si se añaden 5 archivos, se remueven 2, -estos cambios se almacenaran en un commit (aka: captura). Este commit puede ser o +estos cambios se almacenarán en un commit (aka: captura). Este commit puede ser o no ser enviado (aka: "pusheado") hacia un repositorio. ### Branch (rama) -Un "branch", es escencialmente un apuntador hacia el ultimo commit (cambio -registrado) que se ha realizado. A medida que se realizan mas commits, este -apuntador se actualizara automaticamente hacia el ultimo commit. +Un "branch", es escencialmente un apuntador hacia el último commit (cambio +registrado) que se ha realizado. A medida que se realizan más commits, este +apuntador se actualizará automaticamente hacia el ultimo commit. ### "HEAD" y "head" (component of .git dir) "HEAD" es un apuntador hacia la rama (branch) que se esta utilizando. Un repositorio solo puede tener un HEAD activo. En cambio "head", es un apuntador a -cualquier commit realizado, un repositorio puede tener cualquier numero de +cualquier commit realizado, un repositorio puede tener cualquier número de "heads". ### conceptos - recursos. -* [Git para informaticos](http://eagain.net/articles/git-for-computer-scientists/) +* [Git para informáticos](http://eagain.net/articles/git-for-computer-scientists/) * [Git para diseñadores](http://hoth.entp.com/output/git_for_designers.html) @@ -102,8 +102,8 @@ cualquier commit realizado, un repositorio puede tener cualquier numero de ### init -Crear un repositorio de git vacio. Las configuraciones, informacion almacenada y -demas son almacenadas en el directorio ".git". +Crear un repositorio de git vacio. Las configuraciones, información almacenada y +demás son almacenadas en el directorio ".git". ```bash $ git init @@ -127,7 +127,7 @@ $ git config --global user.name "nombre" ### help -Otorga un accceso rapido a una guia extremadamente detallada de cada comando en +Otorga un accceso rápido a una guía extremadamente detallada de cada comando en git. O puede ser usada simplemente como un recordatorio de estos. ```bash @@ -146,7 +146,7 @@ $ git help init ### status -Muestra las diferencias entre el archivo indice y el commit al cual apunta el +Muestra las diferencias entre el archivo índice y el commit al cual apunta el HEAD actualmente. @@ -163,7 +163,7 @@ $ git help status Para añadir archivos al arbol (directorio, repositorio) de trabajo. Si no se utiliza `git add`, los nuevos archivos no se añadiran al arbol de trabajo, por -lo que no se incluiran en los commits (cambios). +lo que no se incluirán en los commits (cambios). ```bash # Añade un archivo en el directorio de trabajo actual. @@ -202,7 +202,7 @@ $ git branch master --edit-description ### checkout Actualiza todos los archivos en el directorio de trabajo para que sean igual que -las versiones almacenadas en el indice, o en un arbol de trabajo especificado. +las versiones almacenadas en el índice, o en un árbol de trabajo especificado. ```bash # Despachar un repositorio. - Por defecto la master branch. (la rama principal llamada 'master') @@ -215,8 +215,8 @@ $ git checkout -b jdei ### clone -Clona, o copia, una repo existente en un nuevo directorio. Tambien añada el -seguimiento hacia las ramas existentes del repo que ha sido clonada, lo que +Clona, o copia, un repositorio existente en un nuevo directorio. También añade el +seguimiento hacia las ramas existentes del repositorio que ha sido clonado, lo que permite subir (push) los archivos hacia una rama remota. ```bash @@ -226,8 +226,8 @@ $ git clone https://github.com/jquery/jquery.git ### commit -Almacena los cambios que almacenados en el indice en un nuevo "commit". Este -commit contiene los cambios hechos mas un resumen hecho por el desarrollador. +Almacena el contenido actual del índice en un nuevo "commit". Este +commit contiene los cambios hechos más un resumen proporcionado por el desarrollador. ```bash # commit with a message @@ -237,8 +237,8 @@ $ git commit -m "jedi anakin wil be - jedis.list" ### diff -Muestra las diferencias entre un archivo en el directorio de trabajo, el indice -y commits. +Muestra las diferencias entre un archivo en el directorio de trabajo, el índice +y los commits. ```bash # Muestra la diferencia entre un directorio de trabajo y el indice. @@ -253,7 +253,7 @@ $ git diff HEAD ### grep -Permite realizar una busqueda rapida en un repositorio. +Permite realizar una busqueda rápida en un repositorio. Configuracion opcionales: From f7cfb3b194ff4fb590173cb7e790c4effc1656c0 Mon Sep 17 00:00:00 2001 From: edholland Date: Sun, 4 Oct 2015 13:18:06 +0200 Subject: [PATCH 055/685] Fix poor formatting and typos --- erlang.html.markdown | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/erlang.html.markdown b/erlang.html.markdown index 64330867..48cee6ec 100644 --- a/erlang.html.markdown +++ b/erlang.html.markdown @@ -308,25 +308,25 @@ self(). % <0.41.0> % Unit tests can be written using EUnits's test generators and assert macros -module(fib). - -export([fib/1]). - -include_lib("eunit/include/eunit.hrl"). +-export([fib/1]). +-include_lib("eunit/include/eunit.hrl"). - fib(0) -> 1; - fib(1) -> 1; - fib(N) when N > 1 -> fib(N-1) + fib(N-2). +fib(0) -> 1; +fib(1) -> 1; +fib(N) when N > 1 -> fib(N-1) + fib(N-2). - fib_test_() -> - [?_assert(fib(0) =:= 1), - ?_assert(fib(1) =:= 1), - ?_assert(fib(2) =:= 2), - ?_assert(fib(3) =:= 3), - ?_assert(fib(4) =:= 5), - ?_assert(fib(5) =:= 8), - ?_assertException(error, function_clause, fib(-1)), - ?_assert(fib(31) =:= 2178309) - ]. +fib_test_() -> + [?_assert(fib(0) =:= 1), + ?_assert(fib(1) =:= 1), + ?_assert(fib(2) =:= 2), + ?_assert(fib(3) =:= 3), + ?_assert(fib(4) =:= 5), + ?_assert(fib(5) =:= 8), + ?_assertException(error, function_clause, fib(-1)), + ?_assert(fib(31) =:= 2178309) + ]. -% EUnit will automatically export to a test() fucntion to allo running the tests +% EUnit will automatically export to a test() function to allow running the tests % in the erlang shell fib:test() From 8aec122beaffc6d7d8e108aa4bbe4a2218062a46 Mon Sep 17 00:00:00 2001 From: Jesus Tinoco Date: Sun, 4 Oct 2015 13:19:34 +0200 Subject: [PATCH 056/685] Typos fixed in git-es.html.markdown --- es-es/git-es.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es-es/git-es.html.markdown b/es-es/git-es.html.markdown index f370aa4d..51812447 100644 --- a/es-es/git-es.html.markdown +++ b/es-es/git-es.html.markdown @@ -11,7 +11,7 @@ lang: es-es --- Git es un sistema de control de versiones distribuido diseñado para manejar -cualquier tipo de proyect,o ya sea largo o pequeño, con velocidad y eficiencia. +cualquier tipo de proyecto, ya sea largo o pequeño, con velocidad y eficiencia. Git realiza esto haciendo "snapshots" del proyecto, con ello permite versionar y administrar nuestro código fuente. From 6b6f88c64d9a4b2d26de5725dee24f3c459fb93c Mon Sep 17 00:00:00 2001 From: bk2dcradle Date: Sun, 4 Oct 2015 01:47:09 +0530 Subject: [PATCH 057/685] Added abstract classes --- java.html.markdown | 68 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/java.html.markdown b/java.html.markdown index 928eb39f..2f41be81 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -451,6 +451,74 @@ public class ExampleClass extends ExampleClassParent implements InterfaceOne, public void InterfaceTwoMethod() { } } + + +// Abstract Classes +// Abstract Class declaration syntax +// abstract extends { +// // Constants and variables +// // Method declarations +// } + +// Methods can't have bodies in an interface, unless the method is +// static. Also variables are NOT final by default, unlike an interface. +// Also abstract classes CAN have the "main" method. +// Abstract classes solve these problems. + +public abstract class Animal +{ + public abstract void makeSound(); + + // Method can have a body + public void eat() + { + System.out.println("I am an animal and I am Eating."); + // Note: We can access private variable here. + age = 30; + } + + // No need to initialise, however in an interface + // a variable is implicitly final and hence has + // to be initialised. + private int age; + + public void printAge() + { + System.out.println(age); + } + + // Abstract classes can have main function. + public static void main(String[] args) + { + System.out.println("I am abstract"); + } +} + +class Dog extends Animal +{ + // Note still have to override the abstract methods in the + // abstract class. + @Override + public void makeSound() + { + System.out.println("Bark"); + // age = 30; ==> ERROR! age is private to Animal + } + + // NOTE: You will get an error if you used the + // @Override annotation here, since java doesn't allow + // overriding of static methods. + // What is happening here is called METHOD HIDING. + // Check out this awesome SO post: (http://stackoverflow.com/questions/16313649/) + public static void main(String[] args) + { + Dog pluto = new Dog(); + pluto.makeSound(); + pluto.eat(); + pluto.printAge(); + } +} + ``` ## Further Reading From f1a90a4e636616ce91a271504eee3f374bfd7094 Mon Sep 17 00:00:00 2001 From: Guntbert Reiter Date: Sun, 4 Oct 2015 16:44:24 +0200 Subject: [PATCH 058/685] Put demonstrative condition into ternary expression It should be made clear that the part before the ternary operator is indeed a condition, most often created as some comparison expression. --- csharp.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/csharp.html.markdown b/csharp.html.markdown index 479b7f01..222ba0d2 100644 --- a/csharp.html.markdown +++ b/csharp.html.markdown @@ -236,7 +236,8 @@ on a new line! ""Wow!"", the masses cried"; // Ternary operators // A simple if/else can be written as follows // ? : - string isTrue = (true) ? "True" : "False"; + int toCompare = 17; + string isTrue = toCompare == 17 ? "True" : "False"; // While loop int fooWhile = 0; From ff1b91d463938a0809f4115c20c6f9fc89e24cfc Mon Sep 17 00:00:00 2001 From: David Lima Date: Sun, 4 Oct 2015 11:55:16 -0300 Subject: [PATCH 059/685] [hack/en] Fixed some typos --- hack.html.markdown | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hack.html.markdown b/hack.html.markdown index 632fc705..b9730dc0 100644 --- a/hack.html.markdown +++ b/hack.html.markdown @@ -2,6 +2,7 @@ language: Hack contributors: - ["Stephen Holdaway", "https://github.com/stecman"] + - ["David Lima", "https://github.com/davelima"] filename: learnhack.hh --- @@ -152,7 +153,7 @@ class ArgumentPromotion private bool $isAwesome) {} } -class WithoutArugmentPromotion +class WithoutArgumentPromotion { public string $name; @@ -169,9 +170,9 @@ class WithoutArugmentPromotion } -// Co-oprerative multi-tasking +// Co-operative multi-tasking // -// Two new keywords "async" and "await" can be used to perform mutli-tasking +// Two new keywords "async" and "await" can be used to perform multi-tasking // Note that this does not involve threads - it just allows transfer of control async function cooperativePrint(int $start, int $end) : Awaitable { From 29ea66dbef66944f59b5a7abe68b7113e1679791 Mon Sep 17 00:00:00 2001 From: David Lima Date: Sun, 4 Oct 2015 12:02:20 -0300 Subject: [PATCH 060/685] [hack/pt-br] Add pt-br translation --- pt-br/hack-pt.html.markdown | 316 ++++++++++++++++++++++++++++++++++++ 1 file changed, 316 insertions(+) create mode 100644 pt-br/hack-pt.html.markdown diff --git a/pt-br/hack-pt.html.markdown b/pt-br/hack-pt.html.markdown new file mode 100644 index 00000000..3efa5f0a --- /dev/null +++ b/pt-br/hack-pt.html.markdown @@ -0,0 +1,316 @@ +--- +language: Hack +contributors: + - ["Stephen Holdaway", "https://github.com/stecman"] + - ["David Lima", "https://github.com/davelima"] +translators: + - ["David Lima", "https://github.com/davelima"] +lang: pt-br +filename: learnhack.hh +--- + +Hack é uma linguagem baseada no PHP e roda numa máquina virtual chamada HHVM. +Hack é quase completamente interoperável com códigos PHP existentes e adiciona +alguns recursos úteis de linguagens estaticamente tipadas. + +Somente recursos específicos da linguagem Hack serão abordados aqui. Detalhes +sobre a sintaxe do PHP estão disponíveis no +[artigo PHP](http://learnxinyminutes.com/docs/php/) neste site. + +```php +id = $id; + } +} + + +// Funções anônimas (lambdas) +$multiplicador = 5; +array_map($y ==> $y * $multiplicador, [1, 2, 3]); + + +// Genéricos +class Caixa +{ + protected T $dados; + + public function __construct(T $dados) { + $this->dados = $dados; + } + + public function pegaDados(): T { + return $this->dados; + } +} + +function abreCaixa(Caixa $caixa) : int +{ + return $caixa->pegaDados(); +} + + +// Formas +// +// Hack adiciona o conceito de formas para definir arrays com uma estrutura +// e tipos de dados garantidos +type Point2D = shape('x' => int, 'y' => int); + +function distancia(Point2D $a, Point2D $b) : float +{ + return sqrt(pow($b['x'] - $a['x'], 2) + pow($b['y'] - $a['y'], 2)); +} + +distancia( + shape('x' => -1, 'y' => 5), + shape('x' => 2, 'y' => 50) +); + + +// Pseudônimos de tipos +// +// Hack adiciona vários recursos para criação de pseudônimos, tornando tipos complexos +// mais fáceis de entender +newtype VectorArray = array>; + +// Um tuple contendo dois inteiros +newtype Point = (int, int); + +function adicionaPontos(Point $p1, Point $p2) : Point +{ + return tuple($p1[0] + $p2[0], $p1[1] + $p2[1]); +} + +adicionaPontos( + tuple(1, 2), + tuple(5, 6) +); + + +// enums em classes +enum TipoDePista : int +{ + Estrada = 0; + Rua = 1; + Alameda = 2; + Avenida = 3; +} + +function getTipoDePista() : TipoDePista +{ + return TipoDePista::Alameda; +} + + +// Especificação de argumentos no construtor (Argument Promotion) +// +// Para evitar que propriedades sejam definidas em mais de um lugar, e +// construtores que só definem propriedades, o Hack adiciona uma sintaxe para +// definir as propriedades e o construtor ao mesmo tempo. +class ArgumentPromotion +{ + public function __construct(public string $nome, + protected int $idade, + private bool $legal) {} +} + +class SemArgumentPromotion +{ + public string $nome; + + protected int $idade; + + private bool $legal; + + public function __construct(string $nome, int $idade, bool $legal) + { + $this->nome = $nome; + $this->idade = $idade; + $this->legal = $legal; + } +} + + +// Multi-tarefas cooperativo +// +// Duas novas palavras-chave ("async" e "await") podem ser usadas para +// trabalhar com multi-tarefas. +// Obs. Isto não envolve threads - apenas permite a transferência de controle +async function printCooperativo(int $inicio, int $fim) : Awaitable +{ + for ($i = $inicio; $i <= $fim; $i++) { + echo "$i "; + + // Permite que outras tarefas façam algo + await RescheduleWaitHandle::create(RescheduleWaitHandle::QUEUE_DEFAULT, 0); + } +} + +// Imprime "1 4 7 2 5 8 3 6 9" +AwaitAllWaitHandle::fromArray([ + printCooperativo(1, 3), + printCooperativo(4, 6), + printCooperativo(7, 9) +])->getWaitHandle()->join(); + + +// Atributos +// +// Atributos são uma forma de definir metadados para funções. +// Hack tem alguns atributos especiais que possuem comportamentos úteis. + +// O atributo especial __Memoize faz com que o resultado da função fique em cache +<<__Memoize>> +function tarefaDemorada() : ?string +{ + return file_get_contents('http://exemplo.com'); +} + +// O corpo da função só é executado uma vez aqui: +tarefaDemorada(); +tarefaDemorada(); + + +// O atributo especial __ConsistentConstruct faz com que o Hack certifique-se +// de que a assinatura do construtor seja a mesma em todas as subclasses +<<__ConsistentConstruct>> +class FooConsistente +{ + public function __construct(int $x, float $y) + { + // ... + } + + public function algumMetodo() + { + // ... + } +} + +class BarConsistente extends FooConsistente +{ + public function __construct(int $x, float $y) + { + // O verificador de tipos do Hack exige que os construtores pai + // sejam chamados + parent::__construct($x, $y); + + // ... + } + + // A anotação __Override é uma anotação opcional que faz com que o + // verificador de tipos do Hack sobrescreva um método em uma classe pai + // ou um trait. Sem __Override, definir este método causará um erro, + // pois ele já foi definido na classe pai (FooConsistente): + <<__Override>> + public function algumMetodo() + { + // ... + } +} + +class SubclasseFooInvalida extends FooConsistente +{ + // Caso o construtor não combine com o construtor da classe pai, o + // verificador de tipos acusará um erro: + // + // "Este objeto é incompatível com o objeto FooConsistente porque algum(ns) + // dos seus métodos são incompatíveis" + // + public function __construct(float $x) + { + // ... + } + + // Usar a anotação __Override em um método que não existe na classe pai + // causará um erro do verificador de tipos: + // "SubclasseFooInvalida::outroMetodo() está marcada para sobrescrever; + // nenhuma definição não-privada foi encontrada ou a classe pai foi + // definida em código não-> + public function outroMetodo() + { + // ... + } +} + + +// Traits podem implementar interfaces (não suportado pelo PHP) +interface InterfaceGatinho +{ + public function brinca() : void; +} + +trait TraitGato implements GatinhoInterface +{ + public function brinca() : void + { + // ... + } +} + +class Samuel +{ + use TraitGato; +} + + +$gato = new Samuel(); +$gato instanceof GatinhoInterface === true; // True + +``` + +## Mais informações + +Visite a [documentação do Hack](http://docs.hhvm.com/manual/en/hacklangref.php) +para ver explicações detalhadas dos recursos que Hack adiciona ao PHP, ou o [site oficial do Hack](http://hanlang.org/) +para outras informações. + +Visite o [site oficial do HHVM](http://hhvm.com/) para aprender a instalar o HHVM. + +Visite [este artigo](http://docs.hhvm.com/manual/en/hack.unsupported.php) para ver +os recursos do PHP que o Hack não suporta e ver incompatibilidades entre Hack e PHP. From 09f8a34244af976f7ca29efc620a6bd51ad4ffa7 Mon Sep 17 00:00:00 2001 From: David Lima Date: Sun, 4 Oct 2015 12:05:07 -0300 Subject: [PATCH 061/685] [hack/pt-br] Fixed some typos --- pt-br/hack-pt.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pt-br/hack-pt.html.markdown b/pt-br/hack-pt.html.markdown index 3efa5f0a..2f9d3c1b 100644 --- a/pt-br/hack-pt.html.markdown +++ b/pt-br/hack-pt.html.markdown @@ -285,7 +285,7 @@ interface InterfaceGatinho public function brinca() : void; } -trait TraitGato implements GatinhoInterface +trait TraitGato implements InterfaceGatinho { public function brinca() : void { @@ -300,7 +300,7 @@ class Samuel $gato = new Samuel(); -$gato instanceof GatinhoInterface === true; // True +$gato instanceof InterfaceGatinho === true; // True ``` From fbd07f268cd6e64c65912ccc27f2ec9e222ec536 Mon Sep 17 00:00:00 2001 From: Pushkar Sharma Date: Sun, 4 Oct 2015 21:24:57 +0530 Subject: [PATCH 062/685] Issue #1157 Comment explaining '-p', in line 178. --- common-lisp.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common-lisp.html.markdown b/common-lisp.html.markdown index f9f64d68..e3bb61cf 100644 --- a/common-lisp.html.markdown +++ b/common-lisp.html.markdown @@ -175,7 +175,8 @@ nil ; for false - and the empty list :age 5)) *rover* ; => #S(DOG :NAME "rover" :BREED "collie" :AGE 5) -(dog-p *rover*) ; => t ;; ewww) +(dog-p *rover*) ; => true #| -p signifies "predicate". It's used to + check if *rover* is an instance of dog.|# (dog-name *rover*) ; => "rover" ;; Dog-p, make-dog, and dog-name are all created by defstruct! From c57868703a6462a0ad64b27d3887b970272ebb4d Mon Sep 17 00:00:00 2001 From: jig08 Date: Sun, 4 Oct 2015 22:14:31 +0530 Subject: [PATCH 063/685] Adding smalltalk tut --- ko-kr/.Rhistory | 0 smalltalk.html.markdown | 959 +++++++++++++++++++++++++++++++++++++++ smalltalk.html.markdown~ | 959 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 1918 insertions(+) create mode 100644 ko-kr/.Rhistory create mode 100644 smalltalk.html.markdown create mode 100644 smalltalk.html.markdown~ diff --git a/ko-kr/.Rhistory b/ko-kr/.Rhistory new file mode 100644 index 00000000..e69de29b diff --git a/smalltalk.html.markdown b/smalltalk.html.markdown new file mode 100644 index 00000000..61e5a94c --- /dev/null +++ b/smalltalk.html.markdown @@ -0,0 +1,959 @@ +--- +language: smalltalk +contributors: + - ["Jigyasa Grover", "https://github.com/jig08"] +--- + +- Smalltalk is an object-oriented, dynamically typed, reflective programming language. +- Smalltalk was created as the language to underpin the "new world" of computing exemplified by "human–computer symbiosis." +- It was designed and created in part for educational use, more so for constructionist learning, at the Learning Research Group (LRG) of Xerox PARC by Alan Kay, Dan Ingalls, Adele Goldberg, Ted Kaehler, Scott Wallace, and others during the 1970s. + +Feedback highly appreciated! Reach me at [@jigyasa_grover](https://twitter.com/jigyasa_grover) or `grover.jigyasa1@gmail.com`. + +``` + +"************************************************************************ + * Allowable characters: * + * - a-z * + * - A-Z * + * - 0-9 * + * - .+/\*~<>@%|&? * + * - blank, tab, cr, ff, lf * + * * + * Variables: * + * - variables must be declared before use * + * - shared vars must begin with uppercase * + * - local vars must begin with lowercase * + * - reserved names: nil, true, false, self, super, and Smalltalk * + * * + * Variable scope: * + * - Global: defined in Dictionary Smalltalk and accessible by all * + * objects in system * + * - Special: (reserved) Smalltalk, super, self, true, false, & nil * + * - Method Temporary: local to a method * + * - Block Temporary: local to a block * + * - Pool: variables in a Dictionary object * + * - Method Parameters: automatic local vars created as a result of * + * message call with params * + * - Block Parameters: automatic local vars created as a result of * + * value: message call * + * - Class: shared with all instances of one class & its subclasses * + * - Class Instance: unique to each instance of a class * + * - Instance Variables: unique to each instance * + ************************************************************************" +"Comments are enclosed in quotes" +"Period (.) is the statement seperator" + +"************************************************************************ + * Transcript: * + ************************************************************************" +Transcript clear. "clear to transcript window" +Transcript show: 'Hello World'. "output string in transcript window" +Transcript nextPutAll: 'Hello World'. "output string in transcript window" +Transcript nextPut: $A. "output character in transcript window" +Transcript space. "output space character in transcript window" +Transcript tab. "output tab character in transcript window" +Transcript cr. "carriage return / linefeed" +'Hello' printOn: Transcript. "append print string into the window" +'Hello' storeOn: Transcript. "append store string into the window" +Transcript endEntry. "flush the output buffer" + +"************************************************************************ + * Assignment: * + ************************************************************************" +| x y | +x _ 4. "assignment (Squeak) <-" +x := 5. "assignment" +x := y := z := 6. "compound assignment" +x := (y := 6) + 1. +x := Object new. "bind to allocated instance of a class" +x := 123 class. "discover the object class" +x := Integer superclass. "discover the superclass of a class" +x := Object allInstances. "get an array of all instances of a class" +x := Integer allSuperclasses. "get all superclasses of a class" +x := 1.2 hash. "hash value for object" +y := x copy. "copy object" +y := x shallowCopy. "copy object (not overridden)" +y := x deepCopy. "copy object and instance vars" +y := x veryDeepCopy. "complete tree copy using a dictionary" + +"************************************************************************ + * Constants: * + ************************************************************************" +| b | +b := true. "true constant" +b := false. "false constant" +x := nil. "nil object constant" +x := 1. "integer constants" +x := 3.14. "float constants" +x := 2e-2. "fractional constants" +x := 16r0F. "hex constant". +x := -1. "negative constants" +x := 'Hello'. "string constant" +x := 'I''m here'. "single quote escape" +x := $A. "character constant" +x := $ . "character constant (space)" +x := #aSymbol. "symbol constants" +x := #(3 2 1). "array constants" +x := #('abc' 2 $a). "mixing of types allowed" + +"************************************************************************ + * Booleans: * + ************************************************************************" +| b x y | +x := 1. y := 2. +b := (x = y). "equals" +b := (x ~= y). "not equals" +b := (x == y). "identical" +b := (x ~~ y). "not identical" +b := (x > y). "greater than" +b := (x < y). "less than" +b := (x >= y). "greater than or equal" +b := (x <= y). "less than or equal" +b := b not. "boolean not" +b := (x < 5) & (y > 1). "boolean and" +b := (x < 5) | (y > 1). "boolean or" +b := (x < 5) and: [y > 1]. "boolean and (short-circuit)" +b := (x < 5) or: [y > 1]. "boolean or (short-circuit)" +b := (x < 5) eqv: (y > 1). "test if both true or both false" +b := (x < 5) xor: (y > 1). "test if one true and other false" +b := 5 between: 3 and: 12. "between (inclusive)" +b := 123 isKindOf: Number. "test if object is class or subclass of" +b := 123 isMemberOf: SmallInteger. "test if object is type of class" +b := 123 respondsTo: sqrt. "test if object responds to message" +b := x isNil. "test if object is nil" +b := x isZero. "test if number is zero" +b := x positive. "test if number is positive" +b := x strictlyPositive. "test if number is greater than zero" +b := x negative. "test if number is negative" +b := x even. "test if number is even" +b := x odd. "test if number is odd" +b := x isLiteral. "test if literal constant" +b := x isInteger. "test if object is integer" +b := x isFloat. "test if object is float" +b := x isNumber. "test if object is number" +b := $A isUppercase. "test if upper case character" +b := $A isLowercase. "test if lower case character" + +"************************************************************************ + * Arithmetic expressions: * + ************************************************************************" +| x | +x := 6 + 3. "addition" +x := 6 - 3. "subtraction" +x := 6 * 3. "multiplication" +x := 1 + 2 * 3. "evaluation always left to right (1 + 2) * 3" +x := 5 / 3. "division with fractional result" +x := 5.0 / 3.0. "division with float result" +x := 5.0 // 3.0. "integer divide" +x := 5.0 \\ 3.0. "integer remainder" +x := -5. "unary minus" +x := 5 sign. "numeric sign (1, -1 or 0)" +x := 5 negated. "negate receiver" +x := 1.2 integerPart. "integer part of number (1.0)" +x := 1.2 fractionPart. "fractional part of number (0.2)" +x := 5 reciprocal. "reciprocal function" +x := 6 * 3.1. "auto convert to float" +x := 5 squared. "square function" +x := 25 sqrt. "square root" +x := 5 raisedTo: 2. "power function" +x := 5 raisedToInteger: 2. "power function with integer" +x := 5 exp. "exponential" +x := -5 abs. "absolute value" +x := 3.99 rounded. "round" +x := 3.99 truncated. "truncate" +x := 3.99 roundTo: 1. "round to specified decimal places" +x := 3.99 truncateTo: 1. "truncate to specified decimal places" +x := 3.99 floor. "truncate" +x := 3.99 ceiling. "round up" +x := 5 factorial. "factorial" +x := -5 quo: 3. "integer divide rounded toward zero" +x := -5 rem: 3. "integer remainder rounded toward zero" +x := 28 gcd: 12. "greatest common denominator" +x := 28 lcm: 12. "least common multiple" +x := 100 ln. "natural logarithm" +x := 100 log. "base 10 logarithm" +x := 100 log: 10. "logarithm with specified base" +x := 100 floorLog: 10. "floor of the log" +x := 180 degreesToRadians. "convert degrees to radians" +x := 3.14 radiansToDegrees. "convert radians to degrees" +x := 0.7 sin. "sine" +x := 0.7 cos. "cosine" +x := 0.7 tan. "tangent" +x := 0.7 arcSin. "arcsine" +x := 0.7 arcCos. "arccosine" +x := 0.7 arcTan. "arctangent" +x := 10 max: 20. "get maximum of two numbers" +x := 10 min: 20. "get minimum of two numbers" +x := Float pi. "pi" +x := Float e. "exp constant" +x := Float infinity. "infinity" +x := Float nan. "not-a-number" +x := Random new next; yourself. x next. "random number stream (0.0 to 1.0) +x := 100 atRandom. "quick random number" + +"************************************************************************ + * Bitwise Manipulation: * + ************************************************************************" +| b x | +x := 16rFF bitAnd: 16r0F. "and bits" +x := 16rF0 bitOr: 16r0F. "or bits" +x := 16rFF bitXor: 16r0F. "xor bits" +x := 16rFF bitInvert. "invert bits" +x := 16r0F bitShift: 4. "left shift" +x := 16rF0 bitShift: -4. "right shift" +"x := 16r80 bitAt: 7." "bit at position (0|1) [!Squeak]" +x := 16r80 highbit. "position of highest bit set" +b := 16rFF allMask: 16r0F. "test if all bits set in mask set in receiver" +b := 16rFF anyMask: 16r0F. "test if any bits set in mask set in receiver" +b := 16rFF noMask: 16r0F. "test if all bits set in mask clear in receiver" + +"************************************************************************ + * Conversion: * + ************************************************************************" +| x | +x := 3.99 asInteger. "convert number to integer (truncates in Squeak)" +x := 3.99 asFraction. "convert number to fraction" +x := 3 asFloat. "convert number to float" +x := 65 asCharacter. "convert integer to character" +x := $A asciiValue. "convert character to integer" +x := 3.99 printString. "convert object to string via printOn:" +x := 3.99 storeString. "convert object to string via storeOn:" +x := 15 radix: 16. "convert to string in given base" +x := 15 printStringBase: 16. +x := 15 storeStringBase: 16. + +"************************************************************************ + * Blocks: * + * - blocks are objects and may be assigned to a variable * + * - value is last expression evaluated unless explicit return * + * - blocks may be nested * + * - specification [ arguments | | localvars | expressions ] * + * - Squeak does not currently support localvars in blocks * + * - max of three arguments allowed * + * - ^expression terminates block & method (exits all nested blocks) * + * - blocks intended for long term storage should not contain ^ * + ************************************************************************" +| x y z | +x := [ y := 1. z := 2. ]. x value. "simple block usage" +x := [ :argOne :argTwo | argOne, ' and ' , argTwo.]. "set up block with argument passing" +Transcript show: (x value: 'First' value: 'Second'); cr. "use block with argument passing" +"x := [ | z | z := 1.]. localvars not available in squeak blocks" + +"************************************************************************ + * Method calls: * + * - unary methods are messages with no arguments * + * - binary methods * + * - keyword methods are messages with selectors including colons * + * * + * standard categories/protocols: * + * - initialize-release (methods called for new instance) * + * - accessing (get/set methods) * + * - testing (boolean tests - is) * + * - comparing (boolean tests with parameter * + * - displaying (gui related methods) * + * - printing (methods for printing) * + * - updating (receive notification of changes) * + * - private (methods private to class) * + * - instance-creation (class methods for creating instance) * + ************************************************************************" +| x | +x := 2 sqrt. "unary message" +x := 2 raisedTo: 10. "keyword message" +x := 194 * 9. "binary message" +Transcript show: (194 * 9) printString; cr. "combination (chaining)" +x := 2 perform: #sqrt. "indirect method invocation" +Transcript "Cascading - send multiple messages to receiver" + show: 'hello '; + show: 'world'; + cr. +x := 3 + 2; * 100. "result=300. Sends message to same receiver (3)" + +"************************************************************************ + * Conditional Statements: * + ************************************************************************" +| x | +x > 10 ifTrue: [Transcript show: 'ifTrue'; cr]. "if then" +x > 10 ifFalse: [Transcript show: 'ifFalse'; cr]. "if else" +x > 10 "if then else" + ifTrue: [Transcript show: 'ifTrue'; cr] + ifFalse: [Transcript show: 'ifFalse'; cr]. +x > 10 "if else then" + ifFalse: [Transcript show: 'ifFalse'; cr] + ifTrue: [Transcript show: 'ifTrue'; cr]. +Transcript + show: + (x > 10 + ifTrue: ['ifTrue'] + ifFalse: ['ifFalse']); + cr. +Transcript "nested if then else" + show: + (x > 10 + ifTrue: [x > 5 + ifTrue: ['A'] + ifFalse: ['B']] + ifFalse: ['C']); + cr. +switch := Dictionary new. "switch functionality" +switch at: $A put: [Transcript show: 'Case A'; cr]. +switch at: $B put: [Transcript show: 'Case B'; cr]. +switch at: $C put: [Transcript show: 'Case C'; cr]. +result := (switch at: $B) value. + +"************************************************************************ + * Iteration statements: * + ************************************************************************" +| x y | +x := 4. y := 1. +[x > 0] whileTrue: [x := x - 1. y := y * 2]. "while true loop" +[x >= 4] whileFalse: [x := x + 1. y := y * 2]. "while false loop" +x timesRepeat: [y := y * 2]. "times repear loop (i := 1 to x)" +1 to: x do: [:a | y := y * 2]. "for loop" +1 to: x by: 2 do: [:a | y := y / 2]. "for loop with specified increment" +#(5 4 3) do: [:a | x := x + a]. "iterate over array elements" + +"************************************************************************ + * Character: * + ************************************************************************" +| x y | +x := $A. "character assignment" +y := x isLowercase. "test if lower case" +y := x isUppercase. "test if upper case" +y := x isLetter. "test if letter" +y := x isDigit. "test if digit" +y := x isAlphaNumeric. "test if alphanumeric" +y := x isSeparator. "test if seperator char" +y := x isVowel. "test if vowel" +y := x digitValue. "convert to numeric digit value" +y := x asLowercase. "convert to lower case" +y := x asUppercase. "convert to upper case" +y := x asciiValue. "convert to numeric ascii value" +y := x asString. "convert to string" +b := $A <= $B. "comparison" +y := $A max: $B. + +"************************************************************************ + * Symbol: * + ************************************************************************" +| b x y | +x := #Hello. "symbol assignment" +y := 'String', 'Concatenation'. "symbol concatenation (result is string)" +b := x isEmpty. "test if symbol is empty" +y := x size. "string size" +y := x at: 2. "char at location" +y := x copyFrom: 2 to: 4. "substring" +y := x indexOf: $e ifAbsent: [0]. "first position of character within string" +x do: [:a | Transcript show: a printString; cr]. "iterate over the string" +b := x conform: [:a | (a >= $a) & (a <= $z)]. "test if all elements meet condition" +y := x select: [:a | a > $a]. "return all elements that meet condition" +y := x asString. "convert symbol to string" +y := x asText. "convert symbol to text" +y := x asArray. "convert symbol to array" +y := x asOrderedCollection. "convert symbol to ordered collection" +y := x asSortedCollection. "convert symbol to sorted collection" +y := x asBag. "convert symbol to bag collection" +y := x asSet. "convert symbol to set collection" + +"************************************************************************ + * String: * + ************************************************************************" +| b x y | +x := 'This is a string'. "string assignment" +x := 'String', 'Concatenation'. "string concatenation" +b := x isEmpty. "test if string is empty" +y := x size. "string size" +y := x at: 2. "char at location" +y := x copyFrom: 2 to: 4. "substring" +y := x indexOf: $a ifAbsent: [0]. "first position of character within string" +x := String new: 4. "allocate string object" +x "set string elements" + at: 1 put: $a; + at: 2 put: $b; + at: 3 put: $c; + at: 4 put: $e. +x := String with: $a with: $b with: $c with: $d. "set up to 4 elements at a time" +x do: [:a | Transcript show: a printString; cr]. "iterate over the string" +b := x conform: [:a | (a >= $a) & (a <= $z)]. "test if all elements meet condition" +y := x select: [:a | a > $a]. "return all elements that meet condition" +y := x asSymbol. "convert string to symbol" +y := x asArray. "convert string to array" +x := 'ABCD' asByteArray. "convert string to byte array" +y := x asOrderedCollection. "convert string to ordered collection" +y := x asSortedCollection. "convert string to sorted collection" +y := x asBag. "convert string to bag collection" +y := x asSet. "convert string to set collection" +y := x shuffled. "randomly shuffle string" + +"************************************************************************ + * Array: Fixed length collection * + * ByteArray: Array limited to byte elements (0-255) * + * WordArray: Array limited to word elements (0-2^32) * + ************************************************************************" +| b x y sum max | +x := #(4 3 2 1). "constant array" +x := Array with: 5 with: 4 with: 3 with: 2. "create array with up to 4 elements" +x := Array new: 4. "allocate an array with specified size" +x "set array elements" + at: 1 put: 5; + at: 2 put: 4; + at: 3 put: 3; + at: 4 put: 2. +b := x isEmpty. "test if array is empty" +y := x size. "array size" +y := x at: 4. "get array element at index" +b := x includes: 3. "test if element is in array" +y := x copyFrom: 2 to: 4. "subarray" +y := x indexOf: 3 ifAbsent: [0]. "first position of element within array" +y := x occurrencesOf: 3. "number of times object in collection" +x do: [:a | Transcript show: a printString; cr]. "iterate over the array" +b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" +y := x select: [:a | a > 2]. "return collection of elements that pass test" +y := x reject: [:a | a < 2]. "return collection of elements that fail test" +y := x collect: [:a | a + a]. "transform each element for new collection" +y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" +sum := 0. x do: [:a | sum := sum + a]. sum. "sum array elements" +sum := 0. 1 to: (x size) do: [:a | sum := sum + (x at: a)]. "sum array elements" +sum := x inject: 0 into: [:a :c | a + c]. "sum array elements" +max := x inject: 0 into: [:a :c | (a > c) "find max element in array" + ifTrue: [a] + ifFalse: [c]]. +y := x shuffled. "randomly shuffle collection" +y := x asArray. "convert to array" +"y := x asByteArray." "note: this instruction not available on Squeak" +y := x asWordArray. "convert to word array" +y := x asOrderedCollection. "convert to ordered collection" +y := x asSortedCollection. "convert to sorted collection" +y := x asBag. "convert to bag collection" +y := x asSet. "convert to set collection" + +"************************************************************************ + * OrderedCollection: acts like an expandable array * + ************************************************************************" +| b x y sum max | +x := OrderedCollection with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" +x := OrderedCollection new. "allocate collection" +x add: 3; add: 2; add: 1; add: 4; yourself. "add element to collection" +y := x addFirst: 5. "add element at beginning of collection" +y := x removeFirst. "remove first element in collection" +y := x addLast: 6. "add element at end of collection" +y := x removeLast. "remove last element in collection" +y := x addAll: #(7 8 9). "add multiple elements to collection" +y := x removeAll: #(7 8 9). "remove multiple elements from collection" +x at: 2 put: 3. "set element at index" +y := x remove: 5 ifAbsent: []. "remove element from collection" +b := x isEmpty. "test if empty" +y := x size. "number of elements" +y := x at: 2. "retrieve element at index" +y := x first. "retrieve first element in collection" +y := x last. "retrieve last element in collection" +b := x includes: 5. "test if element is in collection" +y := x copyFrom: 2 to: 3. "subcollection" +y := x indexOf: 3 ifAbsent: [0]. "first position of element within collection" +y := x occurrencesOf: 3. "number of times object in collection" +x do: [:a | Transcript show: a printString; cr]. "iterate over the collection" +b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" +y := x select: [:a | a > 2]. "return collection of elements that pass test" +y := x reject: [:a | a < 2]. "return collection of elements that fail test" +y := x collect: [:a | a + a]. "transform each element for new collection" +y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" +sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" +sum := 0. 1 to: (x size) do: [:a | sum := sum + (x at: a)]. "sum elements" +sum := x inject: 0 into: [:a :c | a + c]. "sum elements" +max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" + ifTrue: [a] + ifFalse: [c]]. +y := x shuffled. "randomly shuffle collection" +y := x asArray. "convert to array" +y := x asOrderedCollection. "convert to ordered collection" +y := x asSortedCollection. "convert to sorted collection" +y := x asBag. "convert to bag collection" +y := x asSet. "convert to set collection" + +"************************************************************************ + * SortedCollection: like OrderedCollection except order of elements * + * determined by sorting criteria * + ************************************************************************" +| b x y sum max | +x := SortedCollection with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" +x := SortedCollection new. "allocate collection" +x := SortedCollection sortBlock: [:a :c | a > c]. "set sort criteria" +x add: 3; add: 2; add: 1; add: 4; yourself. "add element to collection" +y := x addFirst: 5. "add element at beginning of collection" +y := x removeFirst. "remove first element in collection" +y := x addLast: 6. "add element at end of collection" +y := x removeLast. "remove last element in collection" +y := x addAll: #(7 8 9). "add multiple elements to collection" +y := x removeAll: #(7 8 9). "remove multiple elements from collection" +y := x remove: 5 ifAbsent: []. "remove element from collection" +b := x isEmpty. "test if empty" +y := x size. "number of elements" +y := x at: 2. "retrieve element at index" +y := x first. "retrieve first element in collection" +y := x last. "retrieve last element in collection" +b := x includes: 4. "test if element is in collection" +y := x copyFrom: 2 to: 3. "subcollection" +y := x indexOf: 3 ifAbsent: [0]. "first position of element within collection" +y := x occurrencesOf: 3. "number of times object in collection" +x do: [:a | Transcript show: a printString; cr]. "iterate over the collection" +b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" +y := x select: [:a | a > 2]. "return collection of elements that pass test" +y := x reject: [:a | a < 2]. "return collection of elements that fail test" +y := x collect: [:a | a + a]. "transform each element for new collection" +y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" +sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" +sum := 0. 1 to: (x size) do: [:a | sum := sum + (x at: a)]. "sum elements" +sum := x inject: 0 into: [:a :c | a + c]. "sum elements" +max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" + ifTrue: [a] + ifFalse: [c]]. +y := x asArray. "convert to array" +y := x asOrderedCollection. "convert to ordered collection" +y := x asSortedCollection. "convert to sorted collection" +y := x asBag. "convert to bag collection" +y := x asSet. "convert to set collection" + +"************************************************************************ + * Bag: like OrderedCollection except elements are in no * + * particular order * + ************************************************************************" +| b x y sum max | +x := Bag with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" +x := Bag new. "allocate collection" +x add: 4; add: 3; add: 1; add: 2; yourself. "add element to collection" +x add: 3 withOccurrences: 2. "add multiple copies to collection" +y := x addAll: #(7 8 9). "add multiple elements to collection" +y := x removeAll: #(7 8 9). "remove multiple elements from collection" +y := x remove: 4 ifAbsent: []. "remove element from collection" +b := x isEmpty. "test if empty" +y := x size. "number of elements" +b := x includes: 3. "test if element is in collection" +y := x occurrencesOf: 3. "number of times object in collection" +x do: [:a | Transcript show: a printString; cr]. "iterate over the collection" +b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" +y := x select: [:a | a > 2]. "return collection of elements that pass test" +y := x reject: [:a | a < 2]. "return collection of elements that fail test" +y := x collect: [:a | a + a]. "transform each element for new collection" +y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" +sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" +sum := x inject: 0 into: [:a :c | a + c]. "sum elements" +max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" + ifTrue: [a] + ifFalse: [c]]. +y := x asOrderedCollection. "convert to ordered collection" +y := x asSortedCollection. "convert to sorted collection" +y := x asBag. "convert to bag collection" +y := x asSet. "convert to set collection" + +"************************************************************************ + * Set: like Bag except duplicates not allowed * + * IdentitySet: uses identity test (== rather than =) * + ************************************************************************" +| b x y sum max | +x := Set with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" +x := Set new. "allocate collection" +x add: 4; add: 3; add: 1; add: 2; yourself. "add element to collection" +y := x addAll: #(7 8 9). "add multiple elements to collection" +y := x removeAll: #(7 8 9). "remove multiple elements from collection" +y := x remove: 4 ifAbsent: []. "remove element from collection" +b := x isEmpty. "test if empty" +y := x size. "number of elements" +x includes: 4. "test if element is in collection" +x do: [:a | Transcript show: a printString; cr]. "iterate over the collection" +b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" +y := x select: [:a | a > 2]. "return collection of elements that pass test" +y := x reject: [:a | a < 2]. "return collection of elements that fail test" +y := x collect: [:a | a + a]. "transform each element for new collection" +y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" +sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" +sum := x inject: 0 into: [:a :c | a + c]. "sum elements" +max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" + ifTrue: [a] + ifFalse: [c]]. +y := x asArray. "convert to array" +y := x asOrderedCollection. "convert to ordered collection" +y := x asSortedCollection. "convert to sorted collection" +y := x asBag. "convert to bag collection" +y := x asSet. "convert to set collection" + +"************************************************************************ + * Interval: * + ************************************************************************" +| b x y sum max | +x := Interval from: 5 to: 10. "create interval object" +x := 5 to: 10. +x := Interval from: 5 to: 10 by: 2. "create interval object with specified increment" +x := 5 to: 10 by: 2. +b := x isEmpty. "test if empty" +y := x size. "number of elements" +x includes: 9. "test if element is in collection" +x do: [:k | Transcript show: k printString; cr]. "iterate over interval" +b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" +y := x select: [:a | a > 7]. "return collection of elements that pass test" +y := x reject: [:a | a < 2]. "return collection of elements that fail test" +y := x collect: [:a | a + a]. "transform each element for new collection" +y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" +sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" +sum := 0. 1 to: (x size) do: [:a | sum := sum + (x at: a)]. "sum elements" +sum := x inject: 0 into: [:a :c | a + c]. "sum elements" +max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" + ifTrue: [a] + ifFalse: [c]]. +y := x asArray. "convert to array" +y := x asOrderedCollection. "convert to ordered collection" +y := x asSortedCollection. "convert to sorted collection" +y := x asBag. "convert to bag collection" +y := x asSet. "convert to set collection" + +"************************************************************************ + * Associations: * + ************************************************************************" +| x y | +x := #myVar->'hello'. +y := x key. +y := x value. + +"************************************************************************ + * Dictionary: * + * IdentityDictionary: uses identity test (== rather than =) * + ************************************************************************" +| b x y | +x := Dictionary new. "allocate collection" +x add: #a->4; add: #b->3; add: #c->1; add: #d->2; yourself. "add element to collection" +x at: #e put: 3. "set element at index" +b := x isEmpty. "test if empty" +y := x size. "number of elements" +y := x at: #a ifAbsent: []. "retrieve element at index" +y := x keyAtValue: 3 ifAbsent: []. "retrieve key for given value with error block" +y := x removeKey: #e ifAbsent: []. "remove element from collection" +b := x includes: 3. "test if element is in values collection" +b := x includesKey: #a. "test if element is in keys collection" +y := x occurrencesOf: 3. "number of times object in collection" +y := x keys. "set of keys" +y := x values. "bag of values" +x do: [:a | Transcript show: a printString; cr]. "iterate over the values collection" +x keysDo: [:a | Transcript show: a printString; cr]. "iterate over the keys collection" +x associationsDo: [:a | Transcript show: a printString; cr]."iterate over the associations" +x keysAndValuesDo: [:aKey :aValue | Transcript "iterate over keys and values" + show: aKey printString; space; + show: aValue printString; cr]. +b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" +y := x select: [:a | a > 2]. "return collection of elements that pass test" +y := x reject: [:a | a < 2]. "return collection of elements that fail test" +y := x collect: [:a | a + a]. "transform each element for new collection" +y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" +sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" +sum := x inject: 0 into: [:a :c | a + c]. "sum elements" +max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" + ifTrue: [a] + ifFalse: [c]]. +y := x asArray. "convert to array" +y := x asOrderedCollection. "convert to ordered collection" +y := x asSortedCollection. "convert to sorted collection" +y := x asBag. "convert to bag collection" +y := x asSet. "convert to set collection" + +Smalltalk at: #CMRGlobal put: 'CMR entry'. "put global in Smalltalk Dictionary" +x := Smalltalk at: #CMRGlobal. "read global from Smalltalk Dictionary" +Transcript show: (CMRGlobal printString). "entries are directly accessible by name" +Smalltalk keys do: [ :k | "print out all classes" + ((Smalltalk at: k) isKindOf: Class) + ifFalse: [Transcript show: k printString; cr]]. +Smalltalk at: #CMRDictionary put: (Dictionary new). "set up user defined dictionary" +CMRDictionary at: #MyVar1 put: 'hello1'. "put entry in dictionary" +CMRDictionary add: #MyVar2->'hello2'. "add entry to dictionary use key->value combo" +CMRDictionary size. "dictionary size" +CMRDictionary keys do: [ :k | "print out keys in dictionary" + Transcript show: k printString; cr]. +CMRDictionary values do: [ :k | "print out values in dictionary" + Transcript show: k printString; cr]. +CMRDictionary keysAndValuesDo: [:aKey :aValue | "print out keys and values" + Transcript + show: aKey printString; + space; + show: aValue printString; + cr]. +CMRDictionary associationsDo: [:aKeyValue | "another iterator for printing key values" + Transcript show: aKeyValue printString; cr]. +Smalltalk removeKey: #CMRGlobal ifAbsent: []. "remove entry from Smalltalk dictionary" +Smalltalk removeKey: #CMRDictionary ifAbsent: []. "remove user dictionary from Smalltalk dictionary" + +"************************************************************************ + * Internal Stream: * + ************************************************************************" +| b x ios | +ios := ReadStream on: 'Hello read stream'. +ios := ReadStream on: 'Hello read stream' from: 1 to: 5. +[(x := ios nextLine) notNil] + whileTrue: [Transcript show: x; cr]. +ios position: 3. +ios position. +x := ios next. +x := ios peek. +x := ios contents. +b := ios atEnd. + +ios := ReadWriteStream on: 'Hello read stream'. +ios := ReadWriteStream on: 'Hello read stream' from: 1 to: 5. +ios := ReadWriteStream with: 'Hello read stream'. +ios := ReadWriteStream with: 'Hello read stream' from: 1 to: 10. +ios position: 0. +[(x := ios nextLine) notNil] + whileTrue: [Transcript show: x; cr]. +ios position: 6. +ios position. +ios nextPutAll: 'Chris'. +x := ios next. +x := ios peek. +x := ios contents. +b := ios atEnd. + +"************************************************************************ + * FileStream: * + ************************************************************************" +| b x ios | +ios := FileStream newFileNamed: 'ios.txt'. +ios nextPut: $H; cr. +ios nextPutAll: 'Hello File'; cr. +'Hello File' printOn: ios. +'Hello File' storeOn: ios. +ios close. + +ios := FileStream oldFileNamed: 'ios.txt'. +[(x := ios nextLine) notNil] + whileTrue: [Transcript show: x; cr]. +ios position: 3. +x := ios position. +x := ios next. +x := ios peek. +b := ios atEnd. +ios close. + +"************************************************************************ + * Date: * + ************************************************************************" +| x y | +x := Date today. "create date for today" +x := Date dateAndTimeNow. "create date from current time/date" +x := Date readFromString: '01/02/1999'. "create date from formatted string" +x := Date newDay: 12 month: #July year: 1999 "create date from parts" +x := Date fromDays: 36000. "create date from elapsed days since 1/1/1901" +y := Date dayOfWeek: #Monday. "day of week as int (1-7)" +y := Date indexOfMonth: #January. "month of year as int (1-12)" +y := Date daysInMonth: 2 forYear: 1996. "day of month as int (1-31)" +y := Date daysInYear: 1996. "days in year (365|366)" +y := Date nameOfDay: 1 "weekday name (#Monday,...)" +y := Date nameOfMonth: 1. "month name (#January,...)" +y := Date leapYear: 1996. "1 if leap year; 0 if not leap year" +y := x weekday. "day of week (#Monday,...)" +y := x previous: #Monday. "date for previous day of week" +y := x dayOfMonth. "day of month (1-31)" +y := x day. "day of year (1-366)" +y := x firstDayOfMonth. "day of year for first day of month" +y := x monthName. "month of year (#January,...)" +y := x monthIndex. "month of year (1-12)" +y := x daysInMonth. "days in month (1-31)" +y := x year. "year (19xx)" +y := x daysInYear. "days in year (365|366)" +y := x daysLeftInYear. "days left in year (364|365)" +y := x asSeconds. "seconds elapsed since 1/1/1901" +y := x addDays: 10. "add days to date object" +y := x subtractDays: 10. "subtract days to date object" +y := x subtractDate: (Date today). "subtract date (result in days)" +y := x printFormat: #(2 1 3 $/ 1 1). "print formatted date" +b := (x <= Date today). "comparison" + +"************************************************************************ + * Time: * + ************************************************************************" +| x y | +x := Time now. "create time from current time" +x := Time dateAndTimeNow. "create time from current time/date" +x := Time readFromString: '3:47:26 pm'. "create time from formatted string" +x := Time fromSeconds: (60 * 60 * 4). "create time from elapsed time from midnight" +y := Time millisecondClockValue. "milliseconds since midnight" +y := Time totalSeconds. "total seconds since 1/1/1901" +y := x seconds. "seconds past minute (0-59)" +y := x minutes. "minutes past hour (0-59)" +y := x hours. "hours past midnight (0-23)" +y := x addTime: (Time now). "add time to time object" +y := x subtractTime: (Time now). "subtract time to time object" +y := x asSeconds. "convert time to seconds" +x := Time millisecondsToRun: [ "timing facility" + 1 to: 1000 do: [:index | y := 3.14 * index]]. +b := (x <= Time now). "comparison" + +"************************************************************************ + * Point: * + ************************************************************************" +| x y | +x := 200@100. "obtain a new point" +y := x x. "x coordinate" +y := x y. "y coordinate" +x := 200@100 negated. "negates x and y" +x := (-200@-100) abs. "absolute value of x and y" +x := (200.5@100.5) rounded. "round x and y" +x := (200.5@100.5) truncated. "truncate x and y" +x := 200@100 + 100. "add scale to both x and y" +x := 200@100 - 100. "subtract scale from both x and y" +x := 200@100 * 2. "multiply x and y by scale" +x := 200@100 / 2. "divide x and y by scale" +x := 200@100 // 2. "divide x and y by scale" +x := 200@100 \\ 3. "remainder of x and y by scale" +x := 200@100 + 50@25. "add points" +x := 200@100 - 50@25. "subtract points" +x := 200@100 * 3@4. "multiply points" +x := 200@100 // 3@4. "divide points" +x := 200@100 max: 50@200. "max x and y" +x := 200@100 min: 50@200. "min x and y" +x := 20@5 dotProduct: 10@2. "sum of product (x1*x2 + y1*y2)" + +"************************************************************************ + * Rectangle: * + ************************************************************************" +Rectangle fromUser. + +"************************************************************************ + * Pen: * + ************************************************************************" +| myPen | +Display restoreAfter: [ + Display fillWhite. + +myPen := Pen new. "get graphic pen" +myPen squareNib: 1. +myPen color: (Color blue). "set pen color" +myPen home. "position pen at center of display" +myPen up. "makes nib unable to draw" +myPen down. "enable the nib to draw" +myPen north. "points direction towards top" +myPen turn: -180. "add specified degrees to direction" +myPen direction. "get current angle of pen" +myPen go: 50. "move pen specified number of pixels" +myPen location. "get the pen position" +myPen goto: 200@200. "move to specified point" +myPen place: 250@250. "move to specified point without drawing" +myPen print: 'Hello World' withFont: (TextStyle default fontAt: 1). +Display extent. "get display width@height" +Display width. "get display width" +Display height. "get display height" + +]. + +"************************************************************************ + * Dynamic Message Calling/Compiling: * + ************************************************************************" +| receiver message result argument keyword1 keyword2 argument1 argument2 | +"unary message" +receiver := 5. +message := 'factorial' asSymbol. +result := receiver perform: message. +result := Compiler evaluate: ((receiver storeString), ' ', message). +result := (Message new setSelector: message arguments: #()) sentTo: receiver. + +"binary message" +receiver := 1. +message := '+' asSymbol. +argument := 2. +result := receiver perform: message withArguments: (Array with: argument). +result := Compiler evaluate: ((receiver storeString), ' ', message, ' ', (argument storeString)). +result := (Message new setSelector: message arguments: (Array with: argument)) sentTo: receiver. + +"keyword messages" +receiver := 12. +keyword1 := 'between:' asSymbol. +keyword2 := 'and:' asSymbol. +argument1 := 10. +argument2 := 20. +result := receiver + perform: (keyword1, keyword2) asSymbol + withArguments: (Array with: argument1 with: argument2). +result := Compiler evaluate: + ((receiver storeString), ' ', keyword1, (argument1 storeString) , ' ', keyword2, (argument2 storeString)). +result := (Message + new + setSelector: (keyword1, keyword2) asSymbol + arguments: (Array with: argument1 with: argument2)) + sentTo: receiver. + +"************************************************************************ + * class/meta-class: * + ************************************************************************" +| b x | +x := String name. "class name" +x := String category. "organization category" +x := String comment. "class comment" +x := String kindOfSubclass. "subclass type - subclass: variableSubclass, etc" +x := String definition. "class definition" +x := String instVarNames. "immediate instance variable names" +x := String allInstVarNames. "accumulated instance variable names" +x := String classVarNames. "immediate class variable names" +x := String allClassVarNames. "accumulated class variable names" +x := String sharedPools. "immediate dictionaries used as shared pools" +x := String allSharedPools. "accumulated dictionaries used as shared pools" +x := String selectors. "message selectors for class" +x := String sourceCodeAt: #size. "source code for specified method" +x := String allInstances. "collection of all instances of class" +x := String superclass. "immediate superclass" +x := String allSuperclasses. "accumulated superclasses" +x := String withAllSuperclasses. "receiver class and accumulated superclasses" +x := String subclasses. "immediate subclasses" +x := String allSubclasses. "accumulated subclasses" +x := String withAllSubclasses. "receiver class and accumulated subclasses" +b := String instSize. "number of named instance variables" +b := String isFixed. "true if no indexed instance variables" +b := String isVariable. "true if has indexed instance variables" +b := String isPointers. "true if index instance vars contain objects" +b := String isBits. "true if index instance vars contain bytes/words" +b := String isBytes. "true if index instance vars contain bytes" +b := String isWords. true if index instance vars contain words" +Object withAllSubclasses size. "get total number of class entries" + +"************************************************************************ + * debuging: * + ************************************************************************" +| a b x | +x yourself. "returns receiver" +String browse. "browse specified class" +x inspect. "open object inspector window" +x confirm: 'Is this correct?'. +x halt. "breakpoint to open debugger window" +x halt: 'Halt message'. +x notify: 'Notify text'. +x error: 'Error string'. "open up error window with title" +x doesNotUnderstand: #cmrMessage. "flag message is not handled" +x shouldNotImplement. "flag message should not be implemented" +x subclassResponsibility. "flag message as abstract" +x errorImproperStore. "flag an improper store into indexable object" +x errorNonIntegerIndex. "flag only integers should be used as index" +x errorSubscriptBounds. "flag subscript out of bounds" +x primitiveFailed. "system primitive failed" + +a := 'A1'. b := 'B2'. a become: b. "switch two objects" +Transcript show: a, b; cr. + +"************************************************************************ + * Misc. * + ************************************************************************" +| x | +"Smalltalk condenseChanges." "compress the change file" +x := FillInTheBlank request: 'Prompt Me'. "prompt user for input" +Utilities openCommandKeyHelp + + + + +``` + +## Ready For More? + +### Free Online + +* [GNU Smalltalk User's Guide](https://www.gnu.org/software/smalltalk/manual/html_node/Tutorial.html) +* [smalltalk dot org](http://www.smalltalk.org/smalltalk/learning.html) +* [Computer Programming using GNU Smalltalk](http://www.canol.info/books/computer_programming_using_gnu_smalltalk/) +* [Smalltalk Cheatsheet](http://www.angelfire.com/tx4/cus/notes/smalltalk.html) +* [Smalltalk-72 Manual](http://www.bitsavers.org/pdf/xerox/parc/techReports/Smalltalk-72_Instruction_Manual_Mar76.pdf) +* [BYTE: A Special issue on Smalltalk](https://archive.org/details/byte-magazine-1981-08) +* [Smalltalk, Objects, and Design](https://books.google.co.in/books?id=W8_Une9cbbgC&printsec=frontcover&dq=smalltalk&hl=en&sa=X&ved=0CCIQ6AEwAWoVChMIw63Vo6CpyAIV0HGOCh3S2Alf#v=onepage&q=smalltalk&f=false) +* [Smalltalk: An Introduction to Application Development Using VisualWorks](https://books.google.co.in/books?id=zalQAAAAMAAJ&q=smalltalk&dq=smalltalk&hl=en&sa=X&ved=0CCgQ6AEwAmoVChMIw63Vo6CpyAIV0HGOCh3S2Alf/) diff --git a/smalltalk.html.markdown~ b/smalltalk.html.markdown~ new file mode 100644 index 00000000..61e5a94c --- /dev/null +++ b/smalltalk.html.markdown~ @@ -0,0 +1,959 @@ +--- +language: smalltalk +contributors: + - ["Jigyasa Grover", "https://github.com/jig08"] +--- + +- Smalltalk is an object-oriented, dynamically typed, reflective programming language. +- Smalltalk was created as the language to underpin the "new world" of computing exemplified by "human–computer symbiosis." +- It was designed and created in part for educational use, more so for constructionist learning, at the Learning Research Group (LRG) of Xerox PARC by Alan Kay, Dan Ingalls, Adele Goldberg, Ted Kaehler, Scott Wallace, and others during the 1970s. + +Feedback highly appreciated! Reach me at [@jigyasa_grover](https://twitter.com/jigyasa_grover) or `grover.jigyasa1@gmail.com`. + +``` + +"************************************************************************ + * Allowable characters: * + * - a-z * + * - A-Z * + * - 0-9 * + * - .+/\*~<>@%|&? * + * - blank, tab, cr, ff, lf * + * * + * Variables: * + * - variables must be declared before use * + * - shared vars must begin with uppercase * + * - local vars must begin with lowercase * + * - reserved names: nil, true, false, self, super, and Smalltalk * + * * + * Variable scope: * + * - Global: defined in Dictionary Smalltalk and accessible by all * + * objects in system * + * - Special: (reserved) Smalltalk, super, self, true, false, & nil * + * - Method Temporary: local to a method * + * - Block Temporary: local to a block * + * - Pool: variables in a Dictionary object * + * - Method Parameters: automatic local vars created as a result of * + * message call with params * + * - Block Parameters: automatic local vars created as a result of * + * value: message call * + * - Class: shared with all instances of one class & its subclasses * + * - Class Instance: unique to each instance of a class * + * - Instance Variables: unique to each instance * + ************************************************************************" +"Comments are enclosed in quotes" +"Period (.) is the statement seperator" + +"************************************************************************ + * Transcript: * + ************************************************************************" +Transcript clear. "clear to transcript window" +Transcript show: 'Hello World'. "output string in transcript window" +Transcript nextPutAll: 'Hello World'. "output string in transcript window" +Transcript nextPut: $A. "output character in transcript window" +Transcript space. "output space character in transcript window" +Transcript tab. "output tab character in transcript window" +Transcript cr. "carriage return / linefeed" +'Hello' printOn: Transcript. "append print string into the window" +'Hello' storeOn: Transcript. "append store string into the window" +Transcript endEntry. "flush the output buffer" + +"************************************************************************ + * Assignment: * + ************************************************************************" +| x y | +x _ 4. "assignment (Squeak) <-" +x := 5. "assignment" +x := y := z := 6. "compound assignment" +x := (y := 6) + 1. +x := Object new. "bind to allocated instance of a class" +x := 123 class. "discover the object class" +x := Integer superclass. "discover the superclass of a class" +x := Object allInstances. "get an array of all instances of a class" +x := Integer allSuperclasses. "get all superclasses of a class" +x := 1.2 hash. "hash value for object" +y := x copy. "copy object" +y := x shallowCopy. "copy object (not overridden)" +y := x deepCopy. "copy object and instance vars" +y := x veryDeepCopy. "complete tree copy using a dictionary" + +"************************************************************************ + * Constants: * + ************************************************************************" +| b | +b := true. "true constant" +b := false. "false constant" +x := nil. "nil object constant" +x := 1. "integer constants" +x := 3.14. "float constants" +x := 2e-2. "fractional constants" +x := 16r0F. "hex constant". +x := -1. "negative constants" +x := 'Hello'. "string constant" +x := 'I''m here'. "single quote escape" +x := $A. "character constant" +x := $ . "character constant (space)" +x := #aSymbol. "symbol constants" +x := #(3 2 1). "array constants" +x := #('abc' 2 $a). "mixing of types allowed" + +"************************************************************************ + * Booleans: * + ************************************************************************" +| b x y | +x := 1. y := 2. +b := (x = y). "equals" +b := (x ~= y). "not equals" +b := (x == y). "identical" +b := (x ~~ y). "not identical" +b := (x > y). "greater than" +b := (x < y). "less than" +b := (x >= y). "greater than or equal" +b := (x <= y). "less than or equal" +b := b not. "boolean not" +b := (x < 5) & (y > 1). "boolean and" +b := (x < 5) | (y > 1). "boolean or" +b := (x < 5) and: [y > 1]. "boolean and (short-circuit)" +b := (x < 5) or: [y > 1]. "boolean or (short-circuit)" +b := (x < 5) eqv: (y > 1). "test if both true or both false" +b := (x < 5) xor: (y > 1). "test if one true and other false" +b := 5 between: 3 and: 12. "between (inclusive)" +b := 123 isKindOf: Number. "test if object is class or subclass of" +b := 123 isMemberOf: SmallInteger. "test if object is type of class" +b := 123 respondsTo: sqrt. "test if object responds to message" +b := x isNil. "test if object is nil" +b := x isZero. "test if number is zero" +b := x positive. "test if number is positive" +b := x strictlyPositive. "test if number is greater than zero" +b := x negative. "test if number is negative" +b := x even. "test if number is even" +b := x odd. "test if number is odd" +b := x isLiteral. "test if literal constant" +b := x isInteger. "test if object is integer" +b := x isFloat. "test if object is float" +b := x isNumber. "test if object is number" +b := $A isUppercase. "test if upper case character" +b := $A isLowercase. "test if lower case character" + +"************************************************************************ + * Arithmetic expressions: * + ************************************************************************" +| x | +x := 6 + 3. "addition" +x := 6 - 3. "subtraction" +x := 6 * 3. "multiplication" +x := 1 + 2 * 3. "evaluation always left to right (1 + 2) * 3" +x := 5 / 3. "division with fractional result" +x := 5.0 / 3.0. "division with float result" +x := 5.0 // 3.0. "integer divide" +x := 5.0 \\ 3.0. "integer remainder" +x := -5. "unary minus" +x := 5 sign. "numeric sign (1, -1 or 0)" +x := 5 negated. "negate receiver" +x := 1.2 integerPart. "integer part of number (1.0)" +x := 1.2 fractionPart. "fractional part of number (0.2)" +x := 5 reciprocal. "reciprocal function" +x := 6 * 3.1. "auto convert to float" +x := 5 squared. "square function" +x := 25 sqrt. "square root" +x := 5 raisedTo: 2. "power function" +x := 5 raisedToInteger: 2. "power function with integer" +x := 5 exp. "exponential" +x := -5 abs. "absolute value" +x := 3.99 rounded. "round" +x := 3.99 truncated. "truncate" +x := 3.99 roundTo: 1. "round to specified decimal places" +x := 3.99 truncateTo: 1. "truncate to specified decimal places" +x := 3.99 floor. "truncate" +x := 3.99 ceiling. "round up" +x := 5 factorial. "factorial" +x := -5 quo: 3. "integer divide rounded toward zero" +x := -5 rem: 3. "integer remainder rounded toward zero" +x := 28 gcd: 12. "greatest common denominator" +x := 28 lcm: 12. "least common multiple" +x := 100 ln. "natural logarithm" +x := 100 log. "base 10 logarithm" +x := 100 log: 10. "logarithm with specified base" +x := 100 floorLog: 10. "floor of the log" +x := 180 degreesToRadians. "convert degrees to radians" +x := 3.14 radiansToDegrees. "convert radians to degrees" +x := 0.7 sin. "sine" +x := 0.7 cos. "cosine" +x := 0.7 tan. "tangent" +x := 0.7 arcSin. "arcsine" +x := 0.7 arcCos. "arccosine" +x := 0.7 arcTan. "arctangent" +x := 10 max: 20. "get maximum of two numbers" +x := 10 min: 20. "get minimum of two numbers" +x := Float pi. "pi" +x := Float e. "exp constant" +x := Float infinity. "infinity" +x := Float nan. "not-a-number" +x := Random new next; yourself. x next. "random number stream (0.0 to 1.0) +x := 100 atRandom. "quick random number" + +"************************************************************************ + * Bitwise Manipulation: * + ************************************************************************" +| b x | +x := 16rFF bitAnd: 16r0F. "and bits" +x := 16rF0 bitOr: 16r0F. "or bits" +x := 16rFF bitXor: 16r0F. "xor bits" +x := 16rFF bitInvert. "invert bits" +x := 16r0F bitShift: 4. "left shift" +x := 16rF0 bitShift: -4. "right shift" +"x := 16r80 bitAt: 7." "bit at position (0|1) [!Squeak]" +x := 16r80 highbit. "position of highest bit set" +b := 16rFF allMask: 16r0F. "test if all bits set in mask set in receiver" +b := 16rFF anyMask: 16r0F. "test if any bits set in mask set in receiver" +b := 16rFF noMask: 16r0F. "test if all bits set in mask clear in receiver" + +"************************************************************************ + * Conversion: * + ************************************************************************" +| x | +x := 3.99 asInteger. "convert number to integer (truncates in Squeak)" +x := 3.99 asFraction. "convert number to fraction" +x := 3 asFloat. "convert number to float" +x := 65 asCharacter. "convert integer to character" +x := $A asciiValue. "convert character to integer" +x := 3.99 printString. "convert object to string via printOn:" +x := 3.99 storeString. "convert object to string via storeOn:" +x := 15 radix: 16. "convert to string in given base" +x := 15 printStringBase: 16. +x := 15 storeStringBase: 16. + +"************************************************************************ + * Blocks: * + * - blocks are objects and may be assigned to a variable * + * - value is last expression evaluated unless explicit return * + * - blocks may be nested * + * - specification [ arguments | | localvars | expressions ] * + * - Squeak does not currently support localvars in blocks * + * - max of three arguments allowed * + * - ^expression terminates block & method (exits all nested blocks) * + * - blocks intended for long term storage should not contain ^ * + ************************************************************************" +| x y z | +x := [ y := 1. z := 2. ]. x value. "simple block usage" +x := [ :argOne :argTwo | argOne, ' and ' , argTwo.]. "set up block with argument passing" +Transcript show: (x value: 'First' value: 'Second'); cr. "use block with argument passing" +"x := [ | z | z := 1.]. localvars not available in squeak blocks" + +"************************************************************************ + * Method calls: * + * - unary methods are messages with no arguments * + * - binary methods * + * - keyword methods are messages with selectors including colons * + * * + * standard categories/protocols: * + * - initialize-release (methods called for new instance) * + * - accessing (get/set methods) * + * - testing (boolean tests - is) * + * - comparing (boolean tests with parameter * + * - displaying (gui related methods) * + * - printing (methods for printing) * + * - updating (receive notification of changes) * + * - private (methods private to class) * + * - instance-creation (class methods for creating instance) * + ************************************************************************" +| x | +x := 2 sqrt. "unary message" +x := 2 raisedTo: 10. "keyword message" +x := 194 * 9. "binary message" +Transcript show: (194 * 9) printString; cr. "combination (chaining)" +x := 2 perform: #sqrt. "indirect method invocation" +Transcript "Cascading - send multiple messages to receiver" + show: 'hello '; + show: 'world'; + cr. +x := 3 + 2; * 100. "result=300. Sends message to same receiver (3)" + +"************************************************************************ + * Conditional Statements: * + ************************************************************************" +| x | +x > 10 ifTrue: [Transcript show: 'ifTrue'; cr]. "if then" +x > 10 ifFalse: [Transcript show: 'ifFalse'; cr]. "if else" +x > 10 "if then else" + ifTrue: [Transcript show: 'ifTrue'; cr] + ifFalse: [Transcript show: 'ifFalse'; cr]. +x > 10 "if else then" + ifFalse: [Transcript show: 'ifFalse'; cr] + ifTrue: [Transcript show: 'ifTrue'; cr]. +Transcript + show: + (x > 10 + ifTrue: ['ifTrue'] + ifFalse: ['ifFalse']); + cr. +Transcript "nested if then else" + show: + (x > 10 + ifTrue: [x > 5 + ifTrue: ['A'] + ifFalse: ['B']] + ifFalse: ['C']); + cr. +switch := Dictionary new. "switch functionality" +switch at: $A put: [Transcript show: 'Case A'; cr]. +switch at: $B put: [Transcript show: 'Case B'; cr]. +switch at: $C put: [Transcript show: 'Case C'; cr]. +result := (switch at: $B) value. + +"************************************************************************ + * Iteration statements: * + ************************************************************************" +| x y | +x := 4. y := 1. +[x > 0] whileTrue: [x := x - 1. y := y * 2]. "while true loop" +[x >= 4] whileFalse: [x := x + 1. y := y * 2]. "while false loop" +x timesRepeat: [y := y * 2]. "times repear loop (i := 1 to x)" +1 to: x do: [:a | y := y * 2]. "for loop" +1 to: x by: 2 do: [:a | y := y / 2]. "for loop with specified increment" +#(5 4 3) do: [:a | x := x + a]. "iterate over array elements" + +"************************************************************************ + * Character: * + ************************************************************************" +| x y | +x := $A. "character assignment" +y := x isLowercase. "test if lower case" +y := x isUppercase. "test if upper case" +y := x isLetter. "test if letter" +y := x isDigit. "test if digit" +y := x isAlphaNumeric. "test if alphanumeric" +y := x isSeparator. "test if seperator char" +y := x isVowel. "test if vowel" +y := x digitValue. "convert to numeric digit value" +y := x asLowercase. "convert to lower case" +y := x asUppercase. "convert to upper case" +y := x asciiValue. "convert to numeric ascii value" +y := x asString. "convert to string" +b := $A <= $B. "comparison" +y := $A max: $B. + +"************************************************************************ + * Symbol: * + ************************************************************************" +| b x y | +x := #Hello. "symbol assignment" +y := 'String', 'Concatenation'. "symbol concatenation (result is string)" +b := x isEmpty. "test if symbol is empty" +y := x size. "string size" +y := x at: 2. "char at location" +y := x copyFrom: 2 to: 4. "substring" +y := x indexOf: $e ifAbsent: [0]. "first position of character within string" +x do: [:a | Transcript show: a printString; cr]. "iterate over the string" +b := x conform: [:a | (a >= $a) & (a <= $z)]. "test if all elements meet condition" +y := x select: [:a | a > $a]. "return all elements that meet condition" +y := x asString. "convert symbol to string" +y := x asText. "convert symbol to text" +y := x asArray. "convert symbol to array" +y := x asOrderedCollection. "convert symbol to ordered collection" +y := x asSortedCollection. "convert symbol to sorted collection" +y := x asBag. "convert symbol to bag collection" +y := x asSet. "convert symbol to set collection" + +"************************************************************************ + * String: * + ************************************************************************" +| b x y | +x := 'This is a string'. "string assignment" +x := 'String', 'Concatenation'. "string concatenation" +b := x isEmpty. "test if string is empty" +y := x size. "string size" +y := x at: 2. "char at location" +y := x copyFrom: 2 to: 4. "substring" +y := x indexOf: $a ifAbsent: [0]. "first position of character within string" +x := String new: 4. "allocate string object" +x "set string elements" + at: 1 put: $a; + at: 2 put: $b; + at: 3 put: $c; + at: 4 put: $e. +x := String with: $a with: $b with: $c with: $d. "set up to 4 elements at a time" +x do: [:a | Transcript show: a printString; cr]. "iterate over the string" +b := x conform: [:a | (a >= $a) & (a <= $z)]. "test if all elements meet condition" +y := x select: [:a | a > $a]. "return all elements that meet condition" +y := x asSymbol. "convert string to symbol" +y := x asArray. "convert string to array" +x := 'ABCD' asByteArray. "convert string to byte array" +y := x asOrderedCollection. "convert string to ordered collection" +y := x asSortedCollection. "convert string to sorted collection" +y := x asBag. "convert string to bag collection" +y := x asSet. "convert string to set collection" +y := x shuffled. "randomly shuffle string" + +"************************************************************************ + * Array: Fixed length collection * + * ByteArray: Array limited to byte elements (0-255) * + * WordArray: Array limited to word elements (0-2^32) * + ************************************************************************" +| b x y sum max | +x := #(4 3 2 1). "constant array" +x := Array with: 5 with: 4 with: 3 with: 2. "create array with up to 4 elements" +x := Array new: 4. "allocate an array with specified size" +x "set array elements" + at: 1 put: 5; + at: 2 put: 4; + at: 3 put: 3; + at: 4 put: 2. +b := x isEmpty. "test if array is empty" +y := x size. "array size" +y := x at: 4. "get array element at index" +b := x includes: 3. "test if element is in array" +y := x copyFrom: 2 to: 4. "subarray" +y := x indexOf: 3 ifAbsent: [0]. "first position of element within array" +y := x occurrencesOf: 3. "number of times object in collection" +x do: [:a | Transcript show: a printString; cr]. "iterate over the array" +b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" +y := x select: [:a | a > 2]. "return collection of elements that pass test" +y := x reject: [:a | a < 2]. "return collection of elements that fail test" +y := x collect: [:a | a + a]. "transform each element for new collection" +y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" +sum := 0. x do: [:a | sum := sum + a]. sum. "sum array elements" +sum := 0. 1 to: (x size) do: [:a | sum := sum + (x at: a)]. "sum array elements" +sum := x inject: 0 into: [:a :c | a + c]. "sum array elements" +max := x inject: 0 into: [:a :c | (a > c) "find max element in array" + ifTrue: [a] + ifFalse: [c]]. +y := x shuffled. "randomly shuffle collection" +y := x asArray. "convert to array" +"y := x asByteArray." "note: this instruction not available on Squeak" +y := x asWordArray. "convert to word array" +y := x asOrderedCollection. "convert to ordered collection" +y := x asSortedCollection. "convert to sorted collection" +y := x asBag. "convert to bag collection" +y := x asSet. "convert to set collection" + +"************************************************************************ + * OrderedCollection: acts like an expandable array * + ************************************************************************" +| b x y sum max | +x := OrderedCollection with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" +x := OrderedCollection new. "allocate collection" +x add: 3; add: 2; add: 1; add: 4; yourself. "add element to collection" +y := x addFirst: 5. "add element at beginning of collection" +y := x removeFirst. "remove first element in collection" +y := x addLast: 6. "add element at end of collection" +y := x removeLast. "remove last element in collection" +y := x addAll: #(7 8 9). "add multiple elements to collection" +y := x removeAll: #(7 8 9). "remove multiple elements from collection" +x at: 2 put: 3. "set element at index" +y := x remove: 5 ifAbsent: []. "remove element from collection" +b := x isEmpty. "test if empty" +y := x size. "number of elements" +y := x at: 2. "retrieve element at index" +y := x first. "retrieve first element in collection" +y := x last. "retrieve last element in collection" +b := x includes: 5. "test if element is in collection" +y := x copyFrom: 2 to: 3. "subcollection" +y := x indexOf: 3 ifAbsent: [0]. "first position of element within collection" +y := x occurrencesOf: 3. "number of times object in collection" +x do: [:a | Transcript show: a printString; cr]. "iterate over the collection" +b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" +y := x select: [:a | a > 2]. "return collection of elements that pass test" +y := x reject: [:a | a < 2]. "return collection of elements that fail test" +y := x collect: [:a | a + a]. "transform each element for new collection" +y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" +sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" +sum := 0. 1 to: (x size) do: [:a | sum := sum + (x at: a)]. "sum elements" +sum := x inject: 0 into: [:a :c | a + c]. "sum elements" +max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" + ifTrue: [a] + ifFalse: [c]]. +y := x shuffled. "randomly shuffle collection" +y := x asArray. "convert to array" +y := x asOrderedCollection. "convert to ordered collection" +y := x asSortedCollection. "convert to sorted collection" +y := x asBag. "convert to bag collection" +y := x asSet. "convert to set collection" + +"************************************************************************ + * SortedCollection: like OrderedCollection except order of elements * + * determined by sorting criteria * + ************************************************************************" +| b x y sum max | +x := SortedCollection with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" +x := SortedCollection new. "allocate collection" +x := SortedCollection sortBlock: [:a :c | a > c]. "set sort criteria" +x add: 3; add: 2; add: 1; add: 4; yourself. "add element to collection" +y := x addFirst: 5. "add element at beginning of collection" +y := x removeFirst. "remove first element in collection" +y := x addLast: 6. "add element at end of collection" +y := x removeLast. "remove last element in collection" +y := x addAll: #(7 8 9). "add multiple elements to collection" +y := x removeAll: #(7 8 9). "remove multiple elements from collection" +y := x remove: 5 ifAbsent: []. "remove element from collection" +b := x isEmpty. "test if empty" +y := x size. "number of elements" +y := x at: 2. "retrieve element at index" +y := x first. "retrieve first element in collection" +y := x last. "retrieve last element in collection" +b := x includes: 4. "test if element is in collection" +y := x copyFrom: 2 to: 3. "subcollection" +y := x indexOf: 3 ifAbsent: [0]. "first position of element within collection" +y := x occurrencesOf: 3. "number of times object in collection" +x do: [:a | Transcript show: a printString; cr]. "iterate over the collection" +b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" +y := x select: [:a | a > 2]. "return collection of elements that pass test" +y := x reject: [:a | a < 2]. "return collection of elements that fail test" +y := x collect: [:a | a + a]. "transform each element for new collection" +y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" +sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" +sum := 0. 1 to: (x size) do: [:a | sum := sum + (x at: a)]. "sum elements" +sum := x inject: 0 into: [:a :c | a + c]. "sum elements" +max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" + ifTrue: [a] + ifFalse: [c]]. +y := x asArray. "convert to array" +y := x asOrderedCollection. "convert to ordered collection" +y := x asSortedCollection. "convert to sorted collection" +y := x asBag. "convert to bag collection" +y := x asSet. "convert to set collection" + +"************************************************************************ + * Bag: like OrderedCollection except elements are in no * + * particular order * + ************************************************************************" +| b x y sum max | +x := Bag with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" +x := Bag new. "allocate collection" +x add: 4; add: 3; add: 1; add: 2; yourself. "add element to collection" +x add: 3 withOccurrences: 2. "add multiple copies to collection" +y := x addAll: #(7 8 9). "add multiple elements to collection" +y := x removeAll: #(7 8 9). "remove multiple elements from collection" +y := x remove: 4 ifAbsent: []. "remove element from collection" +b := x isEmpty. "test if empty" +y := x size. "number of elements" +b := x includes: 3. "test if element is in collection" +y := x occurrencesOf: 3. "number of times object in collection" +x do: [:a | Transcript show: a printString; cr]. "iterate over the collection" +b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" +y := x select: [:a | a > 2]. "return collection of elements that pass test" +y := x reject: [:a | a < 2]. "return collection of elements that fail test" +y := x collect: [:a | a + a]. "transform each element for new collection" +y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" +sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" +sum := x inject: 0 into: [:a :c | a + c]. "sum elements" +max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" + ifTrue: [a] + ifFalse: [c]]. +y := x asOrderedCollection. "convert to ordered collection" +y := x asSortedCollection. "convert to sorted collection" +y := x asBag. "convert to bag collection" +y := x asSet. "convert to set collection" + +"************************************************************************ + * Set: like Bag except duplicates not allowed * + * IdentitySet: uses identity test (== rather than =) * + ************************************************************************" +| b x y sum max | +x := Set with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" +x := Set new. "allocate collection" +x add: 4; add: 3; add: 1; add: 2; yourself. "add element to collection" +y := x addAll: #(7 8 9). "add multiple elements to collection" +y := x removeAll: #(7 8 9). "remove multiple elements from collection" +y := x remove: 4 ifAbsent: []. "remove element from collection" +b := x isEmpty. "test if empty" +y := x size. "number of elements" +x includes: 4. "test if element is in collection" +x do: [:a | Transcript show: a printString; cr]. "iterate over the collection" +b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" +y := x select: [:a | a > 2]. "return collection of elements that pass test" +y := x reject: [:a | a < 2]. "return collection of elements that fail test" +y := x collect: [:a | a + a]. "transform each element for new collection" +y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" +sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" +sum := x inject: 0 into: [:a :c | a + c]. "sum elements" +max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" + ifTrue: [a] + ifFalse: [c]]. +y := x asArray. "convert to array" +y := x asOrderedCollection. "convert to ordered collection" +y := x asSortedCollection. "convert to sorted collection" +y := x asBag. "convert to bag collection" +y := x asSet. "convert to set collection" + +"************************************************************************ + * Interval: * + ************************************************************************" +| b x y sum max | +x := Interval from: 5 to: 10. "create interval object" +x := 5 to: 10. +x := Interval from: 5 to: 10 by: 2. "create interval object with specified increment" +x := 5 to: 10 by: 2. +b := x isEmpty. "test if empty" +y := x size. "number of elements" +x includes: 9. "test if element is in collection" +x do: [:k | Transcript show: k printString; cr]. "iterate over interval" +b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" +y := x select: [:a | a > 7]. "return collection of elements that pass test" +y := x reject: [:a | a < 2]. "return collection of elements that fail test" +y := x collect: [:a | a + a]. "transform each element for new collection" +y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" +sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" +sum := 0. 1 to: (x size) do: [:a | sum := sum + (x at: a)]. "sum elements" +sum := x inject: 0 into: [:a :c | a + c]. "sum elements" +max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" + ifTrue: [a] + ifFalse: [c]]. +y := x asArray. "convert to array" +y := x asOrderedCollection. "convert to ordered collection" +y := x asSortedCollection. "convert to sorted collection" +y := x asBag. "convert to bag collection" +y := x asSet. "convert to set collection" + +"************************************************************************ + * Associations: * + ************************************************************************" +| x y | +x := #myVar->'hello'. +y := x key. +y := x value. + +"************************************************************************ + * Dictionary: * + * IdentityDictionary: uses identity test (== rather than =) * + ************************************************************************" +| b x y | +x := Dictionary new. "allocate collection" +x add: #a->4; add: #b->3; add: #c->1; add: #d->2; yourself. "add element to collection" +x at: #e put: 3. "set element at index" +b := x isEmpty. "test if empty" +y := x size. "number of elements" +y := x at: #a ifAbsent: []. "retrieve element at index" +y := x keyAtValue: 3 ifAbsent: []. "retrieve key for given value with error block" +y := x removeKey: #e ifAbsent: []. "remove element from collection" +b := x includes: 3. "test if element is in values collection" +b := x includesKey: #a. "test if element is in keys collection" +y := x occurrencesOf: 3. "number of times object in collection" +y := x keys. "set of keys" +y := x values. "bag of values" +x do: [:a | Transcript show: a printString; cr]. "iterate over the values collection" +x keysDo: [:a | Transcript show: a printString; cr]. "iterate over the keys collection" +x associationsDo: [:a | Transcript show: a printString; cr]."iterate over the associations" +x keysAndValuesDo: [:aKey :aValue | Transcript "iterate over keys and values" + show: aKey printString; space; + show: aValue printString; cr]. +b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" +y := x select: [:a | a > 2]. "return collection of elements that pass test" +y := x reject: [:a | a < 2]. "return collection of elements that fail test" +y := x collect: [:a | a + a]. "transform each element for new collection" +y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" +sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" +sum := x inject: 0 into: [:a :c | a + c]. "sum elements" +max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" + ifTrue: [a] + ifFalse: [c]]. +y := x asArray. "convert to array" +y := x asOrderedCollection. "convert to ordered collection" +y := x asSortedCollection. "convert to sorted collection" +y := x asBag. "convert to bag collection" +y := x asSet. "convert to set collection" + +Smalltalk at: #CMRGlobal put: 'CMR entry'. "put global in Smalltalk Dictionary" +x := Smalltalk at: #CMRGlobal. "read global from Smalltalk Dictionary" +Transcript show: (CMRGlobal printString). "entries are directly accessible by name" +Smalltalk keys do: [ :k | "print out all classes" + ((Smalltalk at: k) isKindOf: Class) + ifFalse: [Transcript show: k printString; cr]]. +Smalltalk at: #CMRDictionary put: (Dictionary new). "set up user defined dictionary" +CMRDictionary at: #MyVar1 put: 'hello1'. "put entry in dictionary" +CMRDictionary add: #MyVar2->'hello2'. "add entry to dictionary use key->value combo" +CMRDictionary size. "dictionary size" +CMRDictionary keys do: [ :k | "print out keys in dictionary" + Transcript show: k printString; cr]. +CMRDictionary values do: [ :k | "print out values in dictionary" + Transcript show: k printString; cr]. +CMRDictionary keysAndValuesDo: [:aKey :aValue | "print out keys and values" + Transcript + show: aKey printString; + space; + show: aValue printString; + cr]. +CMRDictionary associationsDo: [:aKeyValue | "another iterator for printing key values" + Transcript show: aKeyValue printString; cr]. +Smalltalk removeKey: #CMRGlobal ifAbsent: []. "remove entry from Smalltalk dictionary" +Smalltalk removeKey: #CMRDictionary ifAbsent: []. "remove user dictionary from Smalltalk dictionary" + +"************************************************************************ + * Internal Stream: * + ************************************************************************" +| b x ios | +ios := ReadStream on: 'Hello read stream'. +ios := ReadStream on: 'Hello read stream' from: 1 to: 5. +[(x := ios nextLine) notNil] + whileTrue: [Transcript show: x; cr]. +ios position: 3. +ios position. +x := ios next. +x := ios peek. +x := ios contents. +b := ios atEnd. + +ios := ReadWriteStream on: 'Hello read stream'. +ios := ReadWriteStream on: 'Hello read stream' from: 1 to: 5. +ios := ReadWriteStream with: 'Hello read stream'. +ios := ReadWriteStream with: 'Hello read stream' from: 1 to: 10. +ios position: 0. +[(x := ios nextLine) notNil] + whileTrue: [Transcript show: x; cr]. +ios position: 6. +ios position. +ios nextPutAll: 'Chris'. +x := ios next. +x := ios peek. +x := ios contents. +b := ios atEnd. + +"************************************************************************ + * FileStream: * + ************************************************************************" +| b x ios | +ios := FileStream newFileNamed: 'ios.txt'. +ios nextPut: $H; cr. +ios nextPutAll: 'Hello File'; cr. +'Hello File' printOn: ios. +'Hello File' storeOn: ios. +ios close. + +ios := FileStream oldFileNamed: 'ios.txt'. +[(x := ios nextLine) notNil] + whileTrue: [Transcript show: x; cr]. +ios position: 3. +x := ios position. +x := ios next. +x := ios peek. +b := ios atEnd. +ios close. + +"************************************************************************ + * Date: * + ************************************************************************" +| x y | +x := Date today. "create date for today" +x := Date dateAndTimeNow. "create date from current time/date" +x := Date readFromString: '01/02/1999'. "create date from formatted string" +x := Date newDay: 12 month: #July year: 1999 "create date from parts" +x := Date fromDays: 36000. "create date from elapsed days since 1/1/1901" +y := Date dayOfWeek: #Monday. "day of week as int (1-7)" +y := Date indexOfMonth: #January. "month of year as int (1-12)" +y := Date daysInMonth: 2 forYear: 1996. "day of month as int (1-31)" +y := Date daysInYear: 1996. "days in year (365|366)" +y := Date nameOfDay: 1 "weekday name (#Monday,...)" +y := Date nameOfMonth: 1. "month name (#January,...)" +y := Date leapYear: 1996. "1 if leap year; 0 if not leap year" +y := x weekday. "day of week (#Monday,...)" +y := x previous: #Monday. "date for previous day of week" +y := x dayOfMonth. "day of month (1-31)" +y := x day. "day of year (1-366)" +y := x firstDayOfMonth. "day of year for first day of month" +y := x monthName. "month of year (#January,...)" +y := x monthIndex. "month of year (1-12)" +y := x daysInMonth. "days in month (1-31)" +y := x year. "year (19xx)" +y := x daysInYear. "days in year (365|366)" +y := x daysLeftInYear. "days left in year (364|365)" +y := x asSeconds. "seconds elapsed since 1/1/1901" +y := x addDays: 10. "add days to date object" +y := x subtractDays: 10. "subtract days to date object" +y := x subtractDate: (Date today). "subtract date (result in days)" +y := x printFormat: #(2 1 3 $/ 1 1). "print formatted date" +b := (x <= Date today). "comparison" + +"************************************************************************ + * Time: * + ************************************************************************" +| x y | +x := Time now. "create time from current time" +x := Time dateAndTimeNow. "create time from current time/date" +x := Time readFromString: '3:47:26 pm'. "create time from formatted string" +x := Time fromSeconds: (60 * 60 * 4). "create time from elapsed time from midnight" +y := Time millisecondClockValue. "milliseconds since midnight" +y := Time totalSeconds. "total seconds since 1/1/1901" +y := x seconds. "seconds past minute (0-59)" +y := x minutes. "minutes past hour (0-59)" +y := x hours. "hours past midnight (0-23)" +y := x addTime: (Time now). "add time to time object" +y := x subtractTime: (Time now). "subtract time to time object" +y := x asSeconds. "convert time to seconds" +x := Time millisecondsToRun: [ "timing facility" + 1 to: 1000 do: [:index | y := 3.14 * index]]. +b := (x <= Time now). "comparison" + +"************************************************************************ + * Point: * + ************************************************************************" +| x y | +x := 200@100. "obtain a new point" +y := x x. "x coordinate" +y := x y. "y coordinate" +x := 200@100 negated. "negates x and y" +x := (-200@-100) abs. "absolute value of x and y" +x := (200.5@100.5) rounded. "round x and y" +x := (200.5@100.5) truncated. "truncate x and y" +x := 200@100 + 100. "add scale to both x and y" +x := 200@100 - 100. "subtract scale from both x and y" +x := 200@100 * 2. "multiply x and y by scale" +x := 200@100 / 2. "divide x and y by scale" +x := 200@100 // 2. "divide x and y by scale" +x := 200@100 \\ 3. "remainder of x and y by scale" +x := 200@100 + 50@25. "add points" +x := 200@100 - 50@25. "subtract points" +x := 200@100 * 3@4. "multiply points" +x := 200@100 // 3@4. "divide points" +x := 200@100 max: 50@200. "max x and y" +x := 200@100 min: 50@200. "min x and y" +x := 20@5 dotProduct: 10@2. "sum of product (x1*x2 + y1*y2)" + +"************************************************************************ + * Rectangle: * + ************************************************************************" +Rectangle fromUser. + +"************************************************************************ + * Pen: * + ************************************************************************" +| myPen | +Display restoreAfter: [ + Display fillWhite. + +myPen := Pen new. "get graphic pen" +myPen squareNib: 1. +myPen color: (Color blue). "set pen color" +myPen home. "position pen at center of display" +myPen up. "makes nib unable to draw" +myPen down. "enable the nib to draw" +myPen north. "points direction towards top" +myPen turn: -180. "add specified degrees to direction" +myPen direction. "get current angle of pen" +myPen go: 50. "move pen specified number of pixels" +myPen location. "get the pen position" +myPen goto: 200@200. "move to specified point" +myPen place: 250@250. "move to specified point without drawing" +myPen print: 'Hello World' withFont: (TextStyle default fontAt: 1). +Display extent. "get display width@height" +Display width. "get display width" +Display height. "get display height" + +]. + +"************************************************************************ + * Dynamic Message Calling/Compiling: * + ************************************************************************" +| receiver message result argument keyword1 keyword2 argument1 argument2 | +"unary message" +receiver := 5. +message := 'factorial' asSymbol. +result := receiver perform: message. +result := Compiler evaluate: ((receiver storeString), ' ', message). +result := (Message new setSelector: message arguments: #()) sentTo: receiver. + +"binary message" +receiver := 1. +message := '+' asSymbol. +argument := 2. +result := receiver perform: message withArguments: (Array with: argument). +result := Compiler evaluate: ((receiver storeString), ' ', message, ' ', (argument storeString)). +result := (Message new setSelector: message arguments: (Array with: argument)) sentTo: receiver. + +"keyword messages" +receiver := 12. +keyword1 := 'between:' asSymbol. +keyword2 := 'and:' asSymbol. +argument1 := 10. +argument2 := 20. +result := receiver + perform: (keyword1, keyword2) asSymbol + withArguments: (Array with: argument1 with: argument2). +result := Compiler evaluate: + ((receiver storeString), ' ', keyword1, (argument1 storeString) , ' ', keyword2, (argument2 storeString)). +result := (Message + new + setSelector: (keyword1, keyword2) asSymbol + arguments: (Array with: argument1 with: argument2)) + sentTo: receiver. + +"************************************************************************ + * class/meta-class: * + ************************************************************************" +| b x | +x := String name. "class name" +x := String category. "organization category" +x := String comment. "class comment" +x := String kindOfSubclass. "subclass type - subclass: variableSubclass, etc" +x := String definition. "class definition" +x := String instVarNames. "immediate instance variable names" +x := String allInstVarNames. "accumulated instance variable names" +x := String classVarNames. "immediate class variable names" +x := String allClassVarNames. "accumulated class variable names" +x := String sharedPools. "immediate dictionaries used as shared pools" +x := String allSharedPools. "accumulated dictionaries used as shared pools" +x := String selectors. "message selectors for class" +x := String sourceCodeAt: #size. "source code for specified method" +x := String allInstances. "collection of all instances of class" +x := String superclass. "immediate superclass" +x := String allSuperclasses. "accumulated superclasses" +x := String withAllSuperclasses. "receiver class and accumulated superclasses" +x := String subclasses. "immediate subclasses" +x := String allSubclasses. "accumulated subclasses" +x := String withAllSubclasses. "receiver class and accumulated subclasses" +b := String instSize. "number of named instance variables" +b := String isFixed. "true if no indexed instance variables" +b := String isVariable. "true if has indexed instance variables" +b := String isPointers. "true if index instance vars contain objects" +b := String isBits. "true if index instance vars contain bytes/words" +b := String isBytes. "true if index instance vars contain bytes" +b := String isWords. true if index instance vars contain words" +Object withAllSubclasses size. "get total number of class entries" + +"************************************************************************ + * debuging: * + ************************************************************************" +| a b x | +x yourself. "returns receiver" +String browse. "browse specified class" +x inspect. "open object inspector window" +x confirm: 'Is this correct?'. +x halt. "breakpoint to open debugger window" +x halt: 'Halt message'. +x notify: 'Notify text'. +x error: 'Error string'. "open up error window with title" +x doesNotUnderstand: #cmrMessage. "flag message is not handled" +x shouldNotImplement. "flag message should not be implemented" +x subclassResponsibility. "flag message as abstract" +x errorImproperStore. "flag an improper store into indexable object" +x errorNonIntegerIndex. "flag only integers should be used as index" +x errorSubscriptBounds. "flag subscript out of bounds" +x primitiveFailed. "system primitive failed" + +a := 'A1'. b := 'B2'. a become: b. "switch two objects" +Transcript show: a, b; cr. + +"************************************************************************ + * Misc. * + ************************************************************************" +| x | +"Smalltalk condenseChanges." "compress the change file" +x := FillInTheBlank request: 'Prompt Me'. "prompt user for input" +Utilities openCommandKeyHelp + + + + +``` + +## Ready For More? + +### Free Online + +* [GNU Smalltalk User's Guide](https://www.gnu.org/software/smalltalk/manual/html_node/Tutorial.html) +* [smalltalk dot org](http://www.smalltalk.org/smalltalk/learning.html) +* [Computer Programming using GNU Smalltalk](http://www.canol.info/books/computer_programming_using_gnu_smalltalk/) +* [Smalltalk Cheatsheet](http://www.angelfire.com/tx4/cus/notes/smalltalk.html) +* [Smalltalk-72 Manual](http://www.bitsavers.org/pdf/xerox/parc/techReports/Smalltalk-72_Instruction_Manual_Mar76.pdf) +* [BYTE: A Special issue on Smalltalk](https://archive.org/details/byte-magazine-1981-08) +* [Smalltalk, Objects, and Design](https://books.google.co.in/books?id=W8_Une9cbbgC&printsec=frontcover&dq=smalltalk&hl=en&sa=X&ved=0CCIQ6AEwAWoVChMIw63Vo6CpyAIV0HGOCh3S2Alf#v=onepage&q=smalltalk&f=false) +* [Smalltalk: An Introduction to Application Development Using VisualWorks](https://books.google.co.in/books?id=zalQAAAAMAAJ&q=smalltalk&dq=smalltalk&hl=en&sa=X&ved=0CCgQ6AEwAmoVChMIw63Vo6CpyAIV0HGOCh3S2Alf/) From d704d06976f003faf06eb68764b06508044b7500 Mon Sep 17 00:00:00 2001 From: Jigyasa Grover Date: Sun, 4 Oct 2015 22:15:46 +0530 Subject: [PATCH 064/685] Delete .Rhistory --- ko-kr/.Rhistory | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 ko-kr/.Rhistory diff --git a/ko-kr/.Rhistory b/ko-kr/.Rhistory deleted file mode 100644 index e69de29b..00000000 From add1edbeb23ca058c1652b6031a3bf2f8f3c5191 Mon Sep 17 00:00:00 2001 From: Jigyasa Grover Date: Sun, 4 Oct 2015 22:16:17 +0530 Subject: [PATCH 065/685] Delete smalltalk.html.markdown~ --- smalltalk.html.markdown~ | 959 --------------------------------------- 1 file changed, 959 deletions(-) delete mode 100644 smalltalk.html.markdown~ diff --git a/smalltalk.html.markdown~ b/smalltalk.html.markdown~ deleted file mode 100644 index 61e5a94c..00000000 --- a/smalltalk.html.markdown~ +++ /dev/null @@ -1,959 +0,0 @@ ---- -language: smalltalk -contributors: - - ["Jigyasa Grover", "https://github.com/jig08"] ---- - -- Smalltalk is an object-oriented, dynamically typed, reflective programming language. -- Smalltalk was created as the language to underpin the "new world" of computing exemplified by "human–computer symbiosis." -- It was designed and created in part for educational use, more so for constructionist learning, at the Learning Research Group (LRG) of Xerox PARC by Alan Kay, Dan Ingalls, Adele Goldberg, Ted Kaehler, Scott Wallace, and others during the 1970s. - -Feedback highly appreciated! Reach me at [@jigyasa_grover](https://twitter.com/jigyasa_grover) or `grover.jigyasa1@gmail.com`. - -``` - -"************************************************************************ - * Allowable characters: * - * - a-z * - * - A-Z * - * - 0-9 * - * - .+/\*~<>@%|&? * - * - blank, tab, cr, ff, lf * - * * - * Variables: * - * - variables must be declared before use * - * - shared vars must begin with uppercase * - * - local vars must begin with lowercase * - * - reserved names: nil, true, false, self, super, and Smalltalk * - * * - * Variable scope: * - * - Global: defined in Dictionary Smalltalk and accessible by all * - * objects in system * - * - Special: (reserved) Smalltalk, super, self, true, false, & nil * - * - Method Temporary: local to a method * - * - Block Temporary: local to a block * - * - Pool: variables in a Dictionary object * - * - Method Parameters: automatic local vars created as a result of * - * message call with params * - * - Block Parameters: automatic local vars created as a result of * - * value: message call * - * - Class: shared with all instances of one class & its subclasses * - * - Class Instance: unique to each instance of a class * - * - Instance Variables: unique to each instance * - ************************************************************************" -"Comments are enclosed in quotes" -"Period (.) is the statement seperator" - -"************************************************************************ - * Transcript: * - ************************************************************************" -Transcript clear. "clear to transcript window" -Transcript show: 'Hello World'. "output string in transcript window" -Transcript nextPutAll: 'Hello World'. "output string in transcript window" -Transcript nextPut: $A. "output character in transcript window" -Transcript space. "output space character in transcript window" -Transcript tab. "output tab character in transcript window" -Transcript cr. "carriage return / linefeed" -'Hello' printOn: Transcript. "append print string into the window" -'Hello' storeOn: Transcript. "append store string into the window" -Transcript endEntry. "flush the output buffer" - -"************************************************************************ - * Assignment: * - ************************************************************************" -| x y | -x _ 4. "assignment (Squeak) <-" -x := 5. "assignment" -x := y := z := 6. "compound assignment" -x := (y := 6) + 1. -x := Object new. "bind to allocated instance of a class" -x := 123 class. "discover the object class" -x := Integer superclass. "discover the superclass of a class" -x := Object allInstances. "get an array of all instances of a class" -x := Integer allSuperclasses. "get all superclasses of a class" -x := 1.2 hash. "hash value for object" -y := x copy. "copy object" -y := x shallowCopy. "copy object (not overridden)" -y := x deepCopy. "copy object and instance vars" -y := x veryDeepCopy. "complete tree copy using a dictionary" - -"************************************************************************ - * Constants: * - ************************************************************************" -| b | -b := true. "true constant" -b := false. "false constant" -x := nil. "nil object constant" -x := 1. "integer constants" -x := 3.14. "float constants" -x := 2e-2. "fractional constants" -x := 16r0F. "hex constant". -x := -1. "negative constants" -x := 'Hello'. "string constant" -x := 'I''m here'. "single quote escape" -x := $A. "character constant" -x := $ . "character constant (space)" -x := #aSymbol. "symbol constants" -x := #(3 2 1). "array constants" -x := #('abc' 2 $a). "mixing of types allowed" - -"************************************************************************ - * Booleans: * - ************************************************************************" -| b x y | -x := 1. y := 2. -b := (x = y). "equals" -b := (x ~= y). "not equals" -b := (x == y). "identical" -b := (x ~~ y). "not identical" -b := (x > y). "greater than" -b := (x < y). "less than" -b := (x >= y). "greater than or equal" -b := (x <= y). "less than or equal" -b := b not. "boolean not" -b := (x < 5) & (y > 1). "boolean and" -b := (x < 5) | (y > 1). "boolean or" -b := (x < 5) and: [y > 1]. "boolean and (short-circuit)" -b := (x < 5) or: [y > 1]. "boolean or (short-circuit)" -b := (x < 5) eqv: (y > 1). "test if both true or both false" -b := (x < 5) xor: (y > 1). "test if one true and other false" -b := 5 between: 3 and: 12. "between (inclusive)" -b := 123 isKindOf: Number. "test if object is class or subclass of" -b := 123 isMemberOf: SmallInteger. "test if object is type of class" -b := 123 respondsTo: sqrt. "test if object responds to message" -b := x isNil. "test if object is nil" -b := x isZero. "test if number is zero" -b := x positive. "test if number is positive" -b := x strictlyPositive. "test if number is greater than zero" -b := x negative. "test if number is negative" -b := x even. "test if number is even" -b := x odd. "test if number is odd" -b := x isLiteral. "test if literal constant" -b := x isInteger. "test if object is integer" -b := x isFloat. "test if object is float" -b := x isNumber. "test if object is number" -b := $A isUppercase. "test if upper case character" -b := $A isLowercase. "test if lower case character" - -"************************************************************************ - * Arithmetic expressions: * - ************************************************************************" -| x | -x := 6 + 3. "addition" -x := 6 - 3. "subtraction" -x := 6 * 3. "multiplication" -x := 1 + 2 * 3. "evaluation always left to right (1 + 2) * 3" -x := 5 / 3. "division with fractional result" -x := 5.0 / 3.0. "division with float result" -x := 5.0 // 3.0. "integer divide" -x := 5.0 \\ 3.0. "integer remainder" -x := -5. "unary minus" -x := 5 sign. "numeric sign (1, -1 or 0)" -x := 5 negated. "negate receiver" -x := 1.2 integerPart. "integer part of number (1.0)" -x := 1.2 fractionPart. "fractional part of number (0.2)" -x := 5 reciprocal. "reciprocal function" -x := 6 * 3.1. "auto convert to float" -x := 5 squared. "square function" -x := 25 sqrt. "square root" -x := 5 raisedTo: 2. "power function" -x := 5 raisedToInteger: 2. "power function with integer" -x := 5 exp. "exponential" -x := -5 abs. "absolute value" -x := 3.99 rounded. "round" -x := 3.99 truncated. "truncate" -x := 3.99 roundTo: 1. "round to specified decimal places" -x := 3.99 truncateTo: 1. "truncate to specified decimal places" -x := 3.99 floor. "truncate" -x := 3.99 ceiling. "round up" -x := 5 factorial. "factorial" -x := -5 quo: 3. "integer divide rounded toward zero" -x := -5 rem: 3. "integer remainder rounded toward zero" -x := 28 gcd: 12. "greatest common denominator" -x := 28 lcm: 12. "least common multiple" -x := 100 ln. "natural logarithm" -x := 100 log. "base 10 logarithm" -x := 100 log: 10. "logarithm with specified base" -x := 100 floorLog: 10. "floor of the log" -x := 180 degreesToRadians. "convert degrees to radians" -x := 3.14 radiansToDegrees. "convert radians to degrees" -x := 0.7 sin. "sine" -x := 0.7 cos. "cosine" -x := 0.7 tan. "tangent" -x := 0.7 arcSin. "arcsine" -x := 0.7 arcCos. "arccosine" -x := 0.7 arcTan. "arctangent" -x := 10 max: 20. "get maximum of two numbers" -x := 10 min: 20. "get minimum of two numbers" -x := Float pi. "pi" -x := Float e. "exp constant" -x := Float infinity. "infinity" -x := Float nan. "not-a-number" -x := Random new next; yourself. x next. "random number stream (0.0 to 1.0) -x := 100 atRandom. "quick random number" - -"************************************************************************ - * Bitwise Manipulation: * - ************************************************************************" -| b x | -x := 16rFF bitAnd: 16r0F. "and bits" -x := 16rF0 bitOr: 16r0F. "or bits" -x := 16rFF bitXor: 16r0F. "xor bits" -x := 16rFF bitInvert. "invert bits" -x := 16r0F bitShift: 4. "left shift" -x := 16rF0 bitShift: -4. "right shift" -"x := 16r80 bitAt: 7." "bit at position (0|1) [!Squeak]" -x := 16r80 highbit. "position of highest bit set" -b := 16rFF allMask: 16r0F. "test if all bits set in mask set in receiver" -b := 16rFF anyMask: 16r0F. "test if any bits set in mask set in receiver" -b := 16rFF noMask: 16r0F. "test if all bits set in mask clear in receiver" - -"************************************************************************ - * Conversion: * - ************************************************************************" -| x | -x := 3.99 asInteger. "convert number to integer (truncates in Squeak)" -x := 3.99 asFraction. "convert number to fraction" -x := 3 asFloat. "convert number to float" -x := 65 asCharacter. "convert integer to character" -x := $A asciiValue. "convert character to integer" -x := 3.99 printString. "convert object to string via printOn:" -x := 3.99 storeString. "convert object to string via storeOn:" -x := 15 radix: 16. "convert to string in given base" -x := 15 printStringBase: 16. -x := 15 storeStringBase: 16. - -"************************************************************************ - * Blocks: * - * - blocks are objects and may be assigned to a variable * - * - value is last expression evaluated unless explicit return * - * - blocks may be nested * - * - specification [ arguments | | localvars | expressions ] * - * - Squeak does not currently support localvars in blocks * - * - max of three arguments allowed * - * - ^expression terminates block & method (exits all nested blocks) * - * - blocks intended for long term storage should not contain ^ * - ************************************************************************" -| x y z | -x := [ y := 1. z := 2. ]. x value. "simple block usage" -x := [ :argOne :argTwo | argOne, ' and ' , argTwo.]. "set up block with argument passing" -Transcript show: (x value: 'First' value: 'Second'); cr. "use block with argument passing" -"x := [ | z | z := 1.]. localvars not available in squeak blocks" - -"************************************************************************ - * Method calls: * - * - unary methods are messages with no arguments * - * - binary methods * - * - keyword methods are messages with selectors including colons * - * * - * standard categories/protocols: * - * - initialize-release (methods called for new instance) * - * - accessing (get/set methods) * - * - testing (boolean tests - is) * - * - comparing (boolean tests with parameter * - * - displaying (gui related methods) * - * - printing (methods for printing) * - * - updating (receive notification of changes) * - * - private (methods private to class) * - * - instance-creation (class methods for creating instance) * - ************************************************************************" -| x | -x := 2 sqrt. "unary message" -x := 2 raisedTo: 10. "keyword message" -x := 194 * 9. "binary message" -Transcript show: (194 * 9) printString; cr. "combination (chaining)" -x := 2 perform: #sqrt. "indirect method invocation" -Transcript "Cascading - send multiple messages to receiver" - show: 'hello '; - show: 'world'; - cr. -x := 3 + 2; * 100. "result=300. Sends message to same receiver (3)" - -"************************************************************************ - * Conditional Statements: * - ************************************************************************" -| x | -x > 10 ifTrue: [Transcript show: 'ifTrue'; cr]. "if then" -x > 10 ifFalse: [Transcript show: 'ifFalse'; cr]. "if else" -x > 10 "if then else" - ifTrue: [Transcript show: 'ifTrue'; cr] - ifFalse: [Transcript show: 'ifFalse'; cr]. -x > 10 "if else then" - ifFalse: [Transcript show: 'ifFalse'; cr] - ifTrue: [Transcript show: 'ifTrue'; cr]. -Transcript - show: - (x > 10 - ifTrue: ['ifTrue'] - ifFalse: ['ifFalse']); - cr. -Transcript "nested if then else" - show: - (x > 10 - ifTrue: [x > 5 - ifTrue: ['A'] - ifFalse: ['B']] - ifFalse: ['C']); - cr. -switch := Dictionary new. "switch functionality" -switch at: $A put: [Transcript show: 'Case A'; cr]. -switch at: $B put: [Transcript show: 'Case B'; cr]. -switch at: $C put: [Transcript show: 'Case C'; cr]. -result := (switch at: $B) value. - -"************************************************************************ - * Iteration statements: * - ************************************************************************" -| x y | -x := 4. y := 1. -[x > 0] whileTrue: [x := x - 1. y := y * 2]. "while true loop" -[x >= 4] whileFalse: [x := x + 1. y := y * 2]. "while false loop" -x timesRepeat: [y := y * 2]. "times repear loop (i := 1 to x)" -1 to: x do: [:a | y := y * 2]. "for loop" -1 to: x by: 2 do: [:a | y := y / 2]. "for loop with specified increment" -#(5 4 3) do: [:a | x := x + a]. "iterate over array elements" - -"************************************************************************ - * Character: * - ************************************************************************" -| x y | -x := $A. "character assignment" -y := x isLowercase. "test if lower case" -y := x isUppercase. "test if upper case" -y := x isLetter. "test if letter" -y := x isDigit. "test if digit" -y := x isAlphaNumeric. "test if alphanumeric" -y := x isSeparator. "test if seperator char" -y := x isVowel. "test if vowel" -y := x digitValue. "convert to numeric digit value" -y := x asLowercase. "convert to lower case" -y := x asUppercase. "convert to upper case" -y := x asciiValue. "convert to numeric ascii value" -y := x asString. "convert to string" -b := $A <= $B. "comparison" -y := $A max: $B. - -"************************************************************************ - * Symbol: * - ************************************************************************" -| b x y | -x := #Hello. "symbol assignment" -y := 'String', 'Concatenation'. "symbol concatenation (result is string)" -b := x isEmpty. "test if symbol is empty" -y := x size. "string size" -y := x at: 2. "char at location" -y := x copyFrom: 2 to: 4. "substring" -y := x indexOf: $e ifAbsent: [0]. "first position of character within string" -x do: [:a | Transcript show: a printString; cr]. "iterate over the string" -b := x conform: [:a | (a >= $a) & (a <= $z)]. "test if all elements meet condition" -y := x select: [:a | a > $a]. "return all elements that meet condition" -y := x asString. "convert symbol to string" -y := x asText. "convert symbol to text" -y := x asArray. "convert symbol to array" -y := x asOrderedCollection. "convert symbol to ordered collection" -y := x asSortedCollection. "convert symbol to sorted collection" -y := x asBag. "convert symbol to bag collection" -y := x asSet. "convert symbol to set collection" - -"************************************************************************ - * String: * - ************************************************************************" -| b x y | -x := 'This is a string'. "string assignment" -x := 'String', 'Concatenation'. "string concatenation" -b := x isEmpty. "test if string is empty" -y := x size. "string size" -y := x at: 2. "char at location" -y := x copyFrom: 2 to: 4. "substring" -y := x indexOf: $a ifAbsent: [0]. "first position of character within string" -x := String new: 4. "allocate string object" -x "set string elements" - at: 1 put: $a; - at: 2 put: $b; - at: 3 put: $c; - at: 4 put: $e. -x := String with: $a with: $b with: $c with: $d. "set up to 4 elements at a time" -x do: [:a | Transcript show: a printString; cr]. "iterate over the string" -b := x conform: [:a | (a >= $a) & (a <= $z)]. "test if all elements meet condition" -y := x select: [:a | a > $a]. "return all elements that meet condition" -y := x asSymbol. "convert string to symbol" -y := x asArray. "convert string to array" -x := 'ABCD' asByteArray. "convert string to byte array" -y := x asOrderedCollection. "convert string to ordered collection" -y := x asSortedCollection. "convert string to sorted collection" -y := x asBag. "convert string to bag collection" -y := x asSet. "convert string to set collection" -y := x shuffled. "randomly shuffle string" - -"************************************************************************ - * Array: Fixed length collection * - * ByteArray: Array limited to byte elements (0-255) * - * WordArray: Array limited to word elements (0-2^32) * - ************************************************************************" -| b x y sum max | -x := #(4 3 2 1). "constant array" -x := Array with: 5 with: 4 with: 3 with: 2. "create array with up to 4 elements" -x := Array new: 4. "allocate an array with specified size" -x "set array elements" - at: 1 put: 5; - at: 2 put: 4; - at: 3 put: 3; - at: 4 put: 2. -b := x isEmpty. "test if array is empty" -y := x size. "array size" -y := x at: 4. "get array element at index" -b := x includes: 3. "test if element is in array" -y := x copyFrom: 2 to: 4. "subarray" -y := x indexOf: 3 ifAbsent: [0]. "first position of element within array" -y := x occurrencesOf: 3. "number of times object in collection" -x do: [:a | Transcript show: a printString; cr]. "iterate over the array" -b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" -y := x select: [:a | a > 2]. "return collection of elements that pass test" -y := x reject: [:a | a < 2]. "return collection of elements that fail test" -y := x collect: [:a | a + a]. "transform each element for new collection" -y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" -sum := 0. x do: [:a | sum := sum + a]. sum. "sum array elements" -sum := 0. 1 to: (x size) do: [:a | sum := sum + (x at: a)]. "sum array elements" -sum := x inject: 0 into: [:a :c | a + c]. "sum array elements" -max := x inject: 0 into: [:a :c | (a > c) "find max element in array" - ifTrue: [a] - ifFalse: [c]]. -y := x shuffled. "randomly shuffle collection" -y := x asArray. "convert to array" -"y := x asByteArray." "note: this instruction not available on Squeak" -y := x asWordArray. "convert to word array" -y := x asOrderedCollection. "convert to ordered collection" -y := x asSortedCollection. "convert to sorted collection" -y := x asBag. "convert to bag collection" -y := x asSet. "convert to set collection" - -"************************************************************************ - * OrderedCollection: acts like an expandable array * - ************************************************************************" -| b x y sum max | -x := OrderedCollection with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" -x := OrderedCollection new. "allocate collection" -x add: 3; add: 2; add: 1; add: 4; yourself. "add element to collection" -y := x addFirst: 5. "add element at beginning of collection" -y := x removeFirst. "remove first element in collection" -y := x addLast: 6. "add element at end of collection" -y := x removeLast. "remove last element in collection" -y := x addAll: #(7 8 9). "add multiple elements to collection" -y := x removeAll: #(7 8 9). "remove multiple elements from collection" -x at: 2 put: 3. "set element at index" -y := x remove: 5 ifAbsent: []. "remove element from collection" -b := x isEmpty. "test if empty" -y := x size. "number of elements" -y := x at: 2. "retrieve element at index" -y := x first. "retrieve first element in collection" -y := x last. "retrieve last element in collection" -b := x includes: 5. "test if element is in collection" -y := x copyFrom: 2 to: 3. "subcollection" -y := x indexOf: 3 ifAbsent: [0]. "first position of element within collection" -y := x occurrencesOf: 3. "number of times object in collection" -x do: [:a | Transcript show: a printString; cr]. "iterate over the collection" -b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" -y := x select: [:a | a > 2]. "return collection of elements that pass test" -y := x reject: [:a | a < 2]. "return collection of elements that fail test" -y := x collect: [:a | a + a]. "transform each element for new collection" -y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" -sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" -sum := 0. 1 to: (x size) do: [:a | sum := sum + (x at: a)]. "sum elements" -sum := x inject: 0 into: [:a :c | a + c]. "sum elements" -max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" - ifTrue: [a] - ifFalse: [c]]. -y := x shuffled. "randomly shuffle collection" -y := x asArray. "convert to array" -y := x asOrderedCollection. "convert to ordered collection" -y := x asSortedCollection. "convert to sorted collection" -y := x asBag. "convert to bag collection" -y := x asSet. "convert to set collection" - -"************************************************************************ - * SortedCollection: like OrderedCollection except order of elements * - * determined by sorting criteria * - ************************************************************************" -| b x y sum max | -x := SortedCollection with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" -x := SortedCollection new. "allocate collection" -x := SortedCollection sortBlock: [:a :c | a > c]. "set sort criteria" -x add: 3; add: 2; add: 1; add: 4; yourself. "add element to collection" -y := x addFirst: 5. "add element at beginning of collection" -y := x removeFirst. "remove first element in collection" -y := x addLast: 6. "add element at end of collection" -y := x removeLast. "remove last element in collection" -y := x addAll: #(7 8 9). "add multiple elements to collection" -y := x removeAll: #(7 8 9). "remove multiple elements from collection" -y := x remove: 5 ifAbsent: []. "remove element from collection" -b := x isEmpty. "test if empty" -y := x size. "number of elements" -y := x at: 2. "retrieve element at index" -y := x first. "retrieve first element in collection" -y := x last. "retrieve last element in collection" -b := x includes: 4. "test if element is in collection" -y := x copyFrom: 2 to: 3. "subcollection" -y := x indexOf: 3 ifAbsent: [0]. "first position of element within collection" -y := x occurrencesOf: 3. "number of times object in collection" -x do: [:a | Transcript show: a printString; cr]. "iterate over the collection" -b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" -y := x select: [:a | a > 2]. "return collection of elements that pass test" -y := x reject: [:a | a < 2]. "return collection of elements that fail test" -y := x collect: [:a | a + a]. "transform each element for new collection" -y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" -sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" -sum := 0. 1 to: (x size) do: [:a | sum := sum + (x at: a)]. "sum elements" -sum := x inject: 0 into: [:a :c | a + c]. "sum elements" -max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" - ifTrue: [a] - ifFalse: [c]]. -y := x asArray. "convert to array" -y := x asOrderedCollection. "convert to ordered collection" -y := x asSortedCollection. "convert to sorted collection" -y := x asBag. "convert to bag collection" -y := x asSet. "convert to set collection" - -"************************************************************************ - * Bag: like OrderedCollection except elements are in no * - * particular order * - ************************************************************************" -| b x y sum max | -x := Bag with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" -x := Bag new. "allocate collection" -x add: 4; add: 3; add: 1; add: 2; yourself. "add element to collection" -x add: 3 withOccurrences: 2. "add multiple copies to collection" -y := x addAll: #(7 8 9). "add multiple elements to collection" -y := x removeAll: #(7 8 9). "remove multiple elements from collection" -y := x remove: 4 ifAbsent: []. "remove element from collection" -b := x isEmpty. "test if empty" -y := x size. "number of elements" -b := x includes: 3. "test if element is in collection" -y := x occurrencesOf: 3. "number of times object in collection" -x do: [:a | Transcript show: a printString; cr]. "iterate over the collection" -b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" -y := x select: [:a | a > 2]. "return collection of elements that pass test" -y := x reject: [:a | a < 2]. "return collection of elements that fail test" -y := x collect: [:a | a + a]. "transform each element for new collection" -y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" -sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" -sum := x inject: 0 into: [:a :c | a + c]. "sum elements" -max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" - ifTrue: [a] - ifFalse: [c]]. -y := x asOrderedCollection. "convert to ordered collection" -y := x asSortedCollection. "convert to sorted collection" -y := x asBag. "convert to bag collection" -y := x asSet. "convert to set collection" - -"************************************************************************ - * Set: like Bag except duplicates not allowed * - * IdentitySet: uses identity test (== rather than =) * - ************************************************************************" -| b x y sum max | -x := Set with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" -x := Set new. "allocate collection" -x add: 4; add: 3; add: 1; add: 2; yourself. "add element to collection" -y := x addAll: #(7 8 9). "add multiple elements to collection" -y := x removeAll: #(7 8 9). "remove multiple elements from collection" -y := x remove: 4 ifAbsent: []. "remove element from collection" -b := x isEmpty. "test if empty" -y := x size. "number of elements" -x includes: 4. "test if element is in collection" -x do: [:a | Transcript show: a printString; cr]. "iterate over the collection" -b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" -y := x select: [:a | a > 2]. "return collection of elements that pass test" -y := x reject: [:a | a < 2]. "return collection of elements that fail test" -y := x collect: [:a | a + a]. "transform each element for new collection" -y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" -sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" -sum := x inject: 0 into: [:a :c | a + c]. "sum elements" -max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" - ifTrue: [a] - ifFalse: [c]]. -y := x asArray. "convert to array" -y := x asOrderedCollection. "convert to ordered collection" -y := x asSortedCollection. "convert to sorted collection" -y := x asBag. "convert to bag collection" -y := x asSet. "convert to set collection" - -"************************************************************************ - * Interval: * - ************************************************************************" -| b x y sum max | -x := Interval from: 5 to: 10. "create interval object" -x := 5 to: 10. -x := Interval from: 5 to: 10 by: 2. "create interval object with specified increment" -x := 5 to: 10 by: 2. -b := x isEmpty. "test if empty" -y := x size. "number of elements" -x includes: 9. "test if element is in collection" -x do: [:k | Transcript show: k printString; cr]. "iterate over interval" -b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" -y := x select: [:a | a > 7]. "return collection of elements that pass test" -y := x reject: [:a | a < 2]. "return collection of elements that fail test" -y := x collect: [:a | a + a]. "transform each element for new collection" -y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" -sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" -sum := 0. 1 to: (x size) do: [:a | sum := sum + (x at: a)]. "sum elements" -sum := x inject: 0 into: [:a :c | a + c]. "sum elements" -max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" - ifTrue: [a] - ifFalse: [c]]. -y := x asArray. "convert to array" -y := x asOrderedCollection. "convert to ordered collection" -y := x asSortedCollection. "convert to sorted collection" -y := x asBag. "convert to bag collection" -y := x asSet. "convert to set collection" - -"************************************************************************ - * Associations: * - ************************************************************************" -| x y | -x := #myVar->'hello'. -y := x key. -y := x value. - -"************************************************************************ - * Dictionary: * - * IdentityDictionary: uses identity test (== rather than =) * - ************************************************************************" -| b x y | -x := Dictionary new. "allocate collection" -x add: #a->4; add: #b->3; add: #c->1; add: #d->2; yourself. "add element to collection" -x at: #e put: 3. "set element at index" -b := x isEmpty. "test if empty" -y := x size. "number of elements" -y := x at: #a ifAbsent: []. "retrieve element at index" -y := x keyAtValue: 3 ifAbsent: []. "retrieve key for given value with error block" -y := x removeKey: #e ifAbsent: []. "remove element from collection" -b := x includes: 3. "test if element is in values collection" -b := x includesKey: #a. "test if element is in keys collection" -y := x occurrencesOf: 3. "number of times object in collection" -y := x keys. "set of keys" -y := x values. "bag of values" -x do: [:a | Transcript show: a printString; cr]. "iterate over the values collection" -x keysDo: [:a | Transcript show: a printString; cr]. "iterate over the keys collection" -x associationsDo: [:a | Transcript show: a printString; cr]."iterate over the associations" -x keysAndValuesDo: [:aKey :aValue | Transcript "iterate over keys and values" - show: aKey printString; space; - show: aValue printString; cr]. -b := x conform: [:a | (a >= 1) & (a <= 4)]. "test if all elements meet condition" -y := x select: [:a | a > 2]. "return collection of elements that pass test" -y := x reject: [:a | a < 2]. "return collection of elements that fail test" -y := x collect: [:a | a + a]. "transform each element for new collection" -y := x detect: [:a | a > 3] ifNone: []. "find position of first element that passes test" -sum := 0. x do: [:a | sum := sum + a]. sum. "sum elements" -sum := x inject: 0 into: [:a :c | a + c]. "sum elements" -max := x inject: 0 into: [:a :c | (a > c) "find max element in collection" - ifTrue: [a] - ifFalse: [c]]. -y := x asArray. "convert to array" -y := x asOrderedCollection. "convert to ordered collection" -y := x asSortedCollection. "convert to sorted collection" -y := x asBag. "convert to bag collection" -y := x asSet. "convert to set collection" - -Smalltalk at: #CMRGlobal put: 'CMR entry'. "put global in Smalltalk Dictionary" -x := Smalltalk at: #CMRGlobal. "read global from Smalltalk Dictionary" -Transcript show: (CMRGlobal printString). "entries are directly accessible by name" -Smalltalk keys do: [ :k | "print out all classes" - ((Smalltalk at: k) isKindOf: Class) - ifFalse: [Transcript show: k printString; cr]]. -Smalltalk at: #CMRDictionary put: (Dictionary new). "set up user defined dictionary" -CMRDictionary at: #MyVar1 put: 'hello1'. "put entry in dictionary" -CMRDictionary add: #MyVar2->'hello2'. "add entry to dictionary use key->value combo" -CMRDictionary size. "dictionary size" -CMRDictionary keys do: [ :k | "print out keys in dictionary" - Transcript show: k printString; cr]. -CMRDictionary values do: [ :k | "print out values in dictionary" - Transcript show: k printString; cr]. -CMRDictionary keysAndValuesDo: [:aKey :aValue | "print out keys and values" - Transcript - show: aKey printString; - space; - show: aValue printString; - cr]. -CMRDictionary associationsDo: [:aKeyValue | "another iterator for printing key values" - Transcript show: aKeyValue printString; cr]. -Smalltalk removeKey: #CMRGlobal ifAbsent: []. "remove entry from Smalltalk dictionary" -Smalltalk removeKey: #CMRDictionary ifAbsent: []. "remove user dictionary from Smalltalk dictionary" - -"************************************************************************ - * Internal Stream: * - ************************************************************************" -| b x ios | -ios := ReadStream on: 'Hello read stream'. -ios := ReadStream on: 'Hello read stream' from: 1 to: 5. -[(x := ios nextLine) notNil] - whileTrue: [Transcript show: x; cr]. -ios position: 3. -ios position. -x := ios next. -x := ios peek. -x := ios contents. -b := ios atEnd. - -ios := ReadWriteStream on: 'Hello read stream'. -ios := ReadWriteStream on: 'Hello read stream' from: 1 to: 5. -ios := ReadWriteStream with: 'Hello read stream'. -ios := ReadWriteStream with: 'Hello read stream' from: 1 to: 10. -ios position: 0. -[(x := ios nextLine) notNil] - whileTrue: [Transcript show: x; cr]. -ios position: 6. -ios position. -ios nextPutAll: 'Chris'. -x := ios next. -x := ios peek. -x := ios contents. -b := ios atEnd. - -"************************************************************************ - * FileStream: * - ************************************************************************" -| b x ios | -ios := FileStream newFileNamed: 'ios.txt'. -ios nextPut: $H; cr. -ios nextPutAll: 'Hello File'; cr. -'Hello File' printOn: ios. -'Hello File' storeOn: ios. -ios close. - -ios := FileStream oldFileNamed: 'ios.txt'. -[(x := ios nextLine) notNil] - whileTrue: [Transcript show: x; cr]. -ios position: 3. -x := ios position. -x := ios next. -x := ios peek. -b := ios atEnd. -ios close. - -"************************************************************************ - * Date: * - ************************************************************************" -| x y | -x := Date today. "create date for today" -x := Date dateAndTimeNow. "create date from current time/date" -x := Date readFromString: '01/02/1999'. "create date from formatted string" -x := Date newDay: 12 month: #July year: 1999 "create date from parts" -x := Date fromDays: 36000. "create date from elapsed days since 1/1/1901" -y := Date dayOfWeek: #Monday. "day of week as int (1-7)" -y := Date indexOfMonth: #January. "month of year as int (1-12)" -y := Date daysInMonth: 2 forYear: 1996. "day of month as int (1-31)" -y := Date daysInYear: 1996. "days in year (365|366)" -y := Date nameOfDay: 1 "weekday name (#Monday,...)" -y := Date nameOfMonth: 1. "month name (#January,...)" -y := Date leapYear: 1996. "1 if leap year; 0 if not leap year" -y := x weekday. "day of week (#Monday,...)" -y := x previous: #Monday. "date for previous day of week" -y := x dayOfMonth. "day of month (1-31)" -y := x day. "day of year (1-366)" -y := x firstDayOfMonth. "day of year for first day of month" -y := x monthName. "month of year (#January,...)" -y := x monthIndex. "month of year (1-12)" -y := x daysInMonth. "days in month (1-31)" -y := x year. "year (19xx)" -y := x daysInYear. "days in year (365|366)" -y := x daysLeftInYear. "days left in year (364|365)" -y := x asSeconds. "seconds elapsed since 1/1/1901" -y := x addDays: 10. "add days to date object" -y := x subtractDays: 10. "subtract days to date object" -y := x subtractDate: (Date today). "subtract date (result in days)" -y := x printFormat: #(2 1 3 $/ 1 1). "print formatted date" -b := (x <= Date today). "comparison" - -"************************************************************************ - * Time: * - ************************************************************************" -| x y | -x := Time now. "create time from current time" -x := Time dateAndTimeNow. "create time from current time/date" -x := Time readFromString: '3:47:26 pm'. "create time from formatted string" -x := Time fromSeconds: (60 * 60 * 4). "create time from elapsed time from midnight" -y := Time millisecondClockValue. "milliseconds since midnight" -y := Time totalSeconds. "total seconds since 1/1/1901" -y := x seconds. "seconds past minute (0-59)" -y := x minutes. "minutes past hour (0-59)" -y := x hours. "hours past midnight (0-23)" -y := x addTime: (Time now). "add time to time object" -y := x subtractTime: (Time now). "subtract time to time object" -y := x asSeconds. "convert time to seconds" -x := Time millisecondsToRun: [ "timing facility" - 1 to: 1000 do: [:index | y := 3.14 * index]]. -b := (x <= Time now). "comparison" - -"************************************************************************ - * Point: * - ************************************************************************" -| x y | -x := 200@100. "obtain a new point" -y := x x. "x coordinate" -y := x y. "y coordinate" -x := 200@100 negated. "negates x and y" -x := (-200@-100) abs. "absolute value of x and y" -x := (200.5@100.5) rounded. "round x and y" -x := (200.5@100.5) truncated. "truncate x and y" -x := 200@100 + 100. "add scale to both x and y" -x := 200@100 - 100. "subtract scale from both x and y" -x := 200@100 * 2. "multiply x and y by scale" -x := 200@100 / 2. "divide x and y by scale" -x := 200@100 // 2. "divide x and y by scale" -x := 200@100 \\ 3. "remainder of x and y by scale" -x := 200@100 + 50@25. "add points" -x := 200@100 - 50@25. "subtract points" -x := 200@100 * 3@4. "multiply points" -x := 200@100 // 3@4. "divide points" -x := 200@100 max: 50@200. "max x and y" -x := 200@100 min: 50@200. "min x and y" -x := 20@5 dotProduct: 10@2. "sum of product (x1*x2 + y1*y2)" - -"************************************************************************ - * Rectangle: * - ************************************************************************" -Rectangle fromUser. - -"************************************************************************ - * Pen: * - ************************************************************************" -| myPen | -Display restoreAfter: [ - Display fillWhite. - -myPen := Pen new. "get graphic pen" -myPen squareNib: 1. -myPen color: (Color blue). "set pen color" -myPen home. "position pen at center of display" -myPen up. "makes nib unable to draw" -myPen down. "enable the nib to draw" -myPen north. "points direction towards top" -myPen turn: -180. "add specified degrees to direction" -myPen direction. "get current angle of pen" -myPen go: 50. "move pen specified number of pixels" -myPen location. "get the pen position" -myPen goto: 200@200. "move to specified point" -myPen place: 250@250. "move to specified point without drawing" -myPen print: 'Hello World' withFont: (TextStyle default fontAt: 1). -Display extent. "get display width@height" -Display width. "get display width" -Display height. "get display height" - -]. - -"************************************************************************ - * Dynamic Message Calling/Compiling: * - ************************************************************************" -| receiver message result argument keyword1 keyword2 argument1 argument2 | -"unary message" -receiver := 5. -message := 'factorial' asSymbol. -result := receiver perform: message. -result := Compiler evaluate: ((receiver storeString), ' ', message). -result := (Message new setSelector: message arguments: #()) sentTo: receiver. - -"binary message" -receiver := 1. -message := '+' asSymbol. -argument := 2. -result := receiver perform: message withArguments: (Array with: argument). -result := Compiler evaluate: ((receiver storeString), ' ', message, ' ', (argument storeString)). -result := (Message new setSelector: message arguments: (Array with: argument)) sentTo: receiver. - -"keyword messages" -receiver := 12. -keyword1 := 'between:' asSymbol. -keyword2 := 'and:' asSymbol. -argument1 := 10. -argument2 := 20. -result := receiver - perform: (keyword1, keyword2) asSymbol - withArguments: (Array with: argument1 with: argument2). -result := Compiler evaluate: - ((receiver storeString), ' ', keyword1, (argument1 storeString) , ' ', keyword2, (argument2 storeString)). -result := (Message - new - setSelector: (keyword1, keyword2) asSymbol - arguments: (Array with: argument1 with: argument2)) - sentTo: receiver. - -"************************************************************************ - * class/meta-class: * - ************************************************************************" -| b x | -x := String name. "class name" -x := String category. "organization category" -x := String comment. "class comment" -x := String kindOfSubclass. "subclass type - subclass: variableSubclass, etc" -x := String definition. "class definition" -x := String instVarNames. "immediate instance variable names" -x := String allInstVarNames. "accumulated instance variable names" -x := String classVarNames. "immediate class variable names" -x := String allClassVarNames. "accumulated class variable names" -x := String sharedPools. "immediate dictionaries used as shared pools" -x := String allSharedPools. "accumulated dictionaries used as shared pools" -x := String selectors. "message selectors for class" -x := String sourceCodeAt: #size. "source code for specified method" -x := String allInstances. "collection of all instances of class" -x := String superclass. "immediate superclass" -x := String allSuperclasses. "accumulated superclasses" -x := String withAllSuperclasses. "receiver class and accumulated superclasses" -x := String subclasses. "immediate subclasses" -x := String allSubclasses. "accumulated subclasses" -x := String withAllSubclasses. "receiver class and accumulated subclasses" -b := String instSize. "number of named instance variables" -b := String isFixed. "true if no indexed instance variables" -b := String isVariable. "true if has indexed instance variables" -b := String isPointers. "true if index instance vars contain objects" -b := String isBits. "true if index instance vars contain bytes/words" -b := String isBytes. "true if index instance vars contain bytes" -b := String isWords. true if index instance vars contain words" -Object withAllSubclasses size. "get total number of class entries" - -"************************************************************************ - * debuging: * - ************************************************************************" -| a b x | -x yourself. "returns receiver" -String browse. "browse specified class" -x inspect. "open object inspector window" -x confirm: 'Is this correct?'. -x halt. "breakpoint to open debugger window" -x halt: 'Halt message'. -x notify: 'Notify text'. -x error: 'Error string'. "open up error window with title" -x doesNotUnderstand: #cmrMessage. "flag message is not handled" -x shouldNotImplement. "flag message should not be implemented" -x subclassResponsibility. "flag message as abstract" -x errorImproperStore. "flag an improper store into indexable object" -x errorNonIntegerIndex. "flag only integers should be used as index" -x errorSubscriptBounds. "flag subscript out of bounds" -x primitiveFailed. "system primitive failed" - -a := 'A1'. b := 'B2'. a become: b. "switch two objects" -Transcript show: a, b; cr. - -"************************************************************************ - * Misc. * - ************************************************************************" -| x | -"Smalltalk condenseChanges." "compress the change file" -x := FillInTheBlank request: 'Prompt Me'. "prompt user for input" -Utilities openCommandKeyHelp - - - - -``` - -## Ready For More? - -### Free Online - -* [GNU Smalltalk User's Guide](https://www.gnu.org/software/smalltalk/manual/html_node/Tutorial.html) -* [smalltalk dot org](http://www.smalltalk.org/smalltalk/learning.html) -* [Computer Programming using GNU Smalltalk](http://www.canol.info/books/computer_programming_using_gnu_smalltalk/) -* [Smalltalk Cheatsheet](http://www.angelfire.com/tx4/cus/notes/smalltalk.html) -* [Smalltalk-72 Manual](http://www.bitsavers.org/pdf/xerox/parc/techReports/Smalltalk-72_Instruction_Manual_Mar76.pdf) -* [BYTE: A Special issue on Smalltalk](https://archive.org/details/byte-magazine-1981-08) -* [Smalltalk, Objects, and Design](https://books.google.co.in/books?id=W8_Une9cbbgC&printsec=frontcover&dq=smalltalk&hl=en&sa=X&ved=0CCIQ6AEwAWoVChMIw63Vo6CpyAIV0HGOCh3S2Alf#v=onepage&q=smalltalk&f=false) -* [Smalltalk: An Introduction to Application Development Using VisualWorks](https://books.google.co.in/books?id=zalQAAAAMAAJ&q=smalltalk&dq=smalltalk&hl=en&sa=X&ved=0CCgQ6AEwAmoVChMIw63Vo6CpyAIV0HGOCh3S2Alf/) From 2cf31d970603d2fe52a2c652f889556046e3330e Mon Sep 17 00:00:00 2001 From: Jigyasa Grover Date: Sun, 4 Oct 2015 22:22:53 +0530 Subject: [PATCH 066/685] Update smalltalk.html.markdown --- smalltalk.html.markdown | 59 ++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/smalltalk.html.markdown b/smalltalk.html.markdown index 61e5a94c..5f1e7430 100644 --- a/smalltalk.html.markdown +++ b/smalltalk.html.markdown @@ -8,41 +8,34 @@ contributors: - Smalltalk was created as the language to underpin the "new world" of computing exemplified by "human–computer symbiosis." - It was designed and created in part for educational use, more so for constructionist learning, at the Learning Research Group (LRG) of Xerox PARC by Alan Kay, Dan Ingalls, Adele Goldberg, Ted Kaehler, Scott Wallace, and others during the 1970s. -Feedback highly appreciated! Reach me at [@jigyasa_grover](https://twitter.com/jigyasa_grover) or `grover.jigyasa1@gmail.com`. +Feedback highly appreciated! Reach me at [@jigyasa_grover](https://twitter.com/jigyasa_grover) or send me an e-mail at `grover.jigyasa1@gmail.com`. -``` -"************************************************************************ - * Allowable characters: * - * - a-z * - * - A-Z * - * - 0-9 * - * - .+/\*~<>@%|&? * - * - blank, tab, cr, ff, lf * - * * - * Variables: * - * - variables must be declared before use * - * - shared vars must begin with uppercase * - * - local vars must begin with lowercase * - * - reserved names: nil, true, false, self, super, and Smalltalk * - * * - * Variable scope: * - * - Global: defined in Dictionary Smalltalk and accessible by all * - * objects in system * - * - Special: (reserved) Smalltalk, super, self, true, false, & nil * - * - Method Temporary: local to a method * - * - Block Temporary: local to a block * - * - Pool: variables in a Dictionary object * - * - Method Parameters: automatic local vars created as a result of * - * message call with params * - * - Block Parameters: automatic local vars created as a result of * - * value: message call * - * - Class: shared with all instances of one class & its subclasses * - * - Class Instance: unique to each instance of a class * - * - Instance Variables: unique to each instance * - ************************************************************************" -"Comments are enclosed in quotes" -"Period (.) is the statement seperator" +##Allowable characters: +- a-z +- A-Z +- 0-9 +- .+/\*~<>@%|&? +- blank, tab, cr, ff, lf + +##Variables: +- variables must be declared before use +- shared vars must begin with uppercase +- local vars must begin with lowercase +- reserved names: `nil`, `true`, `false`, `self`, `super`, and `Smalltalk` + +##Variable scope: +- Global: defined in Dictionary Smalltalk and accessible by all objects in system - Special: (reserved) `Smalltalk`, `super`, `self`, `true`, `false`, & `nil` +- Method Temporary: local to a method +- Block Temporary: local to a block +- Pool: variables in a Dictionary object +- Method Parameters: automatic local vars created as a result of message call with params - Block Parameters: automatic local vars created as a result of value: message call - Class: shared with all instances of one class & its subclasses + - Class Instance: unique to each instance of a class +- Instance Variables: unique to each instance + +`"Comments are enclosed in quotes"` + +`"Period (.) is the statement seperator"` "************************************************************************ * Transcript: * From 67a2c46bca8362e8cc3c4a360f6a2065bfa7c0f1 Mon Sep 17 00:00:00 2001 From: Jigyasa Grover Date: Sun, 4 Oct 2015 22:23:36 +0530 Subject: [PATCH 067/685] Update smalltalk.html.markdown --- smalltalk.html.markdown | 2 -- 1 file changed, 2 deletions(-) diff --git a/smalltalk.html.markdown b/smalltalk.html.markdown index 5f1e7430..e9e5a56c 100644 --- a/smalltalk.html.markdown +++ b/smalltalk.html.markdown @@ -936,8 +936,6 @@ Utilities openCommandKeyHelp -``` - ## Ready For More? ### Free Online From 40489d4352ada61f3e788190bc07689825aedf14 Mon Sep 17 00:00:00 2001 From: Jigyasa Grover Date: Sun, 4 Oct 2015 22:28:20 +0530 Subject: [PATCH 068/685] Update smalltalk.html.markdown --- smalltalk.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/smalltalk.html.markdown b/smalltalk.html.markdown index e9e5a56c..2c2ee3f7 100644 --- a/smalltalk.html.markdown +++ b/smalltalk.html.markdown @@ -37,9 +37,8 @@ Feedback highly appreciated! Reach me at [@jigyasa_grover](https://twitter.com/j `"Period (.) is the statement seperator"` -"************************************************************************ - * Transcript: * - ************************************************************************" +## Transcript: +``` Transcript clear. "clear to transcript window" Transcript show: 'Hello World'. "output string in transcript window" Transcript nextPutAll: 'Hello World'. "output string in transcript window" @@ -50,6 +49,7 @@ Transcript cr. "carriage return / l 'Hello' printOn: Transcript. "append print string into the window" 'Hello' storeOn: Transcript. "append store string into the window" Transcript endEntry. "flush the output buffer" +``` "************************************************************************ * Assignment: * From 5bf5f1268654e637e0fa08001396e4ea179e0ef9 Mon Sep 17 00:00:00 2001 From: Jigyasa Grover Date: Sun, 4 Oct 2015 22:44:20 +0530 Subject: [PATCH 069/685] Update smalltalk.html.markdown --- smalltalk.html.markdown | 252 ++++++++++++++++++++-------------------- 1 file changed, 127 insertions(+), 125 deletions(-) diff --git a/smalltalk.html.markdown b/smalltalk.html.markdown index 2c2ee3f7..175810d7 100644 --- a/smalltalk.html.markdown +++ b/smalltalk.html.markdown @@ -51,9 +51,8 @@ Transcript cr. "carriage return / l Transcript endEntry. "flush the output buffer" ``` -"************************************************************************ - * Assignment: * - ************************************************************************" +##Assignment: +``` | x y | x _ 4. "assignment (Squeak) <-" x := 5. "assignment" @@ -69,10 +68,10 @@ y := x copy. "copy object" y := x shallowCopy. "copy object (not overridden)" y := x deepCopy. "copy object and instance vars" y := x veryDeepCopy. "complete tree copy using a dictionary" +``` -"************************************************************************ - * Constants: * - ************************************************************************" +##Constants: +``` | b | b := true. "true constant" b := false. "false constant" @@ -90,9 +89,10 @@ x := #aSymbol. "symbol constants" x := #(3 2 1). "array constants" x := #('abc' 2 $a). "mixing of types allowed" -"************************************************************************ - * Booleans: * - ************************************************************************" +``` + +## Booleans: +``` | b x y | x := 1. y := 2. b := (x = y). "equals" @@ -128,9 +128,10 @@ b := x isNumber. "test if object is n b := $A isUppercase. "test if upper case character" b := $A isLowercase. "test if lower case character" -"************************************************************************ - * Arithmetic expressions: * - ************************************************************************" +``` + +## Arithmetic expressions: +``` | x | x := 6 + 3. "addition" x := 6 - 3. "subtraction" @@ -185,9 +186,10 @@ x := Float nan. "not-a-number" x := Random new next; yourself. x next. "random number stream (0.0 to 1.0) x := 100 atRandom. "quick random number" -"************************************************************************ - * Bitwise Manipulation: * - ************************************************************************" +``` + +##Bitwise Manipulation: +``` | b x | x := 16rFF bitAnd: 16r0F. "and bits" x := 16rF0 bitOr: 16r0F. "or bits" @@ -201,9 +203,10 @@ b := 16rFF allMask: 16r0F. "test if all bits se b := 16rFF anyMask: 16r0F. "test if any bits set in mask set in receiver" b := 16rFF noMask: 16r0F. "test if all bits set in mask clear in receiver" -"************************************************************************ - * Conversion: * - ************************************************************************" +``` + +## Conversion: +``` | x | x := 3.99 asInteger. "convert number to integer (truncates in Squeak)" x := 3.99 asFraction. "convert number to fraction" @@ -216,40 +219,39 @@ x := 15 radix: 16. "convert to string i x := 15 printStringBase: 16. x := 15 storeStringBase: 16. -"************************************************************************ - * Blocks: * - * - blocks are objects and may be assigned to a variable * - * - value is last expression evaluated unless explicit return * - * - blocks may be nested * - * - specification [ arguments | | localvars | expressions ] * - * - Squeak does not currently support localvars in blocks * - * - max of three arguments allowed * - * - ^expression terminates block & method (exits all nested blocks) * - * - blocks intended for long term storage should not contain ^ * - ************************************************************************" +``` + +## Blocks: +- blocks are objects and may be assigned to a variable +- value is last expression evaluated unless explicit return +- blocks may be nested +- specification [ arguments | | localvars | expressions ] +- Squeak does not currently support localvars in blocks +- max of three arguments allowed +- `^`expression terminates block & method (exits all nested blocks) +- blocks intended for long term storage should not contain `^` + +``` | x y z | x := [ y := 1. z := 2. ]. x value. "simple block usage" x := [ :argOne :argTwo | argOne, ' and ' , argTwo.]. "set up block with argument passing" Transcript show: (x value: 'First' value: 'Second'); cr. "use block with argument passing" -"x := [ | z | z := 1.]. localvars not available in squeak blocks" +"x := [ | z | z := 1.]. *** localvars not available in squeak blocks" +``` -"************************************************************************ - * Method calls: * - * - unary methods are messages with no arguments * - * - binary methods * - * - keyword methods are messages with selectors including colons * - * * - * standard categories/protocols: * - * - initialize-release (methods called for new instance) * - * - accessing (get/set methods) * - * - testing (boolean tests - is) * - * - comparing (boolean tests with parameter * - * - displaying (gui related methods) * - * - printing (methods for printing) * - * - updating (receive notification of changes) * - * - private (methods private to class) * - * - instance-creation (class methods for creating instance) * - ************************************************************************" +## Method calls: +- unary methods are messages with no arguments +- binary methods +- keyword methods are messages with selectors including colons standard categories/protocols: - initialize-release (methods called for new instance) +- accessing (get/set methods) +- testing (boolean tests - is) +- comparing (boolean tests with parameter +- displaying (gui related methods) +- printing (methods for printing) +- updating (receive notification of changes) +- private (methods private to class) +- instance-creation (class methods for creating instance) +``` | x | x := 2 sqrt. "unary message" x := 2 raisedTo: 10. "keyword message" @@ -261,10 +263,10 @@ Transcript "Cascading - send mu show: 'world'; cr. x := 3 + 2; * 100. "result=300. Sends message to same receiver (3)" +``` -"************************************************************************ - * Conditional Statements: * - ************************************************************************" +##Conditional Statements: +``` | x | x > 10 ifTrue: [Transcript show: 'ifTrue'; cr]. "if then" x > 10 ifFalse: [Transcript show: 'ifFalse'; cr]. "if else" @@ -293,10 +295,10 @@ switch at: $A put: [Transcript show: 'Case A'; cr]. switch at: $B put: [Transcript show: 'Case B'; cr]. switch at: $C put: [Transcript show: 'Case C'; cr]. result := (switch at: $B) value. +``` -"************************************************************************ - * Iteration statements: * - ************************************************************************" +## Iteration statements: +``` | x y | x := 4. y := 1. [x > 0] whileTrue: [x := x - 1. y := y * 2]. "while true loop" @@ -305,10 +307,10 @@ x timesRepeat: [y := y * 2]. "times repear loop ( 1 to: x do: [:a | y := y * 2]. "for loop" 1 to: x by: 2 do: [:a | y := y / 2]. "for loop with specified increment" #(5 4 3) do: [:a | x := x + a]. "iterate over array elements" +``` -"************************************************************************ - * Character: * - ************************************************************************" +## Character: +``` | x y | x := $A. "character assignment" y := x isLowercase. "test if lower case" @@ -326,9 +328,10 @@ y := x asString. "convert to string" b := $A <= $B. "comparison" y := $A max: $B. -"************************************************************************ - * Symbol: * - ************************************************************************" +``` + +## Symbol: +``` | b x y | x := #Hello. "symbol assignment" y := 'String', 'Concatenation'. "symbol concatenation (result is string)" @@ -347,10 +350,10 @@ y := x asOrderedCollection. "convert symbol to o y := x asSortedCollection. "convert symbol to sorted collection" y := x asBag. "convert symbol to bag collection" y := x asSet. "convert symbol to set collection" +``` -"************************************************************************ - * String: * - ************************************************************************" +## String: +``` | b x y | x := 'This is a string'. "string assignment" x := 'String', 'Concatenation'. "string concatenation" @@ -377,12 +380,12 @@ y := x asSortedCollection. "convert string to s y := x asBag. "convert string to bag collection" y := x asSet. "convert string to set collection" y := x shuffled. "randomly shuffle string" +``` -"************************************************************************ - * Array: Fixed length collection * - * ByteArray: Array limited to byte elements (0-255) * - * WordArray: Array limited to word elements (0-2^32) * - ************************************************************************" +## Array: Fixed length collection +## ByteArray: Array limited to byte elements (0-255) +## WordArray: Array limited to word elements (0-2^32) +``` | b x y sum max | x := #(4 3 2 1). "constant array" x := Array with: 5 with: 4 with: 3 with: 2. "create array with up to 4 elements" @@ -419,10 +422,10 @@ y := x asOrderedCollection. "convert to ordered y := x asSortedCollection. "convert to sorted collection" y := x asBag. "convert to bag collection" y := x asSet. "convert to set collection" +``` -"************************************************************************ - * OrderedCollection: acts like an expandable array * - ************************************************************************" +##OrderedCollection: acts like an expandable array +``` | b x y sum max | x := OrderedCollection with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" x := OrderedCollection new. "allocate collection" @@ -462,11 +465,10 @@ y := x asOrderedCollection. "convert to ordered y := x asSortedCollection. "convert to sorted collection" y := x asBag. "convert to bag collection" y := x asSet. "convert to set collection" +``` -"************************************************************************ - * SortedCollection: like OrderedCollection except order of elements * - * determined by sorting criteria * - ************************************************************************" +## SortedCollection: like OrderedCollection except order of elements determined by sorting criteria +``` | b x y sum max | x := SortedCollection with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" x := SortedCollection new. "allocate collection" @@ -505,11 +507,10 @@ y := x asOrderedCollection. "convert to ordered y := x asSortedCollection. "convert to sorted collection" y := x asBag. "convert to bag collection" y := x asSet. "convert to set collection" +``` -"************************************************************************ - * Bag: like OrderedCollection except elements are in no * - * particular order * - ************************************************************************" +## Bag: like OrderedCollection except elements are in no particular order +``` | b x y sum max | x := Bag with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" x := Bag new. "allocate collection" @@ -537,11 +538,11 @@ y := x asOrderedCollection. "convert to ordered y := x asSortedCollection. "convert to sorted collection" y := x asBag. "convert to bag collection" y := x asSet. "convert to set collection" +``` -"************************************************************************ - * Set: like Bag except duplicates not allowed * - * IdentitySet: uses identity test (== rather than =) * - ************************************************************************" +## Set: like Bag except duplicates not allowed +## IdentitySet: uses identity test (== rather than =) +``` | b x y sum max | x := Set with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" x := Set new. "allocate collection" @@ -568,10 +569,10 @@ y := x asOrderedCollection. "convert to ordered y := x asSortedCollection. "convert to sorted collection" y := x asBag. "convert to bag collection" y := x asSet. "convert to set collection" +``` -"************************************************************************ - * Interval: * - ************************************************************************" +## Interval: +``` | b x y sum max | x := Interval from: 5 to: 10. "create interval object" x := 5 to: 10. @@ -597,19 +598,19 @@ y := x asOrderedCollection. "convert to ordered y := x asSortedCollection. "convert to sorted collection" y := x asBag. "convert to bag collection" y := x asSet. "convert to set collection" +``` -"************************************************************************ - * Associations: * - ************************************************************************" +##Associations: +``` | x y | x := #myVar->'hello'. y := x key. y := x value. +``` -"************************************************************************ - * Dictionary: * - * IdentityDictionary: uses identity test (== rather than =) * - ************************************************************************" +## Dictionary: +## IdentityDictionary: uses identity test (== rather than =) +``` | b x y | x := Dictionary new. "allocate collection" x add: #a->4; add: #b->3; add: #c->1; add: #d->2; yourself. "add element to collection" @@ -670,10 +671,10 @@ CMRDictionary associationsDo: [:aKeyValue | "another iterator fo Transcript show: aKeyValue printString; cr]. Smalltalk removeKey: #CMRGlobal ifAbsent: []. "remove entry from Smalltalk dictionary" Smalltalk removeKey: #CMRDictionary ifAbsent: []. "remove user dictionary from Smalltalk dictionary" +``` -"************************************************************************ - * Internal Stream: * - ************************************************************************" +## Internal Stream: +``` | b x ios | ios := ReadStream on: 'Hello read stream'. ios := ReadStream on: 'Hello read stream' from: 1 to: 5. @@ -700,10 +701,10 @@ x := ios next. x := ios peek. x := ios contents. b := ios atEnd. +``` -"************************************************************************ - * FileStream: * - ************************************************************************" +## FileStream: +``` | b x ios | ios := FileStream newFileNamed: 'ios.txt'. ios nextPut: $H; cr. @@ -721,10 +722,10 @@ x := ios next. x := ios peek. b := ios atEnd. ios close. +``` -"************************************************************************ - * Date: * - ************************************************************************" +## Date: +``` | x y | x := Date today. "create date for today" x := Date dateAndTimeNow. "create date from current time/date" @@ -755,10 +756,10 @@ y := x subtractDays: 10. "subtract days to da y := x subtractDate: (Date today). "subtract date (result in days)" y := x printFormat: #(2 1 3 $/ 1 1). "print formatted date" b := (x <= Date today). "comparison" +``` -"************************************************************************ - * Time: * - ************************************************************************" +## Time: +``` | x y | x := Time now. "create time from current time" x := Time dateAndTimeNow. "create time from current time/date" @@ -775,10 +776,10 @@ y := x asSeconds. "convert time to sec x := Time millisecondsToRun: [ "timing facility" 1 to: 1000 do: [:index | y := 3.14 * index]]. b := (x <= Time now). "comparison" +``` -"************************************************************************ - * Point: * - ************************************************************************" +## Point: +``` | x y | x := 200@100. "obtain a new point" y := x x. "x coordinate" @@ -800,15 +801,15 @@ x := 200@100 // 3@4. "divide points" x := 200@100 max: 50@200. "max x and y" x := 200@100 min: 50@200. "min x and y" x := 20@5 dotProduct: 10@2. "sum of product (x1*x2 + y1*y2)" +``` -"************************************************************************ - * Rectangle: * - ************************************************************************" +## Rectangle: +``` Rectangle fromUser. +``` -"************************************************************************ - * Pen: * - ************************************************************************" +## Pen: +``` | myPen | Display restoreAfter: [ Display fillWhite. @@ -832,10 +833,10 @@ Display width. "get display width" Display height. "get display height" ]. +``` -"************************************************************************ - * Dynamic Message Calling/Compiling: * - ************************************************************************" +## Dynamic Message Calling/Compiling: +``` | receiver message result argument keyword1 keyword2 argument1 argument2 | "unary message" receiver := 5. @@ -868,10 +869,10 @@ result := (Message setSelector: (keyword1, keyword2) asSymbol arguments: (Array with: argument1 with: argument2)) sentTo: receiver. +``` -"************************************************************************ - * class/meta-class: * - ************************************************************************" +## Class/Meta-class: +``` | b x | x := String name. "class name" x := String category. "organization category" @@ -901,10 +902,10 @@ b := String isBits. "true if index insta b := String isBytes. "true if index instance vars contain bytes" b := String isWords. true if index instance vars contain words" Object withAllSubclasses size. "get total number of class entries" +``` -"************************************************************************ - * debuging: * - ************************************************************************" +## Debuging: +``` | a b x | x yourself. "returns receiver" String browse. "browse specified class" @@ -924,14 +925,15 @@ x primitiveFailed. "system primitive fa a := 'A1'. b := 'B2'. a become: b. "switch two objects" Transcript show: a, b; cr. +``` -"************************************************************************ - * Misc. * - ************************************************************************" +## Misc +``` | x | "Smalltalk condenseChanges." "compress the change file" x := FillInTheBlank request: 'Prompt Me'. "prompt user for input" Utilities openCommandKeyHelp +``` From 5a0b443ef243f7a6d0568adba1d8d972d67b9a62 Mon Sep 17 00:00:00 2001 From: Jigyasa Grover Date: Sun, 4 Oct 2015 22:48:04 +0530 Subject: [PATCH 070/685] Update smalltalk.html.markdown --- smalltalk.html.markdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/smalltalk.html.markdown b/smalltalk.html.markdown index 175810d7..2095a72e 100644 --- a/smalltalk.html.markdown +++ b/smalltalk.html.markdown @@ -383,8 +383,9 @@ y := x shuffled. "randomly shuffle st ``` ## Array: Fixed length collection -## ByteArray: Array limited to byte elements (0-255) -## WordArray: Array limited to word elements (0-2^32) +- ByteArray: Array limited to byte elements (0-255) +- WordArray: Array limited to word elements (0-2^32) + ``` | b x y sum max | x := #(4 3 2 1). "constant array" From c220cced91bd05efda5120990973ce65b0d857b2 Mon Sep 17 00:00:00 2001 From: Jigyasa Grover Date: Sun, 4 Oct 2015 22:54:24 +0530 Subject: [PATCH 071/685] Update smalltalk.html.markdown --- smalltalk.html.markdown | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/smalltalk.html.markdown b/smalltalk.html.markdown index 2095a72e..a434a1ad 100644 --- a/smalltalk.html.markdown +++ b/smalltalk.html.markdown @@ -29,8 +29,10 @@ Feedback highly appreciated! Reach me at [@jigyasa_grover](https://twitter.com/j - Method Temporary: local to a method - Block Temporary: local to a block - Pool: variables in a Dictionary object -- Method Parameters: automatic local vars created as a result of message call with params - Block Parameters: automatic local vars created as a result of value: message call - Class: shared with all instances of one class & its subclasses - - Class Instance: unique to each instance of a class +- Method Parameters: automatic local vars created as a result of message call with params +- Block Parameters: automatic local vars created as a result of value: message call +- Class: shared with all instances of one class & its subclasses +- Class Instance: unique to each instance of a class - Instance Variables: unique to each instance `"Comments are enclosed in quotes"` From 87e8e77e5fd8d84a252dbb6d6697202118378774 Mon Sep 17 00:00:00 2001 From: Pushkar Sharma Date: Mon, 5 Oct 2015 00:13:54 +0530 Subject: [PATCH 072/685] Fixed a mistake from previous commit. Better explained reference address. --- c++.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c++.html.markdown b/c++.html.markdown index bbd2f9a9..bd86e9e5 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -245,9 +245,9 @@ cout << fooRef; // Prints "I am foo. Hi!" // Doesn't reassign "fooRef". This is the same as "foo = bar", and // foo == "I am bar" // after this line. -cout << &fooRef << endl; //Prints address of fooRef +cout << &fooRef << endl; //Prints address of foo fooRef = bar; -cout << &fooRef << endl; //Prints address of fooRef, AGAIN +cout << &fooRef << endl; //Still prints address of foo cout << fooRef; // Prints "I am bar" //The address of fooRef remains the same, i.e. it is still referring to foo. From f72588075d0cd200d53893ad51129844df17aea7 Mon Sep 17 00:00:00 2001 From: ozgur sahin Date: Sun, 4 Oct 2015 22:01:10 +0300 Subject: [PATCH 073/685] swift-tr.html.markdown Translated some English sentences. --- tr-tr/swift-tr.html.markdown | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tr-tr/swift-tr.html.markdown b/tr-tr/swift-tr.html.markdown index 41835e13..c13f5ecf 100644 --- a/tr-tr/swift-tr.html.markdown +++ b/tr-tr/swift-tr.html.markdown @@ -3,16 +3,14 @@ language: swift contributors: - ["Özgür Şahin", "https://github.com/ozgurshn/"] filename: learnswift.swift +lang: tr-tr --- Swift iOS ve OSX platformlarında geliştirme yapmak için Apple tarafından oluşturulan yeni bir programlama dilidir. Objective - C ile beraber kullanılabilecek ve de hatalı kodlara karşı daha esnek bir yapı sunacak bir şekilde tasarlanmıştır. Swift 2014 yılında Apple'ın geliştirici konferansı WWDC de tanıtıldı. Xcode 6+'a dahil edilen LLVM derleyici ile geliştirildi. - -The official [Swift Programming Language](https://itunes.apple.com/us/book/swift-programming-language/id881256329) book from Apple is now available via iBooks. + Apple'ın resmi [Swift Programlama Dili](https://itunes.apple.com/us/book/swift-programming-language/id881256329) kitabı iBooks'ta yerini aldı. -See also Apple's [getting started guide](https://developer.apple.com/library/prerelease/ios/referencelibrary/GettingStarted/RoadMapiOS/index.html), which has a complete tutorial on Swift. - Ayrıca Swift ile gelen tüm özellikleri görmek için Apple'ın [başlangıç kılavuzu](https://developer.apple.com/library/prerelease/ios/referencelibrary/GettingStarted/RoadMapiOS/index.html)na bakmanızda yarar var. @@ -243,7 +241,7 @@ print("Benzin fiyatı: \(fiyat)") // Çeşitli Argümanlar func ayarla(sayilar: Int...) { - // its an array + // bu bir dizidir let sayi = sayilar[0] let argumanSAyisi = sayilar.count } From 3b246fd869564b0a7f7c847f44aecac82d318c78 Mon Sep 17 00:00:00 2001 From: Pushkar Sharma Date: Mon, 5 Oct 2015 00:32:34 +0530 Subject: [PATCH 074/685] Grammar the address --- c++.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c++.html.markdown b/c++.html.markdown index bd86e9e5..8ee964ca 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -245,9 +245,9 @@ cout << fooRef; // Prints "I am foo. Hi!" // Doesn't reassign "fooRef". This is the same as "foo = bar", and // foo == "I am bar" // after this line. -cout << &fooRef << endl; //Prints address of foo +cout << &fooRef << endl; //Prints the address of foo fooRef = bar; -cout << &fooRef << endl; //Still prints address of foo +cout << &fooRef << endl; //Still prints the address of foo cout << fooRef; // Prints "I am bar" //The address of fooRef remains the same, i.e. it is still referring to foo. From 68fc9b5c1f71adcbbbd53711e9a5692a8372b8cf Mon Sep 17 00:00:00 2001 From: Pushkar Sharma Date: Mon, 5 Oct 2015 00:35:49 +0530 Subject: [PATCH 075/685] fixed the comment format --- common-lisp.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common-lisp.html.markdown b/common-lisp.html.markdown index e3bb61cf..e0597e94 100644 --- a/common-lisp.html.markdown +++ b/common-lisp.html.markdown @@ -176,7 +176,7 @@ nil ; for false - and the empty list *rover* ; => #S(DOG :NAME "rover" :BREED "collie" :AGE 5) (dog-p *rover*) ; => true #| -p signifies "predicate". It's used to - check if *rover* is an instance of dog.|# + check if *rover* is an instance of dog. |# (dog-name *rover*) ; => "rover" ;; Dog-p, make-dog, and dog-name are all created by defstruct! From 1194e9456f2f1302614f8086349c01f4797d34c0 Mon Sep 17 00:00:00 2001 From: willianjusten Date: Sun, 4 Oct 2015 16:13:11 -0300 Subject: [PATCH 076/685] Fixing some typos --- pt-br/javascript-pt.html.markdown | 45 +++++++++++++++---------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/pt-br/javascript-pt.html.markdown b/pt-br/javascript-pt.html.markdown index e39c6c8e..406042fa 100644 --- a/pt-br/javascript-pt.html.markdown +++ b/pt-br/javascript-pt.html.markdown @@ -3,20 +3,21 @@ language: javascript contributors: - ["Adam Brenecki", "http://adam.brenecki.id.au"] - ["Ariel Krakowski", "http://www.learneroo.com"] -filename: javascript.js +translators: + - ["Willian Justen", "http://willianjusten.com.br"] +lang: pt-br --- -JavaScript foi criada por Brendan Eich, funcionário da Netscape, em 1995. Ela +JavaScript foi criada por Brendan Eich, funcionário da Netscape na época, em 1995. Ela foi originalmente criada para ser uma linguagem de script para websites, complementando o uso de Java para aplicações web mais complexas, mas a sua integração com páginas web e seu suporte nativo nos browsers fez com que ela se tornasse mais comum que Java no frontend web. -Javascript não é somente limitado a browsers web, no entanto: existe o Node.js, +Javascript não é somente limitada a browsers web, existindo o Node.js, que é um projeto que fornece um interpretador baseado no motor V8 do Google Chrome e está se tornando cada vez mais famoso. - Feedback são muito apreciados! Você me encontrar em [@adambrenecki](https://twitter.com/adambrenecki), ou [adam@brenecki.id.au](mailto:adam@brenecki.id.au). @@ -29,23 +30,23 @@ Feedback são muito apreciados! Você me encontrar em // comandos podem ser terminados com ; facaAlgo(); -// ... mas eles não precisam ser, assim como o ponto-e-vírgula é automaticamente +// ... mas eles não precisam ser, o ponto-e-vírgula é automaticamente // inserido quando há uma nova linha, exceto alguns casos. facaAlgo() -// Porque esses casos podem causar resultados inesperados, vamos continuar +// Como esses casos podem causar resultados inesperados, vamos continuar // a usar ponto-e-vírgula neste guia. /////////////////////////////////// // 1. Números, Strings e Operadores // Javascript tem um tipo de número (que é o 64-bit IEEE 754 double). -// Doublas tem uma mantissa 52-bit, que é suficiente para guardar inteiros +// Doubles tem uma mantissa 52-bit, que é suficiente para guardar inteiros // acima de 9✕10¹⁵ precisamente. 3; // = 3 1.5; // = 1.5 -// A aritmética básica funciona seria de esperar. +// A aritmética básica funciona como seria de se esperar. 1 + 1; // = 2 0.1 + 0.2; // = 0.30000000000000004 8 - 1; // = 7 @@ -62,7 +63,6 @@ facaAlgo() // A precedência é aplicada com parênteses. (1 + 3) * 2; // = 8 -// There are three special not-a-real-number values: // Existem três especiais valores não-é-número-real: Infinity; // resultado de 1/0 -Infinity; // resultado de -1/0 @@ -76,16 +76,15 @@ false; 'abc'; "Olá, mundo"; -// Negation uses the ! symbol // Negação usa o símbolo ! !true; // = false !false; // = true -// Igualdade é === +// Igualdade é o sinal de === 1 === 1; // = true 2 === 1; // = false -// Desigualdade é !== +// Desigualdade é o sinal de !== 1 !== 1; // = false 2 !== 1; // = true @@ -101,7 +100,7 @@ false; // e comparadas com < e > "a" < "b"; // = true -// A coerção de tipos é feita para comparações com dois iguais... +// A comparação de tipos não é feita com o uso de ==... "5" == 5; // = true null == undefined; // = true @@ -109,7 +108,7 @@ null == undefined; // = true "5" === 5; // = false null === undefined; // = false -// ...que irá resultar num comportamento estranho... +// ...isso pode resultar em comportamentos estranhos... 13 + !0; // 14 "13" + !0; // '13true' @@ -125,21 +124,21 @@ null === undefined; // = false // Existe também o `null` e o `undefined`. null; // usado para indicar um valor não considerado undefined; // usado para indicar um valor que não é a atualmente definido - // (entretando `undefined` é usado como um próprio valor + // (entretando `undefined` é considerado de fato um valor -// false, null, undefined, NaN, 0 and "" são valores falsy; -// qualquer outro valor é truthy -// Note que 0 é falsy e "0" é truthy, até mesmo 0 == "0". +// false, null, undefined, NaN, 0 and "" são valores falsos; +// qualquer outro valor é verdadeiro +// Note que 0 é falso e "0" é verdadeiro, até mesmo 0 == "0". /////////////////////////////////// // 2. Variáveis, Arrays e Objetos -// Variáveis são declarados com a palavra-chave `var`. O Javascript é +// Variáveis são declaradas com a palavra-chave `var`. O Javascript é // dinâmicamente tipado, portanto você não precisa especificar o tipo. // Atribuições usam um simples caracter de `=`. var someVar = 5; -// se você deixar de colocar a palavra-chave var, você não receber um erro... +// se você deixar de colocar a palavra-chave var, você não irá receber um erro... someOtherVar = 10; // ...mas sua variável será criada no escopo global, não no escopo em que você @@ -148,13 +147,13 @@ someOtherVar = 10; // Variáveis declaradas sem receberem um valor são definidas como `undefined`. var someThirdVar; // = undefined -// Existe um shorthad para operações matemáticas em variáveis: +// Existe um shorthand para operações matemáticas em variáveis: someVar += 5; // equivalente a someVar = someVar + 5; someVar é 10 agora someVar *= 10; // agora someVar é 100 // e um para adição e subtração de 1 -someVar++; // now someVar is 101 -someVar--; // back to 100 +someVar++; // agora someVar é 101 +someVar--; // volta para 100 // Arrays são listas ordenadas de valores, de qualquer tipo. var myArray = ["Olá", 45, true]; From 2e987df42225e6bdf824584058467aaffc73fb49 Mon Sep 17 00:00:00 2001 From: Pushkar Sharma Date: Mon, 5 Oct 2015 00:52:47 +0530 Subject: [PATCH 077/685] replaced scanf with fscanf. --- c.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c.html.markdown b/c.html.markdown index 36621a9e..db2ac930 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -131,7 +131,7 @@ int main(void) { // time constant: printf("Enter the array size: "); // ask the user for an array size int size; - scanf("%d", &size); + fscanf(stdin, "%d", &size); char buf[size]; fgets(buf, sizeof buf, stdin); From d2fde6512424b754e0d45ac484d86472a99da3ef Mon Sep 17 00:00:00 2001 From: David Lima Date: Sun, 4 Oct 2015 16:30:42 -0300 Subject: [PATCH 078/685] Including '-pt' suffix on filename --- pt-br/hack-pt.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt-br/hack-pt.html.markdown b/pt-br/hack-pt.html.markdown index 2f9d3c1b..7c938149 100644 --- a/pt-br/hack-pt.html.markdown +++ b/pt-br/hack-pt.html.markdown @@ -6,7 +6,7 @@ contributors: translators: - ["David Lima", "https://github.com/davelima"] lang: pt-br -filename: learnhack.hh +filename: learnhack-pt.hh --- Hack é uma linguagem baseada no PHP e roda numa máquina virtual chamada HHVM. From b1984042c845a73333972715e88a3d7a2e8cfdd7 Mon Sep 17 00:00:00 2001 From: Guntbert Reiter Date: Sun, 4 Oct 2015 16:44:24 +0200 Subject: [PATCH 079/685] Put demonstrative condition into ternary expression It should be made clear that the part before the ternary operator is indeed a condition, most often created as some comparison expression. --- de-de/csharp-de.html.markdown | 5 +++-- fr-fr/csharp-fr.html.markdown | 3 ++- tr-tr/csharp-tr.html.markdown | 3 ++- zh-cn/csharp-cn.html.markdown | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/de-de/csharp-de.html.markdown b/de-de/csharp-de.html.markdown index dc77dda0..8ad7d71f 100644 --- a/de-de/csharp-de.html.markdown +++ b/de-de/csharp-de.html.markdown @@ -248,7 +248,8 @@ zur nächsten Zeile, ""Wahnsinn!"", die Massen waren kaum zu bändigen"; // Ternärer Operator // Anstatt eines einfachen if/else lässt sich auch folgendes schreiben: // ? : - string isTrue = true ? "Ja" : "Nein"; + int zumVergleich = 17; + string isTrue = zumVergleich == 17 ? "Ja" : "Nein"; // while-Schleife int fooWhile = 0; @@ -886,4 +887,4 @@ zur nächsten Zeile, ""Wahnsinn!"", die Massen waren kaum zu bändigen"; * [ASP.NET Web Forms Tutorials](http://www.asp.net/web-forms/tutorials) * [Windows Forms Programming in C#](http://www.amazon.com/Windows-Forms-Programming-Chris-Sells/dp/0321116208) -[C# Coding Conventions](http://msdn.microsoft.com/de-de/library/vstudio/ff926074.aspx) \ No newline at end of file +[C# Coding Conventions](http://msdn.microsoft.com/de-de/library/vstudio/ff926074.aspx) diff --git a/fr-fr/csharp-fr.html.markdown b/fr-fr/csharp-fr.html.markdown index e51eacc8..58b3f386 100644 --- a/fr-fr/csharp-fr.html.markdown +++ b/fr-fr/csharp-fr.html.markdown @@ -239,7 +239,8 @@ sur une nouvelle ligne! ""Wow!"", quel style"; // Opérateur ternaire // Un simple if/else peut s'écrire : // ? : - string isTrue = (true) ? "True" : "False"; + int toCompare = 17; + string isTrue = toCompare == 17 ? "True" : "False"; // Boucle while int fooWhile = 0; diff --git a/tr-tr/csharp-tr.html.markdown b/tr-tr/csharp-tr.html.markdown index a68026a5..91c7c269 100644 --- a/tr-tr/csharp-tr.html.markdown +++ b/tr-tr/csharp-tr.html.markdown @@ -234,7 +234,8 @@ on a new line! ""Wow!"", the masses cried"; // Üçlü operatörler // Basit bir if/else ifadesi şöyle yazılabilir // ? : - string isTrue = (true) ? "True" : "False"; + int toCompare = 17; + string isTrue = toCompare == 17 ? "True" : "False"; // While döngüsü int fooWhile = 0; diff --git a/zh-cn/csharp-cn.html.markdown b/zh-cn/csharp-cn.html.markdown index a3cda5b3..971c1be9 100644 --- a/zh-cn/csharp-cn.html.markdown +++ b/zh-cn/csharp-cn.html.markdown @@ -232,7 +232,8 @@ on a new line! ""Wow!"", the masses cried"; // 三元表达式 // 简单的 if/else 语句可以写成: // <条件> ? <真> : <假> - string isTrue = (true) ? "True" : "False"; + int toCompare = 17; + string isTrue = toCompare == 17 ? "True" : "False"; // While 循环 int fooWhile = 0; From d8efd3ba3416669177683887b2822eb5d56c157b Mon Sep 17 00:00:00 2001 From: bk2dcradle Date: Mon, 5 Oct 2015 01:38:02 +0530 Subject: [PATCH 080/685] Modified as said to by a Collaborator --- java.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java.html.markdown b/java.html.markdown index 2f41be81..89a710ee 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -477,9 +477,9 @@ public abstract class Animal age = 30; } - // No need to initialise, however in an interface + // No need to initialize, however in an interface // a variable is implicitly final and hence has - // to be initialised. + // to be initialized. private int age; public void printAge() @@ -509,7 +509,7 @@ class Dog extends Animal // @Override annotation here, since java doesn't allow // overriding of static methods. // What is happening here is called METHOD HIDING. - // Check out this awesome SO post: (http://stackoverflow.com/questions/16313649/) + // Check out this awesome SO post: http://stackoverflow.com/questions/16313649/ public static void main(String[] args) { Dog pluto = new Dog(); From e7a50adb78d4babdf77039ee58c59f5bc7d241c4 Mon Sep 17 00:00:00 2001 From: ven Date: Sun, 4 Oct 2015 22:44:34 +0200 Subject: [PATCH 081/685] Fix #1289 --- id-id/xml-id.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/id-id/xml-id.html.markdown b/id-id/xml-id.html.markdown index 8e8cdf4e..c1e985aa 100644 --- a/id-id/xml-id.html.markdown +++ b/id-id/xml-id.html.markdown @@ -5,6 +5,7 @@ contributors: - ["João Farias", "https://github.com/JoaoGFarias"] translators: - ["Rizky Luthfianto", "https://github.com/rilut"] +lang: id-id --- XML adalah bahasa markup yang dirancang untuk menyimpan dan mengirim data. From 82bdd1b1c8c5eaa49289d9a683bf87ed85b99be9 Mon Sep 17 00:00:00 2001 From: VeerpalB Date: Sun, 4 Oct 2015 19:41:13 -0400 Subject: [PATCH 082/685] Add step parameter to range function A description of the step parameter of the range function is added. An example of its use in a for loop is also given. --- python3.html.markdown | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/python3.html.markdown b/python3.html.markdown index b3acb122..4696ae1c 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -352,6 +352,18 @@ for i in range(4, 8): print(i) """ +"range(lower, upper, step)" returns an iterable of numbers +from the lower number to the upper number, while incrementing +by step. If step is not indicated, the default value is 1. +prints: + 4 + 6 + 8 +""" +for i in range(4, 8, 2): + print(i) +""" + While loops go until a condition is no longer met. prints: 0 From 52253720456acfef35cbbcf1ea1b3d98816c0961 Mon Sep 17 00:00:00 2001 From: Zachary Ferguson Date: Sun, 4 Oct 2015 19:58:14 -0400 Subject: [PATCH 083/685] Fixed whitespaces Fixed the spacing to conform with standards. --- python3.html.markdown | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/python3.html.markdown b/python3.html.markdown index d70c5462..7b6edae7 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -4,7 +4,7 @@ contributors: - ["Louie Dinh", "http://pythonpracticeprojects.com"] - ["Steven Basart", "http://github.com/xksteven"] - ["Andre Polykanine", "https://github.com/Oire"] - - ["Zachary Ferguson", "http://github.com/zfergus2"] + - ["Zachary Ferguson", "http://github.com/zfergus2"] filename: learnpython3.py --- @@ -158,7 +158,7 @@ print("I'm Python. Nice to meet you!") # By default the print function also prints out a newline at the end. # Use the optional argument end to change the end character. -print("I'm Python. Nice to meet you!", end="") +print("Hello, World", end="!") # => Hello, World! # No need to declare variables before assigning to them. # Convention is to use lower_case_with_underscores @@ -501,10 +501,9 @@ all_the_args(*args, **kwargs) # equivalent to foo(1, 2, 3, 4, a=3, b=4) # Returning multiple values (with tuple assignments) def swap(x, y): - return y, x # Return multiple values as a tuple - # (Note: parenthesis have been excluded but can be included) -# return (y, x) # Just as valid as the above example. - + return y, x # Return multiple values as a tuple without the parenthesis. + # (Note: parenthesis have been excluded but can be included) + x = 1 y = 2 x, y = swap(x, y) # => x = 2, y = 1 From a009095c2f408928e3c75ed64ff31094230f0827 Mon Sep 17 00:00:00 2001 From: connorshea Date: Sun, 4 Oct 2015 18:53:55 -0600 Subject: [PATCH 084/685] Added some Further Reading Links for CSS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And changed CanIUse to “Can I Use…” --- css.html.markdown | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/css.html.markdown b/css.html.markdown index 7224d80a..e217906f 100644 --- a/css.html.markdown +++ b/css.html.markdown @@ -4,6 +4,7 @@ contributors: - ["Mohammad Valipour", "https://github.com/mvalipour"] - ["Marco Scannadinari", "https://github.com/marcoms"] - ["Geoffrey Liu", "https://github.com/g-liu"] + - ["Connor Shea", "https://github.com/connorshea"] filename: learncss.css --- @@ -238,10 +239,13 @@ of what you use in CSS with your target browsers. [QuirksMode CSS](http://www.quirksmode.org/css/) is one of the best sources for this. -To run a quick compatibility check, [CanIUse](http://caniuse.com) is a great resource. +To run a quick compatibility check, [Can I Use...](http://caniuse.com) is a great resource. ## Further Reading +* [Mozilla Developer Network's CSS documentation](https://developer.mozilla.org/en-US/docs/Web/CSS) +* [Codrops' CSS Reference](http://tympanus.net/codrops/css_reference/) * [Understanding Style Precedence in CSS: Specificity, Inheritance, and the Cascade](http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/) * [QuirksMode CSS](http://www.quirksmode.org/css/) * [Z-Index - The stacking context](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Understanding_z_index/The_stacking_context) +* [SCSS](http://sass-lang.com/) and [LESS](http://lesscss.org/) for CSS pre-processing From 0a3bdcd6a5864bdfb6641f883d3f3e2f4545548c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=20Mu=C3=B1oz?= Date: Mon, 5 Oct 2015 11:50:44 +0200 Subject: [PATCH 085/685] Fixed some typos --- es-es/git-es.html.markdown | 108 ++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 55 deletions(-) diff --git a/es-es/git-es.html.markdown b/es-es/git-es.html.markdown index 51812447..18b544b4 100644 --- a/es-es/git-es.html.markdown +++ b/es-es/git-es.html.markdown @@ -11,7 +11,7 @@ lang: es-es --- Git es un sistema de control de versiones distribuido diseñado para manejar -cualquier tipo de proyecto, ya sea largo o pequeño, con velocidad y eficiencia. +cualquier tipo de proyecto, ya sea grande o pequeño, con velocidad y eficiencia. Git realiza esto haciendo "snapshots" del proyecto, con ello permite versionar y administrar nuestro código fuente. @@ -36,8 +36,8 @@ uno o varios archivos, a lo largo del tiempo. ### Por qué usar Git? * Se puede trabajar sin conexion. -* Colaborar con otros es sencillo!. -* Derivar, Crear ramas del proyecto (aka: Branching) es fácil!. +* ¡Colaborar con otros es sencillo!. +* Derivar, crear ramas del proyecto (aka: Branching) es fácil. * Combinar (aka: Merging) * Git es rápido. * Git es flexible. @@ -48,7 +48,7 @@ uno o varios archivos, a lo largo del tiempo. Un repositorio es un conjunto de archivos, directorios, registros, cambios (aka: comits), y encabezados (aka: heads). Imagina que un repositorio es una clase, -y que sus atributos otorgan acceso al historial del elemento, además de otras +y que sus atributos otorgan acceso al historial del elemento, además de otras cosas. Un repositorio esta compuesto por la carpeta .git y un "árbol de trabajo". @@ -68,13 +68,13 @@ las veces se le llama "directorio de trabajo". ### Índice (componentes del directorio .git) El índice es el área de inicio en git. Es basicamente la capa que separa el -directorio de trabajo, del repositorio en git. Esto otorga a los desarrolladores -mas poder sobre lo que envía y recibe en el repositorio. +directorio de trabajo del repositorio en git. Esto otorga a los desarrolladores +más poder sobre lo que se envía y se recibe del repositorio. ### Commit (aka: cambios) Un commit es una captura de un conjunto de cambios, o modificaciones hechas en -el directorio de trabajo. Por ejemplo, si se añaden 5 archivos, se remueven 2, +el directorio de trabajo. Por ejemplo, si se añaden 5 archivos, se eliminan 2, estos cambios se almacenarán en un commit (aka: captura). Este commit puede ser o no ser enviado (aka: "pusheado") hacia un repositorio. @@ -84,7 +84,7 @@ Un "branch", es escencialmente un apuntador hacia el último commit (cambio registrado) que se ha realizado. A medida que se realizan más commits, este apuntador se actualizará automaticamente hacia el ultimo commit. -### "HEAD" y "head" (component of .git dir) +### "HEAD" y "head" (componentes del directorio .git) "HEAD" es un apuntador hacia la rama (branch) que se esta utilizando. Un repositorio solo puede tener un HEAD activo. En cambio "head", es un apuntador a @@ -115,7 +115,7 @@ Se utiliza para configurar las opciones ya sea globalmente, o solamente en el repositorio. ```bash -# Imprime y guarda algunas variables de configuracion basicas. (Globalmente) +# Imprime y guarda algunas variables de configuracion básicas. (Globalmente) $ git config --global user.email $ git config --global user.name @@ -123,7 +123,7 @@ $ git config --global user.email "corre@gmail.com" $ git config --global user.name "nombre" ``` -[Mas sobre git config.](http://git-scm.com/book/es/Personalizando-Git-Configuración-de-Git) +[Más sobre git config.](http://git-scm.com/book/es/Personalizando-Git-Configuración-de-Git) ### help @@ -131,7 +131,7 @@ Otorga un accceso rápido a una guía extremadamente detallada de cada comando e git. O puede ser usada simplemente como un recordatorio de estos. ```bash -# Una vista rapido de los comandos disponibles. +# Una vista rápida de los comandos disponibles. $ git help # Chequear todos los comandos disponibles @@ -151,7 +151,7 @@ HEAD actualmente. ```bash -# Mostrara el "branch", archivos sin añadir a la repo, cambios y otras +# Mostrará el "branch", archivos sin añadir al repo, cambios y otras # diferencias $ git status @@ -161,8 +161,8 @@ $ git help status ### add -Para añadir archivos al arbol (directorio, repositorio) de trabajo. Si no se -utiliza `git add`, los nuevos archivos no se añadiran al arbol de trabajo, por +Para añadir archivos al árbol (directorio, repositorio) de trabajo. Si no se +utiliza `git add`, los nuevos archivos no se añadirán al arbol de trabajo, por lo que no se incluirán en los commits (cambios). ```bash @@ -178,24 +178,24 @@ $ git add ./*.py ### branch -Administra las ramas del repositorios ("branches"). Puedes ver, editar, crear y +Administra las ramas del repositorio ("branches"). Puedes ver, editar, crear y borrar ramas ("branches"), usando este comando. ```bash # lista todas las ramas (remotas y locales) $ git branch -a -# Añada una nueva rama ("branch"). +# Añadir una nueva rama ("branch"). $ git branch branchNueva # Eliminar una rama. $ git branch -d branchFoo -# Renombra una rama. +# Renombrar una rama. # git branch -m $ git branch -m youngling padawan -# Edita la descripcion de la rama. +# Editar la descripcion de la rama. $ git branch master --edit-description ``` @@ -230,7 +230,6 @@ Almacena el contenido actual del índice en un nuevo "commit". Este commit contiene los cambios hechos más un resumen proporcionado por el desarrollador. ```bash -# commit with a message # realizar un commit y añadirle un mensaje. $ git commit -m "jedi anakin wil be - jedis.list" ``` @@ -241,13 +240,13 @@ Muestra las diferencias entre un archivo en el directorio de trabajo, el índice y los commits. ```bash -# Muestra la diferencia entre un directorio de trabajo y el indice. +# Muestra la diferencia entre un directorio de trabajo y el índice. $ git diff -# Muestra la diferencia entre el indice y los commits mas recientes. +# Muestra la diferencia entre el índice y los commits más recientes. $ git diff --cached -# Muestra la diferencia entre el directorio de trabajo y el commit mas reciente. +# Muestra la diferencia entre el directorio de trabajo y el commit más reciente. $ git diff HEAD ``` @@ -255,31 +254,32 @@ $ git diff HEAD Permite realizar una busqueda rápida en un repositorio. -Configuracion opcionales: +Configuraciones opcionales: ```bash # Gracias a Travis Jeffery por compartir lo siguiente. # Permite mostrar numeros de lineas en la salida de grep. $ git config --global grep.lineNumber true -# Realiza una busqueda mas lejible, incluyendo agrupacion. +# Realiza una búsqueda mas legible, incluyendo agrupación. $ git config --global alias.g "grep --break --heading --line-number" ``` ```bash -# Busca por "unaVariable" en todos los archivos ,java +# Busca por "unaVariable" en todos los archivos .java $ git grep 'unaVariable' -- '*.java' -# Busca por una linea que contenga "nombreArreglo" y , "agregar" o "remover" +# Busca por una línea que contenga "nombreArreglo" y "agregar" o "remover" $ git grep -e 'nombreArreglo' --and \( -e agregar -e remover \) ``` -Mas ejemplos: -[Git Grep Ninja](http://travisjeffery.com/b/2012/02/search-a-git-repo-like-a-ninja) +Más ejemplos: + +- [Git Grep Ninja](http://travisjeffery.com/b/2012/02/search-a-git-repo-like-a-ninja) ### log -Muestra los commits (cambios) registrados en el repositotrio. +Muestra los commits (cambios) registrados en el repositorio. ```bash # Muestra todos los commits. @@ -288,7 +288,7 @@ $ git log # Muestra un numero x de commits. $ git log -n 10 -# Muestra solo los commits que se han combinado en el hisotrial +# Muestra solo los commits que se han combinado en el historial. $ git log --merges ``` @@ -301,7 +301,7 @@ que se trabaja. # Combina la rama especificada en la rama actual. $ git merge jediMaster -# Siempre genere un solo merge commit cuando se utilizar merge. +# Siempre genere un solo merge commit cuando se utiliza merge. $ git merge --no-ff jediMaster ``` @@ -310,7 +310,7 @@ $ git merge --no-ff jediMaster Renombra o mueve un archivo ```bash -# Renombrando un archivo +# Renombrando un archivo. $ git mv HolaMundo.c AdiosMundo.c # Moviendo un archivo. @@ -322,33 +322,31 @@ $ git mv -f archivoA archivoB ### pull -Sube (Empuja) de un repositorio y lo combina en otro en una rama diferente. +Trae los cambios de un repositorio y los combina en otro en una rama diferente. ```bash -# Actualiza el repositorio local, combinando los nuevos cambios. +# Actualiza el repositorio local, combinando los nuevos cambios # de las ramas remotas "origin" y "master". -# from the remote "origin" and "master" branch. # git pull $ git pull origin master ``` ### push -Push and merge changes from a branch to a remote & branch. +Envía y combina los cambios de un repositorio local a un repositorio y rama remotos. ```bash -# Push and merge changes from a local repo to a -# Empuja y combina cambios de un repositorio local hacian un repositorio remoto +# Envía y combina cambios de un repositorio local hacia un repositorio remoto # llamados "origin" y "master", respectivamente. # git push # git push => por defecto es lo mismo que poner => git push origin master $ git push origin master ``` +### rebase Toma todos los cambios que fueron registrados en una rama, y los repite dentro -de otra rama. -*No reescribe los commits que se han empujado antes a un repositorio publico* +de otra rama. *No reescribe los commits que se han empujado antes a un repositorio público.* ```bash # Integrar ramaExperimento dentro de la rama "master" @@ -356,47 +354,47 @@ de otra rama. $ git rebase master experimentBranch ``` -[Informacion adicional.](http://git-scm.com/book/es/Ramificaciones-en-Git-Procedimientos-básicos-para-ramificar-y-fusionar) +[Información adicional.](http://git-scm.com/book/es/Ramificaciones-en-Git-Procedimientos-básicos-para-ramificar-y-fusionar) -### reset (precaucion) +### reset (precaución) -Reinicia el cabezal actual hacia un estado especificado. Esto permite desacer -combinaciones (merges), pulls, commits, adds y mas. Es un comando util, pero -tambien peligrosa si no se sabe lo que se hace. +Reinicia el HEAD actual hacia un estado especificado. Esto permite deshacer +combinaciones (merges), pulls, commits, adds y más. Es un comando útil, pero +tambien peligroso si no se sabe lo que se hace. ```bash -# Reinica el area principal, con el ultimo cambio registrado. (deja los +# Reinicia el área principal, con el último cambio registrado. (deja los # directorios sin cambios) $ git reset -# Reinica el area principal, con el ultimo cambio registrado, y reescribe el +# Reinicia el área principal, con el último cambio registrado, y reescribe el # directorio de trabajo. $ git reset --hard # Mueve la rama actual hacia el commit especificado (no realiza cambios a los -# directorios), todos los cambios aun existen el directorio. +# directorios), todos los cambios aún existen el directorio. $ git reset 31f2bb1 -# Mueve la rama actual devuelta a un commit especificado asi como el -# directorios (borra todos los cambios que no fueron registros y todos los -# cambios realizados despues del commit especificado). +# Mueve la rama actual devuelta a un commit especificado, así como el +# directorio (borra todos los cambios que no fueron registrados y todos los +# cambios realizados después del commit especificado). $ git reset --hard 31f2bb1 ``` ### rm -Lo contrario de git add, git rm remueve los archivos del directorio de trabajo +Lo contrario de git add, git rm elimina los archivos del directorio de trabajo actual. ```bash -# Remueve FooBar.c +# Elimina FooBar.c $ git rm FooBar.c -# Remueve un archivo de un directorio. +# Elimina un archivo de un directorio. $ git rm /directorio/del/archivo/FooBar.c ``` -## Informacion Adicional +## Información Adicional * [tryGit - Una forma entretenida y rapida de aprender Git.](http://try.github.io/levels/1/challenges/1) From 142d33340aec0e3d85154a4feeb958f722693023 Mon Sep 17 00:00:00 2001 From: Chashmeet Singh Date: Mon, 5 Oct 2015 15:31:46 +0530 Subject: [PATCH 086/685] Update ruby-ru.html.markdown --- ru-ru/ruby-ru.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/ru-ru/ruby-ru.html.markdown b/ru-ru/ruby-ru.html.markdown index 318e0e09..69b5fb46 100644 --- a/ru-ru/ruby-ru.html.markdown +++ b/ru-ru/ruby-ru.html.markdown @@ -158,6 +158,7 @@ array << 6 #=> [1, 2, 3, 4, 5, 6] hash = {'color' => 'green', 'number' => 5} hash.keys #=> ['color', 'number'] +hash.values #=> ['green', 5] # Значение в хэше легко может быть найдено по ключу: hash['color'] #=> 'green' From 41d49490ba093a74d0d691538b8342682feb997f Mon Sep 17 00:00:00 2001 From: Chashmeet Singh Date: Mon, 5 Oct 2015 15:46:46 +0530 Subject: [PATCH 087/685] Update python-ru.html.markdown --- ru-ru/python-ru.html.markdown | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ru-ru/python-ru.html.markdown b/ru-ru/python-ru.html.markdown index a0e2b474..162675bb 100644 --- a/ru-ru/python-ru.html.markdown +++ b/ru-ru/python-ru.html.markdown @@ -238,6 +238,15 @@ d, e, f = 4, 5, 6 # Обратите внимание, как легко поменять местами значения двух переменных e, d = d, e # теперь d == 5, а e == 4 +#take input of integers in a single line +#if input 1 2 3 +input = map(int,raw_input().split()) #integer + +input #=>[1, 2, 3] + +input = map(str,raw_input().split()) #string + +input #=>['1', '2', '3'] # Словари содержат ассоциативные массивы empty_dict = {} From dca1300e57600f6707d3aa3778a24d9b1626b9b9 Mon Sep 17 00:00:00 2001 From: Chashmeet Singh Date: Mon, 5 Oct 2015 17:33:38 +0530 Subject: [PATCH 088/685] Update python-ru.html.markdown --- ru-ru/python-ru.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ru-ru/python-ru.html.markdown b/ru-ru/python-ru.html.markdown index 162675bb..ec4fff41 100644 --- a/ru-ru/python-ru.html.markdown +++ b/ru-ru/python-ru.html.markdown @@ -238,13 +238,13 @@ d, e, f = 4, 5, 6 # Обратите внимание, как легко поменять местами значения двух переменных e, d = d, e # теперь d == 5, а e == 4 -#take input of integers in a single line -#if input 1 2 3 -input = map(int,raw_input().split()) #integer +#принять ввод чисел в одной строке +#если вход 1 2 3 +input = map(int,raw_input().split()) #целое число input #=>[1, 2, 3] -input = map(str,raw_input().split()) #string +input = map(str,raw_input().split()) #строка input #=>['1', '2', '3'] From cae1960ca3a5c25d8db458234ac0a6e97ab87ed5 Mon Sep 17 00:00:00 2001 From: Chashmeet Singh Date: Mon, 5 Oct 2015 17:51:23 +0530 Subject: [PATCH 089/685] Reverse an array --- ruby.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ruby.html.markdown b/ruby.html.markdown index 7bd28d86..4e8dcc8f 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -168,6 +168,10 @@ array[-1] #=> 5 # With a start index and length array[2, 3] #=> [3, 4, 5] +# Reverse an Array +# array = [1,2,3] +array.reverse #=> [3,2,1] + # Or with a range array[1..3] #=> [2, 3, 4] From 51e3bd21e29ac19884eca57c6f4f1defbd78ea3a Mon Sep 17 00:00:00 2001 From: Chashmeet Singh Date: Mon, 5 Oct 2015 20:22:07 +0530 Subject: [PATCH 090/685] Reverse a list --- ruby.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruby.html.markdown b/ruby.html.markdown index 4e8dcc8f..b6d0e44d 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -169,8 +169,8 @@ array[-1] #=> 5 array[2, 3] #=> [3, 4, 5] # Reverse an Array -# array = [1,2,3] -array.reverse #=> [3,2,1] +a=[1,2,3] +a[::-1] #=> [3,2,1] # Or with a range array[1..3] #=> [2, 3, 4] From 0beb78ac436d232ce73986848f354fc4e7210dfb Mon Sep 17 00:00:00 2001 From: Chashmeet Singh Date: Mon, 5 Oct 2015 20:32:00 +0530 Subject: [PATCH 091/685] Reverse an array --- ruby.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby.html.markdown b/ruby.html.markdown index b6d0e44d..8f23b2e6 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -170,7 +170,7 @@ array[2, 3] #=> [3, 4, 5] # Reverse an Array a=[1,2,3] -a[::-1] #=> [3,2,1] +a.reverse! #=> [3,2,1] # Or with a range array[1..3] #=> [2, 3, 4] From e1abb317dd2526a7352b59c20f9cd37c1a369f55 Mon Sep 17 00:00:00 2001 From: Chashmeet Singh Date: Mon, 5 Oct 2015 20:44:43 +0530 Subject: [PATCH 092/685] String to list characters --- ru-ru/python-ru.html.markdown | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/ru-ru/python-ru.html.markdown b/ru-ru/python-ru.html.markdown index ec4fff41..699d1393 100644 --- a/ru-ru/python-ru.html.markdown +++ b/ru-ru/python-ru.html.markdown @@ -167,6 +167,10 @@ li = [] # Можно сразу начать с заполненного списка other_li = [4, 5, 6] +#Строка в список +a="adambard" +list(a) #=> ['a','d','a','m','b','a','r','d'] + # Объекты добавляются в конец списка методом append li.append(1) # [1] li.append(2) # [1, 2] @@ -238,16 +242,6 @@ d, e, f = 4, 5, 6 # Обратите внимание, как легко поменять местами значения двух переменных e, d = d, e # теперь d == 5, а e == 4 -#принять ввод чисел в одной строке -#если вход 1 2 3 -input = map(int,raw_input().split()) #целое число - -input #=>[1, 2, 3] - -input = map(str,raw_input().split()) #строка - -input #=>['1', '2', '3'] - # Словари содержат ассоциативные массивы empty_dict = {} # Вот так описывается предзаполненный словарь From 62c6f95e9d161967cfffa43a3f9b3f8d73e2ef5f Mon Sep 17 00:00:00 2001 From: Sean Corrales Date: Mon, 5 Oct 2015 10:51:27 -0500 Subject: [PATCH 093/685] Initial work on learn Sass file. --- sass.html.markdown | 234 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 sass.html.markdown diff --git a/sass.html.markdown b/sass.html.markdown new file mode 100644 index 00000000..35af1e67 --- /dev/null +++ b/sass.html.markdown @@ -0,0 +1,234 @@ +--- +language: sass +contributors: + - ["Sean Corrales", "https://github.com/droidenator"] +filename: learnsass.scss +--- + +Sass is a CSS pre-processor. It adds several features that plain +CSS lacks such as variables, mixins, basic math, and inheritance. + +Initially, Sass was written using spacing and indention instead +of brackets and semi-colons; these files use the extension '.sass'. +Sass was later revised to use brackets and semi-colons and become +a superset of CSS3. This new version uses the extension ".scss". +Using ".scss" means that any valid CSS3 file can be converted to +Sass by simply changing the file extension to '.scss'. + +If you're already familiar with CSS3, you'll be able to pick up Sass +relatively quickly. It does not provide any new styling options but rather +the tools to write your CSS more efficiently and make maintenance much +easier. + +Sass files must be compiled into CSS. You can use any number of commandline +tools to compile Sass into CSS. Many IDEs also offer Sass compilation, as well. + + +```sass +/* Like CSS, Sass uses slash-asterisk to denote comments */ + +/* #################### + ## VARIABLES + #################### */ + +/* Sass allows you to define variables that can be used throughout + your stylesheets. Variables are defined by placing a '$' in front + of a string. Many users like to keep their variables in a single file */ +$primary-color: #0000ff; +$headline-size: 24px; + +/* Variables can be used in any CSS declaration. This allows you to change + a single value in one place. */ +a { + color: $primary-color; +} + +h1 { + color: $primary-color; + font-size: $headline-size; +} + +/* After compiling the Sass files into CSS, you'll have the following code + in your generated CSS file */ + +a { + color: #0000ff; +} + +h1 { + color: #0000ff; + font-size: 24px; +} + +/* #################### + ## NESTING + #################### */ + +/* Nesting allows you to easily group together statements and nest them + in a way that indicates their hierarchy */ +article { + font-size: 14px; + + a { + text-decoration: underline; + } + + ul { + list-style-type: disc; + + li { + text-indent: 3em; + } + } + + pre, img { + display: inline-block; + float: left; + } +} + +/* The above will compile into the following CSS */ +article { + font-size: 14px; +} + +article a { + text-decoration: underline; +} + +article ul { + list-style-type: disc; +} + +article ul li { + text-indent: 3em; +} + +article pre, +article img { + display: inline-block; + float: left; +} + +/* It is recommended to not nest too deeply as this can cause issues with + specificity and make your CSS harder to work with and maintain. Best practices + recommend going no more than 3 levels deep when nesting. */ + +/* #################### + ## MIXINS + #################### */ +/* Mixins allow you to define reusable chunks of CSS. They can take one or more + arguments to allow you to make reusable pieces of styling. */ +@mixin form-button($color, $size, $border-radius) { + color: $color; + font-size: $size; + border-radius: $border-radius; +} + +/* Mixins are invoked within a CSS declaration. */ +.user-form .submit { + @include form-button(#0000ff, 16px, 4px); + margin: 10px; +} + +/* The above mixin will compile into the following css */ +.user-form .submit { + color: #0000ff; + font-size: 16px; + border-radius: 4px; + margin: 10px; +} + +/* #################### + ## EXTEND/INHERITANCE + #################### */ + +/* #################### + ## MATH OPERATIONS + #################### */ + +``` + +## Usage + +Save any CSS you want in a file with extension `.css`. + +```xml + + + + + + + +
+
+ +``` + +## Precedence + +As you noticed an element may be targetted by more than one selector. +and may have a property set on it in more than one. +In these cases, one of the rules takes precedence over others. + +Given the following CSS: + +```css +/*A*/ +p.class1[attr='value'] + +/*B*/ +p.class1 {} + +/*C*/ +p.class2 {} + +/*D*/ +p {} + +/*E*/ +p { property: value !important; } + +``` + +and the following markup: + +```xml +

+

+``` + +The precedence of style is as followed: +Remember, the precedence is for each **property**, not for the entire block. + +* `E` has the highest precedence because of the keyword `!important`. + It is recommended to avoid this unless it is strictly necessary to use. +* `F` is next, because it is inline style. +* `A` is next, because it is more "specific" than anything else. + more specific = more specifiers. here 3 specifiers: 1 tagname `p` + + class name `class1` + 1 attribute `attr='value'` +* `C` is next. although it has the same specificness as `B` + but it appears last. +* Then is `B` +* and lastly is `D`. + +## Compatibility + +Most of the features in CSS2 (and gradually in CSS3) are compatible across +all browsers and devices. But it's always vital to have in mind the compatibility +of what you use in CSS with your target browsers. + +[QuirksMode CSS](http://www.quirksmode.org/css/) is one of the best sources for this. + +To run a quick compatibility check, [CanIUse](http://caniuse.com) is a great resource. + +## Further Reading + +* [Understanding Style Precedence in CSS: Specificity, Inheritance, and the Cascade](http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/) +* [QuirksMode CSS](http://www.quirksmode.org/css/) +* [Z-Index - The stacking context](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Understanding_z_index/The_stacking_context) From 1d43bd50c3e9305abfe95eade590ef5828f9ad5c Mon Sep 17 00:00:00 2001 From: wboka Date: Mon, 5 Oct 2015 12:29:08 -0400 Subject: [PATCH 094/685] Initial placeholder --- coldfusion.html.markdown | 1 + 1 file changed, 1 insertion(+) create mode 100644 coldfusion.html.markdown diff --git a/coldfusion.html.markdown b/coldfusion.html.markdown new file mode 100644 index 00000000..3c0b0b06 --- /dev/null +++ b/coldfusion.html.markdown @@ -0,0 +1 @@ +Coming soon From 8b456426407997fdbb8a0befb4181a513e585231 Mon Sep 17 00:00:00 2001 From: Per Lilja Date: Mon, 5 Oct 2015 20:29:05 +0200 Subject: [PATCH 095/685] Added description for Double Brace Initialization --- java.html.markdown | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/java.html.markdown b/java.html.markdown index e4234a39..b4757962 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -325,6 +325,33 @@ public class LearnJava { // toString returns this Object's string representation. System.out.println("trek info: " + trek.toString()); + + // Double Brace Initialization + // The Java Language has no syntax for how to create static Collections + // in an easy way. Usually you end up in the following way: + + private static final Set COUNTRIES = new HashSet(); + static { + validCodes.add("DENMARK"); + validCodes.add("SWEDEN"); + validCodes.add("FINLAND"); + } + + // But there's a nifty way to achive the same thing in an + // easier way, buy using something that is called Double Brace + // Initialization. + + private static final Set COUNTRIES = HashSet() {{ + add("DENMARK"); + add("SWEDEN"); + add("FINLAND"); + }} + + // The first brace is creating an new AnonymousInnerClass and the + // second one declares and instance initializer block. This block + // is called with the anonymous inner class is created. + // This does not only work for Collections, it works for all + // non-final classes. } // End main method } // End LearnJava class From 1bc457737577a01af47a8be5879904dd23bcc410 Mon Sep 17 00:00:00 2001 From: Sean Corrales Date: Mon, 5 Oct 2015 13:52:53 -0500 Subject: [PATCH 096/685] Finishing up documentation for additional Sass functionality. Removing CSS specific instructions from usage, compatibility, and further reading sections. --- sass.html.markdown | 322 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 243 insertions(+), 79 deletions(-) diff --git a/sass.html.markdown b/sass.html.markdown index 35af1e67..d1e0721f 100644 --- a/sass.html.markdown +++ b/sass.html.markdown @@ -25,7 +25,11 @@ tools to compile Sass into CSS. Many IDEs also offer Sass compilation, as well. ```sass -/* Like CSS, Sass uses slash-asterisk to denote comments */ +/* Like CSS, Sass uses slash-asterisk to denote comments. Slash-asterisk comments + can span multiple lines. These comments will appear in your compiled CSS */ + +// Sass also supports single line comments that use double slashes. These comments will +// not be rendered in your compiled CSS /* #################### ## VARIABLES @@ -113,12 +117,52 @@ article img { /* It is recommended to not nest too deeply as this can cause issues with specificity and make your CSS harder to work with and maintain. Best practices recommend going no more than 3 levels deep when nesting. */ + +/* ############################### + ## REFERENCE PARENT SELECTORS + ############################### */ + +/* Reference parent selectors are used when you're nesting statements and want to + reference the parent selector from within the nested statements. You can reference + a parent using & */ + +a { + text-decoration: none; + color: #ff0000; + + &:hover { + text-decoration: underline; + } + + body.noLinks & { + display: none; + } +} + +/* The above Sass will compile into the CSS below */ + +a { + text-decoration: none; + color: #ff0000; +} + +a:hover { + text-decoration: underline; +} + +body.noLinks a { + display: none; +} + /* #################### ## MIXINS #################### */ + /* Mixins allow you to define reusable chunks of CSS. They can take one or more - arguments to allow you to make reusable pieces of styling. */ + arguments to allow you to make reusable pieces of styling. Mixins can also + be very helpful when dealing with vendor prefixes. */ + @mixin form-button($color, $size, $border-radius) { color: $color; font-size: $size; @@ -126,109 +170,229 @@ article img { } /* Mixins are invoked within a CSS declaration. */ + .user-form .submit { @include form-button(#0000ff, 16px, 4px); - margin: 10px; } /* The above mixin will compile into the following css */ + .user-form .submit { color: #0000ff; font-size: 16px; border-radius: 4px; - margin: 10px; +} + +/* #################### + ## FUNCTIONS + #################### */ + +/* Sass provides functions that can be used to accomplish a variety of tasks. Consider the following */ + +body { + width: round(10.25px); +} + +.footer { + background-color: fade_out(#000000, 0.25) +} + +/* The above Sass will compile into the following CSS */ + +body { + width: 10px; +} + +.footer { + background-color: rgba(0, 0, 0, 0.75); +} + +/* You may also define your own functions. Functions are very similar to mixins. When trying to choose between + a function or a mixin, remember that functions are best for returning values while mixins are best for + generating CSS while functions are better for logic that might be used throughout your Sass code. The + examples in the Math Operators' section are ideal candidates for becoming a reusable function. */ + +/* This function will take a target size and the parent size and calculate and return the percentage */ + +@function calculate-percentage($target-size, $parent-size) { + @return $target-size / $parent-size * 100%; +} + +/* Functions can be invoked by using their name and passing in the required arguments */ + +$main-content: calculate-percentage(600px, 960px); + +.main-content { + width: $main-content; +} + +.sidebar { + width: calculate-percentage(300px, 960px); +} + +/* The above Sass will compile into the following CSS */ + +.main-content { + width: 62.5%; +} + +.sidebar { + width: 31.25%; } /* #################### ## EXTEND/INHERITANCE #################### */ + +/* Sass allows you to extend an existing CSS statement. This makes it + very easy to write CSS that does not violate DRY principles. Any + CSS statement can be extended */ + +.content-window { + font-size: 14px; + padding: 10px; + color: #000; + border-radius: 4px; +} + +.message-window { + @extend .content-window; + background-color: #0000ff; +} + +.notification-window { + @extend .content-window; + background-color: #ff0000; +} + +.settings-window { + @extend .content-window; + background-color: #ccc; +} + +/* The above Sass will be compile into the following CSS */ + +.content-window, +.message-window, +.notification-window, +.settings-window { + font-size: 14px; + padding: 10px; + color: #000; + border-radius: 4px; +} + +.message-window { + background-color: #0000ff; +} + +.notification-window { + background-color: #ff0000; +} + +.settings-window { + background-color: #ccc; +} + +/* Extending a CSS statement is preferable to creating a mixin + because of the way it groups together the classes that all share + the same base styling. If this was done with a mixin, the font-size, + padding, color, and border-radius would be duplicated for each statement + that called the mixin. While it won't affect your workflow, it will + add unnecessary bloat to the files created by the Sass compiler. */ + +/* ######################### + ## PLACEHOLDER SELECTORS + ######################### */ + +/* Placeholders are useful when creating a CSS statement to extend. If you wanted to create + a CSS statement that was exclusively used with @extend, you can do so using a placeholder. + Placeholders begin with a '%' instead of '.' or '#'. Placeholders will not appear in the + compiled CSS. */ + +%content-window { + font-size: 14px; + padding: 10px; + color: #000; + border-radius: 4px; +} + +.message-window { + @extend %content-window; + background-color: #0000ff; +} + +/* The above Sass would compile to the following CSS */ + +.message-window { + font-size: 14px; + padding: 10px; + color: #000; + border-radius: 4px; +} + +.message-window { + background-color: #0000ff; +} /* #################### ## MATH OPERATIONS #################### */ +/* Sass provides the following operators: +, -, *, /, and %. These can + be useful for calculating values directly in your Sass files instead + of using values that you've already calculated by hand. Below is an example + of a setting up a simple two column design. */ + +$content-area: 960px; +$main-content: 600px; +$sidebar-content: 300px; + +$main-size: $main-content / $content-area * 100%; +$sidebar-size: $sidebar-content / $content-area * 100%; +$gutter: 100% - ($main-size + $sidebar-size); + +body { + width: 100%; +} + +.main-content { + width: $main-size; +} + +.sidebar { + width: $sidebar-size; +} + +.gutter { + width: $gutter; +} + +/* The above Sass would compile to the CSS below */ + +body { + width: 100%; +} + +.main-content { + width: 62.5%; +} + +.sidebar { + width: 31.25%; +} + +.gutter { + width: 6.25%; +} + ``` ## Usage -Save any CSS you want in a file with extension `.css`. -```xml - - - - - - - -
-
- -``` - -## Precedence - -As you noticed an element may be targetted by more than one selector. -and may have a property set on it in more than one. -In these cases, one of the rules takes precedence over others. - -Given the following CSS: - -```css -/*A*/ -p.class1[attr='value'] - -/*B*/ -p.class1 {} - -/*C*/ -p.class2 {} - -/*D*/ -p {} - -/*E*/ -p { property: value !important; } - -``` - -and the following markup: - -```xml -

-

-``` - -The precedence of style is as followed: -Remember, the precedence is for each **property**, not for the entire block. - -* `E` has the highest precedence because of the keyword `!important`. - It is recommended to avoid this unless it is strictly necessary to use. -* `F` is next, because it is inline style. -* `A` is next, because it is more "specific" than anything else. - more specific = more specifiers. here 3 specifiers: 1 tagname `p` + - class name `class1` + 1 attribute `attr='value'` -* `C` is next. although it has the same specificness as `B` - but it appears last. -* Then is `B` -* and lastly is `D`. ## Compatibility -Most of the features in CSS2 (and gradually in CSS3) are compatible across -all browsers and devices. But it's always vital to have in mind the compatibility -of what you use in CSS with your target browsers. - -[QuirksMode CSS](http://www.quirksmode.org/css/) is one of the best sources for this. - -To run a quick compatibility check, [CanIUse](http://caniuse.com) is a great resource. ## Further Reading - -* [Understanding Style Precedence in CSS: Specificity, Inheritance, and the Cascade](http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/) -* [QuirksMode CSS](http://www.quirksmode.org/css/) -* [Z-Index - The stacking context](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Understanding_z_index/The_stacking_context) From 6611db502aafc9768254efb45495a9fb20a79c81 Mon Sep 17 00:00:00 2001 From: Ayush Date: Tue, 6 Oct 2015 00:44:05 +0530 Subject: [PATCH 097/685] Git: removed some clutter --- git.html.markdown | 68 ++++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/git.html.markdown b/git.html.markdown index bf8fce0c..3b83218c 100644 --- a/git.html.markdown +++ b/git.html.markdown @@ -8,17 +8,17 @@ contributors: filename: LearnGit.txt --- -Git is a distributed version control and source code management system. +Git is a distributed version control and source code management system. -It does this through a series of snapshots of your project, and it works -with those snapshots to provide you with functionality to version and +It does this through a series of snapshots of your project, and it works +with those snapshots to provide you with functionality to version and manage your source code. ## Versioning Concepts ### What is version control? -Version control is a system that records changes to a file, or set of files, over time. +Version control is a system that records changes to a file(s), over time. ### Centralized Versioning VS Distributed Versioning @@ -42,8 +42,9 @@ Version control is a system that records changes to a file, or set of files, ove ### Repository -A set of files, directories, historical records, commits, and heads. Imagine it as a source code data structure, -with the attribute that each source code "element" gives you access to its revision history, among other things. +A set of files, directories, historical records, commits, and heads. Imagine it +as a source code data structure, with the attribute that each source code +"element" gives you access to its revision history, among other things. A git repository is comprised of the .git directory & working tree. @@ -54,32 +55,33 @@ The .git directory contains all the configurations, logs, branches, HEAD, and mo ### Working Tree (component of repository) -This is basically the directories and files in your repository. It is often referred to -as your working directory. +This is basically the directories and files in your repository. It is often +referred to as your working directory. ### Index (component of .git dir) The Index is the staging area in git. It's basically a layer that separates your working tree -from the Git repository. This gives developers more power over what gets sent to the Git -repository. +from the Git repository. This gives developers more power over what gets sent +to the Git repository. ### Commit -A git commit is a snapshot of a set of changes, or manipulations to your Working Tree. -For example, if you added 5 files, and removed 2 others, these changes will be contained -in a commit (or snapshot). This commit can then be pushed to other repositories, or not! +A git commit is a snapshot of a set of changes, or manipulations to your Working +Tree. For example, if you added 5 files, and removed 2 others, these changes +will be contained in a commit (or snapshot). This commit can then be pushed to +other repositories, or not! ### Branch -A branch is essentially a pointer that points to the last commit you made. As you commit, -this pointer will automatically update and point to the latest commit. +A branch is essentially a pointer to the last commit you made. As you go on +committing, this pointer will automatically update to ooint the latest commit. ### HEAD and head (component of .git dir) HEAD is a pointer that points to the current branch. A repository only has 1 *active* HEAD. head is a pointer that points to any commit. A repository can have any number of heads. -###Stages of Git +### Stages of Git * Modified - Changes have been made to a file but file has not been committed to Git Database yet * Staged - Marks a modified file to go into your next commit snapshot * Committed - Files have been committed to the Git Database @@ -95,7 +97,7 @@ head is a pointer that points to any commit. A repository can have any number of ### init -Create an empty Git repository. The Git repository's settings, stored information, +Create an empty Git repository. The Git repository's settings, stored information, and more is stored in a directory (a folder) named ".git". ```bash @@ -144,8 +146,8 @@ $ git init --help ### status -To show differences between the index file (basically your working copy/repo) and the current -HEAD commit. +To show differences between the index file (basically your working copy/repo) +and the current HEAD commit. ```bash @@ -172,7 +174,8 @@ $ git add /path/to/file/HelloWorld.c $ git add ./*.java ``` -This only adds a file to the staging area/index, it doesn't commit it to the working directory/repo. +This only adds a file to the staging area/index, it doesn't commit it to the +working directory/repo. ### branch @@ -205,7 +208,8 @@ Updates all files in the working tree to match the version in the index, or spec $ git checkout # Checkout a specified branch $ git checkout branchName -# Create a new branch & switch to it, like: "git branch ; git checkout " +# Create a new branch & switch to it +# equivalent to "git branch ; git checkout " $ git checkout -b newBranch ``` @@ -268,7 +272,7 @@ $ git config --global alias.g "grep --break --heading --line-number" $ git grep 'variableName' -- '*.java' # Search for a line that contains "arrayListName" and, "add" or "remove" -$ git grep -e 'arrayListName' --and \( -e add -e remove \) +$ git grep -e 'arrayListName' --and \( -e add -e remove \) ``` Google is your friend; for more examples @@ -303,7 +307,7 @@ $ git merge --no-ff branchName ### mv -Rename or move a file +Rename or move a file ```bash # Renaming a file @@ -338,7 +342,7 @@ $ git pull origin master --rebase Push and merge changes from a branch to a remote & branch. ```bash -# Push and merge changes from a local repo to a +# Push and merge changes from a local repo to a # remote named "origin" and "master" branch. # git push # git push => implicitly defaults to => git push origin master @@ -347,23 +351,25 @@ $ git push origin master # To link up current local branch with a remote branch, add -u flag: $ git push -u origin master # Now, anytime you want to push from that same local branch, use shortcut: -$ git push +$ git push ``` ### stash -Stashing takes the dirty state of your working directory and saves it on a stack of unfinished changes that you can reapply at any time. +Stashing takes the dirty state of your working directory and saves it on a stack +of unfinished changes that you can reapply at any time. -Let's say you've been doing some work in your git repo, but you want to pull from the remote. -Since you have dirty (uncommited) changes to some files, you are not able to run `git pull`. -Instead, you can run `git stash` to save your changes onto a stack! +Let's say you've been doing some work in your git repo, but you want to pull +from the remote. Since you have dirty (uncommited) changes to some files, you +are not able to run `git pull`. Instead, you can run `git stash` to save your +changes onto a stack! ```bash $ git stash Saved working directory and index state \ "WIP on master: 049d078 added the index file" HEAD is now at 049d078 added the index file - (To restore them type "git stash apply") + (To restore them type "git stash apply") ``` Now you can pull! @@ -410,7 +416,7 @@ Now you're ready to get back to work on your stuff! [Additional Reading.](http://git-scm.com/book/en/v1/Git-Tools-Stashing) -### rebase (caution) +### rebase (caution) Take all changes that were committed on one branch, and replay them onto another branch. *Do not rebase commits that you have pushed to a public repo*. From 7b7ce666b66e897c115879d505104330923919ec Mon Sep 17 00:00:00 2001 From: Ayush Date: Tue, 6 Oct 2015 00:45:40 +0530 Subject: [PATCH 098/685] Git: added para for gitignore --- git.html.markdown | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/git.html.markdown b/git.html.markdown index 3b83218c..c32d9c5d 100644 --- a/git.html.markdown +++ b/git.html.markdown @@ -144,6 +144,16 @@ $ git commit --help $ git init --help ``` +### ignore (set of) files + +To intentionally untrack file(s) & folder(s) from git. Typically meant for +private & temp files which would otherwise be shared in the repository. +```bash +$ echo "temp/" >> .gitignore +$ echo "private_key" >> .gitignore +``` + + ### status To show differences between the index file (basically your working copy/repo) From 037ff22ef63c5f37b6657e806695bb52f46a7ec3 Mon Sep 17 00:00:00 2001 From: Ayush Date: Tue, 6 Oct 2015 00:46:53 +0530 Subject: [PATCH 099/685] Git: added more clone options --- git.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/git.html.markdown b/git.html.markdown index c32d9c5d..66b890c1 100644 --- a/git.html.markdown +++ b/git.html.markdown @@ -232,6 +232,10 @@ to a remote branch. ```bash # Clone learnxinyminutes-docs $ git clone https://github.com/adambard/learnxinyminutes-docs.git +# shallow clone - faster cloning that pulls only latest snapshot +$ git clone --depth 1 https://github.com/adambard/learnxinyminutes-docs.git +# clone only a specific branch +$ git clone -b master-cn https://github.com/adambard/learnxinyminutes-docs.git --single-branch ``` ### commit From e75a9e031bde60fae2c1972b5f6b18571acd4d99 Mon Sep 17 00:00:00 2001 From: Ayush Date: Tue, 6 Oct 2015 00:56:08 +0530 Subject: [PATCH 100/685] Git: added few random things --- git.html.markdown | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/git.html.markdown b/git.html.markdown index 66b890c1..e20a4b88 100644 --- a/git.html.markdown +++ b/git.html.markdown @@ -106,15 +106,12 @@ $ git init ### config -To configure settings. Whether it be for the repository, the system itself, or global -configurations. +To configure settings. Whether it be for the repository, the system itself, +or global configurations ( global config file is `~/.gitconfig` ). ```bash # Print & Set Some Basic Config Variables (Global) -$ git config --global user.email -$ git config --global user.name - $ git config --global user.email "MyEmail@Zoho.com" $ git config --global user.name "My Name" ``` @@ -249,6 +246,9 @@ $ git commit -m "Added multiplyNumbers() function to HelloWorld.c" # automatically stage modified or deleted files, except new files, and then commit $ git commit -a -m "Modified foo.php and removed bar.php" + +# change last commit (this deletes previous commit with a fresh commit) +$ git commit --amend -m "Correct message" ``` ### diff @@ -300,8 +300,8 @@ Display commits to the repository. # Show all commits $ git log -# Show X number of commits -$ git log -n 10 +# Show only commit message & ref +$ git log --oneline # Show merge commits only $ git log --merges From ab2ef777e2c73699a864e5c4869b285f3443c3f4 Mon Sep 17 00:00:00 2001 From: Rodrigo Muniz Date: Mon, 5 Oct 2015 16:34:58 -0300 Subject: [PATCH 101/685] Corrigidos erros de ortografia --- pt-br/brainfuck-pt.html.markdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pt-br/brainfuck-pt.html.markdown b/pt-br/brainfuck-pt.html.markdown index c7ce55ee..9e4b458d 100644 --- a/pt-br/brainfuck-pt.html.markdown +++ b/pt-br/brainfuck-pt.html.markdown @@ -5,10 +5,11 @@ contributors: - ["Mathias Bynens", "http://mathiasbynens.be/"] translators: - ["Suzane Sant Ana", "http://github.com/suuuzi"] + - ["Rodrigo Muniz", "http://github.com/muniz95"] lang: pt-br --- -Brainfuck (em letras minúsculas, eceto no início de frases) é uma linguagem de +Brainfuck (em letras minúsculas, exceto no início de frases) é uma linguagem de programação Turing-completa extremamente simples com apenas 8 comandos. ``` @@ -18,7 +19,7 @@ Brainfuck é representado por um vetor com 30 000 células inicializadas em zero e um ponteiro de dados que aponta para a célula atual. Existem 8 comandos: -+ : Incrementa o vaor da célula atual em 1. ++ : Incrementa o valor da célula atual em 1. - : Decrementa o valor da célula atual em 1. > : Move o ponteiro de dados para a célula seguinte (célula à direita). < : Move o ponteiro de dados para a célula anterior (célula à esquerda). From 9e605ee35ced12a77f0c0c666c0019d40eaaeea6 Mon Sep 17 00:00:00 2001 From: Ayush Date: Tue, 6 Oct 2015 01:06:15 +0530 Subject: [PATCH 102/685] Git: fixed typo --- git.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git.html.markdown b/git.html.markdown index e20a4b88..b1347309 100644 --- a/git.html.markdown +++ b/git.html.markdown @@ -74,7 +74,7 @@ other repositories, or not! ### Branch A branch is essentially a pointer to the last commit you made. As you go on -committing, this pointer will automatically update to ooint the latest commit. +committing, this pointer will automatically update to point the latest commit. ### HEAD and head (component of .git dir) @@ -141,7 +141,7 @@ $ git commit --help $ git init --help ``` -### ignore (set of) files +### ignore files To intentionally untrack file(s) & folder(s) from git. Typically meant for private & temp files which would otherwise be shared in the repository. From e848adf9d53e8af5863497438753d704d30f7c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerson=20L=C3=A1zaro?= Date: Mon, 5 Oct 2015 15:20:35 -0500 Subject: [PATCH 103/685] Fix for issue #1248 [fa-ir, zh-cn, ko-kr, es-es, ru-ru, fr-fr, de-de] --- de-de/javascript-de.html.markdown | 3 --- es-es/javascript-es.html.markdown | 3 --- fa-ir/javascript.html.markdown | 3 --- fr-fr/javascript-fr.html.markdown | 3 --- ko-kr/javascript-kr.html.markdown | 3 --- ru-ru/javascript-ru.html.markdown | 3 --- zh-cn/javascript-cn.html.markdown | 3 --- 7 files changed, 21 deletions(-) diff --git a/de-de/javascript-de.html.markdown b/de-de/javascript-de.html.markdown index a295c1c2..f3917506 100644 --- a/de-de/javascript-de.html.markdown +++ b/de-de/javascript-de.html.markdown @@ -479,9 +479,6 @@ myNumber === myNumberObj; // = false if (0){ // Dieser Teil wird nicht ausgeführt, weil 0 'falsy' ist. } -if (Number(0)){ - // Dieser Teil des Codes wird ausgeführt, weil Number(0) zu wahr evaluiert. -} // Das Wrapper-Objekt und die regulären, eingebauten Typen, teilen sich einen // Prototyp; so ist es möglich zum Beispiel einem String weitere Funktionen diff --git a/es-es/javascript-es.html.markdown b/es-es/javascript-es.html.markdown index fd01e7b9..036d7082 100644 --- a/es-es/javascript-es.html.markdown +++ b/es-es/javascript-es.html.markdown @@ -478,9 +478,6 @@ miNumero === miNumeroObjeyo; // = false if (0){ // Este código no se ejecutara porque 0 es false. } -if (Number(0)){ - // Este código sí se ejecutara, puesto que Number(0) es true. -} // Aún así, los objetos que envuelven y los prototipos por defecto comparten // un prototipo. así que puedes agregar funcionalidades a un string de la diff --git a/fa-ir/javascript.html.markdown b/fa-ir/javascript.html.markdown index 5c64d24a..fe3555af 100644 --- a/fa-ir/javascript.html.markdown +++ b/fa-ir/javascript.html.markdown @@ -499,9 +499,6 @@ myNumber === myNumberObj; // = false if (0){ // This code won't execute, because 0 is falsy. } -if (Number(0)){ - // This code *will* execute, because Number(0) is truthy. -} ``` diff --git a/fr-fr/javascript-fr.html.markdown b/fr-fr/javascript-fr.html.markdown index 2e18d0be..15478cdb 100644 --- a/fr-fr/javascript-fr.html.markdown +++ b/fr-fr/javascript-fr.html.markdown @@ -469,9 +469,6 @@ myNumber === myNumberObj; // = false if (0){ // 0 est falsy, le code ne fonctionnera pas. } -if (Number(0)){ - // Parce que Number(0) est truthy, le code fonctionnera -} // Cependant, vous pouvez ajouter des fonctionnalités aux types de bases grâce à // cette particularité. diff --git a/ko-kr/javascript-kr.html.markdown b/ko-kr/javascript-kr.html.markdown index 4ca3bb5c..9561e80c 100644 --- a/ko-kr/javascript-kr.html.markdown +++ b/ko-kr/javascript-kr.html.markdown @@ -387,9 +387,6 @@ myNumber === myNumberObj // = false if (0){ // 0은 거짓이라서 이 코드는 실행되지 않습니다. } -if (Number(0)){ - // Number(0)은 참이라서 이 코드는 *실행됩니다*. -} // 하지만 래퍼 객체와 일반 내장 함수는 프로토타입을 공유하기 때문에 // 가령 문자열에 실제로 기능을 추가할 수 있습니다. diff --git a/ru-ru/javascript-ru.html.markdown b/ru-ru/javascript-ru.html.markdown index 79844565..8655ae4a 100644 --- a/ru-ru/javascript-ru.html.markdown +++ b/ru-ru/javascript-ru.html.markdown @@ -470,9 +470,6 @@ myNumber === myNumberObj; // = false if (0) { // Этот код не выполнится, потому что 0 - это ложь. } -if (Number(0)) { - // Этот код *выполнится*, потому что Number(0) истинно. -} // Впрочем, объекты-обёртки и встроенные типы имеют общие прототипы, // поэтому вы можете расширить функционал строк, например: diff --git a/zh-cn/javascript-cn.html.markdown b/zh-cn/javascript-cn.html.markdown index dfeb2012..bdef0099 100644 --- a/zh-cn/javascript-cn.html.markdown +++ b/zh-cn/javascript-cn.html.markdown @@ -447,9 +447,6 @@ myNumber === myNumberObj; // = false if (0){ // 这段代码不会执行,因为0代表假 } -if (Number(0)){ - // 这段代码*会*执行,因为Number(0)代表真 -} // 不过,包装类型和内置类型共享一个原型, // 所以你实际可以给内置类型也增加一些功能,例如对string: From 9d33f091701013236055b553d7eb7a8dba3df65e Mon Sep 17 00:00:00 2001 From: wboka Date: Mon, 5 Oct 2015 16:52:07 -0400 Subject: [PATCH 104/685] Update coldfusion.html.markdown Adds variable declaration, comparison operators, and if/else control structures --- coldfusion.html.markdown | 395 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 394 insertions(+), 1 deletion(-) diff --git a/coldfusion.html.markdown b/coldfusion.html.markdown index 3c0b0b06..4c734920 100644 --- a/coldfusion.html.markdown +++ b/coldfusion.html.markdown @@ -1 +1,394 @@ -Coming soon +--- +language: ColdFusion +contributors: + - ["Wayne Boka", "http://wboka.github.io"] +filename: LearnColdFusion.cfm +--- + +ColdFusion is a scripting language for web development. +[Read more here.](http://www.adobe.com/products/coldfusion-family.html) + +```ColdFusion +" ---> + + + + + + + + + + +#myVariable# +#myNumber# + + + + + + + + + + + + + +#1 + 1# = 2 +#10 - 8# = 2 +#1 * 2# = 2 +#10 / 5# = 2 +#12 % 5# = 0 + + +#1 eq 1# +#15 neq 1# +#10 gt 8# +#1 lt 2# +#10 gte 5# +#1 lte 5# + + + + + #myCondition# + + #myCondition#. Proceed Carefully!!! + + myCondition is unknown + +``` + + +## Further Reading + +The links provided here below are just to get an understanding of the topic, feel free to Google and find specific examples. From 1e7f639755042211ce0f10953153d6d341dbecab Mon Sep 17 00:00:00 2001 From: wboka Date: Mon, 5 Oct 2015 16:52:47 -0400 Subject: [PATCH 105/685] Update coldfusion.html.markdown Fixes a typo --- coldfusion.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coldfusion.html.markdown b/coldfusion.html.markdown index 4c734920..be08733e 100644 --- a/coldfusion.html.markdown +++ b/coldfusion.html.markdown @@ -26,7 +26,7 @@ ColdFusion is a scripting language for web development. #myVariable# -#myNumber# +#myNumber# From 8d57b90efe51c980d63abae4b5537631fb2f2eab Mon Sep 17 00:00:00 2001 From: Mariane Siqueira Machado Date: Mon, 5 Oct 2015 17:59:30 -0300 Subject: [PATCH 106/685] Translates another line --- pt-br/swift-pt.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt-br/swift-pt.html.markdown b/pt-br/swift-pt.html.markdown index 72a57e4a..e840b8cf 100644 --- a/pt-br/swift-pt.html.markdown +++ b/pt-br/swift-pt.html.markdown @@ -221,7 +221,7 @@ println("Gas price: \(price)") // Número variável de argumentos func setup(numbers: Int...) { - // its an array + // é um array let number = numbers[0] let argCount = numbers.count } From c7c9ea674dbe3af1e2e1c09cffb36a40c6553e80 Mon Sep 17 00:00:00 2001 From: Chashmeet Singh Date: Tue, 6 Oct 2015 05:38:40 +0530 Subject: [PATCH 107/685] Update python-ru.html.markdown --- ru-ru/python-ru.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ru-ru/python-ru.html.markdown b/ru-ru/python-ru.html.markdown index 699d1393..3852a550 100644 --- a/ru-ru/python-ru.html.markdown +++ b/ru-ru/python-ru.html.markdown @@ -167,7 +167,7 @@ li = [] # Можно сразу начать с заполненного списка other_li = [4, 5, 6] -#Строка в список +# строка разделена в список a="adambard" list(a) #=> ['a','d','a','m','b','a','r','d'] From b8ad751cc020c07796832c1689cca7b84970b4e9 Mon Sep 17 00:00:00 2001 From: wboka Date: Mon, 5 Oct 2015 21:07:13 -0400 Subject: [PATCH 108/685] Update coldfusion.html.markdown Adds a few more examples --- coldfusion.html.markdown | 87 +++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 50 deletions(-) diff --git a/coldfusion.html.markdown b/coldfusion.html.markdown index be08733e..b8fe9359 100644 --- a/coldfusion.html.markdown +++ b/coldfusion.html.markdown @@ -10,9 +10,9 @@ ColdFusion is a scripting language for web development. ```ColdFusion " ---> - @@ -25,8 +25,10 @@ ColdFusion is a scripting language for web development. -#myVariable# -#myNumber# +#myVariable#
+#myNumber#
+ +
@@ -40,19 +42,23 @@ ColdFusion is a scripting language for web development. -#1 + 1# = 2 -#10 - 8# = 2 -#1 * 2# = 2 -#10 / 5# = 2 -#12 % 5# = 0 +#1 + 1#
= 2 +#10 - 8#
= 2 +#1 * 2#
= 2 +#10 / 5#
= 2 +#12 % 5#
= 0 + +
-#1 eq 1# -#15 neq 1# -#10 gt 8# -#1 lt 2# -#10 gte 5# -#1 lte 5# +#1 eq 1#
+#15 neq 1#
+#10 gt 8#
+#1 lt 2#
+#10 gte 5#
+#1 lte 5#
+ +
@@ -63,36 +69,17 @@ ColdFusion is a scripting language for web development. myCondition is unknown + +
+ + + + #i#
+
+ +
``` -" ---> - +

Simple Variables

+

Set myVariable to "myValue"

+

Set myNumber to 3.14

-#myVariable#
-#myNumber#
+

Display myVariable: #myVariable#

+

Display myNumber: #myNumber#


+

Complex Variables

+

Set myArray1 to an array of 1 dimension using literal or bracket notation

+

Set myArray2 to an array of 1 dimension using function notation

+

Contents of myArray1

- +

Contents of myArray2

+ -#1 + 1#
= 2 -#10 - 8#
= 2 -#1 * 2#
= 2 -#10 / 5#
= 2 -#12 % 5#
= 0 +

Operators

+

Arithmetic

+

1 + 1 = #1 + 1#

+

10 - 7 = #10 - 7#

+

15 * 10 = #15 * 10#

+

100 / 5 = #100 / 5#

+

120 % 5 = #120 % 5#

+

120 mod 5 = #120 mod 5#


-#1 eq 1#
-#15 neq 1#
-#10 gt 8#
-#1 lt 2#
-#10 gte 5#
-#1 lte 5#
+

Comparison

+

Standard Notation

+

Is 1 eq 1? #1 eq 1#

+

Is 15 neq 1? #15 neq 1#

+

Is 10 gt 8? #10 gt 8#

+

Is 1 lt 2? #1 lt 2#

+

Is 10 gte 5? #10 gte 5#

+

Is 1 lte 5? #1 lte 5#

+ +

Alternative Notation

+

Is 1 == 1? #1 eq 1#

+

Is 15 != 1? #15 neq 1#

+

Is 10 > 8? #10 gt 8#

+

Is 1 < 2? #1 lt 2#

+

Is 10 >= 5? #10 gte 5#

+

Is 1 <= 5? #1 lte 5#


+

Control Structures

+ + +

Condition to test for: "#myCondition#"

+ - #myCondition# + #myCondition#. We're testing. #myCondition#. Proceed Carefully!!! @@ -73,54 +101,53 @@ ColdFusion is a scripting language for web development.
+

Loops

+

For Loop

- #i#
+

Index equals #i#

+
+ +

For Each Loop (Complex Variables)

+ +

Set myArray3 to [5, 15, 99, 45, 100]

+ + + + +

Index equals #i#

+
+ +

Set myArray4 to ["Alpha", "Bravo", "Charlie", "Delta", "Echo"]

+ + + + +

Index equals #s#

+
+ +

Switch Statement

+ +

Set myArray5 to [5, 15, 99, 45, 100]

+ + + + + + +

#i# is a multiple of 5.

+
+ +

#i# is ninety-nine.

+
+ +

#i# is not 5, 15, 45, or 99.

+
+

``` - -
@@ -186,8 +186,8 @@ This has to be avoided as much as you can. --> ## Precedence -As you noticed an element may be targetted by more than one selector. -and may have a property set on it in more than one. +As you noticed an element may be targetted by more than one selector. +and may have a property set on it in more than one. In these cases, one of the rules takes precedence over others. Given the following CSS: @@ -217,24 +217,24 @@ and the following markup:

``` -The precedence of style is as followed: +The precedence of style is as followed: Remember, the precedence is for each **property**, not for the entire block. -* `E` has the highest precedence because of the keyword `!important`. +* `E` has the highest precedence because of the keyword `!important`. It is recommended to avoid this unless it is strictly necessary to use. * `F` is next, because it is inline style. -* `A` is next, because it is more "specific" than anything else. - more specific = more specifiers. here 3 specifiers: 1 tagname `p` + +* `A` is next, because it is more "specific" than anything else. + more specific = more specifiers. here 3 specifiers: 1 tagname `p` + class name `class1` + 1 attribute `attr='value'` -* `C` is next. although it has the same specificness as `B` +* `C` is next. although it has the same specificness as `B` but it appears last. * Then is `B` * and lastly is `D`. ## Compatibility -Most of the features in CSS2 (and gradually in CSS3) are compatible across -all browsers and devices. But it's always vital to have in mind the compatibility +Most of the features in CSS2 (and gradually in CSS3) are compatible across +all browsers and devices. But it's always vital to have in mind the compatibility of what you use in CSS with your target browsers. [QuirksMode CSS](http://www.quirksmode.org/css/) is one of the best sources for this. diff --git a/d.html.markdown b/d.html.markdown index daba8020..ba24b60f 100644 --- a/d.html.markdown +++ b/d.html.markdown @@ -1,6 +1,6 @@ --- -language: D -filename: learnd.d +language: D +filename: learnd.d contributors: - ["Nick Papanastasiou", "www.nickpapanastasiou.github.io"] lang: en @@ -18,9 +18,9 @@ void main(string[] args) { } ``` -If you're like me and spend way too much time on the internet, odds are you've heard +If you're like me and spend way too much time on the internet, odds are you've heard about [D](http://dlang.org/). The D programming language is a modern, general-purpose, -multi-paradigm language with support for everything from low-level features to +multi-paradigm language with support for everything from low-level features to expressive high-level abstractions. D is actively developed by Walter Bright and Andrei Alexandrescu, two super smart, really cool @@ -37,7 +37,7 @@ void main() { } auto n = 1; // use auto for type inferred variables - + // Numeric literals can use _ as a digit seperator for clarity while(n < 10_000) { n += n; @@ -49,7 +49,7 @@ void main() { // For and while are nice, but in D-land we prefer foreach // The .. creates a continuous range, excluding the end - foreach(i; 1..1_000_000) { + foreach(i; 1..1_000_000) { if(n % 2 == 0) writeln(i); } @@ -72,12 +72,12 @@ we can use templates to parameterize all of these on both types and values! // Here, T is a type parameter. Think from C++/C#/Java struct LinkedList(T) { T data = null; - LinkedList!(T)* next; // The ! is used to instaniate a parameterized type. Again, think + LinkedList!(T)* next; // The ! is used to instaniate a parameterized type. Again, think } class BinTree(T) { T data = null; - + // If there is only one template parameter, we can omit parens BinTree!T left; BinTree!T right; @@ -101,7 +101,7 @@ alias NumTree = BinTree!double; // We can create function templates as well! T max(T)(T a, T b) { - if(a < b) + if(a < b) return b; return a; @@ -114,7 +114,7 @@ void swap(T)(ref T a, ref T b) { auto temp = a; a = b; - b = temp; + b = temp; } // With templates, we can also parameterize on values, not just types @@ -145,13 +145,13 @@ class MyClass(T, U) { class MyClass(T, U) { T _data; U _other; - + // Constructors are always named `this` this(T t, U u) { data = t; other = u; } - + // getters @property T data() { return _data; @@ -161,7 +161,7 @@ class MyClass(T, U) { return _other; } - // setters + // setters @property void data(T t) { _data = t; } @@ -177,7 +177,7 @@ void main() { mc.data = 7; mc.other = "seven"; - + writeln(mc.data); writeln(mc.other); } @@ -193,7 +193,7 @@ and `override`ing methods. D does inheritance just like Java: Extend one class, implement as many interfaces as you please. We've seen D's OOP facilities, but let's switch gears. D offers -functional programming with first-class functions, `pure` +functional programming with first-class functions, `pure` functions, and immutable data. In addition, all of your favorite functional algorithms (map, filter, reduce and friends) can be found in the wonderful `std.algorithm` module! @@ -205,7 +205,7 @@ import std.range : iota; // builds an end-exclusive range void main() { // We want to print the sum of a list of squares of even ints // from 1 to 100. Easy! - + // Just pass lambda expressions as template parameters! // You can pass any old function you like, but lambdas are convenient here. auto num = iota(1, 101).filter!(x => x % 2 == 0) @@ -216,12 +216,12 @@ void main() { } ``` -Notice how we got to build a nice Haskellian pipeline to compute num? +Notice how we got to build a nice Haskellian pipeline to compute num? That's thanks to a D innovation know as Uniform Function Call Syntax. With UFCS, we can choose whether to write a function call as a method or free function call! Walter wrote a nice article on this -[here.](http://www.drdobbs.com/cpp/uniform-function-call-syntax/232700394) -In short, you can call functions whose first parameter +[here.](http://www.drdobbs.com/cpp/uniform-function-call-syntax/232700394) +In short, you can call functions whose first parameter is of some type A on any expression of type A as a method. I like parallelism. Anyone else like parallelism? Sure you do. Let's do some! diff --git a/dart.html.markdown b/dart.html.markdown index 34d1c6a8..f7601271 100644 --- a/dart.html.markdown +++ b/dart.html.markdown @@ -81,7 +81,7 @@ example5() { // Where classBody can include instance methods and variables, but also // class methods and variables. class Example6Class { - var example6InstanceVariable = "Example6 instance variable"; + var example6InstanceVariable = "Example6 instance variable"; sayIt() { print(example6InstanceVariable); } @@ -92,7 +92,7 @@ example6() { // Class methods and variables are declared with "static" terms. class Example7Class { - static var example7ClassVariable = "Example7 class variable"; + static var example7ClassVariable = "Example7 class variable"; static sayItFromClass() { print(example7ClassVariable); } @@ -111,7 +111,7 @@ example7() { // by default. But arrays and maps are not. They can be made constant by // declaring them "const". var example8A = const ["Example8 const array"], - example8M = const {"someKey": "Example8 const map"}; + example8M = const {"someKey": "Example8 const map"}; example8() { print(example8A[0]); print(example8M["someKey"]); @@ -245,7 +245,7 @@ example18() { // Strings with triple single-quotes or triple double-quotes span // multiple lines and include line delimiters. example19() { - print('''Example19 + print('''Example19 Example19 Don't can't I'm Etc Example19 '''); } @@ -272,7 +272,7 @@ example20() { class Example21 { List _names; Example21() { - _names = ["a", "b"]; + _names = ["a", "b"]; } List get names => _names; set names(List list) { diff --git a/erlang.html.markdown b/erlang.html.markdown index 4e2f1d84..d6ed7b86 100644 --- a/erlang.html.markdown +++ b/erlang.html.markdown @@ -292,7 +292,7 @@ calculateArea() -> _ -> io:format("We can only calculate area of rectangles or circles.") end. - + % Compile the module and create a process that evaluates `calculateArea` in the % shell. c(calculateGeometry). diff --git a/fsharp.html.markdown b/fsharp.html.markdown index 49951c78..62118006 100644 --- a/fsharp.html.markdown +++ b/fsharp.html.markdown @@ -5,7 +5,7 @@ contributors: filename: learnfsharp.fs --- -F# is a general purpose functional/OO programming language. It's free and open source, and runs on Linux, Mac, Windows and more. +F# is a general purpose functional/OO programming language. It's free and open source, and runs on Linux, Mac, Windows and more. It has a powerful type system that traps many errors at compile time, but it uses type inference so that it reads more like a dynamic language. @@ -90,7 +90,7 @@ let simplePatternMatch = | _ -> printfn "x is something else" // underscore matches anything // F# doesn't allow nulls by default -- you must use an Option type -// and then pattern match. +// and then pattern match. // Some(..) and None are roughly analogous to Nullable wrappers let validValue = Some(99) let invalidValue = None @@ -115,7 +115,7 @@ printfn "A string %s, and something generic %A" "hello" [1;2;3;4] // into a string, similar to String.Format in C#. // ================================================ -// More on functions +// More on functions // ================================================ // F# is a true functional language -- functions are first @@ -124,30 +124,30 @@ printfn "A string %s, and something generic %A" "hello" [1;2;3;4] // Modules are used to group functions together // Indentation is needed for each nested module. -module FunctionExamples = +module FunctionExamples = // define a simple adding function let add x y = x + y - + // basic usage of a function let a = add 1 2 printfn "1+2 = %i" a - + // partial application to "bake in" parameters let add42 = add 42 let b = add42 1 printfn "42+1 = %i" b - + // composition to combine functions let add1 = add 1 let add2 = add 2 let add3 = add1 >> add2 let c = add3 7 printfn "3+7 = %i" c - + // higher order functions [1..10] |> List.map add3 |> printfn "new list is %A" - + // lists of functions, and more let add6 = [add1; add2; add3] |> List.reduce (>>) let d = add6 7 @@ -158,54 +158,54 @@ module FunctionExamples = // ================================================ // There are three types of ordered collection: -// * Lists are most basic immutable collection. -// * Arrays are mutable and more efficient when needed. -// * Sequences are lazy and infinite (e.g. an enumerator). +// * Lists are most basic immutable collection. +// * Arrays are mutable and more efficient when needed. +// * Sequences are lazy and infinite (e.g. an enumerator). // // Other collections include immutable maps and sets // plus all the standard .NET collections -module ListExamples = +module ListExamples = - // lists use square brackets + // lists use square brackets let list1 = ["a";"b"] let list2 = "c" :: list1 // :: is prepending let list3 = list1 @ list2 // @ is concat - + // list comprehensions (aka generators) - let squares = [for i in 1..10 do yield i*i] + let squares = [for i in 1..10 do yield i*i] // prime number generator let rec sieve = function | (p::xs) -> p :: sieve [ for x in xs do if x % p > 0 then yield x ] | [] -> [] let primes = sieve [2..50] - printfn "%A" primes - + printfn "%A" primes + // pattern matching for lists - let listMatcher aList = + let listMatcher aList = match aList with - | [] -> printfn "the list is empty" - | [first] -> printfn "the list has one element %A " first - | [first; second] -> printfn "list is %A and %A" first second - | _ -> printfn "the list has more than two elements" + | [] -> printfn "the list is empty" + | [first] -> printfn "the list has one element %A " first + | [first; second] -> printfn "list is %A and %A" first second + | _ -> printfn "the list has more than two elements" listMatcher [1;2;3;4] listMatcher [1;2] listMatcher [1] - listMatcher [] + listMatcher [] // recursion using lists - let rec sum aList = + let rec sum aList = match aList with | [] -> 0 | x::xs -> x + sum xs sum [1..10] - - // ----------------------------------------- - // Standard library functions + // ----------------------------------------- - + // Standard library functions + // ----------------------------------------- + // map let add3 x = x + 3 [1..10] |> List.map add3 @@ -213,68 +213,68 @@ module ListExamples = // filter let even x = x % 2 = 0 [1..10] |> List.filter even - + // many more -- see documentation - -module ArrayExamples = + +module ArrayExamples = // arrays use square brackets with bar let array1 = [| "a";"b" |] let first = array1.[0] // indexed access using dot - + // pattern matching for arrays is same as for lists - let arrayMatcher aList = + let arrayMatcher aList = match aList with - | [| |] -> printfn "the array is empty" - | [| first |] -> printfn "the array has one element %A " first - | [| first; second |] -> printfn "array is %A and %A" first second - | _ -> printfn "the array has more than two elements" + | [| |] -> printfn "the array is empty" + | [| first |] -> printfn "the array has one element %A " first + | [| first; second |] -> printfn "array is %A and %A" first second + | _ -> printfn "the array has more than two elements" arrayMatcher [| 1;2;3;4 |] // Standard library functions just as for List - - [| 1..10 |] + + [| 1..10 |] |> Array.map (fun i -> i+3) |> Array.filter (fun i -> i%2 = 0) |> Array.iter (printfn "value is %i. ") - - -module SequenceExamples = + + +module SequenceExamples = // sequences use curly braces let seq1 = seq { yield "a"; yield "b" } - - // sequences can use yield and + + // sequences can use yield and // can contain subsequences let strange = seq { // "yield! adds one element yield 1; yield 2; - + // "yield!" adds a whole subsequence - yield! [5..10] + yield! [5..10] yield! seq { - for i in 1..10 do + for i in 1..10 do if i%2 = 0 then yield i }} - // test - strange |> Seq.toList - + // test + strange |> Seq.toList + // Sequences can be created using "unfold" // Here's the fibonacci series let fib = Seq.unfold (fun (fst,snd) -> Some(fst + snd, (snd, fst + snd))) (0,1) - // test + // test let fib10 = fib |> Seq.take 10 |> Seq.toList - printf "first 10 fibs are %A" fib10 - - + printf "first 10 fibs are %A" fib10 + + // ================================================ -// Data Types +// Data Types // ================================================ -module DataTypeExamples = +module DataTypeExamples = // All data is immutable by default @@ -282,33 +282,33 @@ module DataTypeExamples = // -- Use a comma to create a tuple let twoTuple = 1,2 let threeTuple = "a",2,true - + // Pattern match to unpack let x,y = twoTuple //sets x=1 y=2 - // ------------------------------------ - // Record types have named fields - // ------------------------------------ + // ------------------------------------ + // Record types have named fields + // ------------------------------------ // Use "type" with curly braces to define a record type type Person = {First:string; Last:string} - - // Use "let" with curly braces to create a record + + // Use "let" with curly braces to create a record let person1 = {First="John"; Last="Doe"} // Pattern match to unpack let {First=first} = person1 //sets first="john" - // ------------------------------------ + // ------------------------------------ // Union types (aka variants) have a set of choices // Only case can be valid at a time. - // ------------------------------------ + // ------------------------------------ // Use "type" with bar/pipe to define a union type - type Temp = + type Temp = | DegreesC of float | DegreesF of float - + // Use one of the cases to create one let temp1 = DegreesF 98.6 let temp2 = DegreesC 37.0 @@ -317,29 +317,29 @@ module DataTypeExamples = let printTemp = function | DegreesC t -> printfn "%f degC" t | DegreesF t -> printfn "%f degF" t - - printTemp temp1 + + printTemp temp1 printTemp temp2 - // ------------------------------------ + // ------------------------------------ // Recursive types - // ------------------------------------ + // ------------------------------------ - // Types can be combined recursively in complex ways + // Types can be combined recursively in complex ways // without having to create subclasses - type Employee = + type Employee = | Worker of Person | Manager of Employee list let jdoe = {First="John";Last="Doe"} let worker = Worker jdoe - - // ------------------------------------ + + // ------------------------------------ // Modelling with types - // ------------------------------------ - + // ------------------------------------ + // Union types are great for modelling state without using flags - type EmailAddress = + type EmailAddress = | ValidEmailAddress of string | InvalidEmailAddress of string @@ -350,40 +350,40 @@ module DataTypeExamples = // The combination of union types and record types together // provide a great foundation for domain driven design. - // You can create hundreds of little types that accurately + // You can create hundreds of little types that accurately // reflect the domain. type CartItem = { ProductCode: string; Qty: int } type Payment = Payment of float type ActiveCartData = { UnpaidItems: CartItem list } type PaidCartData = { PaidItems: CartItem list; Payment: Payment} - - type ShoppingCart = + + type ShoppingCart = | EmptyCart // no data | ActiveCart of ActiveCartData - | PaidCart of PaidCartData + | PaidCart of PaidCartData - // ------------------------------------ + // ------------------------------------ // Built in behavior for types - // ------------------------------------ + // ------------------------------------ // Core types have useful "out-of-the-box" behavior, no coding needed. // * Immutability // * Pretty printing when debugging // * Equality and comparison // * Serialization - + // Pretty printing using %A - printfn "twoTuple=%A,\nPerson=%A,\nTemp=%A,\nEmployee=%A" + printfn "twoTuple=%A,\nPerson=%A,\nTemp=%A,\nEmployee=%A" twoTuple person1 temp1 worker // Equality and comparison built in. // Here's an example with cards. type Suit = Club | Diamond | Spade | Heart - type Rank = Two | Three | Four | Five | Six | Seven | Eight - | Nine | Ten | Jack | Queen | King | Ace + type Rank = Two | Three | Four | Five | Six | Seven | Eight + | Nine | Ten | Jack | Queen | King | Ace - let hand = [ Club,Ace; Heart,Three; Heart,Ace; + let hand = [ Club,Ace; Heart,Three; Heart,Ace; Spade,Jack; Diamond,Two; Diamond,Ace ] // sorting @@ -391,27 +391,27 @@ module DataTypeExamples = List.max hand |> printfn "high card is %A" List.min hand |> printfn "low card is %A" - + // ================================================ // Active patterns // ================================================ -module ActivePatternExamples = +module ActivePatternExamples = - // F# has a special type of pattern matching called "active patterns" - // where the pattern can be parsed or detected dynamically. + // F# has a special type of pattern matching called "active patterns" + // where the pattern can be parsed or detected dynamically. // "banana clips" are the syntax for active patterns - + // for example, define an "active" pattern to match character types... - let (|Digit|Letter|Whitespace|Other|) ch = + let (|Digit|Letter|Whitespace|Other|) ch = if System.Char.IsDigit(ch) then Digit else if System.Char.IsLetter(ch) then Letter else if System.Char.IsWhiteSpace(ch) then Whitespace - else Other + else Other // ... and then use it to make parsing logic much clearer - let printChar ch = + let printChar ch = match ch with | Digit -> printfn "%c is a Digit" ch | Letter -> printfn "%c is a Letter" ch @@ -424,52 +424,52 @@ module ActivePatternExamples = // ----------------------------------- // FizzBuzz using active patterns // ----------------------------------- - + // You can create partial matching patterns as well // Just use undercore in the defintion, and return Some if matched. let (|MultOf3|_|) i = if i % 3 = 0 then Some MultOf3 else None let (|MultOf5|_|) i = if i % 5 = 0 then Some MultOf5 else None // the main function - let fizzBuzz i = + let fizzBuzz i = match i with - | MultOf3 & MultOf5 -> printf "FizzBuzz, " - | MultOf3 -> printf "Fizz, " - | MultOf5 -> printf "Buzz, " + | MultOf3 & MultOf5 -> printf "FizzBuzz, " + | MultOf3 -> printf "Fizz, " + | MultOf5 -> printf "Buzz, " | _ -> printf "%i, " i - + // test - [1..20] |> List.iter fizzBuzz - + [1..20] |> List.iter fizzBuzz + // ================================================ -// Conciseness +// Conciseness // ================================================ -module AlgorithmExamples = +module AlgorithmExamples = - // F# has a high signal/noise ratio, so code reads + // F# has a high signal/noise ratio, so code reads // almost like the actual algorithm // ------ Example: define sumOfSquares function ------ - let sumOfSquares n = + let sumOfSquares n = [1..n] // 1) take all the numbers from 1 to n |> List.map square // 2) square each one |> List.sum // 3) sum the results - // test - sumOfSquares 100 |> printfn "Sum of squares = %A" - - // ------ Example: define a sort function ------ + // test + sumOfSquares 100 |> printfn "Sum of squares = %A" + + // ------ Example: define a sort function ------ let rec sort list = match list with - // If the list is empty - | [] -> + // If the list is empty + | [] -> [] // return an empty list - // If the list is not empty - | firstElem::otherElements -> // take the first element - let smallerElements = // extract the smaller elements + // If the list is not empty + | firstElem::otherElements -> // take the first element + let smallerElements = // extract the smaller elements otherElements // from the remaining ones - |> List.filter (fun e -> e < firstElem) + |> List.filter (fun e -> e < firstElem) |> sort // and sort them let largerElements = // extract the larger ones otherElements // from the remaining ones @@ -479,13 +479,13 @@ module AlgorithmExamples = List.concat [smallerElements; [firstElem]; largerElements] // test - sort [1;5;23;18;9;1;3] |> printfn "Sorted = %A" + sort [1;5;23;18;9;1;3] |> printfn "Sorted = %A" // ================================================ // Asynchronous Code // ================================================ -module AsyncExample = +module AsyncExample = // F# has built-in features to help with async code // without encountering the "pyramid of doom" @@ -495,23 +495,23 @@ module AsyncExample = open System.Net open System open System.IO - open Microsoft.FSharp.Control.CommonExtensions + open Microsoft.FSharp.Control.CommonExtensions // Fetch the contents of a URL asynchronously - let fetchUrlAsync url = - async { // "async" keyword and curly braces + let fetchUrlAsync url = + async { // "async" keyword and curly braces // creates an "async" object - let req = WebRequest.Create(Uri(url)) - use! resp = req.AsyncGetResponse() + let req = WebRequest.Create(Uri(url)) + use! resp = req.AsyncGetResponse() // use! is async assignment - use stream = resp.GetResponseStream() + use stream = resp.GetResponseStream() // "use" triggers automatic close() // on resource at end of scope - use reader = new IO.StreamReader(stream) - let html = reader.ReadToEnd() - printfn "finished downloading %s" url + use reader = new IO.StreamReader(stream) + let html = reader.ReadToEnd() + printfn "finished downloading %s" url } - + // a list of sites to fetch let sites = ["http://www.bing.com"; "http://www.google.com"; @@ -520,7 +520,7 @@ module AsyncExample = "http://www.yahoo.com"] // do it - sites + sites |> List.map fetchUrlAsync // make a list of async tasks |> Async.Parallel // set up the tasks to run in parallel |> Async.RunSynchronously // start them off @@ -529,58 +529,58 @@ module AsyncExample = // .NET compatability // ================================================ -module NetCompatibilityExamples = +module NetCompatibilityExamples = // F# can do almost everything C# can do, and it integrates // seamlessly with .NET or Mono libraries. // ------- work with existing library functions ------- - + let (i1success,i1) = System.Int32.TryParse("123"); if i1success then printfn "parsed as %i" i1 else printfn "parse failed" // ------- Implement interfaces on the fly! ------- - + // create a new object that implements IDisposable - let makeResource name = - { new System.IDisposable + let makeResource name = + { new System.IDisposable with member this.Dispose() = printfn "%s disposed" name } - let useAndDisposeResources = + let useAndDisposeResources = use r1 = makeResource "first resource" - printfn "using first resource" + printfn "using first resource" for i in [1..3] do let resourceName = sprintf "\tinner resource %d" i - use temp = makeResource resourceName - printfn "\tdo something with %s" resourceName + use temp = makeResource resourceName + printfn "\tdo something with %s" resourceName use r2 = makeResource "second resource" - printfn "using second resource" - printfn "done." + printfn "using second resource" + printfn "done." // ------- Object oriented code ------- - + // F# is also a fully fledged OO language. // It supports classes, inheritance, virtual methods, etc. // interface with generic type - type IEnumerator<'a> = + type IEnumerator<'a> = abstract member Current : 'a - abstract MoveNext : unit -> bool + abstract MoveNext : unit -> bool // abstract base class with virtual methods [] - type Shape() = + type Shape() = //readonly properties abstract member Width : int with get abstract member Height : int with get //non-virtual method member this.BoundingArea = this.Height * this.Width //virtual method with base implementation - abstract member Print : unit -> unit + abstract member Print : unit -> unit default this.Print () = printfn "I'm a shape" - // concrete class that inherits from base class and overrides - type Rectangle(x:int, y:int) = + // concrete class that inherits from base class and overrides + type Rectangle(x:int, y:int) = inherit Shape() override this.Width = x override this.Height = y @@ -590,20 +590,20 @@ module NetCompatibilityExamples = let r = Rectangle(2,3) printfn "The width is %i" r.Width printfn "The area is %i" r.BoundingArea - r.Print() + r.Print() // ------- extension methods ------- - + //Just as in C#, F# can extend existing classes with extension methods. type System.String with member this.StartsWithA = this.StartsWith "A" //test let s = "Alice" - printfn "'%s' starts with an 'A' = %A" s s.StartsWithA - + printfn "'%s' starts with an 'A' = %A" s s.StartsWithA + // ------- events ------- - + type MyButton() = let clickEvent = new Event<_>() @@ -615,11 +615,11 @@ module NetCompatibilityExamples = // test let myButton = new MyButton() - myButton.OnClick.Add(fun (sender, arg) -> + myButton.OnClick.Add(fun (sender, arg) -> printfn "Click event with arg=%O" arg) myButton.TestEvent("Hello World!") - + ``` ## More Information diff --git a/hack.html.markdown b/hack.html.markdown index b9730dc0..b3d19f8e 100644 --- a/hack.html.markdown +++ b/hack.html.markdown @@ -51,7 +51,7 @@ function identity(?string $stringOrNull) : ?string class TypeHintedProperties { public ?string $name; - + protected int $id; private float $score = 100.0; @@ -91,7 +91,7 @@ function openBox(Box $box) : int // Shapes -// +// // Hack adds the concept of shapes for defining struct-like arrays with a // guaranteed, type-checked set of keys type Point2D = shape('x' => int, 'y' => int); @@ -108,7 +108,7 @@ distance( // Type aliasing -// +// // Hack adds a bunch of type aliasing features for making complex types readable newtype VectorArray = array>; @@ -142,7 +142,7 @@ function getRoadType() : RoadType // Constructor argument promotion -// +// // To avoid boilerplate property and constructor definitions that only set // properties, Hack adds a concise syntax for defining properties and a // constructor at the same time. @@ -171,12 +171,12 @@ class WithoutArgumentPromotion // Co-operative multi-tasking -// +// // Two new keywords "async" and "await" can be used to perform multi-tasking // Note that this does not involve threads - it just allows transfer of control async function cooperativePrint(int $start, int $end) : Awaitable { - for ($i = $start; $i <= $end; $i++) { + for ($i = $start; $i <= $end; $i++) { echo "$i "; // Give other tasks a chance to do something @@ -193,9 +193,9 @@ AwaitAllWaitHandle::fromArray([ // Attributes -// +// // Attributes are a form of metadata for functions. Hack provides some -// special built-in attributes that introduce useful behaviour. +// special built-in attributes that introduce useful behaviour. // The __Memoize special attribute causes the result of a function to be cached <<__Memoize>> @@ -248,7 +248,7 @@ class ConsistentBar extends ConsistentFoo class InvalidFooSubclass extends ConsistentFoo { // Not matching the parent constructor will cause a type checker error: - // + // // "This object is of type ConsistentBaz. It is incompatible with this object // of type ConsistentFoo because some of their methods are incompatible" // @@ -259,7 +259,7 @@ class InvalidFooSubclass extends ConsistentFoo // Using the __Override annotation on a non-overriden method will cause a // type checker error: - // + // // "InvalidFooSubclass::otherMethod() is marked as override; no non-private // parent definition found or overridden parent is defined in non- COUNTRIES = new HashSet(); static { validCodes.add("DENMARK"); validCodes.add("SWEDEN"); validCodes.add("FINLAND"); } - + // But there's a nifty way to achive the same thing in an // easier way, by using something that is called Double Brace // Initialization. - + private static final Set COUNTRIES = HashSet() {{ add("DENMARK"); add("SWEDEN"); - add("FINLAND"); + add("FINLAND"); }} - - // The first brace is creating an new AnonymousInnerClass and the + + // The first brace is creating an new AnonymousInnerClass and the // second one declares and instance initializer block. This block // is called with the anonymous inner class is created. // This does not only work for Collections, it works for all @@ -500,7 +500,7 @@ public class ExampleClass extends ExampleClassParent implements InterfaceOne, } -// Abstract Classes +// Abstract Classes // Abstract Class declaration syntax // abstract extends { // // Constants and variables @@ -512,26 +512,26 @@ public class ExampleClass extends ExampleClassParent implements InterfaceOne, // Also abstract classes CAN have the "main" method. // Abstract classes solve these problems. -public abstract class Animal +public abstract class Animal { public abstract void makeSound(); // Method can have a body public void eat() { - System.out.println("I am an animal and I am Eating."); + System.out.println("I am an animal and I am Eating."); // Note: We can access private variable here. age = 30; } - // No need to initialize, however in an interface + // No need to initialize, however in an interface // a variable is implicitly final and hence has // to be initialized. private int age; public void printAge() { - System.out.println(age); + System.out.println(age); } // Abstract classes can have main function. @@ -552,7 +552,7 @@ class Dog extends Animal // age = 30; ==> ERROR! age is private to Animal } - // NOTE: You will get an error if you used the + // NOTE: You will get an error if you used the // @Override annotation here, since java doesn't allow // overriding of static methods. // What is happening here is called METHOD HIDING. diff --git a/json.html.markdown b/json.html.markdown index 47a8cb21..6aff2ce2 100644 --- a/json.html.markdown +++ b/json.html.markdown @@ -16,7 +16,7 @@ going to be 100% valid JSON. Luckily, it kind of speaks for itself. ```json { "key": "value", - + "keys": "must always be enclosed in double quotes", "numbers": 0, "strings": "Hellø, wørld. All unicode is allowed, along with \"escaping\".", @@ -46,7 +46,7 @@ going to be 100% valid JSON. Luckily, it kind of speaks for itself. [0, 0, 0, 1] ] ], - + "alternative style": { "comment": "check this out!" , "comma position": "doesn't matter - as long as it's before the value, then it's valid" diff --git a/julia.html.markdown b/julia.html.markdown index 5ccd6484..66329feb 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -14,7 +14,7 @@ This is based on Julia 0.3. # Single line comments start with a hash (pound) symbol. #= Multiline comments can be written - by putting '#=' before the text and '=#' + by putting '#=' before the text and '=#' after the text. They can also be nested. =# @@ -670,7 +670,7 @@ square_area(l) = l * l # square_area (generic function with 1 method) square_area(5) #25 # What happens when we feed square_area an integer? -code_native(square_area, (Int32,)) +code_native(square_area, (Int32,)) # .section __TEXT,__text,regular,pure_instructions # Filename: none # Source line: 1 # Prologue @@ -703,10 +703,10 @@ code_native(square_area, (Float64,)) # vmulsd XMM0, XMM0, XMM0 # Scalar double precision multiply (AVX) # pop RBP # ret - # + # # Note that julia will use floating point instructions if any of the # arguements are floats. -# Let's calculate the area of a circle +# Let's calculate the area of a circle circle_area(r) = pi * r * r # circle_area (generic function with 1 method) circle_area(5) # 78.53981633974483 @@ -737,7 +737,7 @@ code_native(circle_area, (Float64,)) # vmulsd XMM0, XMM1, XMM0 # pop RBP # ret - # + # ``` ## Further Reading diff --git a/livescript.html.markdown b/livescript.html.markdown index e64f7719..9235f5ce 100644 --- a/livescript.html.markdown +++ b/livescript.html.markdown @@ -166,7 +166,7 @@ not false # => true ######################################################################## ## 3. Functions -######################################################################## +######################################################################## # Since LiveScript is functional, you'd expect functions to get a nice # treatment. In LiveScript it's even more apparent that functions are @@ -229,7 +229,7 @@ double-minus-one = (- 1) . (* 2) # Other than the usual `f . g` mathematical formulae, you get the `>>` # and `<<` operators, that describe how the flow of values through the -# functions. +# functions. double-minus-one = (* 2) >> (- 1) double-minus-one = (- 1) << (* 2) @@ -344,7 +344,7 @@ kitten.hug! # => "*Mei (a cat) is hugged*" ## Further reading There's just so much more to LiveScript, but this should be enough to -get you started writing little functional things in it. The +get you started writing little functional things in it. The [official website](http://livescript.net/) has a lot of information on the language, and a nice online compiler for you to try stuff out! diff --git a/make.html.markdown b/make.html.markdown index 75543dcd..563139d1 100644 --- a/make.html.markdown +++ b/make.html.markdown @@ -31,7 +31,7 @@ we are using GNU make which is the standard on Linux. file0.txt: echo "foo" > file0.txt # Even comments in these 'recipe' sections get passed to the shell. - # Try `make file0.txt` or simply `make` - first rule is the default. + # Try `make file0.txt` or simply `make` - first rule is the default. # This rule will only run if file0.txt is newer than file1.txt. @@ -49,7 +49,7 @@ file2.txt file3.txt: file0.txt file1.txt touch file2.txt touch file3.txt -# Make will complain about multiple recipes for the same rule. Empty +# Make will complain about multiple recipes for the same rule. Empty # recipes don't count though and can be used to add new dependencies. #----------------------------------------------------------------------- @@ -115,7 +115,7 @@ small/%.png: %.svg %.png: %.ps @echo this rule is not chosen if *.svg and *.ps are both present -# make already has some pattern rules built-in. For instance, it knows +# make already has some pattern rules built-in. For instance, it knows # how to turn *.c files into *.o files. # Older makefiles might use suffix rules instead of pattern rules @@ -185,7 +185,7 @@ var := hello var2 ::= $(var) hello #:= and ::= are equivalent. -# These variables are evaluated procedurely (in the order that they +# These variables are evaluated procedurely (in the order that they # appear), thus breaking with the rest of the language ! # This doesn't work diff --git a/markdown.html.markdown b/markdown.html.markdown index acb808ea..2333110f 100644 --- a/markdown.html.markdown +++ b/markdown.html.markdown @@ -70,7 +70,7 @@ I'm in paragraph three! -I end with two spaces (highlight me to see them). +I end with two spaces (highlight me to see them). There's a
above me! @@ -97,7 +97,7 @@ or + Item + One more item -or +or - Item - Item @@ -129,7 +129,7 @@ render the numbers in order, but this may not be a good idea --> Boxes below without the 'x' are unchecked HTML checkboxes. -- [ ] First task to complete. +- [ ] First task to complete. - [ ] Second task that needs done This checkbox below will be a checked HTML checkbox. - [x] This task has been completed @@ -169,7 +169,7 @@ with or without spaces. --> *** --- -- - - +- - - **************** diff --git a/matlab.html.markdown b/matlab.html.markdown index 00f4c53a..02fe5962 100644 --- a/matlab.html.markdown +++ b/matlab.html.markdown @@ -6,7 +6,7 @@ contributors: --- -MATLAB stands for MATrix LABoratory. It is a powerful numerical computing language commonly used in engineering and mathematics. +MATLAB stands for MATrix LABoratory. It is a powerful numerical computing language commonly used in engineering and mathematics. If you have any feedback please feel free to reach me at [@the_ozzinator](https://twitter.com/the_ozzinator), or @@ -16,7 +16,7 @@ If you have any feedback please feel free to reach me at % Comments start with a percent sign. %{ -Multi line comments look +Multi line comments look something like this @@ -62,10 +62,10 @@ disp('text') % print "text" to the screen % Variables & Expressions myVariable = 4 % Notice Workspace pane shows newly created variable myVariable = 4; % Semi colon suppresses output to the Command Window -4 + 6 % ans = 10 -8 * myVariable % ans = 32 -2 ^ 3 % ans = 8 -a = 2; b = 3; +4 + 6 % ans = 10 +8 * myVariable % ans = 32 +2 ^ 3 % ans = 8 +a = 2; b = 3; c = exp(a)*sin(pi/2) % c = 7.3891 % Calling functions can be done in either of two ways: @@ -73,7 +73,7 @@ c = exp(a)*sin(pi/2) % c = 7.3891 load('myFile.mat', 'y') % arguments within parantheses, spererated by commas % Command syntax: load myFile.mat y % no parentheses, and spaces instead of commas -% Note the lack of quote marks in command form: inputs are always passed as +% Note the lack of quote marks in command form: inputs are always passed as % literal text - cannot pass variable values. Also, can't receive output: [V,D] = eig(A); % this has no equivalent in command form [~,D] = eig(A); % if you only want D and not V @@ -103,7 +103,7 @@ a(2) % ans = y % Cells -a = {'one', 'two', 'three'} +a = {'one', 'two', 'three'} a(1) % ans = 'one' - returns a cell char(a(1)) % ans = one - returns a string @@ -113,7 +113,7 @@ A.c = [1 2]; A.d.e = false; % Vectors -x = [4 32 53 7 1] +x = [4 32 53 7 1] x(2) % ans = 32, indices in Matlab start 1, not 0 x(2:3) % ans = 32 53 x(2:end) % ans = 32 53 7 1 @@ -123,7 +123,7 @@ x = [4; 32; 53; 7; 1] % Column vector x = [1:10] % x = 1 2 3 4 5 6 7 8 9 10 % Matrices -A = [1 2 3; 4 5 6; 7 8 9] +A = [1 2 3; 4 5 6; 7 8 9] % Rows are separated by a semicolon; elements are separated with space or comma % A = @@ -132,7 +132,7 @@ A = [1 2 3; 4 5 6; 7 8 9] % 7 8 9 A(2,3) % ans = 6, A(row, column) -A(6) % ans = 8 +A(6) % ans = 8 % (implicitly concatenates columns into vector, then indexes into that) @@ -171,7 +171,7 @@ A(1,:) % All columns in row 1 % 4 5 42 % 7 8 9 -% this is the same as +% this is the same as vertcat(A,A); @@ -183,7 +183,7 @@ vertcat(A,A); % 4 5 42 4 5 42 % 7 8 9 7 8 9 -% this is the same as +% this is the same as horzcat(A,A); @@ -201,21 +201,21 @@ A(:, 1) =[] % Delete the first column of the matrix transpose(A) % Transpose the matrix, which is the same as: A one -ctranspose(A) % Hermitian transpose the matrix +ctranspose(A) % Hermitian transpose the matrix % (the transpose, followed by taking complex conjugate of each element) -% Element by Element Arithmetic vs. Matrix Arithmetic +% Element by Element Arithmetic vs. Matrix Arithmetic % On their own, the arithmetic operators act on whole matrices. When preceded % by a period, they act on each element instead. For example: A * B % Matrix multiplication A .* B % Multiple each element in A by its corresponding element in B -% There are several pairs of functions, where one acts on each element, and +% There are several pairs of functions, where one acts on each element, and % the other (whose name ends in m) acts on the whole matrix. -exp(A) % exponentiate each element +exp(A) % exponentiate each element expm(A) % calculate the matrix exponential sqrt(A) % take the square root of each element sqrtm(A) % find the matrix whose square is A @@ -233,7 +233,7 @@ axis([0 2*pi -1 1]) % x range from 0 to 2*pi, y range from -1 to 1 plot(x,y1,'-',x,y2,'--',x,y3,':') % For multiple functions on one plot legend('Line 1 label', 'Line 2 label') % Label curves with a legend -% Alternative method to plot multiple functions in one plot. +% Alternative method to plot multiple functions in one plot. % while 'hold' is on, commands add to existing graph rather than replacing it plot(x, y) hold on @@ -271,9 +271,9 @@ clf clear % clear current figure window, and reset most figure properties % Properties can be set and changed through a figure handle. % You can save a handle to a figure when you create it. -% The function gcf returns a handle to the current figure +% The function gcf returns a handle to the current figure h = plot(x, y); % you can save a handle to a figure when you create it -set(h, 'Color', 'r') +set(h, 'Color', 'r') % 'y' yellow; 'm' magenta, 'c' cyan, 'r' red, 'g' green, 'b' blue, 'w' white, 'k' black set(h, 'LineStyle', '--') % '--' is solid line, '---' dashed, ':' dotted, '-.' dash-dot, 'none' is no line @@ -298,8 +298,8 @@ cd /path/to/move/into % change directory % Variables can be saved to .mat files -save('myFileName.mat') % Save the variables in your Workspace -load('myFileName.mat') % Load saved variables into Workspace +save('myFileName.mat') % Save the variables in your Workspace +load('myFileName.mat') % Load saved variables into Workspace % M-file Scripts % A script file is an external file that contains a sequence of statements. @@ -312,11 +312,11 @@ load('myFileName.mat') % Load saved variables into Workspace % Also, they have their own workspace (ie. different variable scope). % Function name should match file name (so save this example as double_input.m). % 'help double_input.m' returns the comments under line beginning function -function output = double_input(x) +function output = double_input(x) %double_input(x) returns twice the value of x output = 2*x; end -double_input(6) % ans = 12 +double_input(6) % ans = 12 % You can also have subfunctions and nested functions. @@ -325,8 +325,8 @@ double_input(6) % ans = 12 % functions, and have access to both its workspace and their own workspace. % If you want to create a function without creating a new file you can use an -% anonymous function. Useful when quickly defining a function to pass to -% another function (eg. plot with fplot, evaluate an indefinite integral +% anonymous function. Useful when quickly defining a function to pass to +% another function (eg. plot with fplot, evaluate an indefinite integral % with quad, find roots with fzero, or find minimum with fminsearch). % Example that returns the square of it's input, assigned to to the handle sqr: sqr = @(x) x.^2; @@ -336,12 +336,12 @@ doc function_handle % find out more % User input a = input('Enter the value: ') -% Stops execution of file and gives control to the keyboard: user can examine +% Stops execution of file and gives control to the keyboard: user can examine % or change variables. Type 'return' to continue execution, or 'dbquit' to exit keyboard % Reading in data (also xlsread/importdata/imread for excel/CSV/image files) -fopen(filename) +fopen(filename) % Output disp(a) % Print out the value of variable a @@ -363,8 +363,8 @@ end for k = 1:5 disp(k) end - -k = 0; + +k = 0; while (k < 5) k = k + 1; end @@ -382,7 +382,7 @@ password = 'root'; driver = 'com.mysql.jdbc.Driver'; dburl = ['jdbc:mysql://localhost:8889/' dbname]; javaclasspath('mysql-connector-java-5.1.xx-bin.jar'); %xx depends on version, download available at http://dev.mysql.com/downloads/connector/j/ -conn = database(dbname, username, password, driver, dburl); +conn = database(dbname, username, password, driver, dburl); sql = ['SELECT * from table_name where id = 22'] % Example sql statement a = fetch(conn, sql) %a will contain your data @@ -394,7 +394,7 @@ tan(x) asin(x) acos(x) atan(x) -exp(x) +exp(x) sqrt(x) log(x) log10(x) @@ -426,7 +426,7 @@ pinv(A) % calculate the pseudo-inverse zeros(m,n) % m x n matrix of 0's ones(m,n) % m x n matrix of 1's diag(A) % Extracts the diagonal elements of a matrix A -diag(x) % Construct a matrix with diagonal elements listed in x, and zeroes elsewhere +diag(x) % Construct a matrix with diagonal elements listed in x, and zeroes elsewhere eye(m,n) % Identity matrix linspace(x1, x2, n) % Return n equally spaced points, with min x1 and max x2 inv(A) % Inverse of matrix A @@ -452,15 +452,15 @@ flipud(A) % Flip matrix up to down [U,S,V] = svd(X) % SVD: XV = US, U and V are unitary matrices, S has non-negative diagonal elements in decreasing order % Common vector functions -max % largest component -min % smallest component +max % largest component +min % smallest component length % length of a vector -sort % sort in ascending order -sum % sum of elements +sort % sort in ascending order +sum % sum of elements prod % product of elements mode % modal value -median % median value -mean % mean value +median % median value +mean % mean value std % standard deviation perms(x) % list all permutations of elements of x diff --git a/neat.html.markdown b/neat.html.markdown index e99d1e0e..f02461ee 100644 --- a/neat.html.markdown +++ b/neat.html.markdown @@ -47,18 +47,18 @@ void main(string[] args) { // There are no one-value tuples though. // So you can always use () in the mathematical sense. // (string) arg; <- is an error - + /* byte: 8 bit signed integer char: 8 bit UTF-8 byte component. short: 16 bit signed integer int: 32 bit signed integer long: 64 bit signed integer - + float: 32 bit floating point double: 64 bit floating point real: biggest native size floating point (80 bit on x86). - + bool: true or false */ int a = 5; @@ -139,14 +139,14 @@ void main(string[] args) { assert !(hewo is s); // same as assert (hewo !is s); - + // Allocate arrays using "new array length" int[] integers = new int[] 10; assert(integers.length == 10); assert(integers[0] == 0); // zero is default initializer integers = integers ~ 5; // This allocates a new array! assert(integers.length == 11); - + // This is an appender array. // Instead of (length, pointer), it tracks (capacity, length, pointer). // When you append to it, it will use the free capacity if it can. @@ -156,13 +156,13 @@ void main(string[] args) { appender ~= 2; appender ~= 3; appender.free(); // same as {mem.free(appender.ptr); appender = null;} - + // Scope variables are automatically freed at the end of the current scope. scope int[auto~] someOtherAppender; // This is the same as: int[auto~] someOtherAppender2; onExit { someOtherAppender2.free; } - + // You can do a C for loop too // - but why would you want to? for (int i = 0; i < 5; ++i) { } @@ -178,23 +178,23 @@ void main(string[] args) { assert(i == 5); break; // otherwise we'd go back up to do { } - + // This is a nested function. // Nested functions can access the surrounding function. string returnS() { return s; } writeln returnS(); - + // Take the address of a function using & // The type of a global function is ReturnType function(ParameterTypeTuple). void function() foop = &foo; - + // Similarly, the type of a nested function is ReturnType delegate(ParameterTypeTuple). string delegate() returnSp = &returnS; writeln returnSp(); // Class member functions and struct member functions also fit into delegate variables. // In general, delegates are functions that carry an additional context pointer. // ("fat pointers" in C) - + // Allocate a "snapshot" with "new delegate". // Snapshots are not closures! I used to call them closures too, // but then my Haskell-using friends yelled at me so I had to stop. @@ -232,8 +232,8 @@ void main(string[] args) { auto nestfun = λ() { } // There is NO semicolon needed here! // "}" can always substitute for "};". // This provides syntactic consistency with built-in statements. - - + + // This is a class. // Note: almost all elements of Neat can be used on the module level // or just as well inside a function. @@ -268,7 +268,7 @@ void main(string[] args) { E e = E:cd; // dynamic class cast! e.doE(); writeln "$e"; // all interfaces convert to Object implicitly. - + // Templates! // Templates are parameterized namespaces, taking a type as a parameter. template Templ(T) { diff --git a/objective-c.html.markdown b/objective-c.html.markdown index 407ba3c8..89901308 100644 --- a/objective-c.html.markdown +++ b/objective-c.html.markdown @@ -11,7 +11,7 @@ filename: LearnObjectiveC.m --- Objective-C is the main programming language used by Apple for the OS X and iOS operating systems and their respective frameworks, Cocoa and Cocoa Touch. -It is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. +It is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. ```objective_c // Single-line comments start with // @@ -41,15 +41,15 @@ int main (int argc, const char * argv[]) // Use NSLog to print lines to the console NSLog(@"Hello World!"); // Print the string "Hello World!" - + /////////////////////////////////////// // Types & Variables /////////////////////////////////////// - + // Primitive declarations int myPrimitive1 = 1; long myPrimitive2 = 234554664565; - + // Object declarations // Put the * in front of the variable names for strongly-typed object declarations MyClass *myObject1 = nil; // Strong typing @@ -57,15 +57,15 @@ int main (int argc, const char * argv[]) // %@ is an object // 'description' is a convention to display the value of the Objects NSLog(@"%@ and %@", myObject1, [myObject2 description]); // prints => "(null) and (null)" - + // String NSString *worldString = @"World"; - NSLog(@"Hello %@!", worldString); // prints => "Hello World!" + NSLog(@"Hello %@!", worldString); // prints => "Hello World!" // NSMutableString is a mutable version of the NSString object NSMutableString *mutableString = [NSMutableString stringWithString:@"Hello"]; [mutableString appendString:@" World!"]; NSLog(@"%@", mutableString); // prints => "Hello World!" - + // Character literals NSNumber *theLetterZNumber = @'Z'; char theLetterZ = [theLetterZNumber charValue]; // or 'Z' @@ -75,11 +75,11 @@ int main (int argc, const char * argv[]) NSNumber *fortyTwoNumber = @42; int fortyTwo = [fortyTwoNumber intValue]; // or 42 NSLog(@"%i", fortyTwo); - + NSNumber *fortyTwoUnsignedNumber = @42U; unsigned int fortyTwoUnsigned = [fortyTwoUnsignedNumber unsignedIntValue]; // or 42 NSLog(@"%u", fortyTwoUnsigned); - + NSNumber *fortyTwoShortNumber = [NSNumber numberWithShort:42]; short fortyTwoShort = [fortyTwoShortNumber shortValue]; // or 42 NSLog(@"%hi", fortyTwoShort); @@ -87,7 +87,7 @@ int main (int argc, const char * argv[]) NSNumber *fortyOneShortNumber = [NSNumber numberWithShort:41]; unsigned short fortyOneUnsigned = [fortyOneShortNumber unsignedShortValue]; // or 41 NSLog(@"%u", fortyOneUnsigned); - + NSNumber *fortyTwoLongNumber = @42L; long fortyTwoLong = [fortyTwoLongNumber longValue]; // or 42 NSLog(@"%li", fortyTwoLong); @@ -101,7 +101,7 @@ int main (int argc, const char * argv[]) float piFloat = [piFloatNumber floatValue]; // or 3.141592654f NSLog(@"%f", piFloat); // prints => 3.141592654 NSLog(@"%5.2f", piFloat); // prints => " 3.14" - + NSNumber *piDoubleNumber = @3.1415926535; double piDouble = [piDoubleNumber doubleValue]; // or 3.1415926535 NSLog(@"%f", piDouble); @@ -111,7 +111,7 @@ int main (int argc, const char * argv[]) NSDecimalNumber *oneDecNum = [NSDecimalNumber decimalNumberWithString:@"10.99"]; NSDecimalNumber *twoDecNum = [NSDecimalNumber decimalNumberWithString:@"5.002"]; // NSDecimalNumber isn't able to use standard +, -, *, / operators so it provides its own: - [oneDecNum decimalNumberByAdding:twoDecNum]; + [oneDecNum decimalNumberByAdding:twoDecNum]; [oneDecNum decimalNumberBySubtracting:twoDecNum]; [oneDecNum decimalNumberByMultiplyingBy:twoDecNum]; [oneDecNum decimalNumberByDividingBy:twoDecNum]; @@ -130,8 +130,8 @@ int main (int argc, const char * argv[]) NSArray *anArray = @[@1, @2, @3, @4]; NSNumber *thirdNumber = anArray[2]; NSLog(@"Third number = %@", thirdNumber); // prints => "Third number = 3" - // NSMutableArray is a mutable version of NSArray, allowing you to change - // the items in the array and to extend or shrink the array object. + // NSMutableArray is a mutable version of NSArray, allowing you to change + // the items in the array and to extend or shrink the array object. // Convenient, but not as efficient as NSArray. NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:2]; [mutableArray addObject:@"Hello"]; @@ -161,7 +161,7 @@ int main (int argc, const char * argv[]) /////////////////////////////////////// // Operators /////////////////////////////////////// - + // The operators works like in the C language // For example: 2 + 5; // => 7 @@ -206,13 +206,13 @@ int main (int argc, const char * argv[]) NSLog(@"I print"); } break; } - + // While loops statements int ii = 0; while (ii < 4) { NSLog(@"%d,", ii++); // ii++ increments ii in-place, after using its value - } // prints => "0," + } // prints => "0," // "1," // "2," // "3," @@ -222,25 +222,25 @@ int main (int argc, const char * argv[]) for (jj=0; jj < 4; jj++) { NSLog(@"%d,", jj); - } // prints => "0," + } // prints => "0," // "1," // "2," // "3," - - // Foreach statements + + // Foreach statements NSArray *values = @[@0, @1, @2, @3]; for (NSNumber *value in values) { NSLog(@"%@,", value); - } // prints => "0," + } // prints => "0," // "1," // "2," // "3," // Object for loop statement. Can be used with any Objective-C object type - for (id item in values) { - NSLog(@"%@,", item); - } // prints => "0," + for (id item in values) { + NSLog(@"%@,", item); + } // prints => "0," // "1," // "2," // "3," @@ -251,7 +251,7 @@ int main (int argc, const char * argv[]) // Your statements here @throw [NSException exceptionWithName:@"FileNotFoundException" reason:@"File Not Found on System" userInfo:nil]; - } @catch (NSException * e) // use: @catch (id exceptionName) to catch all objects. + } @catch (NSException * e) // use: @catch (id exceptionName) to catch all objects. { NSLog(@"Exception: %@", e); } @finally @@ -260,17 +260,17 @@ int main (int argc, const char * argv[]) } // prints => "Exception: File Not Found on System" // "Finally. Time to clean up." - // NSError objects are useful for function arguments to populate on user mistakes. + // NSError objects are useful for function arguments to populate on user mistakes. NSError *error = [NSError errorWithDomain:@"Invalid email." code:4 userInfo:nil]; - + /////////////////////////////////////// // Objects /////////////////////////////////////// - + // Create an object instance by allocating memory and initializing it // An object is not fully functional until both steps have been completed MyClass *myObject = [[MyClass alloc] init]; - + // The Objective-C model of object-oriented programming is based on message // passing to object instances // In Objective-C one does not simply call a method; one sends a message @@ -281,7 +281,7 @@ int main (int argc, const char * argv[]) // End of @autoreleasepool } - + // End the program return 0; } @@ -302,9 +302,9 @@ int main (int argc, const char * argv[]) @interface MyClass : NSObject // NSObject is Objective-C's base object class. { // Instance variable declarations (can exist in either interface or implementation file) - int count; // Protected access by default. + int count; // Protected access by default. @private id data; // Private access (More convenient to declare in implementation file) - NSString *name; + NSString *name; } // Convenient notation for public access variables to auto generate a setter method // By default, setter method name is 'set' followed by @property variable name @@ -314,7 +314,7 @@ int main (int argc, const char * argv[]) @property (readonly) NSString *roString; // Use @synthesize in @implementation to create accessor // You can customize the getter and setter names instead of using default 'set' name: @property (getter=lengthGet, setter=lengthSet:) int length; - + // Methods +/- (return type)methodSignature:(Parameter Type *)parameterName; @@ -336,7 +336,7 @@ int main (int argc, const char * argv[]) // To access public variables from the implementation file, @property generates a setter method // automatically. Method name is 'set' followed by @property variable name: MyClass *myClass = [[MyClass alloc] init]; // create MyClass object instance -[myClass setCount:10]; +[myClass setCount:10]; NSLog(@"%d", [myClass count]); // prints => 10 // Or using the custom getter and setter method defined in @interface: [myClass lengthSet:32]; @@ -359,7 +359,7 @@ NSString *stringFromInstanceMethod = [myClass instanceMethodWithParameter:@"Hell // as a variable // SEL is the data type. @selector() returns a selector from method name provided // methodAParameterAsString:andAParameterAsNumber: is method name for method in MyClass -SEL selectorVar = @selector(methodAParameterAsString:andAParameterAsNumber:); +SEL selectorVar = @selector(methodAParameterAsString:andAParameterAsNumber:); if ([myClass respondsToSelector:selectorVar]) { // Checks if class contains method // Must put all method arguments into one object to send to performSelector function NSArray *arguments = [NSArray arrayWithObjects:@"Hello", @4, nil]; @@ -383,7 +383,7 @@ distance = 18; // References "long distance" from MyClass implementation @synthesize roString = _roString; // _roString available now in @implementation // Called before calling any class methods or instantiating any objects -+ (void)initialize ++ (void)initialize { if (self == [MyClass class]) { distance = 0; @@ -393,7 +393,7 @@ distance = 18; // References "long distance" from MyClass implementation // Counterpart to initialize method. Called when an object's reference count is zero - (void)dealloc { - [height release]; // If not using ARC, make sure to release class variable objects + [height release]; // If not using ARC, make sure to release class variable objects [super dealloc]; // and call parent class dealloc } @@ -408,7 +408,7 @@ distance = 18; // References "long distance" from MyClass implementation return self; } // Can create constructors that contain arguments: -- (id)initWithDistance:(int)defaultDistance +- (id)initWithDistance:(int)defaultDistance { distance = defaultDistance; return self; @@ -419,7 +419,7 @@ distance = 18; // References "long distance" from MyClass implementation return @"Some string"; } -+ (MyClass *)myClassFromHeight:(NSNumber *)defaultHeight ++ (MyClass *)myClassFromHeight:(NSNumber *)defaultHeight { height = defaultHeight; return [[self alloc] init]; @@ -435,7 +435,7 @@ distance = 18; // References "long distance" from MyClass implementation return @42; } -// Objective-C does not have private method declarations, but you can simulate them. +// Objective-C does not have private method declarations, but you can simulate them. // To simulate a private method, create the method in the @implementation but not in the @interface. - (NSNumber *)secretPrivateMethod { return @72; @@ -454,15 +454,15 @@ distance = 18; // References "long distance" from MyClass implementation // Categories /////////////////////////////////////// // A category is a group of methods designed to extend a class. They allow you to add new methods -// to an existing class for organizational purposes. This is not to be mistaken with subclasses. -// Subclasses are meant to CHANGE functionality of an object while categories instead ADD +// to an existing class for organizational purposes. This is not to be mistaken with subclasses. +// Subclasses are meant to CHANGE functionality of an object while categories instead ADD // functionality to an object. // Categories allow you to: // -- Add methods to an existing class for organizational purposes. // -- Allow you to extend Objective-C object classes (ex: NSString) to add your own methods. -// -- Add ability to create protected and private methods to classes. -// NOTE: Do not override methods of the base class in a category even though you have the ability -// to. Overriding methods may cause compiler errors later between different categories and it +// -- Add ability to create protected and private methods to classes. +// NOTE: Do not override methods of the base class in a category even though you have the ability +// to. Overriding methods may cause compiler errors later between different categories and it // ruins the purpose of categories to only ADD functionality. Subclass instead to override methods. // Here is a simple Car base class. @@ -494,8 +494,8 @@ distance = 18; // References "long distance" from MyClass implementation @end // Now, if we wanted to create a Truck object, we would instead create a subclass of Car as it would -// be changing the functionality of the Car to behave like a truck. But lets say we want to just add -// functionality to this existing Car. A good example would be to clean the car. So we would create +// be changing the functionality of the Car to behave like a truck. But lets say we want to just add +// functionality to this existing Car. A good example would be to clean the car. So we would create // a category to add these cleaning methods: // @interface filename: Car+Clean.h (BaseClassName+CategoryName.h) #import "Car.h" // Make sure to import base class to extend. @@ -519,7 +519,7 @@ distance = 18; // References "long distance" from MyClass implementation NSLog(@"Waxed."); } -@end +@end // Any Car object instance has the ability to use a category. All they need to do is import it: #import "Car+Clean.h" // Import as many different categories as you want to use. @@ -534,7 +534,7 @@ int main (int argc, const char * argv[]) { [mustang turnOn]; // Use methods from base Car class. [mustang washWindows]; // Use methods from Car's Clean category. } - return 0; + return 0; } // Objective-C does not have protected method declarations but you can simulate them. @@ -548,7 +548,7 @@ int main (int argc, const char * argv[]) { //To use protected methods, import the category, then implement the methods: #import "Car+Protected.h" // Remember, import in the @implementation file only. -@implementation Car +@implementation Car - (void)lockCar { NSLog(@"Car locked."); // Instances of Car can't use lockCar because it's not in the @interface. @@ -571,8 +571,8 @@ int main (int argc, const char * argv[]) { // You can override numOfSides variable or getNumOfSides method to edit them with an extension: // @implementation filename: Shape.m #import "Shape.h" -// Extensions live in the same file as the class @implementation. -@interface Shape () // () after base class name declares an extension. +// Extensions live in the same file as the class @implementation. +@interface Shape () // () after base class name declares an extension. @property (copy) NSNumber *numOfSides; // Make numOfSides copy instead of readonly. -(NSNumber)getNumOfSides; // Make getNumOfSides return a NSNumber instead of an int. @@ -580,7 +580,7 @@ int main (int argc, const char * argv[]) { @end // The main @implementation: -@implementation Shape +@implementation Shape @synthesize numOfSides = _numOfSides; @@ -604,14 +604,14 @@ int main (int argc, const char * argv[]) { @property BOOL engineOn; // Adopting class must @synthesize all defined @properties and - (void)turnOnEngine; // all defined methods. @end -// Below is an example class implementing the protocol. +// Below is an example class implementing the protocol. #import "CarUtilities.h" // Import the @protocol file. @interface Car : NSObject // Name of protocol goes inside <> // You don't need the @property or method names here for CarUtilities. Only @implementation does. - (void)turnOnEngineWithUtilities:(id )car; // You can use protocols as data too. @end -// The @implementation needs to implement the @properties and methods for the protocol. +// The @implementation needs to implement the @properties and methods for the protocol. @implementation Car : NSObject @synthesize engineOn = _engineOn; // Create a @synthesize statement for the engineOn @property. @@ -620,14 +620,14 @@ int main (int argc, const char * argv[]) { _engineOn = YES; // how you implement a method, it just requires that you do implement it. } // You may use a protocol as data as you know what methods and variables it has implemented. -- (void)turnOnEngineWithCarUtilities:(id )objectOfSomeKind { +- (void)turnOnEngineWithCarUtilities:(id )objectOfSomeKind { [objectOfSomeKind engineOn]; // You have access to object variables - [objectOfSomeKind turnOnEngine]; // and the methods inside. + [objectOfSomeKind turnOnEngine]; // and the methods inside. [objectOfSomeKind engineOn]; // May or may not be YES. Class implements it however it wants. } @end -// Instances of Car now have access to the protocol. +// Instances of Car now have access to the protocol. Car *carInstance = [[Car alloc] init]; [carInstance setEngineOn:NO]; [carInstance turnOnEngine]; @@ -656,10 +656,10 @@ if ([myClass conformsToProtocol:@protocol(CarUtilities)]) { // See the problem is that Sister relies on Brother, and Brother relies on Sister. #import "Sister.h" -@protocol Sister; // These lines stop the recursion, resolving the issue. +@protocol Sister; // These lines stop the recursion, resolving the issue. @protocol Brother - + - (void)beNiceToSister:(id )sister; @end @@ -668,24 +668,24 @@ if ([myClass conformsToProtocol:@protocol(CarUtilities)]) { /////////////////////////////////////// // Blocks /////////////////////////////////////// -// Blocks are statements of code, just like a function, that are able to be used as data. +// Blocks are statements of code, just like a function, that are able to be used as data. // Below is a simple block with an integer argument that returns the argument plus 4. -int (^addUp)(int n); // Declare a variable to store the block. -void (^noParameterBlockVar)(void); // Example variable declaration of block with no arguments. +int (^addUp)(int n); // Declare a variable to store the block. +void (^noParameterBlockVar)(void); // Example variable declaration of block with no arguments. // Blocks have access to variables in the same scope. But the variables are readonly and the -// value passed to the block is the value of the variable when the block is created. +// value passed to the block is the value of the variable when the block is created. int outsideVar = 17; // If we edit outsideVar after declaring addUp, outsideVar is STILL 17. __block long mutableVar = 3; // __block makes variables writable to blocks, unlike outsideVar. -addUp = ^(int n) { // Remove (int n) to have a block that doesn't take in any parameters. +addUp = ^(int n) { // Remove (int n) to have a block that doesn't take in any parameters. NSLog(@"You may have as many lines in a block as you would like."); NSSet *blockSet; // Also, you can declare local variables. mutableVar = 32; // Assigning new value to __block variable. - return n + outsideVar; // Return statements are optional. + return n + outsideVar; // Return statements are optional. } -int addUp = add(10 + 16); // Calls block code with arguments. +int addUp = add(10 + 16); // Calls block code with arguments. // Blocks are often used as arguments to functions to be called later, or for callbacks. -@implementation BlockExample : NSObject - +@implementation BlockExample : NSObject + - (void)runBlock:(void (^)(NSString))block { NSLog(@"Block argument returns nothing and takes in a NSString object."); block(@"Argument given to block to execute."); // Calling block. @@ -697,19 +697,19 @@ int addUp = add(10 + 16); // Calls block code with arguments. /////////////////////////////////////// // Memory Management /////////////////////////////////////// -/* +/* For each object used in an application, memory must be allocated for that object. When the application -is done using that object, memory must be deallocated to ensure application efficiency. -Objective-C does not use garbage collection and instead uses reference counting. As long as +is done using that object, memory must be deallocated to ensure application efficiency. +Objective-C does not use garbage collection and instead uses reference counting. As long as there is at least one reference to an object (also called "owning" an object), then the object -will be available to use (known as "ownership"). +will be available to use (known as "ownership"). When an instance owns an object, its reference counter is increments by one. When the object is released, the reference counter decrements by one. When reference count is zero, -the object is removed from memory. +the object is removed from memory. -With all object interactions, follow the pattern of: -(1) create the object, (2) use the object, (3) then free the object from memory. +With all object interactions, follow the pattern of: +(1) create the object, (2) use the object, (3) then free the object from memory. */ MyClass *classVar = [MyClass alloc]; // 'alloc' sets classVar's reference count to one. Returns pointer to object @@ -724,11 +724,11 @@ MyClass *newVar = [classVar retain]; // If classVar is released, object is still // Automatic Reference Counting (ARC) // Because memory management can be a pain, Xcode 4.2 and iOS 4 introduced Automatic Reference Counting (ARC). -// ARC is a compiler feature that inserts retain, release, and autorelease automatically for you, so when using ARC, +// ARC is a compiler feature that inserts retain, release, and autorelease automatically for you, so when using ARC, // you must not use retain, relase, or autorelease -MyClass *arcMyClass = [[MyClass alloc] init]; +MyClass *arcMyClass = [[MyClass alloc] init]; // ... code using arcMyClass -// Without ARC, you will need to call: [arcMyClass release] after you're done using arcMyClass. But with ARC, +// Without ARC, you will need to call: [arcMyClass release] after you're done using arcMyClass. But with ARC, // there is no need. It will insert this release statement for you // As for the 'assign' and 'retain' @property attributes, with ARC you use 'weak' and 'strong' diff --git a/ocaml.html.markdown b/ocaml.html.markdown index b0027fea..02435e4d 100644 --- a/ocaml.html.markdown +++ b/ocaml.html.markdown @@ -34,13 +34,13 @@ For a source file you can use "ocamlc -i /path/to/file.ml" command to print all names and type signatures. ``` -$ cat sigtest.ml +$ cat sigtest.ml let inc x = x + 1 let add x y = x + y -let a = 1 +let a = 1 -$ ocamlc -i ./sigtest.ml +$ ocamlc -i ./sigtest.ml val inc : int -> int val add : int -> int -> int val a : int @@ -104,7 +104,7 @@ let fact_4 = factorial (5-1) ;; let sqr2 = sqr (-2) ;; (* Every function must have at least one argument. - Since some funcions naturally don't take any arguments, there's + Since some funcions naturally don't take any arguments, there's "unit" type for it that has the only one value written as "()" *) let print_hello () = print_endline "hello world" ;; @@ -301,7 +301,7 @@ let l = IntList (1, EmptyList) ;; (* Pattern matching is somewhat similar to switch statement in imperative languages, but offers a lot more expressive power. - Even though it may look complicated, it really boils down to matching + Even though it may look complicated, it really boils down to matching an argument against an exact value, a predicate, or a type constructor. The type system is what makes it so powerful. *) @@ -320,7 +320,7 @@ let is_one = function ;; (* Matching predicates, aka "guarded pattern matching". *) -let abs x = +let abs x = match x with | x when x < 0 -> -x | _ -> x diff --git a/perl6.html.markdown b/perl6.html.markdown index 8d425f7d..63c0830a 100644 --- a/perl6.html.markdown +++ b/perl6.html.markdown @@ -7,11 +7,11 @@ contributors: - ["Nami-Doc", "http://github.com/Nami-Doc"] --- -Perl 6 is a highly capable, feature-rich programming language made for at +Perl 6 is a highly capable, feature-rich programming language made for at least the next hundred years. The primary Perl 6 compiler is called [Rakudo](http://rakudo.org), which runs on -the JVM and [the MoarVM](http://moarvm.com) and +the JVM and [the MoarVM](http://moarvm.com) and [prior to March 2015](http://pmthium.com/2015/02/suspending-rakudo-parrot/), [the Parrot VM](http://parrot.org/). @@ -143,7 +143,7 @@ sub with-mandatory-named(:$str!) { say "$str !"; } with-mandatory-named(str => "My String"); #=> My String ! -with-mandatory-named; # run time error: "Required named parameter not passed" +with-mandatory-named; # run time error: "Required named parameter not passed" with-mandatory-named(3); # run time error: "Too many positional parameters passed" ## If a sub takes a named boolean argument ... @@ -290,7 +290,7 @@ for @array -> $variable { # That means you can use `when` in a `for` just like you were in a `given`. for @array { say "I've got $_"; - + .say; # This is also allowed. # A dot call with no "topic" (receiver) is sent to `$_` by default $_.say; # the above and this are equivalent. @@ -378,8 +378,8 @@ say join(' ', @array[15..*]); #=> 15 16 17 18 19 # which is equivalent to: say join(' ', @array[-> $n { 15..$n }]); -# You can use that in most places you'd expect, even assigning to an array -my @numbers = ^20; +# You can use that in most places you'd expect, even assigning to an array +my @numbers = ^20; my @seq = 3, 9 ... * > 95; # 3 9 15 21 27 [...] 81 87 93 99 @numbers[5..*] = 3, 9 ... *; # even though the sequence is infinite, # only the 15 needed values will be calculated. @@ -634,14 +634,14 @@ class A { method get-value { $.field + $!private-field; } - + method set-value($n) { # $.field = $n; # As stated before, you can't use the `$.` immutable version. $!field = $n; # This works, because `$!` is always mutable. - + $.other-field = 5; # This works, because `$.other-field` is `rw`. } - + method !private-method { say "This method is private to the class !"; } @@ -660,19 +660,19 @@ $a.other-field = 10; # This, however, works, because the public field class A { has $.val; - + submethod not-inherited { say "This method won't be available on B."; say "This is most useful for BUILD, which we'll see later"; } - + method bar { $.val * 5 } } class B is A { # inheritance uses `is` method foo { say $.val; } - + method bar { $.val * 10 } # this shadows A's `bar` } @@ -699,20 +699,20 @@ role PrintableVal { # you "import" a mixin (a "role") with "does": class Item does PrintableVal { has $.val; - + # When `does`-ed, a `role` literally "mixes in" the class: # the methods and fields are put together, which means a class can access # the private fields/methods of its roles (but not the inverse !): method access { say $!counter++; } - + # However, this: # method print {} # is ONLY valid when `print` isn't a `multi` with the same dispatch. # (this means a parent class can shadow a child class's `multi print() {}`, # but it's an error if a role does) - + # NOTE: You can use a role as a class (with `is ROLE`). In this case, methods # will be shadowed, since the compiler will consider `ROLE` to be a class. } @@ -812,7 +812,7 @@ module Foo::Bar { say "Can't access me from outside, I'm my !"; } } - + say ++$n; # lexically-scoped variables are still available } say $Foo::Bar::n; #=> 1 @@ -1075,8 +1075,8 @@ say [//] Nil, Any, False, 1, 5; #=> False # Default value examples: -say [*] (); #=> 1 -say [+] (); #=> 0 +say [*] (); #=> 1 +say [+] (); #=> 0 # meaningless values, since N*1=N and N+0=N. say [//]; #=> (Any) # There's no "default value" for `//`. @@ -1335,7 +1335,7 @@ sub MAIN($name) { say "Hello, $name !" } # This produces: # $ perl6 cli.pl # Usage: -# t.pl +# t.pl # And since it's a regular Perl 6 sub, you can haz multi-dispatch: # (using a "Bool" for the named argument so that we can do `--replace` @@ -1348,7 +1348,7 @@ multi MAIN('import', File, Str :$as) { ... } # omitting parameter name # This produces: # $ perl 6 cli.pl # Usage: -# t.pl [--replace] add +# t.pl [--replace] add # t.pl remove # t.pl [--as=] import (File) # As you can see, this is *very* powerful. @@ -1400,7 +1400,7 @@ for { # (explained in details below). .say } - + if rand == 0 ff rand == 1 { # compare variables other than `$_` say "This ... probably will never run ..."; } diff --git a/php.html.markdown b/php.html.markdown index 93066284..2b1fe1dc 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -515,7 +515,7 @@ class MyClass } } -// Class constants can always be accessed statically +// Class constants can always be accessed statically echo MyClass::MY_CONST; // Outputs 'value'; echo MyClass::$staticVar; // Outputs 'static'; diff --git a/purescript.html.markdown b/purescript.html.markdown index 6bff7545..a006cdff 100644 --- a/purescript.html.markdown +++ b/purescript.html.markdown @@ -70,12 +70,12 @@ true && (9 >= 19 || 1 < 2) -- true -- Safe access return Maybe a head [1,2,3] -- Just (1) -tail [3,2,1] -- Just ([2,1]) +tail [3,2,1] -- Just ([2,1]) init [1,2,3] -- Just ([1,2]) last [3,2,1] -- Just (1) -- Random access - indexing [3,4,5,6,7] !! 2 -- Just (5) --- Range +-- Range 1..5 -- [1,2,3,4,5] length [2,2,2] -- 3 drop 3 [5,4,3,2,1] -- [2,1] @@ -129,10 +129,10 @@ first :: [Number] -> Number first (x:_) = x first [3,4,5] -- 3 second :: [Number] -> Number -second (_:y:_) = y +second (_:y:_) = y second [3,4,5] -- 4 sumTwo :: [Number] -> [Number] -sumTwo (x:y:rest) = (x+y) : rest +sumTwo (x:y:rest) = (x+y) : rest sumTwo [2,3,4,5,6] -- [5,4,5,6] -- sumTwo doesn't handle when the array is empty or just have one @@ -161,7 +161,7 @@ ecoTitle {title: "The Quantum Thief"} -- Object does not have property author -- Lambda expressions (\x -> x*x) 3 -- 9 -(\x y -> x*x + y*y) 4 5 -- 41 +(\x y -> x*x + y*y) 4 5 -- 41 sqr = \x -> x*x -- Currying @@ -187,7 +187,7 @@ foldr (+) 0 (1..10) -- 55 sum (1..10) -- 55 product (1..10) -- 3628800 --- Testing with predicate +-- Testing with predicate any even [1,2,3] -- true all even [1,2,3] -- false diff --git a/python3.html.markdown b/python3.html.markdown index 971ca0a4..acd6187c 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -96,7 +96,7 @@ False or True #=> True 1 < 2 < 3 # => True 2 < 3 < 2 # => False -# (is vs. ==) is checks if two variable refer to the same object, but == checks +# (is vs. ==) is checks if two variable refer to the same object, but == checks # if the objects pointed to have the same values. a = [1, 2, 3, 4] # Point a at a new list, [1, 2, 3, 4] b = a # Point b at what a is pointing to @@ -256,8 +256,8 @@ empty_dict = {} # Here is a prefilled dictionary filled_dict = {"one": 1, "two": 2, "three": 3} -# Note keys for dictionaries have to be immutable types. This is to ensure that -# the key can be converted to a constant hash value for quick look-ups. +# Note keys for dictionaries have to be immutable types. This is to ensure that +# the key can be converted to a constant hash value for quick look-ups. # Immutable types include ints, floats, strings, tuples. invalid_dict = {[1,2,3]: "123"} # => Raises a TypeError: unhashable type: 'list' valid_dict = {(1,2,3):[1,2,3]} # Values can be of any type, however. @@ -423,7 +423,7 @@ else: # Optional clause to the try/except block. Must follow all except blocks print("All good!") # Runs only if the code in try raises no exceptions finally: # Execute under all circumstances print("We can clean up resources here") - + # Instead of try/finally to cleanup resources you can use a with statement with open("myfile.txt") as f: for line in f: diff --git a/r.html.markdown b/r.html.markdown index d3d725d3..93751df5 100644 --- a/r.html.markdown +++ b/r.html.markdown @@ -36,8 +36,8 @@ head(rivers) # peek at the data set length(rivers) # how many rivers were measured? # 141 summary(rivers) # what are some summary statistics? -# Min. 1st Qu. Median Mean 3rd Qu. Max. -# 135.0 310.0 425.0 591.2 680.0 3710.0 +# Min. 1st Qu. Median Mean 3rd Qu. Max. +# 135.0 310.0 425.0 591.2 680.0 3710.0 # make a stem-and-leaf plot (a histogram-like data visualization) stem(rivers) @@ -54,14 +54,14 @@ stem(rivers) # 14 | 56 # 16 | 7 # 18 | 9 -# 20 | +# 20 | # 22 | 25 # 24 | 3 -# 26 | -# 28 | -# 30 | -# 32 | -# 34 | +# 26 | +# 28 | +# 30 | +# 32 | +# 34 | # 36 | 1 stem(log(rivers)) # Notice that the data are neither normal nor log-normal! @@ -70,7 +70,7 @@ stem(log(rivers)) # Notice that the data are neither normal nor log-normal! # The decimal point is 1 digit(s) to the left of the | # # 48 | 1 -# 50 | +# 50 | # 52 | 15578 # 54 | 44571222466689 # 56 | 023334677000124455789 @@ -85,7 +85,7 @@ stem(log(rivers)) # Notice that the data are neither normal nor log-normal! # 74 | 84 # 76 | 56 # 78 | 4 -# 80 | +# 80 | # 82 | 2 # make a histogram: @@ -108,7 +108,7 @@ sort(discoveries) # [76] 4 4 4 4 5 5 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 8 9 10 12 stem(discoveries, scale=2) -# +# # The decimal point is at the | # # 0 | 000000000 @@ -122,14 +122,14 @@ stem(discoveries, scale=2) # 8 | 0 # 9 | 0 # 10 | 0 -# 11 | +# 11 | # 12 | 0 max(discoveries) # 12 summary(discoveries) -# Min. 1st Qu. Median Mean 3rd Qu. Max. -# 0.0 2.0 3.0 3.1 4.0 12.0 +# Min. 1st Qu. Median Mean 3rd Qu. Max. +# 0.0 2.0 3.0 3.1 4.0 12.0 # Roll a die a few times round(runif(7, min=.5, max=6.5)) @@ -262,7 +262,7 @@ class(NULL) # NULL parakeet = c("beak", "feathers", "wings", "eyes") parakeet # => -# [1] "beak" "feathers" "wings" "eyes" +# [1] "beak" "feathers" "wings" "eyes" parakeet <- NULL parakeet # => @@ -279,7 +279,7 @@ as.numeric("Bilbo") # => # [1] NA # Warning message: -# NAs introduced by coercion +# NAs introduced by coercion # Also note: those were just the basic data types # There are many more data types, such as for dates, time series, etc. @@ -419,10 +419,10 @@ mat %*% t(mat) mat2 <- cbind(1:4, c("dog", "cat", "bird", "dog")) mat2 # => -# [,1] [,2] -# [1,] "1" "dog" -# [2,] "2" "cat" -# [3,] "3" "bird" +# [,1] [,2] +# [1,] "1" "dog" +# [2,] "2" "cat" +# [3,] "3" "bird" # [4,] "4" "dog" class(mat2) # matrix # Again, note what happened! diff --git a/racket.html.markdown b/racket.html.markdown index e345db8b..0fe3f030 100644 --- a/racket.html.markdown +++ b/racket.html.markdown @@ -285,7 +285,7 @@ m ; => '#hash((b . 2) (a . 1) (c . 3)) <-- no `d' (= 3 3.0) ; => #t (= 2 1) ; => #f -;; `eq?' returns #t if 2 arguments refer to the same object (in memory), +;; `eq?' returns #t if 2 arguments refer to the same object (in memory), ;; #f otherwise. ;; In other words, it's a simple pointer comparison. (eq? '() '()) ; => #t, since there exists only one empty list in memory @@ -320,7 +320,7 @@ m ; => '#hash((b . 2) (a . 1) (c . 3)) <-- no `d' (eqv? (string-append "foo" "bar") (string-append "foo" "bar")) ; => #f ;; `equal?' supports the comparison of the following datatypes: -;; strings, byte strings, pairs, mutable pairs, vectors, boxes, +;; strings, byte strings, pairs, mutable pairs, vectors, boxes, ;; hash tables, and inspectable structures. ;; for other datatypes, `equal?' and `eqv?' return the same result. (equal? 3 3.0) ; => #f diff --git a/red.html.markdown b/red.html.markdown index f33060c4..05da3c3f 100644 --- a/red.html.markdown +++ b/red.html.markdown @@ -8,31 +8,31 @@ contributors: --- -Red was created out of the need to get work done, and the tool the author wanted to use, the language of REBOL, had a couple of drawbacks. +Red was created out of the need to get work done, and the tool the author wanted to use, the language of REBOL, had a couple of drawbacks. It was not Open Sourced at that time and it is an interpreted language, what means that it is on average slow compared to a compiled language. Red, together with its C-level dialect Red/System, provides a language that covers the entire programming space you ever need to program something in. -Red is a language heavily based on the language of REBOL. Where Red itself reproduces the flexibility of the REBOL language, the underlying language Red will be built upon, -Red/System, covers the more basic needs of programming like C can, being closer to the metal. +Red is a language heavily based on the language of REBOL. Where Red itself reproduces the flexibility of the REBOL language, the underlying language Red will be built upon, +Red/System, covers the more basic needs of programming like C can, being closer to the metal. -Red will be the world's first Full Stack Programming Language. This means that it will be an effective tool to do (almost) any programming task on every level -from the metal to the meta without the aid of other stack tools. -Furthermore Red will be able to cross-compile Red source code without using any GCC like toolchain +Red will be the world's first Full Stack Programming Language. This means that it will be an effective tool to do (almost) any programming task on every level +from the metal to the meta without the aid of other stack tools. +Furthermore Red will be able to cross-compile Red source code without using any GCC like toolchain from any platform to any other platform. And it will do this all from a binary executable that is supposed to stay under 1 MB. Ready to learn your first Red? ``` -All text before the header will be treated as comment, as long as you avoid using the -word "red" starting with a capital "R" in this pre-header text. This is a temporary -shortcoming of the used lexer but most of the time you start your script or program -with the header itself. -The header of a red script is the capitalized word "red" followed by a +All text before the header will be treated as comment, as long as you avoid using the +word "red" starting with a capital "R" in this pre-header text. This is a temporary +shortcoming of the used lexer but most of the time you start your script or program +with the header itself. +The header of a red script is the capitalized word "red" followed by a whitespace character followed by a block of square brackets []. -The block of brackets can be filled with useful information about this script or +The block of brackets can be filled with useful information about this script or program: the author's name, the filename, the version, the license, a summary of what the program does or any other files it needs. -The red/System header is just like the red header, only saying "red/System" and +The red/System header is just like the red header, only saying "red/System" and not "red". Red [] @@ -49,21 +49,21 @@ comment { ; Your program's entry point is the first executable code that is found ; no need to restrict this to a 'main' function. -; Valid variable names start with a letter and can contain numbers, -; variables containing only capital A thru F and numbers and ending with 'h' are -; forbidden, because that is how hexadecimal numbers are expressed in Red and +; Valid variable names start with a letter and can contain numbers, +; variables containing only capital A thru F and numbers and ending with 'h' are +; forbidden, because that is how hexadecimal numbers are expressed in Red and ; Red/System. ; assign a value to a variable using a colon ":" my-name: "Red" -reason-for-using-the-colon: {Assigning values using the colon makes - the equality sign "=" exclusively usable for comparisons purposes, - exactly what "=" was intended for in the first place! +reason-for-using-the-colon: {Assigning values using the colon makes + the equality sign "=" exclusively usable for comparisons purposes, + exactly what "=" was intended for in the first place! Remember this y = x + 1 and x = 1 => y = 2 stuff from school? } is-this-name-valid?: true -; print output using print, or prin for printing without a newline or linefeed at the +; print output using print, or prin for printing without a newline or linefeed at the ; end of the printed text. prin " My name is " print my-name @@ -77,20 +77,20 @@ My name is Red ; ; Datatypes ; -; If you know Rebol, you probably have noticed it has lots of datatypes. Red -; does not have yet all those types, but as Red want to be close to Rebol it +; If you know Rebol, you probably have noticed it has lots of datatypes. Red +; does not have yet all those types, but as Red want to be close to Rebol it ; will have a lot of datatypes. -; You can recognize types by the exclamation sign at the end. But beware -; names ending with an exclamation sign are allowed. -; Some of the available types are integer! string! block! +; You can recognize types by the exclamation sign at the end. But beware +; names ending with an exclamation sign are allowed. +; Some of the available types are integer! string! block! -; Declaring variables before using them? -; Red knows by itself what variable is best to use for the data you want to use it -; for. -; A variable declaration is not always necessary. +; Declaring variables before using them? +; Red knows by itself what variable is best to use for the data you want to use it +; for. +; A variable declaration is not always necessary. ; It is considered good coding practise to declare your variables, ; but it is not forced upon you by Red. -; You can declare a variable and specify its type. a variable's type determines its +; You can declare a variable and specify its type. a variable's type determines its ; size in bytes. ; Variables of integer! type are usually 4 bytes or 32 bits @@ -101,7 +101,7 @@ my-integer: 0 type? my-integer integer! -; A variable can be initialized using another variable that gets initialized +; A variable can be initialized using another variable that gets initialized ; at the same time. i2: 1 + i1: 1 @@ -111,9 +111,9 @@ i2 - i1 ; result 1 i2 * i1 ; result 2 i1 / i2 ; result 0 (0.5, but truncated towards 0) -; Comparison operators are probably familiar, and unlike in other languages you +; Comparison operators are probably familiar, and unlike in other languages you ; only need a single '=' sign for comparison. -; There is a boolean like type in Red. It has values true and false, but also the +; There is a boolean like type in Red. It has values true and false, but also the ; values on/off or yes/no can be used 3 = 2 ; result false @@ -125,15 +125,15 @@ i1 / i2 ; result 0 (0.5, but truncated towards 0) ; ; Control Structures -; +; ; if -; Evaluate a block of code if a given condition is true. IF does not return any value, +; Evaluate a block of code if a given condition is true. IF does not return any value, ; so cannot be used in an expression. if a < 0 [print "a is negative"] ; either -; Evaluate a block of code if a given condition is true, else evaluate an alternative -; block of code. If the last expressions in both blocks have the same type, EITHER can +; Evaluate a block of code if a given condition is true, else evaluate an alternative +; block of code. If the last expressions in both blocks have the same type, EITHER can ; be used inside an expression. either a < 0 [ either a = 0 [ @@ -147,7 +147,7 @@ either a < 0 [ print ["a is " msg lf] -; There is an alternative way to write this +; There is an alternative way to write this ; (Which is allowed because all code paths return a value of the same type): msg: either a < 0 [ @@ -162,7 +162,7 @@ msg: either a < 0 [ print ["a is " msg lf] ; until -; Loop over a block of code until the condition at end of block, is met. +; Loop over a block of code until the condition at end of block, is met. ; UNTIL does not return any value, so it cannot be used in an expression. c: 5 until [ @@ -172,11 +172,11 @@ until [ ] ; will output: ooooo -; Note that the loop will always be evaluated at least once, even if the condition is +; Note that the loop will always be evaluated at least once, even if the condition is ; not met from the beginning. ; while -; While a given condition is met, evaluate a block of code. +; While a given condition is met, evaluate a block of code. ; WHILE does not return any value, so it cannot be used in an expression. c: 5 while [c > 0][ @@ -206,7 +206,7 @@ print twice b ; will output 6. ## Further Reading -The main source for information about Red is the [Red language homepage](http://www.red-lang.org). +The main source for information about Red is the [Red language homepage](http://www.red-lang.org). The source can be found on [github](https://github.com/red/red). @@ -218,4 +218,4 @@ Browse or ask questions on [Stack Overflow](stackoverflow.com/questions/tagged/r Maybe you want to try Red right away? That is possible on the [try Rebol and Red site](http://tryrebol.esperconsultancy.nl). -You can also learn Red by learning some [Rebol](http://www.rebol.com/docs.html). +You can also learn Red by learning some [Rebol](http://www.rebol.com/docs.html). diff --git a/rust.html.markdown b/rust.html.markdown index 3157fcf4..b2854b0c 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -6,20 +6,20 @@ filename: learnrust.rs --- Rust is a programming language developed by Mozilla Research. -Rust combines low-level control over performance with high-level convenience and -safety guarantees. +Rust combines low-level control over performance with high-level convenience and +safety guarantees. -It achieves these goals without requiring a garbage collector or runtime, making +It achieves these goals without requiring a garbage collector or runtime, making it possible to use Rust libraries as a "drop-in replacement" for C. -Rust’s first release, 0.1, occurred in January 2012, and for 3 years development +Rust’s first release, 0.1, occurred in January 2012, and for 3 years development moved so quickly that until recently the use of stable releases was discouraged -and instead the general advice was to use nightly builds. +and instead the general advice was to use nightly builds. -On May 15th 2015, Rust 1.0 was released with a complete guarantee of backward +On May 15th 2015, Rust 1.0 was released with a complete guarantee of backward compatibility. Improvements to compile times and other aspects of the compiler are currently available in the nightly builds. Rust has adopted a train-based release -model with regular releases every six weeks. Rust 1.1 beta was made available at +model with regular releases every six weeks. Rust 1.1 beta was made available at the same time of the release of Rust 1.0. Although Rust is a relatively low-level language, Rust has some functional diff --git a/self.html.markdown b/self.html.markdown index 69524a84..9290a0c9 100644 --- a/self.html.markdown +++ b/self.html.markdown @@ -5,13 +5,13 @@ contributors: filename: learnself.self --- -Self is a fast prototype based OO language which runs in its own JIT vm. Most development is done through interacting with live objects through a visual development environment called *morphic* with integrated browsers and debugger. +Self is a fast prototype based OO language which runs in its own JIT vm. Most development is done through interacting with live objects through a visual development environment called *morphic* with integrated browsers and debugger. Everything in Self is an object. All computation is done by sending messages to objects. Objects in Self can be understood as sets of key-value slots. # Constructing objects -The inbuild Self parser can construct objects, including method objects. +The inbuild Self parser can construct objects, including method objects. ``` "This is a comment" @@ -38,18 +38,18 @@ The inbuild Self parser can construct objects, including method objects. x <- 20. |) -"An object which understands the method 'doubleX' which +"An object which understands the method 'doubleX' which doubles the value of x and then returns the object" (| x <- 20. doubleX = (x: x * 2. self) |) -"An object which understands all the messages -that 'traits point' understands". The parser -looks up 'traits point' by sending the messages -'traits' then 'point' to a known object called -the 'lobby'. It looks up the 'true' object by +"An object which understands all the messages +that 'traits point' understands". The parser +looks up 'traits point' by sending the messages +'traits' then 'point' to a known object called +the 'lobby'. It looks up the 'true' object by also sending the message 'true' to the lobby." (| parent* = traits point. x = 7. @@ -63,19 +63,19 @@ also sending the message 'true' to the lobby." Messages can either be unary, binary or keyword. Precedence is in that order. Unlike Smalltalk, the precedence of binary messages must be specified, and all keywords after the first must start with a capital letter. Messages are separeated from their destination by whitespace. ``` -"unary message, sends 'printLine' to the object '23' +"unary message, sends 'printLine' to the object '23' which prints the string '23' to stdout and returns the receiving object (ie 23)" 23 printLine "sends the message '+' with '7' to '23', then the message '*' with '8' to the result" -(23 + 7) * 8 +(23 + 7) * 8 "sends 'power:' to '2' with '8' returns 256" -2 power: 8 +2 power: 8 -"sends 'keyOf:IfAbsent:' to 'hello' with arguments 'e' and '-1'. +"sends 'keyOf:IfAbsent:' to 'hello' with arguments 'e' and '-1'. Returns 1, the index of 'e' in 'hello'." -'hello' keyOf: 'e' IfAbsent: -1 +'hello' keyOf: 'e' IfAbsent: -1 ``` # Blocks @@ -90,13 +90,13 @@ Examples of the use of a block: ``` "returns 'HELLO'" -'hello' copyMutable mapBy: [|:c| c capitalize] +'hello' copyMutable mapBy: [|:c| c capitalize] "returns 'Nah'" -'hello' size > 5 ifTrue: ['Yay'] False: ['Nah'] +'hello' size > 5 ifTrue: ['Yay'] False: ['Nah'] "returns 'HaLLO'" -'hello' copyMutable mapBy: [|:c| +'hello' copyMutable mapBy: [|:c| c = 'e' ifTrue: [c capitalize] False: ['a']] ``` @@ -105,7 +105,7 @@ Multiple expressions are separated by a period. ^ returns immediately. ``` "returns An 'E'! How icky!" -'hello' copyMutable mapBy: [|:c. tmp <- ''| +'hello' copyMutable mapBy: [|:c. tmp <- ''| tmp: c capitalize. tmp = 'E' ifTrue: [^ 'An \'E\'! How icky!']. c capitalize @@ -119,7 +119,7 @@ Blocks are performed by sending them the message 'value' and inherit (delegate t x: 15. "Repeatedly sends 'value' to the first block while the result of sending 'value' to the second block is the 'true' object" - [x > 0] whileTrue: [x: x - 1]. + [x > 0] whileTrue: [x: x - 1]. x ] value ``` @@ -130,12 +130,12 @@ Methods are like blocks but they are not within a context but instead are stored ``` "Here is an object with one assignable slot 'x' and a method 'reduceXTo: y'. -Sending the message 'reduceXTo: 10' to this object will put +Sending the message 'reduceXTo: 10' to this object will put the object '10' in the 'x' slot and return the original object" -(| +(| x <- 50. reduceXTo: y = ( - [x > y] whileTrue: [x: x - 1]. + [x > y] whileTrue: [x: x - 1]. self) |) . diff --git a/smalltalk.html.markdown b/smalltalk.html.markdown index a434a1ad..3b388505 100644 --- a/smalltalk.html.markdown +++ b/smalltalk.html.markdown @@ -11,28 +11,28 @@ contributors: Feedback highly appreciated! Reach me at [@jigyasa_grover](https://twitter.com/jigyasa_grover) or send me an e-mail at `grover.jigyasa1@gmail.com`. -##Allowable characters: -- a-z -- A-Z -- 0-9 +##Allowable characters: +- a-z +- A-Z +- 0-9 - .+/\*~<>@%|&? - blank, tab, cr, ff, lf ##Variables: -- variables must be declared before use -- shared vars must begin with uppercase -- local vars must begin with lowercase +- variables must be declared before use +- shared vars must begin with uppercase +- local vars must begin with lowercase - reserved names: `nil`, `true`, `false`, `self`, `super`, and `Smalltalk` -##Variable scope: -- Global: defined in Dictionary Smalltalk and accessible by all objects in system - Special: (reserved) `Smalltalk`, `super`, `self`, `true`, `false`, & `nil` -- Method Temporary: local to a method -- Block Temporary: local to a block -- Pool: variables in a Dictionary object +##Variable scope: +- Global: defined in Dictionary Smalltalk and accessible by all objects in system - Special: (reserved) `Smalltalk`, `super`, `self`, `true`, `false`, & `nil` +- Method Temporary: local to a method +- Block Temporary: local to a block +- Pool: variables in a Dictionary object - Method Parameters: automatic local vars created as a result of message call with params - Block Parameters: automatic local vars created as a result of value: message call -- Class: shared with all instances of one class & its subclasses -- Class Instance: unique to each instance of a class +- Class: shared with all instances of one class & its subclasses +- Class Instance: unique to each instance of a class - Instance Variables: unique to each instance `"Comments are enclosed in quotes"` @@ -53,7 +53,7 @@ Transcript cr. "carriage return / l Transcript endEntry. "flush the output buffer" ``` -##Assignment: +##Assignment: ``` | x y | x _ 4. "assignment (Squeak) <-" @@ -72,7 +72,7 @@ y := x deepCopy. "copy object and ins y := x veryDeepCopy. "complete tree copy using a dictionary" ``` -##Constants: +##Constants: ``` | b | b := true. "true constant" @@ -93,7 +93,7 @@ x := #('abc' 2 $a). "mixing of types all ``` -## Booleans: +## Booleans: ``` | b x y | x := 1. y := 2. @@ -132,7 +132,7 @@ b := $A isLowercase. "test if lower case ``` -## Arithmetic expressions: +## Arithmetic expressions: ``` | x | x := 6 + 3. "addition" @@ -190,7 +190,7 @@ x := 100 atRandom. "quick random number ``` -##Bitwise Manipulation: +##Bitwise Manipulation: ``` | b x | x := 16rFF bitAnd: 16r0F. "and bits" @@ -207,7 +207,7 @@ b := 16rFF noMask: 16r0F. "test if all bits se ``` -## Conversion: +## Conversion: ``` | x | x := 3.99 asInteger. "convert number to integer (truncates in Squeak)" @@ -223,15 +223,15 @@ x := 15 storeStringBase: 16. ``` -## Blocks: -- blocks are objects and may be assigned to a variable -- value is last expression evaluated unless explicit return -- blocks may be nested -- specification [ arguments | | localvars | expressions ] -- Squeak does not currently support localvars in blocks -- max of three arguments allowed -- `^`expression terminates block & method (exits all nested blocks) -- blocks intended for long term storage should not contain `^` +## Blocks: +- blocks are objects and may be assigned to a variable +- value is last expression evaluated unless explicit return +- blocks may be nested +- specification [ arguments | | localvars | expressions ] +- Squeak does not currently support localvars in blocks +- max of three arguments allowed +- `^`expression terminates block & method (exits all nested blocks) +- blocks intended for long term storage should not contain `^` ``` | x y z | @@ -241,18 +241,18 @@ Transcript show: (x value: 'First' value: 'Second'); cr. "use block with argu "x := [ | z | z := 1.]. *** localvars not available in squeak blocks" ``` -## Method calls: -- unary methods are messages with no arguments -- binary methods -- keyword methods are messages with selectors including colons standard categories/protocols: - initialize-release (methods called for new instance) -- accessing (get/set methods) -- testing (boolean tests - is) -- comparing (boolean tests with parameter -- displaying (gui related methods) -- printing (methods for printing) -- updating (receive notification of changes) -- private (methods private to class) -- instance-creation (class methods for creating instance) +## Method calls: +- unary methods are messages with no arguments +- binary methods +- keyword methods are messages with selectors including colons standard categories/protocols: - initialize-release (methods called for new instance) +- accessing (get/set methods) +- testing (boolean tests - is) +- comparing (boolean tests with parameter +- displaying (gui related methods) +- printing (methods for printing) +- updating (receive notification of changes) +- private (methods private to class) +- instance-creation (class methods for creating instance) ``` | x | x := 2 sqrt. "unary message" @@ -299,7 +299,7 @@ switch at: $C put: [Transcript show: 'Case C'; cr]. result := (switch at: $B) value. ``` -## Iteration statements: +## Iteration statements: ``` | x y | x := 4. y := 1. @@ -311,7 +311,7 @@ x timesRepeat: [y := y * 2]. "times repear loop ( #(5 4 3) do: [:a | x := x + a]. "iterate over array elements" ``` -## Character: +## Character: ``` | x y | x := $A. "character assignment" @@ -544,7 +544,7 @@ y := x asSet. "convert to set coll ``` ## Set: like Bag except duplicates not allowed -## IdentitySet: uses identity test (== rather than =) +## IdentitySet: uses identity test (== rather than =) ``` | b x y sum max | x := Set with: 4 with: 3 with: 2 with: 1. "create collection with up to 4 elements" @@ -603,7 +603,7 @@ y := x asBag. "convert to bag coll y := x asSet. "convert to set collection" ``` -##Associations: +##Associations: ``` | x y | x := #myVar->'hello'. diff --git a/swift.html.markdown b/swift.html.markdown index 86a0b89a..a40e86c8 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -3,7 +3,7 @@ language: swift contributors: - ["Grant Timmerman", "http://github.com/grant"] - ["Christopher Bess", "http://github.com/cbess"] - - ["Joey Huang", "http://github.com/kamidox"] + - ["Joey Huang", "http://github.com/kamidox"] - ["Anthony Nguyen", "http://github.com/anthonyn60"] filename: learnswift.swift --- @@ -74,7 +74,7 @@ if someOptionalString != nil { if someOptionalString!.hasPrefix("opt") { print("has the prefix") } - + let empty = someOptionalString?.isEmpty } someOptionalString = nil @@ -99,7 +99,7 @@ anyObjectVar = "Changed value to a string, not good practice, but possible." /* Comment here - + /* Nested comments are also supported */ @@ -298,7 +298,7 @@ print(numbers) // [3, 6, 18] // Structures and classes have very similar capabilites struct NamesTable { let names = [String]() - + // Custom subscript subscript(index: Int) -> String { return names[index] @@ -329,7 +329,7 @@ public class Shape { internal class Rect: Shape { var sideLength: Int = 1 - + // Custom getter and setter property private var perimeter: Int { get { @@ -340,11 +340,11 @@ internal class Rect: Shape { sideLength = newValue / 4 } } - + // Lazily load a property // subShape remains nil (uninitialized) until getter called lazy var subShape = Rect(sideLength: 4) - + // If you don't need a custom getter and setter, // but still want to run code before and after getting or setting // a property, you can use `willSet` and `didSet` @@ -354,19 +354,19 @@ internal class Rect: Shape { print(someIdentifier) } } - + init(sideLength: Int) { self.sideLength = sideLength // always super.init last when init custom properties super.init() } - + func shrink() { if sideLength > 0 { --sideLength } } - + override func getArea() -> Int { return sideLength * sideLength } @@ -398,13 +398,13 @@ class Circle: Shape { override func getArea() -> Int { return 3 * radius * radius } - + // Place a question mark postfix after `init` is an optional init // which can return nil init?(radius: Int) { self.radius = radius super.init() - + if radius <= 0 { return nil } @@ -458,7 +458,7 @@ enum Furniture { case Desk(height: Int) // Associate with String and Int case Chair(String, Int) - + func description() -> String { switch self { case .Desk(let height): @@ -497,7 +497,7 @@ protocol ShapeGenerator { class MyShape: Rect { var delegate: TransformShape? - + func grow() { sideLength += 2 @@ -532,7 +532,7 @@ extension Int { var customProperty: String { return "This is \(self)" } - + func multiplyBy(num: Int) -> Int { return num * self } diff --git a/tcl.html.markdown b/tcl.html.markdown index 3982807f..b90bd690 100644 --- a/tcl.html.markdown +++ b/tcl.html.markdown @@ -14,7 +14,7 @@ programming language. It can also be used as a portable C library, even in cases where no scripting capability is needed, as it provides data structures such as dynamic strings, lists, and hash tables. The C library also provides portable functionality for loading dynamic libraries, string formatting and -code conversion, filesystem operations, network operations, and more. +code conversion, filesystem operations, network operations, and more. Various features of Tcl stand out: * Convenient cross-platform networking API @@ -58,14 +58,14 @@ lighter that that of Lisp, just gets out of the way. #! /bin/env tclsh ################################################################################ -## 1. Guidelines +## 1. Guidelines ################################################################################ # Tcl is not Bash or C! This needs to be said because standard shell quoting # habits almost work in Tcl and it is common for people to pick up Tcl and try # to get by with syntax they know from another language. It works at first, # but soon leads to frustration with more complex scripts. - + # Braces are just a quoting mechanism, not a code block constructor or a list # constructor. Tcl doesn't have either of those things. Braces are used, # though, to escape special characters in procedure bodies and in strings that @@ -73,7 +73,7 @@ lighter that that of Lisp, just gets out of the way. ################################################################################ -## 2. Syntax +## 2. Syntax ################################################################################ # Every line is a command. The first word is the name of the command, and @@ -83,13 +83,13 @@ lighter that that of Lisp, just gets out of the way. # are used, they are not a string constructor, but just another escaping # character. -set greeting1 Sal +set greeting1 Sal set greeting2 ut set greeting3 ations #semicolon also delimits commands -set greeting1 Sal; set greeting2 ut; set greeting3 ations +set greeting1 Sal; set greeting2 ut; set greeting3 ations # Dollar sign introduces variable substitution @@ -126,11 +126,11 @@ puts lots\nof\n\n\n\n\n\nnewlines set somevar { This is a literal $ sign, and this \} escaped brace remains uninterpreted -} +} # In a word enclosed in double quotes, whitespace characters lose their special -# meaning +# meaning set name Neo set greeting "Hello, $name" @@ -178,7 +178,7 @@ set greeting "Hello $people::person1::name" ################################################################################ -## 3. A Few Notes +## 3. A Few Notes ################################################################################ # All other functionality is implemented via commands. From this point on, @@ -193,8 +193,8 @@ set greeting "Hello $people::person1::name" namespace delete :: -# Because of name resolution behaviour, it's safer to use the "variable" command to -# declare or to assign a value to a namespace. If a variable called "name" already +# Because of name resolution behaviour, it's safer to use the "variable" command to +# declare or to assign a value to a namespace. If a variable called "name" already # exists in the global namespace, using "set" here will assign a value to the global variable # instead of creating a new variable in the local namespace. namespace eval people { @@ -210,7 +210,7 @@ set people::person1::name Neo ################################################################################ -## 4. Commands +## 4. Commands ################################################################################ # Math can be done with the "expr" command. @@ -295,7 +295,7 @@ while {$i < 10} { # A list is a specially-formatted string. In the simple case, whitespace is sufficient to delimit values -set amounts 10\ 33\ 18 +set amounts 10\ 33\ 18 set amount [lindex $amounts 1] @@ -339,7 +339,7 @@ eval {set name Neo} eval [list set greeting "Hello, $name"] -# Therefore, when using "eval", use [list] to build up a desired command +# Therefore, when using "eval", use [list] to build up a desired command set command {set name} lappend command {Archibald Sorbisol} eval $command @@ -355,7 +355,7 @@ eval $command ;# There is an error here, because there are too many arguments \ # This mistake can easily occur with the "subst" command. set replacement {Archibald Sorbisol} set command {set name $replacement} -set command [subst $command] +set command [subst $command] eval $command ;# The same error as before: too many arguments to "set" in \ {set name Archibald Sorbisol} @@ -364,12 +364,12 @@ eval $command ;# The same error as before: too many arguments to "set" in \ # command. set replacement [list {Archibald Sorbisol}] set command {set name $replacement} -set command [subst $command] +set command [subst $command] eval $command # It is extremely common to see the "list" command being used to properly -# format values that are substituted into Tcl script templates. There are +# format values that are substituted into Tcl script templates. There are # several examples of this, below. @@ -422,12 +422,12 @@ proc while {condition script} { # The "coroutine" command creates a separate call stack, along with a command # to enter that call stack. The "yield" command suspends execution in that -# stack. +# stack. proc countdown {} { #send something back to the initial "coroutine" command yield - set count 3 + set count 3 while {$count > 1} { yield [incr count -1] } @@ -435,12 +435,12 @@ proc countdown {} { } coroutine countdown1 countdown coroutine countdown2 countdown -puts [countdown 1] ;# -> 2 -puts [countdown 2] ;# -> 2 -puts [countdown 1] ;# -> 1 -puts [countdown 1] ;# -> 0 +puts [countdown 1] ;# -> 2 +puts [countdown 2] ;# -> 2 +puts [countdown 1] ;# -> 1 +puts [countdown 1] ;# -> 0 puts [coundown 1] ;# -> invalid command name "countdown1" -puts [countdown 2] ;# -> 1 +puts [countdown 2] ;# -> 1 ``` diff --git a/visualbasic.html.markdown b/visualbasic.html.markdown index f9906e96..bdfdcc10 100644 --- a/visualbasic.html.markdown +++ b/visualbasic.html.markdown @@ -17,7 +17,7 @@ Module Module1 ' This navigation system is explained however as we go deeper into this ' tutorial, you'll understand what it all means. Console.Title = ("Learn X in Y Minutes") - Console.WriteLine("NAVIGATION") 'Display + Console.WriteLine("NAVIGATION") 'Display Console.WriteLine("") Console.ForegroundColor = ConsoleColor.Green Console.WriteLine("1. Hello World Output") @@ -39,13 +39,13 @@ Module Module1 Case "2" 'Hello Input Console.Clear() HelloWorldInput() - Case "3" 'Calculating Whole Numbers + Case "3" 'Calculating Whole Numbers Console.Clear() CalculatingWholeNumbers() - Case "4" 'Calculting Decimal Numbers + Case "4" 'Calculting Decimal Numbers Console.Clear() CalculatingDecimalNumbers() - Case "5" 'Working Calcculator + Case "5" 'Working Calcculator Console.Clear() WorkingCalculator() Case "6" 'Using Do While Loops @@ -74,7 +74,7 @@ Module Module1 'One - I'm using numbers to help with the above navigation when I come back 'later to build it. - 'We use private subs to seperate different sections of the program. + 'We use private subs to seperate different sections of the program. Private Sub HelloWorldOutput() 'Title of Console Application Console.Title = "Hello World Ouput | Learn X in Y Minutes" @@ -172,7 +172,7 @@ Module Module1 'program more than once. Console.Title = "UsingDoWhileLoops | Learn X in Y Minutes" Dim answer As String 'We use the variable "String" as the answer is text - Do 'We start the program with + Do 'We start the program with Console.Write("First number: ") Dim a As Double = Console.ReadLine Console.Write("Second number: ") @@ -192,7 +192,7 @@ Module Module1 Console.WriteLine(" = " + f.ToString.PadLeft(3)) Console.ReadLine() 'Ask the question, does the user wish to continue? Unfortunately it - 'is case sensitive. + 'is case sensitive. Console.Write("Would you like to continue? (yes / no)") 'The program grabs the variable and prints and starts again. answer = Console.ReadLine @@ -208,8 +208,8 @@ Module Module1 Console.Title = "Using For Loops | Learn X in Y Minutes" 'Declare Variable and what number it should count down in Step -1, - 'Step -2, Step -3 ect. - For i As Integer = 10 To 0 Step -1 + 'Step -2, Step -3 ect. + For i As Integer = 10 To 0 Step -1 Console.WriteLine(i.ToString) 'Print the value of the counter Next i 'Calculate new value Console.WriteLine("Start") 'Lets start the program baby!! @@ -274,8 +274,8 @@ End Module ## References -I learnt Visual Basic in the console application. It allowed me to understand the principles of computer programming to go on to learn other programming languages easily. +I learnt Visual Basic in the console application. It allowed me to understand the principles of computer programming to go on to learn other programming languages easily. -I created a more indepth Visual Basic tutorial for those who would like to learn more. +I created a more indepth Visual Basic tutorial for those who would like to learn more. -The entire syntax is valid. Copy the and paste in to the Visual Basic compiler and run (F5) the program. +The entire syntax is valid. Copy the and paste in to the Visual Basic compiler and run (F5) the program. diff --git a/xml.html.markdown b/xml.html.markdown index 059ea132..d407512d 100644 --- a/xml.html.markdown +++ b/xml.html.markdown @@ -38,10 +38,10 @@ Unlike HTML, XML does not specify how to display or to format data, just carry i @@ -54,8 +54,8 @@ Unlike HTML, XML does not specify how to display or to format data, just carry i 2 - Elements -> That's pure data. That's what the parser will retrieve from the XML file. Elements appear between the open and close tags. --> - - + + computer.gif @@ -68,14 +68,14 @@ A XML document is well-formated if it is syntactically correct. However, it is possible to inject more constraints in the document, using document definitions, such as DTD and XML Schema. -A XML document which follows a document definition is called valid, -regarding that document. +A XML document which follows a document definition is called valid, +regarding that document. With this tool, you can check the XML data outside the application logic. ```xml - From e1ac6209a8d3f43e7a018d79454fb1095b3314c0 Mon Sep 17 00:00:00 2001 From: Zachary Ferguson Date: Wed, 7 Oct 2015 23:45:01 -0400 Subject: [PATCH 156/685] [c/en] Added a section for header files. Added a section for header files. Included a discussion of what belongs in a header file and what does not. --- c.html.markdown | 50 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/c.html.markdown b/c.html.markdown index db2ac930..f1201eac 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -6,7 +6,7 @@ contributors: - ["Árpád Goretity", "http://twitter.com/H2CO3_iOS"] - ["Jakub Trzebiatowski", "http://cbs.stgn.pl"] - ["Marco Scannadinari", "https://marcoms.github.io"] - + - ["Zachary Ferguson", "https://github.io/zfergus2"] --- Ah, C. Still **the** language of modern high-performance computing. @@ -630,6 +630,54 @@ typedef void (*my_fnp_type)(char *); ``` +Header files are an important part of c as they allow for the connection of c +source files and can simplify code and definitions by seperating them into +seperate files. + +Header files are syntaxtically similar to c source files but reside in ".h" +files. They can be included in your c source file by using the precompiler +command #include "example.h", given that example.h exists in the same directory +as the c file. + +```c +/* A safe guard to prevent the header from being defined too many times. This */ +/* happens in the case of circle dependency, the contents of the header is */ +/* already defined. */ +#ifndef EXAMPLE_H /* if EXAMPLE_H is not yet defined. */ +#define EXAMPLE_H /* Define the macro EXAMPLE_H. */ + +/* Other headers can be included in headers and therefore transitively */ +/* included into files that include this header. */ +#include + +/* Like c source files macros can be defined in headers and used in files */ +/* that include this header file. */ +#define EXAMPLE_NAME "Dennis Ritchie" +/* Function macros can also be defined. */ +#define ADD(a, b) (a + b) + +/* Structs and typedefs can be used for consistency between files. */ +typedef struct node +{ + int val; + struct node *next; +} Node; + +/* So can enumerations. */ +enum traffic_light_state {GREEN, YELLOW, RED}; + +/* Function prototypes can also be defined here for use in multiple files, */ +/* but it is bad practice to define the function in the header. Definitions */ +/* should instead be put in a c file. */ +Node createLinkedList(int *vals, int len); + +/* Beyond the above elements, other definitions should be left to a c source */ +/* file. Excessive includeds 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. */ + +``` ## Further Reading Best to find yourself a copy of [K&R, aka "The C Programming Language"](https://en.wikipedia.org/wiki/The_C_Programming_Language) From 3c02fdb8e496816b0fd615e029fad4a8ed9f4585 Mon Sep 17 00:00:00 2001 From: Zachary Ferguson Date: Wed, 7 Oct 2015 23:49:46 -0400 Subject: [PATCH 157/685] Revert "[c/en] Added a section for header files." This reverts commit e1ac6209a8d3f43e7a018d79454fb1095b3314c0. --- c.html.markdown | 50 +------------------------------------------------ 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/c.html.markdown b/c.html.markdown index f1201eac..db2ac930 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -6,7 +6,7 @@ contributors: - ["Árpád Goretity", "http://twitter.com/H2CO3_iOS"] - ["Jakub Trzebiatowski", "http://cbs.stgn.pl"] - ["Marco Scannadinari", "https://marcoms.github.io"] - - ["Zachary Ferguson", "https://github.io/zfergus2"] + --- Ah, C. Still **the** language of modern high-performance computing. @@ -630,54 +630,6 @@ typedef void (*my_fnp_type)(char *); ``` -Header files are an important part of c as they allow for the connection of c -source files and can simplify code and definitions by seperating them into -seperate files. - -Header files are syntaxtically similar to c source files but reside in ".h" -files. They can be included in your c source file by using the precompiler -command #include "example.h", given that example.h exists in the same directory -as the c file. - -```c -/* A safe guard to prevent the header from being defined too many times. This */ -/* happens in the case of circle dependency, the contents of the header is */ -/* already defined. */ -#ifndef EXAMPLE_H /* if EXAMPLE_H is not yet defined. */ -#define EXAMPLE_H /* Define the macro EXAMPLE_H. */ - -/* Other headers can be included in headers and therefore transitively */ -/* included into files that include this header. */ -#include - -/* Like c source files macros can be defined in headers and used in files */ -/* that include this header file. */ -#define EXAMPLE_NAME "Dennis Ritchie" -/* Function macros can also be defined. */ -#define ADD(a, b) (a + b) - -/* Structs and typedefs can be used for consistency between files. */ -typedef struct node -{ - int val; - struct node *next; -} Node; - -/* So can enumerations. */ -enum traffic_light_state {GREEN, YELLOW, RED}; - -/* Function prototypes can also be defined here for use in multiple files, */ -/* but it is bad practice to define the function in the header. Definitions */ -/* should instead be put in a c file. */ -Node createLinkedList(int *vals, int len); - -/* Beyond the above elements, other definitions should be left to a c source */ -/* file. Excessive includeds 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. */ - -``` ## Further Reading Best to find yourself a copy of [K&R, aka "The C Programming Language"](https://en.wikipedia.org/wiki/The_C_Programming_Language) From 7aca9100a042f3813d383f979f8c32a95ecc4bbb Mon Sep 17 00:00:00 2001 From: Zachary Ferguson Date: Thu, 8 Oct 2015 00:00:37 -0400 Subject: [PATCH 158/685] [java/en] Fixed repitions --- java.html.markdown | 59 ++-------------------------------------------- 1 file changed, 2 insertions(+), 57 deletions(-) diff --git a/java.html.markdown b/java.html.markdown index 61478968..ba602d2e 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -513,12 +513,8 @@ public class ExampleClass extends ExampleClassParent implements InterfaceOne, } } -<<<<<<< HEAD -// Abstract Classes -======= - // Abstract Classes ->>>>>>> adambard/master + // Abstract Class declaration syntax // abstract extends { // // Constants and variables @@ -535,7 +531,6 @@ public class ExampleClass extends ExampleClassParent implements InterfaceOne, public abstract class Animal { -<<<<<<< HEAD public abstract void makeSound(); // Method can have a body @@ -561,38 +556,10 @@ public abstract class Animal { System.out.println("I am abstract"); } -======= - public abstract void makeSound(); - - // Method can have a body - public void eat() - { - System.out.println("I am an animal and I am Eating."); - // Note: We can access private variable here. - age = 30; - } - - // No need to initialize, however in an interface - // a variable is implicitly final and hence has - // to be initialized. - private int age; - - public void printAge() - { - System.out.println(age); - } - - // Abstract classes can have main function. - public static void main(String[] args) - { - System.out.println("I am abstract"); - } ->>>>>>> adambard/master } class Dog extends Animal { -<<<<<<< HEAD // Note still have to override the abstract methods in the // abstract class. @Override @@ -614,32 +581,10 @@ class Dog extends Animal pluto.eat(); pluto.printAge(); } -======= - // Note still have to override the abstract methods in the - // abstract class. - @Override - public void makeSound() - { - System.out.println("Bark"); - // age = 30; ==> ERROR! age is private to Animal - } - - // NOTE: You will get an error if you used the - // @Override annotation here, since java doesn't allow - // overriding of static methods. - // What is happening here is called METHOD HIDING. - // Check out this awesome SO post: http://stackoverflow.com/questions/16313649/ - public static void main(String[] args) - { - Dog pluto = new Dog(); - pluto.makeSound(); - pluto.eat(); - pluto.printAge(); - } ->>>>>>> adambard/master } // Final Classes + // Final Class declaration syntax // final { // // Constants and variables From 707c8db171cb5239682332f14fd2098901741c63 Mon Sep 17 00:00:00 2001 From: Valentine Silvansky Date: Thu, 8 Oct 2015 10:00:13 +0300 Subject: [PATCH 159/685] Add generics operator in Swift --- swift.html.markdown | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/swift.html.markdown b/swift.html.markdown index a40e86c8..75535e43 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -574,4 +574,18 @@ print(mySquare.sideLength) // 4 // change side length using custom !!! operator, increases size by 3 !!!mySquare print(mySquare.sideLength) // 12 + +// Operators can also be generics +infix operator <-> {} +func <-> (inout a: T, inout b: T) { + let c = a + a = b + b = c +} + +var foo: Float = 10 +var bar: Float = 20 + +foo <-> bar +print("foo is \(foo), bar is \(bar)") // "foo is 20.0, bar is 10.0" ``` From 9796759379d77a848ef84f8c1019672b87b90822 Mon Sep 17 00:00:00 2001 From: himanshu81494 Date: Thu, 8 Oct 2015 14:44:10 +0530 Subject: [PATCH 160/685] Update c.html.markdown --- c.html.markdown | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/c.html.markdown b/c.html.markdown index db2ac930..b99cfe84 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -472,7 +472,22 @@ char c[] = "This is a test."; str_reverse(c); printf("%s\n", c); // => ".tset a si sihT" */ - +//as we can return return only one variable +//to change values of more than one variables we use call by reference +void swapTwoNumbers(int *a, int *b) +{ +int temp = *a; +*a = *b; +*b = temp; +} +/* +int first = 10; +int second = 20; +printf("first: %d\nsecond: %d\n", first, second); +swapTwoNumbers(&first, &second); +printf("first: %d\nsecond: %d\n", first, second); +// values will be swapped +*/ // if referring to external variables outside function, must use extern keyword. int i = 0; void testFunc() { From 626ee03fc3ca27698044db118bd53f563d22ccd0 Mon Sep 17 00:00:00 2001 From: himanshu81494 Date: Thu, 8 Oct 2015 14:45:16 +0530 Subject: [PATCH 161/685] Update c.html.markdown --- c.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/c.html.markdown b/c.html.markdown index b99cfe84..8e1675bb 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -6,6 +6,7 @@ contributors: - ["Árpád Goretity", "http://twitter.com/H2CO3_iOS"] - ["Jakub Trzebiatowski", "http://cbs.stgn.pl"] - ["Marco Scannadinari", "https://marcoms.github.io"] + - ["himanshu", "https://github.com/himanshu81494"] --- From e8248af13431ca87786fff17a605189c69aacf15 Mon Sep 17 00:00:00 2001 From: himanshu81494 Date: Thu, 8 Oct 2015 15:31:40 +0530 Subject: [PATCH 162/685] Update c.html.markdown --- c.html.markdown | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/c.html.markdown b/c.html.markdown index 8e1675bb..29bc5a5b 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -307,7 +307,25 @@ int main(void) { exit(-1); break; } - + + // using "goto" + typedef enum { false, true } bool; + // for C don't have bool as data type :( + bool disaster = false; + int i, j; + for(i=0;i<100;++i) + for(j=0;j<100;++j) + { + if((i + j) >= 150) + disaster = true; + if(disaster) + goto error; + } + error : + printf("Error occured at i = %d & j = %d.\n", i, j); + // this will print out "Error occured at i = 52 & j = 99." + + /////////////////////////////////////// // Typecasting /////////////////////////////////////// From 617599a527a7ee9e3d01a21f11338a1cba3e1eb5 Mon Sep 17 00:00:00 2001 From: himanshu81494 Date: Thu, 8 Oct 2015 15:49:51 +0530 Subject: [PATCH 163/685] Update json.html.markdown --- json.html.markdown | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/json.html.markdown b/json.html.markdown index 6aff2ce2..f4adfc8b 100644 --- a/json.html.markdown +++ b/json.html.markdown @@ -4,6 +4,7 @@ filename: learnjson.json contributors: - ["Anna Harren", "https://github.com/iirelu"] - ["Marco Scannadinari", "https://github.com/marcoms"] + - ["himanshu", "https://github.com/himanshu81494"] --- As JSON is an extremely simple data-interchange format, this is most likely going @@ -13,6 +14,11 @@ JSON in its purest form has no actual comments, but most parsers will accept C-style (`//`, `/* */`) comments. For the purposes of this, however, everything is going to be 100% valid JSON. Luckily, it kind of speaks for itself. +Data types supported by JSON includes: numbers, string, boolean, array, object and null. +Supporting browsers are: Firefox(Mozilla) 3.5, Internet Explorer 8, Chrome, Opera 10, Safari 4. +JSON file type for JSON files is ".json". The MIME type for JSON text is "application/json" +Drawbacks of JSON include lack of type definition and some sort of DTD. + ```json { "key": "value", From b723d3284bbccbcbf5e7ecedee3469b87f4d5959 Mon Sep 17 00:00:00 2001 From: Matteo Taroli Date: Thu, 8 Oct 2015 12:38:19 +0200 Subject: [PATCH 164/685] Add explanation about $_ and fix typos --- fr-fr/perl-fr.html.markdown | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/fr-fr/perl-fr.html.markdown b/fr-fr/perl-fr.html.markdown index 7a061da7..e737b7aa 100644 --- a/fr-fr/perl-fr.html.markdown +++ b/fr-fr/perl-fr.html.markdown @@ -5,6 +5,7 @@ language: perl filename: learnperl-fr.pl contributors: - ["Korjavin Ivan", "http://github.com/korjavin"] + - ["Matteo Taroli", "http://www.matteotaroli.be"] translators: - ["Matteo Taroli", "http://www.matteotaroli.be"] lang: fr-fr @@ -27,7 +28,7 @@ est autant adapté à un prototypage rapide qu'à des projets de grande envergur ### Perl a trois types principaux de variables: $scalaire, @tableau and %hash ## Scalaires -# Un scalaire représente une valeure unique : +# Un scalaire représente une valeur unique : my $animal = "chameau"; my $reponse = 42; @@ -99,8 +100,15 @@ for my $element (@elements) { # implicitement +# La variable de contexte scalaire $_ est utilisée par défaut dans différentes +# situations, comme par exemple dans la boucle foreach ou en argument par défaut +# de la plupart des fonctions pour en simplifier l'écriture. + +# Dans l'exemple suivant, $_ prends successivement la valeur de +# chaque élément de la liste. + for (@elements) { - print; + print; # affiche le contenu de $_ } @@ -116,11 +124,11 @@ if ($a =~ /foo/) { ... } # vrai si $a contient "foo" # Simple substitution -$a =~ s/foo/bar/; # remplace foo par bar dans $a +$a =~ s/foo/bar/; # remplace le premier foo par bar dans $a $a =~ s/foo/bar/g; # remplace TOUTES LES INSTANCES de foo par bar dans $a -#### Fichiers and E/S +#### Fichiers et E/S # Vous pouvez ouvrir un fichier pour y écrire ou pour le lire avec la fonction "open()". @@ -136,9 +144,9 @@ open(my $log, ">>", "my.log") or die "Impossible d'ouvrir my.log: $!"; my $ligne = <$in> my $lignes = <$in> -#### Ecrire des sous-programmes +#### Ecrire des fonctions -# Ecrire des sous-programmes est facile : +# Ecrire des fonctions est facile : sub logger { my $logmessage = shift; @@ -148,9 +156,9 @@ sub logger { print $logfile $logmessage; } -# Maintenant, nous pouvons utiliser le sous-programme comme n'importe quelle fonction intégrée : +# Maintenant, nous pouvons utiliser cette fonction comme n'importe quelle fonction intégrée : -logger("On a un sous-programme de logging!!"); +logger("On a une fonction de logging!!"); ``` #### Utiliser des modules Perl From 6f2d38155930911159bfb4e169b4a4430fed2e72 Mon Sep 17 00:00:00 2001 From: Tim Heaney Date: Thu, 8 Oct 2015 07:14:24 -0400 Subject: [PATCH 165/685] Typo: "thought of" not "though of" --- chapel.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapel.html.markdown b/chapel.html.markdown index e20be998..7252a3e4 100644 --- a/chapel.html.markdown +++ b/chapel.html.markdown @@ -633,7 +633,7 @@ writeln( toThisArray ); // var iterArray : [1..10] int = [ i in 1..10 ] if ( i % 2 == 1 ) then j; // exhibits a runtime error. // Even though the domain of the array and the loop-expression are -// the same size, the body of the expression can be though of as an iterator. +// the same size, the body of the expression can be thought of as an iterator. // Because iterators can yield nothing, that iterator yields a different number // of things than the domain of the array or loop, which is not allowed. From c39264fd881d9a7e39dbba1f37ec9de15cf11eea Mon Sep 17 00:00:00 2001 From: Tim Heaney Date: Thu, 8 Oct 2015 09:00:59 -0400 Subject: [PATCH 166/685] Typo: "easily" rather than "easy" --- fsharp.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsharp.html.markdown b/fsharp.html.markdown index 62118006..76318d7d 100644 --- a/fsharp.html.markdown +++ b/fsharp.html.markdown @@ -119,7 +119,7 @@ printfn "A string %s, and something generic %A" "hello" [1;2;3;4] // ================================================ // F# is a true functional language -- functions are first -// class entities and can be combined easy to make powerful +// class entities and can be combined easily to make powerful // constructs // Modules are used to group functions together From 4b74a7a76d5840cee8f713605347a6cad245d4bb Mon Sep 17 00:00:00 2001 From: Tom Samstag Date: Thu, 8 Oct 2015 08:46:54 -0700 Subject: [PATCH 167/685] fix the output of ff example --- perl6.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl6.html.markdown b/perl6.html.markdown index 63c0830a..26373c28 100644 --- a/perl6.html.markdown +++ b/perl6.html.markdown @@ -1429,7 +1429,7 @@ for { # A flip-flop can change state as many times as needed: for { .say if $_ eq 'start' ^ff^ $_ eq 'stop'; # exclude both "start" and "stop", - #=> "print this printing again" + #=> "print it print again" } # you might also use a Whatever Star, From 6d3f52b7f01409818853de6148abf1d8fe57fab0 Mon Sep 17 00:00:00 2001 From: "Todd M. Guerra" Date: Thu, 8 Oct 2015 11:53:19 -0400 Subject: [PATCH 168/685] Fix some grammar, spelling and indentation Just some quick cleanup to make the code correctly formatted in parts and fixed some typos. --- java.html.markdown | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/java.html.markdown b/java.html.markdown index fc7948d6..e020885c 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -337,7 +337,7 @@ public class LearnJava { validCodes.add("FINLAND"); } - // But there's a nifty way to achive the same thing in an + // But there's a nifty way to achieve the same thing in an // easier way, by using something that is called Double Brace // Initialization. @@ -347,9 +347,9 @@ public class LearnJava { add("FINLAND"); }} - // The first brace is creating an new AnonymousInnerClass and the - // second one declares and instance initializer block. This block - // is called with the anonymous inner class is created. + // The first brace is creating a new AnonymousInnerClass and the + // second one declares an instance initializer block. This block + // is called when the anonymous inner class is created. // This does not only work for Collections, it works for all // non-final classes. @@ -476,14 +476,14 @@ public interface Digestible { // We can now create a class that implements both of these interfaces. public class Fruit implements Edible, Digestible { @Override - public void eat() { - // ... - } + public void eat() { + // awesome code goes here + } @Override - public void digest() { - // ... - } + public void digest() { + // awesome code goes here + } } // In Java, you can extend only one class, but you can implement many @@ -491,12 +491,14 @@ public class Fruit implements Edible, Digestible { public class ExampleClass extends ExampleClassParent implements InterfaceOne, InterfaceTwo { @Override - public void InterfaceOneMethod() { - } + public void InterfaceOneMethod() { + // awesome code goes here + } @Override - public void InterfaceTwoMethod() { - } + public void InterfaceTwoMethod() { + // awesome code goes here + } } From 79cee63879088757cdd5c05c8d51d83a725b794d Mon Sep 17 00:00:00 2001 From: Colton Kohnke Date: Thu, 8 Oct 2015 21:20:37 +0200 Subject: [PATCH 169/685] [matlab/en] Added simple class example to Matlab --- matlab.html.markdown | 54 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/matlab.html.markdown b/matlab.html.markdown index 02fe5962..0cbc6f57 100644 --- a/matlab.html.markdown +++ b/matlab.html.markdown @@ -3,6 +3,7 @@ language: Matlab contributors: - ["mendozao", "http://github.com/mendozao"] - ["jamesscottbrown", "http://jamesscottbrown.com"] + - ["Colton Kohnke", "http://github.com/voltnor"] --- @@ -464,6 +465,59 @@ mean % mean value std % standard deviation perms(x) % list all permutations of elements of x + +% Classes +% Matlab can support object-oriented programming. +% Classes must be put in a file of the class name with a .m extension. +% To begin, we create a simple class to store GPS waypoints. +% Begin WaypointClass.m +classdef WaypointClass % The class name. + properties % The properties of the class behave like Structures + latitude + longitude + end + methods + % This method that has the same name of the class is the constructor. + function obj = WaypointClass(lat, lon) + obj.latitude = lat; + obj.longitude = lon; + end + + % Other functions that use the Waypoint object + function r = multiplyLatBy(obj, n) + r = n*[obj.latitude]; + end + + % If we want to add two Waypoint objects together without calling + % a special function we can overload Matlab's arithmetic like so: + function r = plus(o1,o2) + r = WaypointClass([o1.latitude] +[o2.latitude], ... + [o1.longitude]+[o2.longitude]); + end + end +end +% End WaypointClass.m + +% We can create an object of the class using the constructor +a = WaypointClass(45.0, 45.0) + +% Class properties behave exactly like Matlab Structures. +a.latitude = 70.0 +a.longitude = 25.0 + +% Methods can be called in the same way as functions +ans = multiplyLatBy(a,3) + +% The method can also be called using dot notation. In this case, the object +% does not need to be passed to the method. +ans = a.multiplyLatBy(a,1/3) + +% Matlab functions can be overloaded to handle objects. +% In the method above, we have overloaded how Matlab handles +% the addition of two Waypoint objects. +b = WaypointClass(15.0, 32.0) +c = a + b + ``` ## More on Matlab From 25d5d07dd342dc57831785032b813b3c2b3a5a9e Mon Sep 17 00:00:00 2001 From: Sean Corrales Date: Thu, 8 Oct 2015 15:37:54 -0500 Subject: [PATCH 170/685] Updating function instructions. --- sass.html.markdown | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/sass.html.markdown b/sass.html.markdown index d1e0721f..9bc72478 100644 --- a/sass.html.markdown +++ b/sass.html.markdown @@ -188,7 +188,8 @@ body.noLinks a { #################### */ /* Sass provides functions that can be used to accomplish a variety of tasks. Consider the following */ - + +/* Functions can be invoked by using their name and passing in the required arguments */ body { width: round(10.25px); } @@ -207,19 +208,19 @@ body { background-color: rgba(0, 0, 0, 0.75); } -/* You may also define your own functions. Functions are very similar to mixins. When trying to choose between - a function or a mixin, remember that functions are best for returning values while mixins are best for - generating CSS while functions are better for logic that might be used throughout your Sass code. The - examples in the Math Operators' section are ideal candidates for becoming a reusable function. */ +/* You may also define your own functions. Functions are very similar to mixins. When trying + to choose between a function or a mixin, remember that functions are best for returning + values while mixins are best for generating CSS while functions are better for logic that + might be used throughout your Sass code. The examples in the Math Operators' section are + ideal candidates for becoming a reusable function. */ -/* This function will take a target size and the parent size and calculate and return the percentage */ +/* This function will take a target size and the parent size and calculate and return + the percentage */ @function calculate-percentage($target-size, $parent-size) { @return $target-size / $parent-size * 100%; } -/* Functions can be invoked by using their name and passing in the required arguments */ - $main-content: calculate-percentage(600px, 960px); .main-content { From c7f02d174a72f1f1d807c57e030ba3c8f066c27b Mon Sep 17 00:00:00 2001 From: Colton Kohnke Date: Thu, 8 Oct 2015 23:07:05 +0200 Subject: [PATCH 171/685] [latex/en] Initial latex whirlwind showcase --- latex.html.markdown | 183 ++++++++++++++++++++++++-------------------- 1 file changed, 102 insertions(+), 81 deletions(-) diff --git a/latex.html.markdown b/latex.html.markdown index cc1d99cb..c8f21a83 100644 --- a/latex.html.markdown +++ b/latex.html.markdown @@ -2,6 +2,7 @@ language: latex contributors: - ["Chaitanya Krishna Ande", "http://icymist.github.io"] + - ["Colton Kohnke", "http://github.com/voltnor"] filename: learn-latex.tex --- @@ -12,122 +13,142 @@ getting it to behave exactly the way you want can be a bit hairy. ```latex + % All comment lines start with % % There are no multi-line comments % LaTeX is NOT a ``What You See Is What You Get'' word processing software like % MS Word, or OpenOffice Writer -% Getting to the final document using LaTeX consists of the following steps: -% 1. Write the document in plain text -% 2. Compile plain text document to produce a pdf -% The compilation step looks something like this: -% $ pdflatex your-tex-file.tex your-tex-file.pdf -% A number of LaTeX editors combine both Step 1 and Step 2 in the same piece of -% software. So, you get to see Step 1, but not Step 2 completely. -% Step 2 is still happening behind the scenes. +% LaTeX documents start with a defining the type of document it's compiling +% Other document types include book, report, presentations, etc. +\documentclass[12pt]{article} -% 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 -% format you defined in Step 1. +% Next we define the packages the document uses. +% I'm going to include the float and caption packages for figures. +\usepackage{caption} +\usepackage{float} -% For Step 1, it is best if you get a good text editor -% On Windows, probably Notepad++ -% For Step 2, you will need to get a TeX distribution -% Windows: MikTeX -% MacOS: MacTeX -% Linux: Should be available from your package manager +% We can define some other document properties too! +\author{Chaitanya Krishna Ande \& Colton Kohnke} +\date{\today} +\title{Learn LaTeX in Y Minutes!} -% Let's get to the final pdf document as soon as possible - -% Choose the kind of document you want to write. -% You can replace article with book, report, etc. -\documentclass{article} -% begin the document -\begin{document} -% end the document -\end{document} -% Compile to pdf -% Now, you already have a final document which of course it is empty. -% Everything that you write is between the -% \begin{document} -% \end{document} - -% Start a new document from here. -% Let's do a decent document -\documentclass{article} -% required for inserting images -\usepackage{graphicx} -% begin the document -\begin{document} -% set the title (optional) -\title{Title of the document} -% set the author (optional) -\author{Chaitanya Krishna Ande} - -% make the title (optional) +% Now we're ready to begin the document +% Everything before this line is called "The Preamble" +\begin{document} +% if we set the author, date, title fields, we can have LaTeX +% create a title page fo us. \maketitle -% start the first section \section{Introduction} +Hello, my name is Colton and together we're going to explore LaTeX ! -% write your text -This is the introduction. - -% start another section \section{Another section} -This is the text for another section. +This is the text for another section. I think it needs a subsection. -% another section with subsection -\section{Section with sub-section} -Text for the section. -\subsection{Sub-section} -Let's discuss the Pythagoras theorem. -\subsubsection{Pythagoras Theorm} -% for cross-reference +\subsection{This is a subsection} +I think we need another one + +\subsubsection{Pythagoras} +Much better now. \label{subsec:pythagoras} -% notice how the sections and sub-sections are automatically numbered +\section*{This is an unnumbered section} +However not all sections have to be numbered! -% Some math -% Inline math within $ $ -For a right angled triangle (see Fig.~\ref{fig:right-triangle}) with sides $a$, $b$ and $c$, where $c$ is the -hypotenuse, the following holds: +\section{Some Text notes} +LaTeX is generally pretty good about placing text where it should go. If +a line \\ needs \\ to \\ break \\ you add \textbackslash\textbackslash to +the text. In case you haven't noticed the \textbackslash is the character +the tells the LaTeX compiler it should pay attention to what's next. + +\section{Math} + +One of the primary uses for LaTeX is to produce academic article or +technical papers. Usually in the realm of math and science. As such, +we need to be able to add special symbols to our paper! \\ + +My favorite Greek letter is $\xi$. I also like $\beta$, $\gamma$ and $\sigma$. +Notice how I needed to add \$ signs before and after the symbols. This is +because when writing, we are in text-mode. However, the math symbols only exist +in math-mode. We can enter math-mode from text mode with the \$ signs. +The opposite also holds true. Variable can also be rendered in math-mode. \\ + +% We can also add references +For a right angled triangle (see Fig.~\ref{fig:right-triangle}) with sides $a$, + $b$ and $c$, where $c$ is the hypotenuse, the following holds: % Display math with the equation 'environment' -\begin{equation} +\begin{equation} % enters math-mode c^2 = a^2 + b^2. % for cross-reference \label{eq:pythagoras} -\end{equation} +\end{equation} % all \begin statments must have an end statement -% Let's cross-reference the equation Eqn.~\ref{eq:pythagoras} is also known as the Pythagoras Theorem which is also the subject of Sec.~\ref{subsec:pythagoras}. -\subsubsection{Figure} -Let's insert a Figure. -\begin{figure} +\section{Figures} + +Let's insert a Figure. Figure placement can get a little tricky. +I definately have to lookup the placement options each time. + +\begin{figure}[H] \centering - \includegraphics[width=0.8\linewidth]{right-triangle.png} - \caption{Right triangle with sides a, b, c} + %\includegraphics[width=0.8\linewidth]{right-triangle.png} + % Commented out for compilation purposes. Use your imagination. + \caption{Right triangle with sides $a$, $b$, $c$} \label{fig:right-triangle} \end{figure} - -\subsubsection{Table} +\subsection{Table} Let's insert a Table. -\begin{table} -\caption{Caption for the Table.} -\begin{tabular}{ccc} -Number & Last Name & First Name \\ -\hline -1 & Biggus & Dickus \\ -2 & Monty & Python -\end{tabular} +\begin{table}[H] + \caption{Caption for the Table.} + \begin{tabular}{ccc} + Number & Last Name & First Name \\ + \hline + 1 & Biggus & Dickus \\ + 2 & Monty & Python + \end{tabular} \end{table} + +\section{Compiling} + +By now you're probably wondering how to compile this fabulous document +(yes, it actually compiles). \\ +Getting to the final document using LaTeX consists of the following steps: + \begin{enumerate} % we can also created numbered lists! + \item Write the document in plain text + \item Compile plain text document to produce a pdf. + The compilation step looks something like this: \\ + % Verbatim tells the compiler to not interpret. + \begin{verbatim} + $pdflatex learn-latex.tex learn-latex.pdf + \end{verbatim} + \end{enumerate} + +A number of LaTeX editors combine both Step 1 and Step 2 in the same piece of +software. So, you get to see Step 1, but not Step 2 completely. +Step 2 is still happening behind the scenes. + +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 +format you defined in Step 1. + +\section{End} + +That's all for now! + % end the document \end{document} ``` +## More on 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/) + + From c3914e277bafb320a37617c4a41984462be1a20d Mon Sep 17 00:00:00 2001 From: Raphael Nascimento Date: Thu, 8 Oct 2015 18:34:03 -0300 Subject: [PATCH 172/685] Added for/in loop JavaScript Fixing code style --- javascript.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/javascript.html.markdown b/javascript.html.markdown index f7a662a4..0e38be8f 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -221,7 +221,7 @@ for (var i = 0; i < 5; i++){ //The For/In statement loops iterates over every property across the entire prototype chain var description = ""; var person = {fname:"Paul", lname:"Ken", age:18}; -for (var x in person) { +for (var x in person){ description += person[x] + " "; } @@ -229,8 +229,8 @@ for (var x in person) { //and not its prototypes use hasOwnProperty() check var description = ""; var person = {fname:"Paul", lname:"Ken", age:18}; -for (var x in person) { - if( person.hasOwnProperty( x ) ) { +for (var x in person){ + if (person.hasOwnProperty(x)){ description += person[x] + " "; } } From 8f5f1240eb14919deed89c54f0b322bc11e1469c Mon Sep 17 00:00:00 2001 From: Heather Fenton Date: Thu, 8 Oct 2015 19:18:07 -0400 Subject: [PATCH 173/685] Git: Add Git Immersion tutorial as a resource --- git.html.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git.html.markdown b/git.html.markdown index b1347309..72079f6c 100644 --- a/git.html.markdown +++ b/git.html.markdown @@ -484,6 +484,8 @@ $ git rm /pather/to/the/file/HelloWorld.c * [Udemy Git Tutorial: A Comprehensive Guide](https://blog.udemy.com/git-tutorial-a-comprehensive-guide/) +* [Git Immersion - A Guided tour that walks through the fundamentals of git](http://gitimmersion.com/) + * [git-scm - Video Tutorials](http://git-scm.com/videos) * [git-scm - Documentation](http://git-scm.com/docs) From 16c7f5e3b1260b9ae20613ae02728bf7090b0b9f Mon Sep 17 00:00:00 2001 From: Zsolt Prontvai Date: Fri, 9 Oct 2015 02:41:08 +0200 Subject: [PATCH 174/685] Ruby hungarian translation --- hu-hu/ruby.html.markdown | 555 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 555 insertions(+) create mode 100644 hu-hu/ruby.html.markdown diff --git a/hu-hu/ruby.html.markdown b/hu-hu/ruby.html.markdown new file mode 100644 index 00000000..169f2b8e --- /dev/null +++ b/hu-hu/ruby.html.markdown @@ -0,0 +1,555 @@ +--- +language: ruby +lang: hu-hu +filenev: learnruby.rb +contributors: + - ["David Underwood", "http://theflyingdeveloper.com"] + - ["Joel Walden", "http://joelwalden.net"] + - ["Luke Holder", "http://twitter.com/lukeholder"] + - ["Tristan Hume", "http://thume.ca/"] + - ["Nick LaMuro", "https://github.com/NickLaMuro"] + - ["Marcos Brizeno", "http://www.about.me/marcosbrizeno"] + - ["Ariel Krakowski", "http://www.learneroo.com"] + - ["Dzianis Dashkevich", "https://github.com/dskecse"] + - ["Levi Bostian", "https://github.com/levibostian"] + - ["Rahil Momin", "https://github.com/iamrahil"] + translators: + - ["Zsolt Prontvai", "https://github.com/prozsolt"] +--- + +```ruby +# Ez egy komment + +=begin +Ez egy többsoros komment +Senki sem használja +Neked sem kellene +=end + +# Először is: Minden objektum + +# A számok objektumok + +3.class #=> Fixnum + +3.to_s #=> "3" + + +# Néhány alapvető számtani művelet +1 + 1 #=> 2 +8 - 1 #=> 7 +10 * 2 #=> 20 +35 / 5 #=> 7 +2**5 #=> 32 + +# A számtani művelet csak szintaktikus cukor +# az objektumon történő függvény hívásra +1.+(3) #=> 4 +10.* 5 #=> 50 + +# A speciális értékek objektumok +nil # Nincs itt semmi látnivaló +true # igaz +false # hamis + +nil.class #=> NilClass +true.class #=> TrueClass +false.class #=> FalseClass + +# Egyenlőség +1 == 1 #=> true +2 == 1 #=> false + +# Egyenlőtlenség +1 != 1 #=> false +2 != 1 #=> true + +# A false-on kívül, nil az egyetlen hamis érték + +!nil #=> true +!false #=> true +!0 #=> false + +# Még több összehasonlítás +1 < 10 #=> true +1 > 10 #=> false +2 <= 2 #=> true +2 >= 2 #=> true + +# Logikai operátorok +true && false #=> false +true || false #=> true +!true #=> false + +# A logikai operátoroknak alternatív verziójuk is van sokkal kisebb +# precedenciával. Ezeket arra szánták, hogy több állítást összeláncoljanak +# amíg egyikük igaz vagy hamis értékkel nem tér vissza. + +# `csinalj_valami_mast` csak akkor fut le, ha `csinalj_valamit` igaz értékkel +# tért vissza. +csinalj_valamit() and csinalj_valami_mast() +# `log_error` csak akkor fut le, ha `csinalj_valamit` hamis értékkel +# tért vissza. +csinalj_valamit() or log_error() + + +# A sztringek objektumok + +'Én egy sztring vagyok'.class #=> String +"Én is egy sztring vagyok".class #=> String + +helykitolto = 'interpolációt használhatok' +"Sztring #{helykitolto}, ha dupla időzőjelben van a sztringem" +#=> "Sztring interpolációt használhatok, ha dupla időzőjelben van a sztringem" + +# A szimpla idézőjelet preferáljuk, ahol csak lehet, +# mert a dupla idézőjel extra számításokat végez. + +# Kombinálhatunk sztringeket, de nem számokkal +'hello ' + 'world' #=> "hello world" +'hello ' + 3 #=> TypeError: can't convert Fixnum into String +'hello ' + 3.to_s #=> "hello 3" + +# kiírás a kimenetre +puts "Írok" + +# Változók +x = 25 #=> 25 +x #=> 25 + +# Értékadás az adott értékkel tér vissza +# Ez azt jelenti, hogy használhatunk többszörös értékadást: + +x = y = 10 #=> 10 +x #=> 10 +y #=> 10 + +# Konvencióból, snake_case változó neveket használj +snake_case = true + +# Leíró változó neveket használj +ut_a_projekt_gyokerehez = '/jo/nev/' +ut = '/rossz/nev/' + +# A szimbólumok (objektumok) +# A szimbólumok megváltoztathatatlan, újra felhasználható konstans, +# mely belsőleg egész számként reprezentált. Sokszor sztring helyett használják, +# hogy effektíven közvetítsünk konkrét, értelmes értékeket + +:fuggoben.class #=> Symbol + +statusz = :fuggoben + +statusz == :fuggoben #=> true + +statusz == 'fuggoben' #=> false + +statusz == :jovahagyott #=> false + +# Tömbök + +# Ez egy tömb +tomb = [1, 2, 3, 4, 5] #=> [1, 2, 3, 4, 5] + +# A tömmbök különböző tipusú dolgokat tartalmazhat + +[1, 'hello', false] #=> [1, "hello", false] + +# Tömbök indexelhetőek +# Az elejéről +tomb[0] #=> 1 +tomb[12] #=> nil + +# Akárcsak a számtani műveletek [var] hozzáférés +# is csak szintaktikus cukor +# a [] függvény hívására az objektumon +tomb.[] 0 #=> 1 +tomb.[] 12 #=> nil + +# A végéről +tomb[-1] #=> 5 + +# Kezdőértékkel és hosszal +tomb[2, 3] #=> [3, 4, 5] + +# Tömb megfordítása +a=[1,2,3] +a.reverse! #=> [3,2,1] + +# Vagy tartománnyal +tomb[1..3] #=> [2, 3, 4] + +# Így adhatunk a tömbhöz +tomb << 6 #=> [1, 2, 3, 4, 5, 6] +# Vagy így +tomb.push(6) #=> [1, 2, 3, 4, 5, 6] + +# Ellenőrízük, hogy a tömb tartalmaz egy elemet +tomb.include?(1) #=> true + +# Hash-ek a ruby elsődleges szótárjai kulcs/érték párokkal +# Hash-eket kapcsos zárójellel jelöljük +hash = { 'szin' => 'zold', 'szam' => 5 } + +hash.keys #=> ['szin', 'szam'] + +# Hash-ekben könnyen kreshetünk a kulcs segítségével: +hash['szin'] #=> 'zold' +hash['szam'] #=> 5 + +# Nem létező kulcsra keresve nil-t kapunk: +hash['nincs itt semmi'] #=> nil + +# Ruby 1.9-től, egy külnleges szintaxist is használhatunk a szimbólumot +# használunk kulcsnak + +uj_hash = { defcon: 3, action: true } + +uj_hash.keys #=> [:defcon, :action] + +# Ellenőrizzük, hogy az adott kulcs és érték bene-e van a hash-ben +uj_hash.has_key?(:defcon) #=> true +uj_hash.has_value?(3) #=> true + +# Tip: A tömbök és hash-ek is felsorolhatóak +# Sok közös függvényük van, akár az each, map, count, és több + +# Kontroll Struktúrák + +if true + 'ha állítás' +elsif false + 'különben ha, opcionális' +else + 'különben, szintén opcionális' +end + +for szamlalo in 1..5 + puts "iteracio #{szamlalo}" +end +#=> iteracio 1 +#=> iteracio 2 +#=> iteracio 3 +#=> iteracio 4 +#=> iteracio 5 + +# HOWEVER, No-one uses for loops. +# Instead you should use the "each" method and pass it a block. +# A block is a bunch of code that you can pass to a method like "each". +# It is analogous to lambdas, anonymous functions or closures in other +# programming languages. +# +# The "each" method of a range runs the block once for each element of the range. +# The block is passed a counter as a parameter. +# Calling the "each" method with a block looks like this: + +(1..5).each do |counter| + puts "iteration #{counter}" +end +#=> iteration 1 +#=> iteration 2 +#=> iteration 3 +#=> iteration 4 +#=> iteration 5 + +# You can also surround blocks in curly brackets: +(1..5).each { |counter| puts "iteration #{counter}" } + +# The contents of data structures can also be iterated using each. +array.each do |element| + puts "#{element} is part of the array" +end +hash.each do |key, value| + puts "#{key} is #{value}" +end + +counter = 1 +while counter <= 5 do + puts "iteration #{counter}" + counter += 1 +end +#=> iteration 1 +#=> iteration 2 +#=> iteration 3 +#=> iteration 4 +#=> iteration 5 + +jegy = '4' + +case jegy +when '5' + puts 'Kitünő' +when '4' + puts 'Jó' +when '3' + puts 'Közepes' +when '2' + puts 'Elégsége' +when '1' + puts 'Elégtelen' +else + puts 'Alternatív értékelés, hm?' +end +#=> "Jó" + +# case-ek tartományokat is használhatnak +jegy = 82 +case jegy +when 90..100 + puts 'Hurrá!' +when 80...90 + puts 'Jó munka' +else + puts 'Megbuktál!' +end +#=> "Jó munka" + +# kivétel kezelés: +begin + # kód ami kivételt dobhat + raise NoMemoryError, 'Megtelt a memória' +rescue NoMemoryError => kivetel_valtozo + puts 'NoMemoryError-t dobott', kivetel_valtozo +rescue RuntimeError => mas_kivetel_valtozo + puts 'RuntimeError dobott most' +else + puts 'Ez akkor fut ha nem dob kivételt' +ensure + puts 'Ez a kód mindenképpen lefut' +end + +# Függvények + +def ketszeres(x) + x * 2 +end + +# Függvények (és egyébb blokkok) implicit viszatértnek az utolsó értékkel +ketszeres(2) #=> 4 + +# Zárójelezés opcionális, ha az eredmény félreérthetetlen +ketszeres 3 #=> 6 + +ketszeres ketszeres 3 #=> 12 + +def osszeg(x, y) + x + y +end + +# Függvény argumentumait vesszővel választjuk el. +osszeg 3, 4 #=> 7 + +osszeg osszeg(3, 4), 5 #=> 12 + +# yield +# Minden függvénynek van egy implicit, opcionális block paramétere +# 'yield' kulcsszóval hívhatjuk + +def korulvesz + puts '{' + yield + puts '}' +end + +korulvesz { puts 'hello world' } + +# { +# hello world +# } + + +# Fuggvénynek átadhatunk blokkot +# "&" jelöli az átadott blokk referenciáját +def vendegek(&block) + block.call 'valami_argumentum' +end + +# Argumentum lisát is átadhatunk, ami tömbé lesz konvertálva +# Erre való a splat operátor ("*") +def vendegek(*array) + array.each { |vendeg| puts vendeg } +end + +# Osztályt a class kulcsszóval definiálhatunk +class Ember + + # Az osztály változó. Az osztály minden példánnyával megvan osztva + @@faj = 'H. sapiens' + + # Alap inicializáló + def initialize(nev, kor = 0) + # Hozzárendeli az argumentumot a "nev" példány változóhoz + @nev = nev + # Ha nem adtunk meg kort akkor az alapértemezet értéket fogja használni + @kor = kor + end + + # Alap setter függvény + def nev=(nev) + @nev = nev + end + + # Alap getter függvény + def nev + @nev + end + + # A fönti funkcionalítást az attr_accessor függvénnyel is elérhetjük + attr_accessor :nev + + # Getter/setter függvények egyenként is kreálhatóak + attr_reader :nev + attr_writer :nev + + # Az osztály függvények "self"-et hasznalnak, hogy megkülönböztessék magukat a + # példány függvényektől + # Az osztályn hívhatóak, nem a példányon + def self.mond(uzenet) + puts uzenet + end + + def faj + @@faj + end +end + + +# Példányosítsuk az osztályt +jim = Ember.new('Jim Halpert') + +dwight = Ember.new('Dwight K. Schrute') + +# Hívjunk meg pár függvényt +jim.faj #=> "H. sapiens" +jim.nev #=> "Jim Halpert" +jim.nev = "Jim Halpert II" #=> "Jim Halpert II" +jim.nev #=> "Jim Halpert II" +dwight.faj #=> "H. sapiens" +dwight.nev #=> "Dwight K. Schrute" + +# Hívjuk meg az osztály függvényt +Ember.mond('Hi') #=> "Hi" + +# Változók szókjait az elnevezésük definiálja +# $ kezdetű változók globálisak +$var = "Én egy globális változó vagyok" +defined? $var #=> "global-variable" + +# Változók amik @-al kezdődnek példány szkópjuk van +@var = "Én egy példány változó vagyok" +defined? @var #=> "instance-variable" + +# Változók amik @@-al kezdődnek példány szkópjuk van +@@var = "Én egy osztály változó vagyok" +defined? @@var #=> "class variable" + +# Változók amik nagy betűvel kezdődnek a konstansok +Var = "Konstans vagyok" +defined? Var #=> "constant" + +# Az osztály is objetum. Tehát az osztálynak lehet példány változója +# Az osztályváltozón osztozik minden pédány és leszármazott + +# Ős osztály +class Ember + @@foo = 0 + + def self.foo + @@foo + end + + def self.foo=(ertek) + @@foo = ertek + end +end + +# Leszarmazott osztály +class Dolgozo < Ember +end + +Ember.foo # 0 +Dolgozo.foo # 0 + +Ember.foo = 2 # 2 +Dolgozo.foo # 2 + +# Az osztálynak példány változóját nem látja az osztály leszármazottja. + +class Ember + @bar = 0 + + def self.bar + @bar + end + + def self.bar=(ertek) + @bar = ertek + end +end + +class Doctor < Ember +end + +Ember.bar # 0 +Doctor.bar # nil + +module ModulePelda + def foo + 'foo' + end +end + +# Modulok include-olása a fügvényeiket az osztály példányaihoz köti. +# Modulok extend-elésa a fügvényeiket magához az osztályhoz köti. + +class Szemely + include ModulePelda +end + +class Konyv + extend ModulePelda +end + +Szemely.foo # => NoMethodError: undefined method `foo' for Szemely:Class +Szemely.new.foo # => 'foo' +Konyv.foo # => 'foo' +Konyv.new.foo # => NoMethodError: undefined method `foo' + +# Callback-ek végrehajtódnak amikor include-olunk és extend-elünk egy modult + +module ConcernPelda + def self.included(base) + base.extend(ClassMethods) + base.send(:include, InstanceMethods) + end + + module ClassMethods + def bar + 'bar' + end + end + + module InstanceMethods + def qux + 'qux' + end + end +end + +class Valami + include ConcernPelda +end + +Valami.bar # => 'bar' +Valami.qux # => NoMethodError: undefined method `qux' +Valami.new.bar # => NoMethodError: undefined method `bar' +Valami.new.qux # => 'qux' +``` + +## Egyéb források + +- [Learn Ruby by Example with Challenges](http://www.learneroo.com/modules/61/nodes/338) +- [Official Documentation](http://www.ruby-doc.org/core-2.1.1/) +- [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/) - A régebbi [ingyenes változat](http://ruby-doc.com/docs/ProgrammingRuby/) elérhető online. +- [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide) From d1b75f63352338bcbb1af6731c9a47b977a6be24 Mon Sep 17 00:00:00 2001 From: Raphael Nascimento Date: Thu, 8 Oct 2015 23:39:00 -0300 Subject: [PATCH 175/685] translation clojure-macros to pt br --- pt-br/clojure-macros-pt.html.markdown | 154 ++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 pt-br/clojure-macros-pt.html.markdown diff --git a/pt-br/clojure-macros-pt.html.markdown b/pt-br/clojure-macros-pt.html.markdown new file mode 100644 index 00000000..dbc0c25c --- /dev/null +++ b/pt-br/clojure-macros-pt.html.markdown @@ -0,0 +1,154 @@ +--- +language: clojure +filename: learnclojure-pt.clj +contributors: + - ["Adam Bard", "http://adambard.com/"] +translators: + - ["Raphael Bezerra do Nascimento"] +lang: pt-br +--- + +Como todas as Lisps, a inerente [homoiconicity](https://en.wikipedia.org/wiki/Homoiconic) +do Clojure lhe dá acesso a toda a extensão da linguagem +para escrever rotinas de geração de código chamados "macros". Macros fornecem uma poderosa forma de adequar a linguagem +às suas necessidades. + +Pórem Tenha cuidado. É considerado má pratica escrever uma macro quando uma função vai fazer. Use uma macro apenas +quando você precisar do controle sobre quando ou se os argumentos para um formulário será avaliado. + +Você vai querer estar familiarizado com Clojure. Certifique-se de entender tudo em +[Clojure em Y Minutos](/docs/clojure/). + +```clojure +;; Defina uma macro utilizando defmacro. Sua macro deve ter como saida uma lista que possa +;; ser avaliada como codigo Clojure. +;; +;; Essa macro é a mesma coisa que se você escrever (reverse "Hello World") +(defmacro my-first-macro [] + (list reverse "Hello World")) + +;; Inspecione o resultado de uma macro utilizando macroexpand or macroexpand-1. +;; +;; Note que a chamada deve utilizar aspas simples. +(macroexpand '(my-first-macro)) +;; -> (# "Hello World") + +;; Você pode avaliar o resultad de macroexpand diretamente: +(eval (macroexpand '(my-first-macro))) +; -> (\d \l \o \r \W \space \o \l \l \e \H) + +;; mas você deve usar esse mais suscinto, sintax como de função: +(my-first-macro) ; -> (\d \l \o \r \W \space \o \l \l \e \H) + +;; Você pode tornar as coisas mais faceis pra você, utilizando a sintaxe de citação mais suscinta +;; para criar listas nas suas macros: +(defmacro my-first-quoted-macro [] + '(reverse "Hello World")) + +(macroexpand '(my-first-quoted-macro)) +;; -> (reverse "Hello World") +;; Note que reverse não é mais uma função objeto, mas um simbolo. + +;; Macros podem ter argumentos. +(defmacro inc2 [arg] + (list + 2 arg)) + +(inc2 2) ; -> 4 + +;; Mas se você tentar fazer isso com uma lista entre aspas simples, você vai receber um erro, por que o +;; argumento irá entra aspas simples também. Para contornar isso, Clojure prover uma maneira de utilizar aspas simples +;; em macros: `. Dentro `, você pode usar ~ para chegar ao escopo externo. +(defmacro inc2-quoted [arg] + `(+ 2 ~arg)) + +(inc2-quoted 2) + +;; Você pode usar os argumentos de destruturação habituais. Expandir lista de variaveis usando ~@ +(defmacro unless [arg & body] + `(if (not ~arg) + (do ~@body))) ; Lembrar o do! + +(macroexpand '(unless true (reverse "Hello World"))) +;; -> +;; (if (clojure.core/not true) (do (reverse "Hello World"))) + +;; (unless) avalia e retorna seu corpo, se o primeiro argumento é falso. +;; caso contrario, retorna nil + +(unless true "Hello") ; -> nil +(unless false "Hello") ; -> "Hello" + +;; Usado sem cuidados, macros podem fazer muito mal por sobreporem suas variaveis +(defmacro define-x [] + '(do + (def x 2) + (list x))) + +(def x 4) +(define-x) ; -> (2) +(list x) ; -> (2) + +;;s Para evitar isso, use gensym para receber um identificador unico +(gensym 'x) ; -> x1281 (ou outra coisa) + +(defmacro define-x-safely [] + (let [sym (gensym 'x)] + `(do + (def ~sym 2) + (list ~sym)))) + +(def x 4) +(define-x-safely) ; -> (2) +(list x) ; -> (4) + +;; Você pode usar # dentro de ` para produzir uma gensym para cada simbolo automaticamente +(defmacro define-x-hygenically [] + `(do + (def x# 2) + (list x#))) + +(def x 4) +(define-x-hygenically) ; -> (2) +(list x) ; -> (4) + +;; É típico o uso de funções de auxilio com macros. Vamos criar um pouco +;; Vamos criar um pouco para nos ajudar a suportar uma sintaxe aritmética inline (estupida) +(declare inline-2-helper) +(defn clean-arg [arg] + (if (seq? arg) + (inline-2-helper arg) + arg)) + +(defn apply-arg + "Given args [x (+ y)], return (+ x y)" + [val [op arg]] + (list op val (clean-arg arg))) + +(defn inline-2-helper + [[arg1 & ops-and-args]] + (let [ops (partition 2 ops-and-args)] + (reduce apply-arg (clean-arg arg1) ops))) + +;; Podemos testar isso imediatamente, sem criar uma macro +(inline-2-helper '(a + (b - 2) - (c * 5))) ; -> (- (+ a (- b 2)) (* c 5)) + +; Entretanto, temos que tornar isso uma macro caso quisermos que isso seja rodado em tempo de compilação +(defmacro inline-2 [form] + (inline-2-helper form))) + +(macroexpand '(inline-2 (1 + (3 / 2) - (1 / 2) + 1))) +; -> (+ (- (+ 1 (/ 3 2)) (/ 1 2)) 1) + +(inline-2 (1 + (3 / 2) - (1 / 2) + 1)) +; -> 3 (Na verdade, 3N, desde que o numero ficou convertido em uma fração racional com / + +### Leitura adicional + +Escrevendo Macros de [Clojure para o Brave e True](http://www.braveclojure.com/) +[http://www.braveclojure.com/writing-macros/](http://www.braveclojure.com/writing-macros/) + +Documentos oficiais +[http://clojure.org/macros](http://clojure.org/macros) + +Quando utilizar macros? +[http://dunsmor.com/lisp/onlisp/onlisp_12.html](http://dunsmor.com/lisp/onlisp/onlisp_12.html) From bc065831ce25467ba06d3cf6e6ad159eed16a525 Mon Sep 17 00:00:00 2001 From: Clayton Walker Date: Thu, 8 Oct 2015 23:24:25 -0400 Subject: [PATCH 176/685] Added suggested changes --- go.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go.html.markdown b/go.html.markdown index f9821a0c..646a5650 100644 --- a/go.html.markdown +++ b/go.html.markdown @@ -408,8 +408,8 @@ func requestServer() { The root of all things Go is the [official Go web site](http://golang.org/). There you can follow the tutorial, play interactively, and read lots. -Aside from a tour, [the docs](https://golang.org/doc/) contain how to write -clean and effective Go code, package and command docs, and release history. +Aside from a tour, [the docs](https://golang.org/doc/) contain information on +how to write clean and effective Go code, package and command docs, and release history. The language definition itself is highly recommended. It's easy to read and amazingly short (as language definitions go these days.) From b4860de42f2bbf0ab97ef28085eb40accb030657 Mon Sep 17 00:00:00 2001 From: Clayton Walker Date: Thu, 8 Oct 2015 23:27:19 -0400 Subject: [PATCH 177/685] Suggested changes --- swift.html.markdown | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/swift.html.markdown b/swift.html.markdown index 46e5e6d4..9f0019d8 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -58,8 +58,8 @@ let piText = "Pi = \(π), Pi 2 = \(π * 2)" // String interpolation print("Build value: \(buildValue)") // Build value: 7 /* - Optionals are a Swift language feature that either contains a value, - or contains nil (no value) to indicate that a value is missing. + Optionals are a Swift language feature that either contains a value, + or contains nil (no value) to indicate that a value is missing. A question mark (?) after the type marks the value as optional. Because Swift requires every property to have a value, even nil must be @@ -82,9 +82,9 @@ if someOptionalString != nil { someOptionalString = nil /* - To get the underlying type from an optional, you unwrap it using the - force unwrap operator (!). Only use the unwrap operator if you're sure - the underlying value isn't nil. + Trying to use ! to access a non-existent optional value triggers a runtime + error. Always make sure that an optional contains a non-nil value before + using ! to force-unwrap its value. */ // implicitly unwrapped optional From 7fd149485e0cbef6fc57206cb1377f261ed70278 Mon Sep 17 00:00:00 2001 From: Martin N Date: Fri, 9 Oct 2015 07:39:22 +0000 Subject: [PATCH 178/685] Mention of trailing commas in JSON and that they should be avoided --- json.html.markdown | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/json.html.markdown b/json.html.markdown index 6aff2ce2..a85cecc4 100644 --- a/json.html.markdown +++ b/json.html.markdown @@ -10,8 +10,11 @@ As JSON is an extremely simple data-interchange format, this is most likely goin to be the simplest Learn X in Y Minutes ever. JSON in its purest form has no actual comments, but most parsers will accept -C-style (`//`, `/* */`) comments. For the purposes of this, however, everything is -going to be 100% valid JSON. Luckily, it kind of speaks for itself. +C-style (`//`, `/* */`) comments. Some parsers also tolerate a trailing comma +(i.e. a comma after the last element of an array or the after the last property of an object), +but they should be avoided for better compatibility. + +For the purposes of this, however, everything is going to be 100% valid JSON. Luckily, it kind of speaks for itself. ```json { From 4c27047a9748c0d3197dc63de34cc8bebf03633f Mon Sep 17 00:00:00 2001 From: Vojta Svoboda Date: Fri, 9 Oct 2015 11:27:19 +0200 Subject: [PATCH 179/685] [json/en] Typo --- json.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json.html.markdown b/json.html.markdown index a85cecc4..a1629137 100644 --- a/json.html.markdown +++ b/json.html.markdown @@ -14,7 +14,7 @@ C-style (`//`, `/* */`) comments. Some parsers also tolerate a trailing comma (i.e. a comma after the last element of an array or the after the last property of an object), but they should be avoided for better compatibility. -For the purposes of this, however, everything is going to be 100% valid JSON. Luckily, it kind of speaks for itself. +For the purposes of this, however, everything is going to be 100% valid JSON. Luckily, it kind of speaks for itself. ```json { From ab8267f4273d6fa2c3027775e353d95e7d5f1493 Mon Sep 17 00:00:00 2001 From: payet-s Date: Thu, 8 Oct 2015 16:48:50 +0200 Subject: [PATCH 180/685] [yaml/fr] Fix typos --- fr-fr/yaml-fr.html.markdown | 92 +++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 44 deletions(-) diff --git a/fr-fr/yaml-fr.html.markdown b/fr-fr/yaml-fr.html.markdown index 43b1df54..1e8296d3 100644 --- a/fr-fr/yaml-fr.html.markdown +++ b/fr-fr/yaml-fr.html.markdown @@ -8,113 +8,117 @@ lang: fr-fr Proposé à l'origine par Clark Evans en Mai 2001, YAML est un un format de représentation de données par sérialisation, conçu pour être aisément -éditable et lisible par nous même, les humains. +modifiable et lisible par nous-mêmes, les humains. -YAML est plus concis que le XML auquel il est parfois comparé par ceux qui le découvre, plus lisible et clair que le CSV, et emprunte beaucoup au JSON dont il est un parent naturel. Toutefois, YAML emprunte également des idées et concepts de chez Python, et s'intègre bien avec bon nombre de langages. +YAML est plus concis que le XML auquel il est parfois comparé par ceux qui le +découvre, plus lisible et clair que le CSV, et emprunte beaucoup au JSON dont +il est un parent naturel. Toutefois, YAML emprunte également des idées et +concepts de Python, et s'intègre bien avec bon nombre de langages. +Contrairement à ce dernier, YAML interdit l'utilisation des tabulations. ```yaml -# les Commentaires sont précédés d'un signe "#", comme cette ligne. +# Les commentaires sont précédés d'un signe "#", comme cette ligne. ############# # SCALAIRES # ############# -# Les scalaires sont l'ensemble des types YAML qui ne sont pas des collections -# ( listes ou tableaux associatifs ). +# Les scalaires sont l'ensemble des types YAML qui ne sont pas des collections +# (listes ou tableaux associatifs). -# Notre objet root ( racine ), sera une map ( carte ) et englobera -# l'intégralité du document. Cette map est l'équivalent d'un dictionnaire, +# Notre objet root (racine), sera une map (carte) et englobera +# l'intégralité du document. Cette map est l'équivalent d'un dictionnaire, # hash ou objet dans d'autres langages. clé: valeur -aurtre_clé: une autre valeur +autre_clé: une autre valeur valeur_numérique: 100 notation_scientifique: 1e+12 -boolean: true +booléen: true valeur_null: null clé avec espaces: valeur -# Bien qu'il ne soit pas nécessaire d'enfermer les chaînes de caractères +# Bien qu'il ne soit pas nécessaire de mettre les chaînes de caractères # entre guillemets, cela reste possible, et parfois utile. toutefois: "Une chaîne, peut être contenue entre guillemets." -"Une clé entre guillemets.": "Utile si on veut utiliser ':' dans la clé." +"Une clé entre guillemets.": "Utile si l'on veut utiliser ':' dans la clé." -# Les chaînes couvrant plusieurs lignes, peuvent être écrites au choix, -# comme un 'bloc littéral' ( avec | ) ou bien 'bloc replié' avec ( > ). +# Les chaînes couvrant plusieurs lignes, peuvent être écrites au choix, +# comme un "bloc littéral" (avec '|') ou bien un "bloc replié" (avec '>'). bloc_littéral: | - Tout ce bloc de texte sera la valeur de la clé 'bloc_littéral', - avec préservation des retours à la ligne. ( chaque ligne vide à - l'intérieur du même bloc, sera remplacée par "\n\n" ) + Tout ce bloc de texte sera la valeur de la clé "bloc_littéral", + avec préservation des retours à la ligne. Le littéral continue jusqu'à ce que l'indentation soit annulée. - Toutes lignes qui serait "d'avantage indentées" conservent leur + Toutes lignes qui seraient "davantage indentées" conservent leur indentation, constituée de 4 espaces. bloc_replié: > - Tout ce bloc de texte sera la valeur de la clé 'bloc_replié', mais - cette fois ci, toutes les nouvelles lignes deviendront un simple espace. + Tout ce bloc de texte sera la valeur de la clé "bloc_replié", mais + cette fois-ci, toutes les nouvelles lignes deviendront un simple espace. - Les lignes vides, comme ci-dessus, seront converties en caractère "\n". + Les lignes vides, comme ci-dessus, seront converties en caractère de + nouvelle ligne. - Les lignes 'plus-indentées' gardent leurs retours à la ligne - + Les lignes "plus-indentées" gardent leurs retours à la ligne - ce texte apparaîtra sur deux lignes. ############### # COLLECTIONS # ############### -# l'Imbrication est créée par indentation. +# L'imbrication est créée par indentation. une_map_imbriquée: clé: valeur autre_clé: autre valeur autre_map_imbriquée: bonjour: bonjour -# les Clés des Maps ne sont pas nécessairement des chaînes de caractères. -0.25: une clé de type float +# Les clés des maps ne sont pas nécessairement des chaînes de caractères. +0.25: une clé de type flottant -# les Clés peuvent également être des objets s'étendant sur plusieurs lignes, +# Les clés peuvent également être des objets s'étendant sur plusieurs lignes, # en utilisant le signe "?" pour indiquer le début de la clé. ? | - ceci est une Clé + ceci est une clé sur de multiples lignes -: et ceci est sa Valeur +: et ceci est sa valeur # YAML autorise aussi l'usage des collections à l'intérieur des clés, # mais certains langages de programmation ne le tolère pas si bien. -# les Séquences (équivalent des listes ou tableaux) ressemblent à cela: +# Les séquences (équivalent des listes ou tableaux) ressemblent à cela : une_séquence: - - Item 1 - - Item 2 + - Objet 1 + - Objet 2 - 0.5 # les séquences peuvent contenir des types variés. - - Item 4 + - Objet 4 - clé: valeur autre_clé: autre_valeur - - Ceci est une séquence - dans une autre séquence -# YAML étant un proche parent de JSON, vous pouvez écrire directement +# YAML étant un proche parent de JSON, vous pouvez écrire directement # des maps et séquences façon JSON json_map: {"clé": "valeur"} json_seq: [1, 2, 3, "soleil"] -################################# +################################ # AUTRES FONCTIONNALITÉES YAML # -################################# +################################ -# YAML possède une fonctionnalité fort utile nommée 'ancres'. Celle-ci +# YAML possède une fonctionnalité fort utile nommée "ancres". Celle-ci # vous permet de dupliquer aisément du contenu au sein de votre document. -# Les deux clés suivantes auront la même valeur: +# Les deux clés suivantes auront la même valeur : contenu_ancré: &nom_ancre Cette chaîne sera la valeur des deux clés. autre_ancre: *nom_ancre -# Avec les Tags YAML, vous pouvez explicitement déclarer des types de données. +# Avec les tags YAML, vous pouvez explicitement déclarer des types de données. chaine_explicite: !!str 0.5 -# Certains parsers implémentent des tags spécifiques à d'autres langages, -# comme par exemple le "complex number" de Python. +# Certains analyseurs syntaxiques (parsers) implémentent des tags spécifiques à +# d'autres langages, comme par exemple celui des nombres complexes de Python. python_complex_number: !!python/complex 1+2j ##################### @@ -122,7 +126,7 @@ python_complex_number: !!python/complex 1+2j ##################### # YAML interprète également les données formatées ISO de type date et datetime, -# pas seulement les chaînes et nombres. +# pas seulement les chaînes et nombres. datetime: 2001-12-15T02:59:43.1Z datetime_avec_espaces: 2001-12-14 21:59:43.10 -5 date: 2002-12-14 @@ -135,14 +139,14 @@ fichier_gif: !!binary | +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs= -# YAML a de même un type "set", qui ressemble à cela: +# YAML a de même un type "set", semblable à ceci : set: ? item1 ? item2 ? item3 # Comme dans Python, les sets ne sont que des maps contenant des valeurs null ; -# le set précédent est l'équivalent du suivant: +# le set précédent est l'équivalent du suivant : set2: item1: null item2: null @@ -152,6 +156,6 @@ set2: Quelques références et outils : -- Doc officielle [YAML 1.2](http://www.yaml.org/spec/1.2/spec.html) *anglais*, +- Documentation officielle [YAML 1.2](http://www.yaml.org/spec/1.2/spec.html) *anglais*, - Une [Introduction à YAML](http://sweetohm.net/html/introduction-yaml.html) très bien construite et claire, -- Un outil pour tester [live](http://yaml-online-parser.appspot.com/) la syntaxe YAML, avec des exemples. +- Un outil pour tester [en ligne](http://yaml-online-parser.appspot.com/) la syntaxe YAML, avec des exemples. From bf7d33037f64ea9f80f106a37929e3fdf20bd24d Mon Sep 17 00:00:00 2001 From: Cameron Schermerhorn Date: Fri, 9 Oct 2015 08:14:11 -0400 Subject: [PATCH 181/685] Add space to comment prior to switch string + Add space to comment (after //) prior to switch on string example --- java.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java.html.markdown b/java.html.markdown index e567b049..eb8b23e9 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -277,7 +277,7 @@ public class LearnJava { } System.out.println("Switch Case Result: " + monthString); - //Starting in Java 7 and above, switching Strings works like this: + // Starting in Java 7 and above, switching Strings works like this: String myAnswer = "maybe"; switch(myAnswer){ case "yes": From 1f68a9645573e54354d672709605ed9975e4843b Mon Sep 17 00:00:00 2001 From: wboka Date: Fri, 9 Oct 2015 08:43:12 -0400 Subject: [PATCH 182/685] Update coldfusion.html.markdown Adds conversion table and example of a very basic component. Adds a link to the official Adobe ColdFusion developer reference. --- coldfusion.html.markdown | 423 ++++++++++++++++----------------------- 1 file changed, 168 insertions(+), 255 deletions(-) diff --git a/coldfusion.html.markdown b/coldfusion.html.markdown index 6a9b69f0..e2f0737d 100644 --- a/coldfusion.html.markdown +++ b/coldfusion.html.markdown @@ -146,263 +146,176 @@ ColdFusion is a scripting language for web development.
+ +

Converting types

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ValueAs BooleanAs numberAs date-timeAs string
"Yes"TRUE1Error"Yes"
"No"FALSE0Error"No"
TRUETRUE1Error"Yes"
FALSEFALSE0Error"No"
NumberTrue if Number is not 0; False otherwise.NumberSee "Date-time values" earlier in this chapter.String representation of the number (for example, "8").
StringIf "Yes", True
If "No", False
If it can be converted to 0, False
If it can be converted to any other number, True
If it represents a number (for example, "1,000" or "12.36E-12"), it is converted to the corresponding number.If it represents a date-time (see next column), it is converted to the numeric value of the corresponding date-time object.
If it is an ODBC date, time, or timestamp (for example "{ts '2001-06-14 11:30:13'}", or if it is expressed in a standard U.S. date or time format, including the use of full or abbreviated month names, it is converted to the corresponding date-time value.
Days of the week or unusual punctuation result in an error.
Dashes, forward-slashes, and spaces are generally allowed.
String
DateErrorThe numeric value of the date-time object.DateAn ODBC timestamp.
+ +
+ +

Components

+ +Code for reference (Functions must return something to support IE) + +
+<cfcomponent>
+	<cfset this.hello = "Hello" />
+	<cfset this.world = "world" />
+
+	<cffunction name="sayHello">
+		<cfreturn this.hello & ", " & this.world & "!" />
+	</cffunction>
+	
+	<cffunction name="setHello">
+		<cfargument name="newHello" type="string" required="true" />
+		
+		<cfset this.hello = arguments.newHello />
+		 
+		<cfreturn true />
+	</cffunction>
+	
+	<cffunction name="setWorld">
+		<cfargument name="newWorld" type="string" required="true" />
+		
+		<cfset this.world = arguments.newWorld />
+		 
+		<cfreturn true />
+	</cffunction>
+	
+	<cffunction name="getHello">
+		<cfreturn this.hello />
+	</cffunction>
+	
+	<cffunction name="getWorld">
+		<cfreturn this.world />
+	</cffunction>
+</cfcomponent>
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +sayHello() +

#sayHello()#

+getHello() +

#getHello()#

+getWorld() +

#getWorld()#

+setHello("Hola") +

#setHello("Hola")#

+setWorld("mundo") +

#setWorld("mundo")#

+sayHello() +

#sayHello()#

+getHello() +

#getHello()#

+getWorld() +

#getWorld()#

``` - ## Further Reading The links provided here below are just to get an understanding of the topic, feel free to Google and find specific examples. + +1. [Coldfusion Reference From Adobe](https://helpx.adobe.com/coldfusion/cfml-reference/topics.html) From c1c7a96378d79d379e68084780eecd91731fa4bb Mon Sep 17 00:00:00 2001 From: Himanshu81494 Date: Fri, 9 Oct 2015 19:57:06 +0530 Subject: [PATCH 183/685] typo in readme --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 774797d5..28fa5093 100644 --- a/README.markdown +++ b/README.markdown @@ -8,7 +8,7 @@ commented code and explained as they go. ... to write more inline code tutorials. Just grab an existing file from this repo and copy the formatting (don't worry, it's all very simple). -Make a new file, send a pull request, and if it passes muster I'll get it up pronto. +Make a new file, send a pull request, and if it passes master I'll get it up pronto. Remember to fill in the "contributors" fields so you get credited properly! From 1e90e7da1d042dfc46a5be11117a4e45e460bcf8 Mon Sep 17 00:00:00 2001 From: Andy B Date: Fri, 9 Oct 2015 15:32:05 +0100 Subject: [PATCH 184/685] [objective-c/en-fr-ru-tr-vn] Enable syntax highlighting --- fr-fr/objective-c-fr.html.markdown | 2 +- objective-c.html.markdown | 2 +- ru-ru/objective-c-ru.html.markdown | 2 +- tr-tr/objective-c-tr.html.markdown | 2 +- vi-vn/objective-c-vi.html.markdown | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fr-fr/objective-c-fr.html.markdown b/fr-fr/objective-c-fr.html.markdown index 69f4d8f9..4e31c4bf 100644 --- a/fr-fr/objective-c-fr.html.markdown +++ b/fr-fr/objective-c-fr.html.markdown @@ -14,7 +14,7 @@ lang: fr-fr L'Objective-C est un langage de programmation orienté objet réflexif principalement utilisé par Apple pour les systèmes d'exploitations Mac OS X et iOS et leurs frameworks respectifs, Cocoa et Cocoa Touch. -```objective_c +```objective-c // Les commentaires sur une seule ligne commencent par // /* diff --git a/objective-c.html.markdown b/objective-c.html.markdown index 89901308..cf6bf780 100644 --- a/objective-c.html.markdown +++ b/objective-c.html.markdown @@ -13,7 +13,7 @@ filename: LearnObjectiveC.m Objective-C is the main programming language used by Apple for the OS X and iOS operating systems and their respective frameworks, Cocoa and Cocoa Touch. It is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. -```objective_c +```objective-c // Single-line comments start with // /* diff --git a/ru-ru/objective-c-ru.html.markdown b/ru-ru/objective-c-ru.html.markdown index ddff2e5c..8eac4ddb 100644 --- a/ru-ru/objective-c-ru.html.markdown +++ b/ru-ru/objective-c-ru.html.markdown @@ -17,7 +17,7 @@ Cocoa Touch. Он является объектно-ориентированным языком программирования общего назначения, который добавляет обмен сообщениями в Smalltalk-стиле к языку программирования C. -```objective_c +```objective-c // Однострочные комментарии начинаются с // /* diff --git a/tr-tr/objective-c-tr.html.markdown b/tr-tr/objective-c-tr.html.markdown index f27cbf08..727f973e 100644 --- a/tr-tr/objective-c-tr.html.markdown +++ b/tr-tr/objective-c-tr.html.markdown @@ -14,7 +14,7 @@ kendi çatıları olan Cocoa ve Cocoa Touch için kullanılan bir programlama di Genel açamlı, object-oriented bir yapıya sahip programlama dilidir. C programlama diline Smalltalk stilinde mesajlaşma ekler. -```objective_c +```objective-c // Tek satır yorum // işaretleri ile başlar /* diff --git a/vi-vn/objective-c-vi.html.markdown b/vi-vn/objective-c-vi.html.markdown index c97bb560..38e418e9 100644 --- a/vi-vn/objective-c-vi.html.markdown +++ b/vi-vn/objective-c-vi.html.markdown @@ -12,7 +12,7 @@ filename: LearnObjectiveC-vi.m Objective-C là ngôn ngữ lập trình chính được sử dụng bởi Apple cho các hệ điều hành OS X, iOS và các framework tương ứng của họ, Cocoa và Cocoa Touch. Nó là một ngôn ngữ lập trình mục đích tổng quát, hướng đối tượng có bổ sung thêm kiểu truyền thông điệp giống Smalltalk vào ngôn ngữ lập trình C. -```objective_c +```objective-c // Chú thích dòng đơn bắt đầu với // /* From a67d9d9e0ed3d351ce0139de18a4b212b47ab9cb Mon Sep 17 00:00:00 2001 From: Andy B Date: Fri, 9 Oct 2015 15:36:51 +0100 Subject: [PATCH 185/685] [coffeescript/en] Fixed grammar --- coffeescript.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coffeescript.html.markdown b/coffeescript.html.markdown index 85a5f81f..106854bd 100644 --- a/coffeescript.html.markdown +++ b/coffeescript.html.markdown @@ -7,7 +7,7 @@ filename: coffeescript.coffee --- CoffeeScript is a little language that compiles one-to-one into the equivalent JavaScript, and there is no interpretation at runtime. -As one of the succeeders of JavaScript, CoffeeScript tries its best to output readable, pretty-printed and smooth-running JavaScript codes working well in every JavaScript runtime. +As one of the successors to JavaScript, CoffeeScript tries its best to output readable, pretty-printed and smooth-running JavaScript code, which works well in every JavaScript runtime. See also [the CoffeeScript website](http://coffeescript.org/), which has a complete tutorial on CoffeeScript. From e8e8b9c76fb578d3f8e90b90b3c8a1c59cf0e901 Mon Sep 17 00:00:00 2001 From: Andy B Date: Fri, 9 Oct 2015 15:48:21 +0100 Subject: [PATCH 186/685] [C/en] Accessing command line arguments in main --- c.html.markdown | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/c.html.markdown b/c.html.markdown index db2ac930..345dca7f 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -27,6 +27,7 @@ Multi-line comments don't nest /* Be careful */ // comment ends on this line... */ // ...not this one! // Constants: #define +// Constants are written in all-caps out of convention, not requirement #define DAYS_IN_YEAR 365 // Enumeration constants are also ways to declare constants. @@ -56,6 +57,15 @@ int add_two_ints(int x1, int x2); // function prototype // Your program's entry point is a function called // main with an integer return type. int main(void) { + // your program +} + +// The command line arguments used to run your program are also passed to main +// argc being the number of arguments - your program's name counts as 1 +// argv is an array of character arrays - containing the arguments themselves +// argv[0] = name of your program, argv[1] = first argument, etc. +int main (int argc, char** argv) +{ // print output using printf, for "print formatted" // %d is an integer, \n is a newline printf("%d\n", 0); // => Prints 0 From 53a0264029dbaaf5909110c0a390753b276ac324 Mon Sep 17 00:00:00 2001 From: Sricharan Chiruvolu Date: Fri, 9 Oct 2015 20:30:57 +0530 Subject: [PATCH 187/685] Update latex.html.markdown --- latex.html.markdown | 53 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/latex.html.markdown b/latex.html.markdown index c8f21a83..f0646941 100644 --- a/latex.html.markdown +++ b/latex.html.markdown @@ -3,6 +3,7 @@ language: latex contributors: - ["Chaitanya Krishna Ande", "http://icymist.github.io"] - ["Colton Kohnke", "http://github.com/voltnor"] + - ["Sricharan Chiruvolu", "http://sricharan.xyz"] filename: learn-latex.tex --- @@ -25,12 +26,15 @@ getting it to behave exactly the way you want can be a bit hairy. \documentclass[12pt]{article} % Next we define the packages the document uses. +% If you want to include graphics, colored text or +% source code from a file into your document, +% you need to enhance the capabilities of LaTeX. This is done by adding packages. % I'm going to include the float and caption packages for figures. \usepackage{caption} \usepackage{float} % We can define some other document properties too! -\author{Chaitanya Krishna Ande \& Colton Kohnke} +\author{Chaitanya Krishna Ande, Colton Kohnke \& Sricharan Chiruvolu} \date{\today} \title{Learn LaTeX in Y Minutes!} @@ -41,6 +45,16 @@ getting it to behave exactly the way you want can be a bit hairy. % create a title page fo us. \maketitle +% Most research papers have abstract, you can use the predefined commands for this. +% This should appear in its logical order, therefore, after the top matter, +% but before the main sections of the body. +% This command is available in document classes article and report. +\begin{abstract} + LaTex documentation written as LaTex! How novel and totally not my idea! +\end{abstract} + +% Section commands are intuitive. +% All the titles of the sections are added automatically to the table of contents. \section{Introduction} Hello, my name is Colton and together we're going to explore LaTeX ! @@ -69,15 +83,34 @@ One of the primary uses for LaTeX is to produce academic article or technical papers. Usually in the realm of math and science. As such, we need to be able to add special symbols to our paper! \\ -My favorite Greek letter is $\xi$. I also like $\beta$, $\gamma$ and $\sigma$. +Math has many symbols, far beyond what you can find on a keyboard. +Set and relation symbols, arrows, operators, Greek letters to name a few. \\ + + +Sets and relations play a vital role in many mathematical research papers. +Here's how you state all y that belong to X, $\forall$ x $\in$ X. Notice how I needed to add \$ signs before and after the symbols. This is because when writing, we are in text-mode. However, the math symbols only exist in math-mode. We can enter math-mode from text mode with the \$ signs. The opposite also holds true. Variable can also be rendered in math-mode. \\ -% We can also add references -For a right angled triangle (see Fig.~\ref{fig:right-triangle}) with sides $a$, - $b$ and $c$, where $c$ is the hypotenuse, the following holds: +My favorite Greek letter is $\xi$. I also like $\beta$, $\gamma$ and $\sigma$. + +Operators are essential parts of a mathematical document: trigonometric functions +(sin, cos, tan), logarithms and exponentials (log, exp), limits (lim) e.t.c. 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$ + +Fractions(Numerator-denominators) can be written in these forms: + +% 10 / 7 +^10/_7 + +% Relatively complex fractions can be written as +% \frac{numerator}{denominator} +$\frac{n!}{k!(n - k)!}$ + % Display math with the equation 'environment' \begin{equation} % enters math-mode c^2 = a^2 + b^2. @@ -88,11 +121,17 @@ For a right angled triangle (see Fig.~\ref{fig:right-triangle}) with sides $a$, Eqn.~\ref{eq:pythagoras} is also known as the Pythagoras Theorem which is also the subject of Sec.~\ref{subsec:pythagoras}. +Summations and Integrals are written with sum and int commands: +\begin{equation} % enters math-mode +\sum_{i=0}^{5} f_i + +\int_0^\infty \mathrm{e}^{-x}\,\mathrm{d}x +\end{equation} \section{Figures} Let's insert a Figure. Figure placement can get a little tricky. -I definately have to lookup the placement options each time. +I definitely have to lookup the placement options each time. \begin{figure}[H] \centering @@ -115,6 +154,8 @@ Let's insert a Table. \end{tabular} \end{table} +% \section{Hyperlinks} + \section{Compiling} From bb8eeb53ef01b6bfbdf64d6f1dc067f9cf4b8f8d Mon Sep 17 00:00:00 2001 From: Andy B Date: Fri, 9 Oct 2015 16:05:21 +0100 Subject: [PATCH 188/685] [xml/en] Grammar fixes --- xml.html.markdown | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xml.html.markdown b/xml.html.markdown index d407512d..4d33e614 100644 --- a/xml.html.markdown +++ b/xml.html.markdown @@ -40,13 +40,14 @@ Unlike HTML, XML does not specify how to display or to format data, just carry i It starts with a declaration, informing some metadata (optional). XML uses a tree structure. Above, the root node is 'bookstore', which has - three child nodes, all 'books'. Those nodes has more child nodes, and so on... + three child nodes, all 'books'. Those nodes have more child nodes (or + children), and so on... - Nodes are created using open/close tags, and childs are just nodes between + Nodes are created using open/close tags, and children are just nodes between the open and close tags.--> - + - + - +
- ``` -## Precedence +## Precedence or Cascade -As you noticed an element may be targetted by more than one selector. -and may have a property set on it in more than one. -In these cases, one of the rules takes precedence over others. +An element may be targeted by multiple selectors and may have a property set on it in more than once. In these cases, one of the rules takes precedence over others. Generally, a rule in a more specific selector take precedence over a less specific one, and a rule occuring later in the stylesheet overwrites a previous one. + +This process is called cascading, hence the name Cascading Style Sheets. Given the following CSS: ```css -/*A*/ +/* A */ p.class1[attr='value'] -/*B*/ -p.class1 {} +/* B */ +p.class1 { } -/*C*/ -p.class2 {} +/* C */ +p.class2 { } -/*D*/ -p {} +/* D */ +p { } -/*E*/ +/* E */ p { property: value !important; } - ``` and the following markup: ```xml -

-

+

``` -The precedence of style is as followed: -Remember, the precedence is for each **property**, not for the entire block. +The precedence of style is as follows. Remember, the precedence is for each **property**, not for the entire block. -* `E` has the highest precedence because of the keyword `!important`. - It is recommended to avoid this unless it is strictly necessary to use. -* `F` is next, because it is inline style. -* `A` is next, because it is more "specific" than anything else. - more specific = more specifiers. here 3 specifiers: 1 tagname `p` + - class name `class1` + 1 attribute `attr='value'` -* `C` is next. although it has the same specificness as `B` - but it appears last. -* Then is `B` -* and lastly is `D`. +* `E` has the highest precedence because of the keyword `!important`. It is recommended that you avoid its usage. +* `F` is next, because it is an inline style. +* `A` is next, because it is more "specific" than anything else. It has 3 specifiers: The name of the element `p`, its class `class1`, an attribute `attr='value'`. +* `C` is next, even though it has the same specificity as `B`. This is because it appears after `B`. +* `B` is next. +* `D` is the last one. ## Compatibility -Most of the features in CSS2 (and gradually in CSS3) are compatible across -all browsers and devices. But it's always vital to have in mind the compatibility -of what you use in CSS with your target browsers. +Most of the features in CSS 2 (and many in CSS 3) are available across all browsers and devices. But it's always good practice to check before using a new feature. -[QuirksMode CSS](http://www.quirksmode.org/css/) is one of the best sources for this. +## Resources -To run a quick compatibility check, [Can I Use...](http://caniuse.com) is a great resource. +* To run a quick compatibility check, [CanIUse](http://caniuse.com). +* CSS Playground [Dabblet](http://dabblet.com/). +* [Mozilla Developer Network's CSS documentation](https://developer.mozilla.org/en-US/docs/Web/CSS) +* [Codrops' CSS Reference](http://tympanus.net/codrops/css_reference/) ## Further Reading -* [Mozilla Developer Network's CSS documentation](https://developer.mozilla.org/en-US/docs/Web/CSS) -* [Codrops' CSS Reference](http://tympanus.net/codrops/css_reference/) * [Understanding Style Precedence in CSS: Specificity, Inheritance, and the Cascade](http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/) +* [Selecting elements using attributes](https://css-tricks.com/almanac/selectors/a/attribute/) * [QuirksMode CSS](http://www.quirksmode.org/css/) * [Z-Index - The stacking context](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Understanding_z_index/The_stacking_context) -* [SCSS](http://sass-lang.com/) and [LESS](http://lesscss.org/) for CSS pre-processing +* [SASS](http://sass-lang.com/) and [LESS](http://lesscss.org/) for CSS pre-processing +* [CSS-Tricks](https://css-tricks.com) From a65d0fb99ad7faa7469da576938b8d37aca6f859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Su=C3=A1rez?= Date: Sat, 10 Oct 2015 13:07:10 +0200 Subject: [PATCH 202/685] Update and fix Spanish brainfuck article --- es-es/brainfuck-es.html.markdown | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/es-es/brainfuck-es.html.markdown b/es-es/brainfuck-es.html.markdown index e33d672d..550511da 100644 --- a/es-es/brainfuck-es.html.markdown +++ b/es-es/brainfuck-es.html.markdown @@ -9,8 +9,10 @@ lang: es-es --- Brainfuck (con mayúscula sólo al inicio de una oración) es un -lenguaje de programación mínimo, computacionalmente universal -en tamaño con sólo 8 comandos. +lenguaje de programación extremadamente pequeño, Turing completo con sólo 8 comandos. + +Puedes probar brainfuck en tu navegador con [brainfuck-visualizer](http://fatiherikli.github.io/brainfuck-visualizer/). + ``` @@ -18,7 +20,7 @@ Cualquier caracter que no sea "><+-.,[]" (sin incluir las comillas) será ignorado. Brainfuck es representado por un arreglo de 30,000 celdas inicializadas -en cero y un apuntador en la celda actual. +en cero y un puntero apuntando la celda actual. Existen ocho comandos: @@ -26,7 +28,7 @@ Existen ocho comandos: - : Decrementa 1 al valor de la celda actual. > : Mueve el apuntador a la siguiente celda. (a la derecha) < : Mueve el apuntador a la celda anterior. (a la izquierda) -. : Imprime el valor en ASCII de la celda actual (i.e. 65 = 'A') +. : Imprime el valor en ASCII de la celda actual (p.e. 65 = 'A') , : Lee un caracter como input y lo escribe en la celda actual. [ : Si el valor en la celda actual es cero mueve el apuntador hasta el primer ']' que encuentre. Si no es cero sigue a la @@ -37,7 +39,7 @@ Existen ocho comandos: [ y ] forman un while. Obviamente, deben estar balanceados. -Ahora unos ejemplos de programas escritos con brainfuck. +Estos son algunos ejemplos de programas escritos con brainfuck. ++++++ [ > ++++++++++ < - ] > +++++ . @@ -63,7 +65,7 @@ Esto continúa hasta que la celda #1 contenga un cero. Cuando #1 contenga un cero la celda #2 tendrá el valor inicial de #1. Como este ciclo siempre terminara en la celda #1 nos movemos a la celda #2 e imprimimos (.). -Ten en mente que los espacios son sólo para fines de legibilidad. +Ten en cuenta que los espacios son sólo para fines de legibilidad. Es lo mismo escribir el ejemplo de arriba que esto: ,[>+<-]>. @@ -81,7 +83,7 @@ hasta la próxima vez. Para resolver este problema también incrementamos la celda #4 y luego copiamos la celda #4 a la celda #2. La celda #3 contiene el resultado. ``` -Y eso es brainfuck. ¿No tan difícil o sí? Como diversión, puedes escribir +Y eso es brainfuck. No es tan difícil, ¿verdad? Como diversión, puedes escribir tu propio intérprete de brainfuck o tu propio programa en brainfuck. El intérprete es relativamente sencillo de hacer, pero si eres masoquista, -intenta construir tu proprio intérprete de brainfuck... en brainfuck. +puedes intentar construir tu propio intérprete de brainfuck... en brainfuck. From 622d4485ab9efd265be83d16abbe8cb12da7934c Mon Sep 17 00:00:00 2001 From: Kara Kincaid Date: Sat, 10 Oct 2015 08:20:03 -0400 Subject: [PATCH 203/685] [css/en] Added more pseudo-classes and pseudo-elements examples --- css.html.markdown | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/css.html.markdown b/css.html.markdown index 811767e6..4c459f7f 100644 --- a/css.html.markdown +++ b/css.html.markdown @@ -119,6 +119,19 @@ selected:link {} /* or an input element which is focused */ selected:focus {} +/* any element that is the first child of its parent */ +selector:first-child {} + +/* any element that is the last child of its parent */ +selector:last-child {} + +/* Just like pseudo classes, pseudo elements allow you to style certain parts of a document */ + +/* matches a virtual first child of the selected element */ +selector::before {} + +/* matches a virtual last child of the selected element */ +selector::after {} /* #################### ## PROPERTIES From 7c2c4480600b6c817418d5ba04315bca3c5a400d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joa=CC=83o=20Costa?= Date: Sat, 10 Oct 2015 16:49:53 +0100 Subject: [PATCH 204/685] Fix compile errors of the English and French Scala tutorials --- fr-fr/scala.html.markdown | 9 ++++++--- scala.html.markdown | 12 ++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/fr-fr/scala.html.markdown b/fr-fr/scala.html.markdown index a43edf16..c6d06361 100644 --- a/fr-fr/scala.html.markdown +++ b/fr-fr/scala.html.markdown @@ -208,6 +208,7 @@ sSquared.reduce (_+_) // La fonction filter prend un prédicat (une fonction de type A -> Booléen) et // sélectionne tous les éléments qui satisfont ce prédicat List(1, 2, 3) filter (_ > 2) // List(3) +case class Person(name: String, age: Int) List( Person(name = "Dom", age = 23), Person(name = "Bob", age = 30) @@ -217,6 +218,7 @@ List( // Scala a une méthode foreach définie pour certaines collections // qui prend en argument une fonction renvoyant Unit (une méthode void) +val aListOfNumbers = List(1, 2, 3, 4, 10, 20, 100) aListOfNumbers foreach (x => println(x)) aListOfNumbers foreach println @@ -271,11 +273,12 @@ i // Montre la valeur de i. Notez que while est une boucle au sens classique. // mais utiliser des combinateurs et des compréhensions comme ci-dessus est plus // facile pour comprendre et pour faire la parallélisation +i = 0 // La boucle do while do { println("x is still less then 10"); - x += 1 -} while (x < 10) + i += 1 +} while (i < 10) // La récursivité est un moyen idiomatique de faire une chose répétitive en Scala. @@ -370,7 +373,7 @@ val email(user, domain) = "henry@zkpr.com" "Les chaînes de caractères Scala sont entourées de doubles guillements" 'a' // Un caractère de Scala -'Les simples guillemets n'existent pas en Scala // Erreur +// 'Les simples guillemets n'existent pas en Scala' // Erreur "Les chaînes de caractères possèdent les méthodes usuelles de Java".length "Il y a aussi quelques méthodes extra de Scala.".reverse diff --git a/scala.html.markdown b/scala.html.markdown index 7189be10..7f545196 100644 --- a/scala.html.markdown +++ b/scala.html.markdown @@ -6,7 +6,6 @@ contributors: - ["Dominic Bou-Samra", "http://dbousamra.github.com"] - ["Geoff Liu", "http://geoffliu.me"] - ["Ha-Duong Nguyen", "http://reference-error.org"] -filename: learn.scala --- Scala - the scalable language @@ -244,10 +243,11 @@ i // Show the value of i. Note that while is a loop in the classical sense - // comprehensions above is easier to understand and parallelize // A do while loop +i = 0 do { - println("x is still less than 10") - x += 1 -} while (x < 10) + println("i is still less than 10") + i += 1 +} while (i < 10) // Tail recursion is an idiomatic way of doing recurring things in Scala. // Recursive functions need an explicit return type, the compiler can't infer it. @@ -566,8 +566,8 @@ sendGreetings("Jane") // => "Hello Jane, 100 blessings to you and yours!" // Implicit function parameters enable us to simulate type classes in other // functional languages. It is so often used that it gets its own shorthand. The // following two lines mean the same thing: -def foo[T](implicit c: C[T]) = ... -def foo[T : C] = ... +// def foo[T](implicit c: C[T]) = ... +// def foo[T : C] = ... // Another situation in which the compiler looks for an implicit is if you have From ae7dee12a5fef665e9c5bb3ae1ebc9eece9c7648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joa=CC=83o=20Costa?= Date: Sat, 10 Oct 2015 16:51:07 +0100 Subject: [PATCH 205/685] [scala-pt] Fix variable names on while cycle --- pt-pt/scala-pt.html.markdown | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pt-pt/scala-pt.html.markdown b/pt-pt/scala-pt.html.markdown index 270fb01e..a4c1c02b 100644 --- a/pt-pt/scala-pt.html.markdown +++ b/pt-pt/scala-pt.html.markdown @@ -245,10 +245,11 @@ i // Mostra o valor de i. Note que o while é um ciclo no sentido clássico - // paralelizar // Um ciclo do while +i = 0 do { - println("x ainda é menor que 10") - x = x + 1 -} while (x < 10) + println("i ainda é menor que 10") + i += 1 +} while (i < 10) // A forma idiomática em Scala de definir acções recorrentes é através de // recursão em cauda. From 77f0219cc6fd64f9c4dbd3007fa395b2242a6e49 Mon Sep 17 00:00:00 2001 From: Ratan Date: Sat, 10 Oct 2015 12:10:27 -0400 Subject: [PATCH 206/685] change String to AbstractString as per 0.4 spec --- julia.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/julia.html.markdown b/julia.html.markdown index 66329feb..7ca2d492 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -78,7 +78,7 @@ false 1 < 2 < 3 # => true 2 < 3 < 2 # => false -# Strings are created with " +# AbstractStrings are created with " "This is a string." # Character literals are written with ' @@ -314,7 +314,7 @@ end # For loops iterate over iterables. -# Iterable types include Range, Array, Set, Dict, and String. +# 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 @@ -550,13 +550,13 @@ super(Any) # => Any # <: is the subtyping operator type Lion <: Cat # Lion is a subtype of Cat mane_color - roar::String + roar::AbstractString end # You can define more constructors for your type # Just define a function of the same name as the type # and call an existing constructor to get a value of the correct type -Lion(roar::String) = Lion("green",roar) +Lion(roar::AbstractString) = Lion("green",roar) # This is an outer constructor because it's outside the type definition type Panther <: Cat # Panther is also a subtype of Cat From 7281681a3e45e8103b771933b40920a292fc2818 Mon Sep 17 00:00:00 2001 From: Thibault iTech Date: Sat, 10 Oct 2015 18:58:25 +0200 Subject: [PATCH 207/685] Added translation in french for the HAML article --- fr-fr/haml-fr.html.markdown | 156 ++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 fr-fr/haml-fr.html.markdown diff --git a/fr-fr/haml-fr.html.markdown b/fr-fr/haml-fr.html.markdown new file mode 100644 index 00000000..0267a380 --- /dev/null +++ b/fr-fr/haml-fr.html.markdown @@ -0,0 +1,156 @@ +--- +language: haml +filename: learnhaml.haml +contributors: + - ["Simon Neveu", "https://github.com/sneveu"] + - ["Thibault", "https://github.com/iTech-"] +--- + +Haml est un langage de balisage utilisé majoritairement avec Ruby, qui décrit de manière simple et propre le HTML de n'importe quelle page web sans l'utilisation des traditionnelles lignes de code. Le langage est une alternative très populaire au langage de templates Rails (.erb) et permet d'intégrer du code en Ruby dans votre balisage. + +Son but est de réduire le nombre de répétitions dans le balisage en fermant des balises pour vous en se basant sur l'indentation de votre code. Finalement, le balisage est bien structuré, ne contient pas de répétition, est logique et facile à lire. + +Vous pouvez aussi utiliser Haml sur un projet indépendant de Ruby, en installant les gems de Haml et en le convertissant en html grâce aux commandes. + +$ haml fichier_entree.haml fichier_sortie.html + + +```haml +/ ------------------------------------------- +/ Indentation +/ ------------------------------------------- + +/ + A cause de l'importance de l'indentation sur la manière dont votre code sera + converti, l'indentation doit être constante à travers votre document. Un + simple changement d'indentation entrainera une erreur. En général, on utilise + deux espaces, mais ce genre de décision sur l'indentation vous appartient, du + moment que vous vous y tenez. + +/ ------------------------------------------- +/ Commentaires +/ ------------------------------------------- + +/ Ceci est un commentaire en Haml. + +/ + Pour écrire un commentaire sur plusieurs lignes, indentez votre code + commenté en le commençant par un slash + +-# Ceci est un commentaire silencieux, qui n'apparaîtra pas dans le fichier + + +/ ------------------------------------------- +/ Eléments HTML +/ ------------------------------------------- + +/ Pour écrire vos balises, utilisez un pourcentage suivi du nom de votre balise +%body + %header + %nav + +/ Remarquez qu'il n'y a aucunes balises fermées. Le code produira alors ceci + +

+ +
+ + +/ La balise div est l'élément par défaut, vous pouvez donc l'écrire comme ceci +.balise + +/ Pour ajouter du contenu à votre balise, ajoutez le texte après sa déclaration +%h1 Titre contenu + +/ Pour écrire du contenu sur plusieurs lignes, imbriquez le +%p + Ce paragraphe contient beaucoup de contenu qui pourrait + probablement tenir sur deux lignes séparées. + +/ + Vous pouvez utiliser des caractères html spéciaux en utilisant &=. Cela va + convertir les caractères comme &, /, : en leur équivalent HTML. Par exemple + +%p + &= "Oui & oui" + +/ Produira 'Oui & oui' + +/ Vous pouvez écrire du contenu html sans qu'il soit converti en utilisant != +%p + != "Voici comment écrire une balise de paragraphe

" + +/ Cela produira 'Voici comment écrire une balise de paragraphe

' + +/ Une classe CSS peut être ajouté à votre balise en chainant le nom de la classe +%div.truc.machin + +/ ou en utilisant un hash de Ruby +%div{:class => 'truc machin'} + +/ Des attributs pour n'importe quelles balises peuvent être ajoutés au hash +%a{:href => '#', :class => 'machin', :title => 'Titre machin'} + +/ Pour affecter une valeur à un booléen, utilisez 'true' +%input{:selected => true} + +/ Pour écrire des data-attributes, utilisez le :data avec la valeur d'un hash +%div{:data => {:attribute => 'machin'}} + + +/ ------------------------------------------- +/ Insérer du Ruby +/ ------------------------------------------- + +/ + Pour transférer une valeur de Ruby comme contenu d'une balise, utilisez le + signe égal suivi du code Ruby + +%h1= livre.titre + +%p + = livre.auteur + = livre.editeur + + +/ Pour lancer du code Ruby sans le convertir en HTML, utilisez un trait d'union +- livres = ['livre 1', 'livre 2', 'livre 3'] + +/ Ceci vous permet de faire des choses géniales comme des blocs Ruby +- livre.shuffle.each_with_index do |livre, index| + %h1= livre + + if livre do + %p Ceci est un livre + +/ + Encore une fois il n'est pas nécessaire d'ajouter une balise fermante, même + pour Ruby. + L'indentation le fera pour vous. + + +/ ------------------------------------------- +/ Ruby en-ligne / Interpolation en Ruby +/ ------------------------------------------- + +/ Inclure une variable Ruby dans une ligne en utilisant #{} +%p Votre meilleur score est #{record} + + +/ ------------------------------------------- +/ Filtres +/ ------------------------------------------- + +/ + Utilisez les deux points pour définir un filtre Haml, vous pouvez par exemple + utiliser un filtre :javascript pour écrire du contenu en-ligne js + +:javascript + console.log('Ceci est la balise en-ligne + + + + + +``` + + + +### Optimizar todo un proyecto usando r.js + + + +Muchas personas prefiere usar AMD para la sana organización del código durante el desarrollo, pero todavía prefiere enviar para producción un solo fichero en vez de ejecutar cientos de XHRs en las cargas de página. + + + +`require.js` incluye un script llamado `r.js` (el que probablemente correrás en node.js, aunque Rhino también es soportado) que puede analizar el gráfico de dependencias de tu proyecto, y armar un solo fichero que contenga todos tus módulos (adecuadamente nombrados), minificado y listo para consumo. + + + +Instálalo usando `npm`: + +```shell + +$ npm install requirejs -g + +``` + + + +Ahora puedes alimentarlo con un fichero de configuración: + +```shell + +$ r.js -o app.build.js + +``` + + + +Para nuestro ejemplo anterior el archivo de configuración luciría así: + +```javascript + +/* file : app.build.js */ + +({ + + name : 'main', // name of the entry point + + out : 'main-built.js', // name of the file to write the output to + + baseUrl : 'app', + + paths : { + + // `empty:` tells r.js that this should still be loaded from the CDN, using + + // the location specified in `main.js` + + jquery : 'empty:', + + coolLibFromBower : '../bower_components/cool-lib/coollib' + + } + +}) + +``` + + + +Para usar el fichero creado en producción, simplemente intercambia `data-main`: + +```html + + + +``` + + + +Un increíblemente detallado [resumen de opciones de generación](https://github.com/jrburke/r.js/blob/master/build/example.build.js) está disponible en el repositorio de GitHub. + + + +### Tópicos no cubiertos en este tutorial + +* [Cargador de plugins / transformaciones](http://requirejs.org/docs/plugins.html) + +* [Cargando y exportando estilos CommonJS](http://requirejs.org/docs/commonjs.html) + +* [Configuración avanzada](http://requirejs.org/docs/api.html#config) + +* [Configuración de Shim (cargando módulos no-AMD)](http://requirejs.org/docs/api.html#config-shim) + +* [Cargando y optimizando CSS con require.js](http://requirejs.org/docs/optimization.html#onecss) + +* [Usando almond.js para construcciones](https://github.com/jrburke/almond) + + + +### Otras lecturas: + + + +* [Especificaciones oficiales](https://github.com/amdjs/amdjs-api/wiki/AMD) + +* [¿Por qué AMD?](http://requirejs.org/docs/whyamd.html) + +* [Definición Universal de Módulos](https://github.com/umdjs/umd) + + + +### Implementaciones: + + + +* [require.js](http://requirejs.org) + +* [dojo toolkit](http://dojotoolkit.org/documentation/tutorials/1.9/modules/) + +* [cujo.js](http://cujojs.com/) + +* [curl.js](https://github.com/cujojs/curl) + +* [lsjs](https://github.com/zazl/lsjs) + +* [mmd](https://github.com/alexlawrence/mmd) From 8dd11eee84a36ac2d81f266574b07bf603327e0e Mon Sep 17 00:00:00 2001 From: Moritz Kammerer Date: Sat, 17 Oct 2015 15:56:00 +0200 Subject: [PATCH 363/685] Adds german translation for LateX --- de-de/latex-de.html.markdown | 235 +++++++++++++++++++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 de-de/latex-de.html.markdown diff --git a/de-de/latex-de.html.markdown b/de-de/latex-de.html.markdown new file mode 100644 index 00000000..2c18b8fd --- /dev/null +++ b/de-de/latex-de.html.markdown @@ -0,0 +1,235 @@ +--- +language: latex +contributors: + - ["Chaitanya Krishna Ande", "http://icymist.github.io"] + - ["Colton Kohnke", "http://github.com/voltnor"] + - ["Sricharan Chiruvolu", "http://sricharan.xyz"] +translators: + - ["Moritz Kammerer", "https://github.com/phxql"] +lang: de-de +filename: latex-de.tex +--- +``` +% Alle Kommentare starten fangen mit % an +% Es gibt keine Kommentare über mehrere Zeilen + +% 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 (\) + +% 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. +\documentclass[12pt]{article} + +% 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. +% Wir verwenden die Pakete float und caption für Bilder. +\usepackage{caption} +\usepackage{float} + +% Mit diesem Paket können leichter Umlaute getippt werden +\usepackage[utf8]{inputenc} + +% 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!} + +% Nun kann's losgehen mit unserem Dokument. +% Alles vor dieser Zeile wird die Preamble genannt. +\begin{document} +% Wenn wir den Autor, das Datum und den Titel gesetzt haben, kann +% LateX für uns eine Titelseite generieren +\maketitle + +% 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! +\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! + +\section{Noch eine section} +Das hier ist der Text für noch eine section. Ich glaube, wir brauchen eine subsection. + +\subsection{Das ist eine subsection} % Subsections sind auch ziemlich intuitiv. +Ich glaube, wir brauchen noch eine. + +\subsubsection{Pythagoras} +So ist's schon viel besser. +\label{subsec:pythagoras} + +% 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{Ein paar Notizen} +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, +also lass uns eine Einkaufsliste schreiben: +\begin{enumerate} % Dieser Befehl erstellt eine "enumerate" Umgebung. + % \item bringt enumerate dazu, eins weiterzuzählen. + \item Salat. + \item 27 Wassermelonen. + \item einen Hasen. + % Wir können die Nummer des Eintrags durch [] überschreiben + \item[Wie viele?] Mittelgroße Wasserpistolen. + + Kein Listeneintrag, aber immer noch Teil von enumerate. + +\end{enumerate} % Alle Umgebungen müssen ein end haben. + +\section{Mathe} + +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! \\ + +Mathe kennt sehr viele Symbole, viel mehr als auf einer Tastatur zu finden sind; +Symbole für Mengen und relationen, Pfeile, Operatoren und Griechische Buchstaben, +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. \\ + +% 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! + +Operatoren sind ebenfalls wichtige Bestandteile von mathematischen Dokumenten: +Trigonometrische Funktionen ($\sin$, $\cos$, $\tan$), +Logarithmus und Exponenten ($\log$, $\exp$), +Grenzwerte ($\lim$), etc. haben vordefinierte Befehle. +Lass uns eine Gleichung schreiben: \\ + +$\cos(2\theta) = \cos^{2}(\theta) - \sin^{2}(\theta)$\\ + +Brüche (Zähler / Nenner) können so geschrieben werden: + +% 10 / 7 +$^{10}/_{7}$ + +% Komplexere Brüche können so geschrieben werden: +% \frac{Zähler}{Nenner} +$\frac{n!}{k!(n - k)!}$ \\ + +Wir können Gleichungen auch in einer equation Umgebung verwenden. + +% Dies zeigt Mathe in einer equation Umgebung an +\begin{equation} % Aktiviert automatisch den Mathe-Modus. + c^2 = a^2 + b^2. + \label{eq:pythagoras} % Pythagoras referenzieren +\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 +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} + \sum_{i=0}^{5} f_{i} +\end{equation} +\begin{equation} + \int_{0}^{\infty} \mathrm{e}^{-x} \mathrm{d}x +\end{equation} + +\section{Grafiken} + +Lass uns eine Grafik einfügen. Das Platzieren von Grafiken kann etwas trickreich sein. +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} + % Auskommentiert, damit es nicht im Dokument auftaucht. + \caption{Dreieck mit den Seiten $a$, $b$, $c$} + \label{fig:right-triangle} +\end{figure} + +\subsection{Tabellen} +Wir können Tabellen genauso wie Grafiken einfügen. + +\begin{table}[H] + \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} + Nummer & Nachname & Vorname \\ % Spalten werden durch & getrennt + \hline % Eine horizontale Linie + 1 & Biggus & Dickus \\ + 2 & Monty & Python + \end{tabular} +\end{table} + +% \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, +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} + 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} + +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. + Das Kompilieren sieht so ähnlich wie das hier aus (Linux): \\ + \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 +2 wird unsichtbar im Hintergrund ausgeführt. + +Alle Formatierungsoptionen werden in Schritt 1 in den Quelltext geschrieben. Schritt 2 verwendet +dann diese Informationen und kümmert sich drum, dass das Dokument korrekt erstellt wird. + +\section{Ende} + +Das war's erst mal! + +% Dokument beenden +\end{document} +``` +## Mehr Informationen über LateX + +* Das tolle LaTeX wikibook: [https://de.wikibooks.org/wiki/LaTeX-Kompendium](https://de.wikibooks.org/wiki/LaTeX-Kompendium) +* Ein Tutorial (englisch): [http://www.latex-tutorial.com/](http://www.latex-tutorial.com/) From 0768364a4d69e8b3a81fa0dcfea9d996ad2fea7f Mon Sep 17 00:00:00 2001 From: Tommaso Date: Sat, 17 Oct 2015 15:57:07 +0200 Subject: [PATCH 364/685] Add myself as a translator --- it-it/java-it.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/it-it/java-it.html.markdown b/it-it/java-it.html.markdown index 0e782dd1..54602cff 100644 --- a/it-it/java-it.html.markdown +++ b/it-it/java-it.html.markdown @@ -6,6 +6,7 @@ contributors: - ["Madison Dickson", "http://github.com/mix3d"] translators: - ["Ivan Sala","http://github.com/slavni96"] + - ["Tommaso Pifferi","http://github.com/neslinesli93"] lang: it-it --- From 600483a4582713b515e1e72fd842927bbb30a613 Mon Sep 17 00:00:00 2001 From: Santhosh Kumar Srinivasan Date: Sat, 17 Oct 2015 19:38:39 +0530 Subject: [PATCH 365/685] Fix typo on readme Just a typo. Changed `tag your issues pull requests with` to `tag your issues and pull requests with` --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 28fa5093..46408a04 100644 --- a/README.markdown +++ b/README.markdown @@ -18,7 +18,7 @@ All contributions are welcome, from the tiniest typo to a brand new article. Tra in all languages are welcome (or, for that matter, original articles in any language). Send a pull request or open an issue any time of day or night. -**Please tag your issues pull requests with [language/lang-code] at the beginning** +**Please tag your issues and pull requests with [language/lang-code] at the beginning** **(e.g. [python/en] for English Python).** This will help everyone pick out things they care about. From df1f9fdb9ea25953820209d3a4ef547f8afa8dce Mon Sep 17 00:00:00 2001 From: Gloria Dwomoh Date: Sat, 17 Oct 2015 18:22:55 +0300 Subject: [PATCH 366/685] Update racket-gr.html.markdown --- el-gr/racket-gr.html.markdown | 72 +++++++++++++++++------------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/el-gr/racket-gr.html.markdown b/el-gr/racket-gr.html.markdown index 4c4576bb..589adfeb 100644 --- a/el-gr/racket-gr.html.markdown +++ b/el-gr/racket-gr.html.markdown @@ -31,12 +31,12 @@ H Racket είναι μια γενικού σκοπού, πολυ-υποδειγ ;; Τα σχόλια S-expression (εκφράσεις S) comments απορρίπτουν την ;; έκφραση που ακολουθεί, δυνατότητα που είναι χρήσιμη για να -;; κάνουμε σχόλια κάποιες εκφράσεις κατα τη διάρκεια του debugging +;; κάνουμε σχόλια κάποιες εκφράσεις κατά τη διάρκεια του debugging #; (αυτή η έκφραση δεν θα εκτελεστεί) ;; (Αν δεν καταλαβαίνεται τι είναι οι εκφράσεις , περιμένετε... Θα το μάθουμε -;; πολύ συντομα!) +;; πολύ σύντομα!) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -57,8 +57,8 @@ H Racket είναι μια γενικού σκοπού, πολυ-υποδειγ ;; όπου το f είναι η συνάρτηση και τα x y z ;; είναι οι όροι που η συνάρτηση δέχεται ;; ως ορίσματα. Αν θέλουμε να δημιουργήσουμε -;; μια λίστα στην κυριολεξία απο δίαφορα δεδομένα, -;; χρησιμοποιούμε το ' για να το εμποδίσουμε απο το να +;; μια λίστα στην κυριολεξία από δίαφορα δεδομένα, +;; χρησιμοποιούμε το ' για να το εμποδίσουμε από το να ;; αξιολογηθεί σαν έκφραση. Για παράδειγμα: '(+ 1 2) ; => Παραμένει (+ 1 2) και δεν γίνεται η πράξη ;; Τώρα , ας κάνουμε μερικές πράξεις @@ -88,15 +88,15 @@ H Racket είναι μια γενικού σκοπού, πολυ-υποδειγ ;;; Τα αλφαριθμητικά είναι πίνακες χαρακτήρων συγκεκριμένου μήκους "Hello, world!" "Benjamin \"Bugsy\" Siegel" ; Το backslash είναι χαρακτήρας διαφυγής -"Foo\tbar\41\x21\u0021\a\r\n" ; Συμπεριλαμβάνονται οι χαρακτήες διαφυγής της C, +"Foo\tbar\41\x21\u0021\a\r\n" ; Συμπεριλαμβάνονται οι χαρακτήρες διαφυγής της C, ; σε Unicode "λx:(μα.α→α).xx" ; Μπορούν να υπάρχουν και Unicode χαρακτήρες -;; Μπορούμε να εννώσουμε αλφαριθμητικά! +;; Μπορούμε να ενώσουμε αλφαριθμητικά! (string-append "Hello " "world!") ; => "Hello world!" -;; Ένα αλφαριθμητικό μπορούμε να το χρησιμοπιησουμε -;; όπως και μια λίστα απο χαρακτήρες +;; Ένα αλφαριθμητικό μπορούμε να το χρησιμοποιήσουμε +;; όπως και μια λίστα από χαρακτήρες (string-ref "Apple" 0) ; => #\A ;; Παίρνουμε το πρώτο στοιχείο ;; Η συνάρτηση format μπορεί να χρησιμοποιηθεί για @@ -117,18 +117,18 @@ H Racket είναι μια γενικού σκοπού, πολυ-υποδειγ some-var ; => 5 ;; Μπορούμε επίσης να χρησιμοποιήσουμε unicode χαρακτήρες. -(define ⊆ subset?) ;; Εδώ ουστιαστικά δίνουμε στη ήδη ύπαρχουσα συνάρτηση subset? +(define ⊆ subset?) ;; Εδώ ουσιαστικά δίνουμε στη ήδη υπάρχουσα συνάρτηση subset? ;; ένα νέο όνομα ⊆ , και παρακάτω την καλούμε με το νέο της όνομα. (⊆ (set 3 2) (set 1 2 3)) ; => #t -;; Αν ζητήσουμε μια μεταβλητή που δεν έχει οριστεί πρίν π.χ +;; Αν ζητήσουμε μια μεταβλητή που δεν έχει οριστεί πριν π.χ. (printf name) ;; θα πάρουμε το παρακάτω μήνυμα ;name: undefined; ; cannot reference undefined identifier ; context...: -;; Η τοπική δέσμευση : `me' δευσμεύεται με το "Bob" μόνο μέσα στο (let ...) +;; Η τοπική δέσμευση : `me' δεσμεύεται με το "Bob" μόνο μέσα στο (let ...) (let ([me "Bob"]) "Alice" me) ; => "Bob" @@ -156,7 +156,7 @@ my-pet ; => # ;;; Λίστες ;; Οι λίστες είναι linked-list δομές δεδομένων, -;; που έχουν δημιουργηθεί απο ζευγάρια 'cons' +;; που έχουν δημιουργηθεί από ζευγάρια 'cons' ;; και τελειώνουν με 'null' (ή αλλιώς '()) για να ;; δηλώσουν ότι αυτό είναι το τέλος της λίστας (cons 1 (cons 2 (cons 3 null))) ; => '(1 2 3) @@ -191,12 +191,12 @@ my-pet ; => # ;; Τα διανύσματα είναι πίνακες σταθερού μήκους #(1 2 3) ; => '#(1 2 3) -;; Χρησιμοποιύμε το `vector-append' για να προσθέσουμε διανύσματα +;; Χρησιμοποιούμε το `vector-append' για να προσθέσουμε διανύσματα (vector-append #(1 2 3) #(4 5 6)) ; => #(1 2 3 4 5 6) ;;; Σύνολα -;; Δημιουργούμε ένα σύνολο απο μία λίστα +;; Δημιουργούμε ένα σύνολο από μία λίστα (list->set '(1 2 3 1 2 3 3 2 1 3 2 1)) ; => (set 1 2 3) ;; Προσθέτουμε έναν αριθμό στο σύνολο χρησιμοποιώντας το `set-add' @@ -214,10 +214,10 @@ my-pet ; => # ;; Δημιουργήστε ένα αμετάβλητο πίνακα κατακερματισμού (define m (hash 'a 1 'b 2 'c 3)) -;; Παίρνουμε μια τιμή απο τον πίνακα +;; Παίρνουμε μια τιμή από τον πίνακα (hash-ref m 'a) ; => 1 -;; Άν ζητήσουμε μια τιμή που δέν υπάρχει παίρνουμε μία εξαίρεση +;; Αν ζητήσουμε μια τιμή που δεν υπάρχει παίρνουμε μία εξαίρεση ; (hash-ref m 'd) => no value found for key ;; Μπορούμε να δώσουμε μια default τιμή για τα κλειδιά που λείπουν @@ -234,7 +234,7 @@ m2 ; => '#hash((b . 2) (a . 1) (d . 4) (c . 3)) m ; => '#hash((b . 2) (a . 1) (c . 3)) <-- δεν υπάρχει `d' ;; Χρησιμοποιούμε το `hash-remove' για να αφαιρέσουμε -;; κλειδία +;; κλειδιά (hash-remove m 'a) ; => '#hash((b . 2) (c . 3)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -247,12 +247,12 @@ m ; => '#hash((b . 2) (a . 1) (c . 3)) <-- δεν υπάρχει `d' ;; Μπορούμε επίσης να χρησιμοποιήσουμε το `λ' (λ () "Hello World") ; => Ίδια συνάρτηση -;; Χρησιμοποιύμε τις παρενθέσεις για να καλέσουμε όλες τις συναρτήσεις +;; Χρησιμοποιούμε τις παρενθέσεις για να καλέσουμε όλες τις συναρτήσεις ;; συμπεριλαμβανομένων και των εκφράσεων 'λάμδα' ((lambda () "Hello World")) ; => "Hello World" ((λ () "Hello World")) ; => "Hello World" -;; Εκχωρούμε σε μια μετάβλητη την συνάρτηση +;; Εκχωρούμε σε μια μεταβλητή την συνάρτηση (define hello-world (lambda () "Hello World")) (hello-world) ; => "Hello World" @@ -302,7 +302,7 @@ m ; => '#hash((b . 2) (a . 1) (c . 3)) <-- δεν υπάρχει `d' (lambda (name . args) (format "Hello ~a, you passed ~a extra args" name (length args)))) -;; Και με λέξεις κλειδία +;; Και με λέξεις κλειδιά (define (hello-k #:name [name "World"] #:greeting [g "Hello"] . args) (format "~a ~a, ~a extra args" g name (length args))) (hello-k) ; => "Hello World, 0 extra args" @@ -347,7 +347,7 @@ m ; => '#hash((b . 2) (a . 1) (c . 3)) <-- δεν υπάρχει `d' (eq? (string-append "foo" "bar") (string-append "foo" "bar")) ; => #f -;; Το `eqv?' υποστηρίζει την σύκριση αριθμών αλλα και χαρακτήρων +;; Το `eqv?' υποστηρίζει την σύγκριση αριθμών αλλά και χαρακτήρων ;; Για άλλα ήδη μεταβλητών το `eqv?' και το `eq?' επιστρέφουν το ίδιο. (eqv? 3 3.0) ; => #f (eqv? (expt 2 100) (expt 2 100)) ; => #t @@ -365,12 +365,12 @@ m ; => '#hash((b . 2) (a . 1) (c . 3)) <-- δεν υπάρχει `d' (equal? (list 3) (list 3)) ; => #t ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; 5. Έλεχγος Ροής +;; 5. Έλεγχος Ροής ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Συνθήκες (conditionals) -(if #t ; έκφραση ελέχγου +(if #t ; έκφραση ελέγχου "this is true" ; έκφραση then "this is false") ; έκφραση else ; => "this is true" @@ -483,7 +483,7 @@ m ; => '#hash((b . 2) (a . 1) (c . 3)) <-- δεν υπάρχει `d' (values i (number->string i))) ; => '#hash((1 . "1") (2 . "2") (3 . "3")) -;; Υπάρχουν πολλά είδη απο προϋπάρχοντες τρόπους για να συλλέγουμε +;; Υπάρχουν πολλά είδη από προϋπάρχοντες τρόπους για να συλλέγουμε ;; τιμές από τους βρόχους (for/sum ([i 10]) (* i i)) ; => 285 @@ -491,7 +491,7 @@ m ; => '#hash((b . 2) (a . 1) (c . 3)) <-- δεν υπάρχει `d' (for/and ([i 10] [j (in-range 10 20)]) (< i j)) ; => #t (for/or ([i 10] [j (in-range 0 20 2)]) (= i j)) ; => #t -;; Και για να χρησιμοποιήσουμε ένα αφθαίρετο συνδιασμό χρησιμοποιούμε +;; Και για να χρησιμοποιήσουμε ένα αυθαίρετο συνδυασμό χρησιμοποιούμε ;; το 'for/fold' (for/fold ([sum 0]) ([i '(1 2 3 4)]) (+ sum i)) ; => 10 @@ -524,17 +524,17 @@ m ; => '#hash((b . 2) (a . 1) (c . 3)) <-- δεν υπάρχει `d' (set! n (add1 n)) n ; => 6 -;; Χρησιμοποιούμε τα boxes για να δηλώσουμε ρητά ότι μια μεταβητή -;; θα είναι mutable (θα μπορεί να αλλάξη η τιμή της) +;; Χρησιμοποιούμε τα boxes για να δηλώσουμε ρητά ότι μια μεταβλητή +;; θα είναι mutable (θα μπορεί να αλλάξει η τιμή της) ;; Αυτό είναι παρόμοιο με τους pointers σε άλλες γλώσσες (define n* (box 5)) (set-box! n* (add1 (unbox n*))) (unbox n*) ; => 6 -;; Πολλοί τύποι μεταβλητών στη Racket είναι αμετάβλητοι πχ τα ζεύγη, οι +;; Πολλοί τύποι μεταβλητών στη Racket είναι αμετάβλητοι π.χ. τα ζεύγη, οι ;; λίστες κτλ. Άλλοι υπάρχουν και σε μεταβλητή και σε αμετάβλητη μορφή -;; πχ αλφαριθμητικά, διανύσματα κτλ +;; π.χ. αλφαριθμητικά, διανύσματα κτλ. (define vec (vector 2 2 3 4)) (define wall (make-vector 100 'bottle-of-beer)) ;; Χρησιμοποιούμε το 'vector-set!' για να ανεώσουμε κάποια @@ -579,7 +579,7 @@ vec ; => #(1 2 3 4) (printf fmt (make-string n ch)) (newline))) -;; Χρησιμοποιομε το 'require' για να πάρουμε όλα τα +;; Χρησιμοποιουμε το 'require' για να πάρουμε όλα τα ;; παρεχόμενα ονόματα από μία ενότητα (require 'cake) ; το ' είναι για τοπική υποενότητα (print-cake 3) @@ -634,7 +634,7 @@ vec ; => #(1 2 3 4) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Οι μακροεντολές μας επιτρέπουν να επεκτείνουμε -;; το συντακτικό μιάς γλώσσας. +;; το συντακτικό μιας γλώσσας. ;; Ας προσθέσουμε έναν βρόχο while (define-syntax-rule (while condition body ...) @@ -664,20 +664,20 @@ vec ; => #(1 2 3 4) ;; (set! tmp other) ;; (set! other tmp_1)) -;; Αλλά ακόμα υπάρχουν ακόμη μετασχηματισμοί του κώδικα, π.χ: +;; Αλλά ακόμα υπάρχουν ακόμη μετασχηματισμοί του κώδικα, π.χ.: (define-syntax-rule (bad-while condition body ...) (when condition body ... (bad-while condition body ...))) -;; αυτή η μακροεντολή είναι χαλασμένη: δημιουγεί ατέρμονα βρόχο +;; αυτή η μακροεντολή είναι χαλασμένη: δημιουργεί ατέρμονα βρόχο ;; και αν προσπαθήσουμε να το χρησιμοποιήσουμε, ο μεταγλωττιστής -;; θα μπεί στον ατέρμονα βρόχο. +;; θα μπει στον ατέρμονα βρόχο. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; 10. Συμβόλαια (Contracts) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Τα συμβόλαια βάζουν περιορισμόυς σε τιμές που προέρχονται +;; Τα συμβόλαια βάζουν περιορισμούς σε τιμές που προέρχονται ;; από ενότητες (modules) (module bank-account racket (provide (contract-out @@ -719,7 +719,7 @@ vec ; => #(1 2 3 4) (displayln "Hola mundo" out-port) (close-output-port out-port) -;; Διαβάζουμε απο αρχείο ξανά +;; Διαβάζουμε από αρχείο ξανά (define in-port (open-input-file "/tmp/tmp.txt")) (displayln (read-line in-port)) ; => "Hello World" From 1ae02fc6cf7642911125e088ec5e7ce15552b95d Mon Sep 17 00:00:00 2001 From: Persa Zula Date: Sat, 17 Oct 2015 11:25:05 -0400 Subject: [PATCH 367/685] Adds more string operations to ruby doc --- ruby.html.markdown | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ruby.html.markdown b/ruby.html.markdown index 0e798706..f4de8038 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -12,7 +12,8 @@ contributors: - ["Dzianis Dashkevich", "https://github.com/dskecse"] - ["Levi Bostian", "https://github.com/levibostian"] - ["Rahil Momin", "https://github.com/iamrahil"] - - ["Gabriel Halley", https://github.com/ghalley"] + - ["Gabriel Halley", "https://github.com/ghalley"] + - ["Persa Zula", "http://persazula.com"] --- ```ruby @@ -107,6 +108,12 @@ placeholder = 'use string interpolation' 'hello ' + 3 #=> TypeError: can't convert Fixnum into String 'hello ' + 3.to_s #=> "hello 3" +# Combine strings and operators +'hello ' * 3 #=> "hello hello hello" + +# Append to string +'hello' << ' world' #=> "hello world" + # print to the output with a newline at the end puts "I'm printing!" #=> I'm printing! @@ -284,7 +291,7 @@ end #=> iteration 4 #=> iteration 5 -# There are a bunch of other helpful looping functions in Ruby, +# There are a bunch of other helpful looping functions in Ruby, # for example "map", "reduce", "inject", the list goes on. Map, # for instance, takes the array it's looping over, does something # to it as defined in your block, and returns an entirely new array. From 547bc1df42ff8dfb463e2d64d1ca1f6887a91300 Mon Sep 17 00:00:00 2001 From: "G. Reiter" Date: Sat, 10 Oct 2015 19:03:49 +0200 Subject: [PATCH 368/685] Improve the translation several characters were wrong, additionally German spelling/grammar is now correct (German is my primary language). --- de-de/bash-de.html.markdown | 223 +++++++++++++++++++++++++++++++++--- de-de/git-de.html.markdown | 30 ++--- 2 files changed, 223 insertions(+), 30 deletions(-) diff --git a/de-de/bash-de.html.markdown b/de-de/bash-de.html.markdown index fb9cd9d4..541d28bb 100644 --- a/de-de/bash-de.html.markdown +++ b/de-de/bash-de.html.markdown @@ -28,18 +28,50 @@ echo Hello, world! echo 'Dies ist die erste Zeile'; echo 'Dies die zweite Zeile' # Variablen deklariert man so: -VARIABLE="irgendein String" +Variable="irgendein String" # Aber nicht so: -VARIABLE = "irgendein String" -# Bash wird VARIABLE für einen Befehl halten, den es ausführen soll. Es wird einen Fehler ausgeben, +Variable = "irgendein String" +# Bash wird 'Variable' für einen Befehl halten, den es ausführen soll. Es wird einen Fehler ausgeben, # weil es den Befehl nicht findet. +# Und so auch nicht: +Variable= 'Some string' +# Bash wird 'Variable' wieder für einen Befehl halten, den es ausführen soll. Es wird einen Fehler ausgeben, +# Hier wird der Teil 'Variable=' als nur für diesen einen Befehl gültige Zuweisung an die Variable gesehen. + # Eine Variable wird so benutzt: -echo $VARIABLE -echo "$VARIABLE" -# Wenn du eine Variable selbst benutzt – ihr Werte zuweist, sie exportierst oder irgendetwas anders –, +echo $Variable +echo "$Variable" +echo ${Variable} +# aber +echo '$Variable' +# Wenn du eine Variable selbst benutzt – ihr Werte zuweist, sie exportierst oder irgendetwas anderes –, # dann über ihren Namen ohne $. Aber wenn du ihren zugewiesenen Wert willst, dann musst du $ voranstellen. +# Beachte: ' (Hochkomma) verhindert das Interpretieren der Variablen + +# Ersetzen von Zeichenketten in Variablen +echo ${Variable/irgendein/neuer} +# Ersetzt das erste Vorkommen von "irgendein" durch "neuer" + +# Teil einer Zeichenkette +Laenge=7 +echo ${Variable:0:Laenge} +# Gibt nur die ersten 7 Zeichen zurück + +# Standardwert verwenden +echo ${Foo:-"ErsatzWennLeerOderUngesetzt"} +# Das funktioniert mit nicht gesetzten Variablen (Foo=) und leeren Zeichenketten (Foo="") +# Die Zahl 0 (Foo=0) liefert 0. +# Beachte: der wert der Variablen wird nicht geändert + +# Eingebaute Variable (BUILTINS): +# Einige nützliche Beispiele +echo "Rückgabewert des letzten Befehls: $?" +echo "Die PID des skripts: $$" +echo "Anzahl der Argumente beim Aufruf: $#" +echo "Alle Argumente beim Aufruf: $@" +echo "Die Argumente in einzelnen Variablen: $1 $2..." # Einen Wert aus der Eingabe lesen: echo "Wie heisst du?" @@ -47,14 +79,30 @@ read NAME # Wir mussten nicht mal eine neue Variable deklarieren echo Hello, $NAME! # Wir haben die übliche if-Struktur: -if true +# 'man test' liefert weitere Informationen zu Bedingungen +if [ "$NAME" -ne $USER ] then - echo "Wie erwartet" + echo "Dein Name ist nicht dein Login-Name" else - echo "Und dies nicht" + echo "Dein Name ist dein Login-Name" fi -# Ausdrücke werden im folgenden Format festgehalten: +# Es gibt auch bedingte Ausführung +echo "immer ausgeführt" || echo "Nur ausgeführt wenn der erste Befehl fehlschlägt" +echo "immer ausgeführt" && echo "Nur ausgeführt wenn der erste Befehl Erfolg hat" + +# Um && und || mit if statements zu verwenden, braucht man mehrfache Paare eckiger Klammern: +if [ $NAME == "Steve" ] && [ $Alter -eq 15 ] +then + echo "Wird ausgeführt wenn $NAME gleich 'Steve' UND $Alter gleich 15." +fi + +if [ $Name == "Daniya" ] || [ $Name == "Zach" ] +then + echo "Wird ausgeführt wenn $NAME gleich 'Daniya' ODER $NAME gleich 'Zach'." +fi + +# Ausdrücke haben folgendes Format: echo $(( 10 + 5 )) # Anders als andere Programmiersprachen ist Bash eine Shell – es arbeitet also im Kontext von Verzeichnissen. @@ -69,13 +117,60 @@ ls -l # Liste alle Dateien und Unterverzeichnisse auf einer eigenen Zeile auf # txt-Dateien im aktuellen Verzeichnis auflisten: ls -l | grep "\.txt" -# Befehle können innerhalb anderer Befehle mit $( ) erstetzt werden: +# Ein- und Ausgabe können umgeleitet werden (stdin, stdout, and stderr). +# Von stdin lesen bis "EOF" allein in einer Zeile auftaucht +# und die Datei hello.py mit den Zeilen zwischen den beiden "EOF" +# überschreiben: +cat > hello.py << EOF +#!/usr/bin/env python +from __future__ import print_function +import sys +print("#stdout", file=sys.stdout) +print("#stderr", file=sys.stderr) +for line in sys.stdin: + print(line, file=sys.stdout) +EOF + +# Führe hello.py mit verschiedenen Umleitungen von +# stdin, stdout und stderr aus: +python hello.py < "input.in" +python hello.py > "output.out" +python hello.py 2> "error.err" +python hello.py > "output-and-error.log" 2>&1 +python hello.py > /dev/null 2>&1 +# Die Fehlerausgabe würde die Datei "error.err" überschreiben (falls sie existiert) +# verwende ">>" um stattdessen anzuhängen: +python hello.py >> "output.out" 2>> "error.err" + +# Überschreibe output.out, hänge an error.err an und zähle die Zeilen beider Dateien: +info bash 'Basic Shell Features' 'Redirections' > output.out 2>> error.err +wc -l output.out error.err + +# Führe einen Befehl aus und gib dessen "file descriptor" (zB /dev/fd/123) aus +# siehe: man fd +echo <(echo "#helloworld") + +# Mehrere Arten, um output.out mit "#helloworld" zu überschreiben: +cat > output.out <(echo "#helloworld") +echo "#helloworld" > output.out +echo "#helloworld" | cat > output.out +echo "#helloworld" | tee output.out >/dev/null + +# Löschen der Hilfsdateien von oberhalb, mit Anzeige der Dateinamen +# (mit '-i' für "interactive" erfolgt für jede Date eine Rückfrage) +rm -v output.out error.err output-and-error.log + +# Die Ausgabe von Befehlen kann mit Hilfe von $( ) in anderen Befehlen verwendet weden: # Der folgende Befehl zeigt die Anzahl aller Dateien und Unterverzeichnisse # im aktuellen Verzeichnis an. echo "Dieser Ordner beinhaltet $(ls | wc -l) Dateien und Verzeichnisse." +# Dasselbe kann man mit "backticks" `` erreichen, aber diese können +# nicht verschachtelt werden. $() ist die empfohlene Methode. +echo "Dieser Ordner beinhaltet `ls | wc -l` Dateien und Verzeichnisse." + # Bash nutzt einen case-Ausdruck, der sich ähnlich wie switch in Java oder C++ verhält. -case "$VARIABLE" +case "$Variable" in # Liste der Fälle, die unterschieden werden sollen 0) echo "Hier ist eine Null." @@ -83,10 +178,106 @@ in *) echo "Das ist nicht Null." esac -# loops iterieren über die angegebene Zahl von Argumenten: -# Der Inhalt von $VARIABLE wird dreimal ausgedruckt. -for $VARIABLE in x y z +# 'for' Schleifen iterieren über die angegebene Zahl von Argumenten: +# Der Inhalt von $Variable wird dreimal ausgedruckt. +for $Variable in {1..3} do - echo "$VARIABLE" + echo "$Variable" done + +# Oder verwende die "traditionelle 'for'-Schleife": +for ((a=1; a <= 3; a++)) +do + echo $a +done + +# Schleifen können auch mit Dateien arbeiten: +# 'cat' zeigt zuerst file1 an und dann file2 +for Variable in file1 file2 +do + cat "$Variable" +done + +# .. oder mit der Ausgabe eines Befehls: +# Ausgabe des Inhalts jeder Datei, die von 'ls' aufgezählt wird +for Output in $(ls) +do + cat "$Output" +done + +# while Schleife: +while [ true ] +do + echo "Schleifenkörper..." + break +done + +# Funktionen definieren +# Definition: +function foo () +{ + echo "Argumente funktionieren wie bei skripts: $@" + echo Und: $1 $2..." + echo "Dies ist eine Funktion" + return 0 +} + +# oder einfacher +bar () +{ + echo "Auch so kann man Funktionen deklarieren!" + return 0 +} + +# Aufruf der Funktion: +foo "My name is" $Name + +# Was du noch lernen könntest: +# Ausgabe der letzten 10 Zeilen von file.txt +tail -n 10 file.txt +# Ausgabe der ersten 10 Zeilen von file.txt +head -n 10 file.txt +# sortierte Ausgabe von file.txt +sort file.txt +# Mehrfachzeilen in sortierten Dateien unterdrücken +# oder (mit -d) nur diese ausgeben +uniq -d file.txt +# Ausgabe nur der ersten Spalte (vor dem ersten ',') +cut -d ',' -f 1 file.txt +# ersetze in file.txt jedes vorkommende 'gut' durch 'super' (versteht regex) +sed -i 's/gut/super/g' file.txt +# Ausgabe nach stdout aller Zeilen von file.txt, die auf eine regex passen +# Im Beispiel: Zeilen, die mit "foo" beginnen und mit "bar" enden +grep "^foo.*bar$" file.txt +# Mit der Option "-c" wird stattdessen die Anzahl der gefundenen Zeilen ausgegeben +grep -c "^foo.*bar$" file.txt +# verwende 'fgrep' oder 'grep -F' wenn du buchstäblich nach den Zeichen +# suchen willst, ohne sie als regex zu interpretieren +fgrep "^foo.*bar$" file.txt + +# Dokumentation über die in bash eingebauten Befehle +# bekommst du mit dem eingebauten Befehl 'help' +help +help help +help for +help return +help source +help . + +# Das bash-Handbuch liest du mit 'man' +apropos bash +man 1 bash +man bash + +# Dann gibt es noch das 'info' System (drücke ? um Hilfe angezeigt zu bekommen) +apropos info | grep '^info.*(' +man info +info info +info 5 info + +# info Dokumentation über bash: +info bash +info bash 'Bash Features' +info bash 6 +info --apropos bash ``` diff --git a/de-de/git-de.html.markdown b/de-de/git-de.html.markdown index 43939129..dea329d5 100644 --- a/de-de/git-de.html.markdown +++ b/de-de/git-de.html.markdown @@ -18,12 +18,12 @@ Anmerkung des Übersetzers: Einige englische Begriffe wie *Repository*, *Commit* ### Was ist Versionsverwaltung? -Eine Versionskontrolle erfasst die Änderungen einer Datei oder eines Verzeichnisses im Verlauf der Zeit. +Eine Versionsverwaltung erfasst die Änderungen einer Datei oder eines Verzeichnisses im Verlauf der Zeit. ### Zentrale im Vergleich mit verteilter Versionverwaltung -* Zentrale Versionskontrolle konzentriert sich auf das Synchronisieren, Verfolgen und Sichern von Dateien. -* Verteilte Versionskontrolle konzentriert sich auf das Teilen der Änderungen. Jede Änderung hat eine eindeutige ID. +* Zentrale Versionsverwaltung konzentriert sich auf das Synchronisieren, Verfolgen und Sichern von Dateien. +* Verteilte Versionsverwaltung konzentriert sich auf das Teilen der Änderungen. Jede Änderung hat eine eindeutige ID. * Verteilte Systeme haben keine vorbestimmte Struktur. Ein SVN-ähnliches, zentrales System wäre mit Git ebenso umsetzbar. [Weiterführende Informationen](http://git-scm.com/book/en/Getting-Started-About-Version-Control) @@ -61,7 +61,7 @@ Der Index ist die die Staging-Area von Git. Es ist im Grunde eine Ebene, die Arb ### Commit -Ein Commit ist ein Schnappschuss von Uderungen in deinem Arbeitsverzeichnis. Wenn du zum Beispiel 5 Dateien hinzugefügt und 2 andere entfernt hast, werden diese Änderungen im Commit (Schnappschuss) enthalten sein. Dieser Commit kann dann in andere Repositorys gepusht werden. Oder nicht! +Ein Commit ist ein Schnappschuss von Änderungen in deinem Arbeitsverzeichnis. Wenn du zum Beispiel 5 Dateien hinzugefügt und 2 andere entfernt hast, werden diese Änderungen im Commit (Schnappschuss) enthalten sein. Dieser Commit kann dann in andere Repositories gepusht werden. Oder nicht! ### Branch @@ -69,7 +69,9 @@ Ein Branch, ein Ast oder Zweig, ist im Kern ein Pointer auf den letzten Commit, ### HEAD und head (Teil des .git-Verzeichnisses) -HEAD ist ein Pointer auf den aktuellen Branch. Ein Repository hat nur einen *aktiven* HEAD. Ein head ist ein Pointer, der auf ein beliebige Zahl von heads zeigt. +HEAD ist ein Pointer auf den aktuellen Branch. Ein Repository hat nur einen *aktiven* HEAD. + +Ein *head* ist ein Pointer, der auf einen beliebigen Commit zeigt. Ein Repository kann eine beliebige Zahl von *heads* enthalten. ### Konzeptionelle Hintergründe @@ -127,7 +129,7 @@ Zeigt die Unterschiede zwischen Index (im Grunde dein Arbeitsverzeichnis/-reposi ```bash -# Zeigt den Branch, nicht-verfolgte Dateien, Uderungen und andere Unterschiede an +# Zeigt den Branch, nicht-verfolgte Dateien, Änderungen und andere Unterschiede an $ git status # Anderes Wissenswertes über git status anzeigen @@ -151,7 +153,7 @@ $ git add ./*.java ### branch -Verwalte alle Branches. Du kannst sie mit diesem Befehl ansehen, bearbeiten, neue erschaffen oder löschen. +Verwalte alle Branches. Du kannst sie mit diesem Befehl ansehen, bearbeiten, neue erzeugen oder löschen. ```bash # Liste alle bestehenden Branches und Remotes auf @@ -186,7 +188,7 @@ $ git checkout -b newBranch ### clone -Ein bestehendes Repository in ein neues Verzeichnis klonen oder kopieren. Es fügt außerdem für hedes geklonte Repo remote-tracking Branches hinzu. Du kannst auf diese Remote-Branches pushen. +Ein bestehendes Repository in ein neues Verzeichnis klonen oder kopieren. Es fügt außerdem für jedes geklonte Repository remote-tracking Branches hinzu. Du kannst auf diese Remote-Branches pushen. ```bash # Klone learnxinyminutes-docs @@ -288,16 +290,16 @@ $ git mv -f myFile existingFile ### pull -Führe einen Pull, zieht alle Daten, eines Repositorys und f?? einen Merge mit einem anderen Branch durch. +Führe einen Pull (zieht alle Daten eines Repositories) aus und führt einen Merge mit einem anderen Branch durch. ```bash -# Update deines lokalen Repos, indem ein Merge der neuen Uderungen -# von den remote-liegenden "origin"- und "master"-Branches durchgef?? wird. +# Update deines lokalen Repos, indem ein Merge der neuen Änderungen +# von den remote-liegenden "origin"- und "master"-Branches durchgeführt wird. # git pull # git pull => impliziter Verweis auf origin und master $ git pull origin master -# F?? einen Merge von Uderungen eines remote-Branch und ein Rebase +# Führt einen Merge von Änderungen eines remote-Branch und ein Rebase # des Branch-Commits im lokalen Repo durch. Wie: pull , git rebase " $ git pull origin master --rebase ``` @@ -337,8 +339,8 @@ $ git reset # Setze die Staging-Area zurück, um dem letzten Commit zu entsprechen und überschreibe das Arbeitsverzeichnis $ git reset --hard -# Bewegt die Spitze des Branches zu dem angegebenen Commit (das Verzeichnis bleibt unber??) -# Alle Uderungen bleiben im Verzeichnis erhalten +# Bewegt die Spitze des Branches zu dem angegebenen Commit (das Verzeichnis bleibt unberührt) +# Alle Änderungen bleiben im Verzeichnis erhalten $ git reset 31f2bb1 # Bewegt die Spitze des Branches zurück zu dem angegebenen Commit From c030e8aab18e2d63a40eb1321b21a62471094bc0 Mon Sep 17 00:00:00 2001 From: Kirushan Rasendran Date: Sat, 17 Oct 2015 21:17:09 +0530 Subject: [PATCH 369/685] CSS Translation En to Tamil --- ta_in/css.html.markdown | 261 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 261 insertions(+) create mode 100644 ta_in/css.html.markdown diff --git a/ta_in/css.html.markdown b/ta_in/css.html.markdown new file mode 100644 index 00000000..b55ab363 --- /dev/null +++ b/ta_in/css.html.markdown @@ -0,0 +1,261 @@ +--- +language: css +contributors: + - ["Mohammad Valipour", "https://github.com/mvalipour"] + - ["Marco Scannadinari", "https://github.com/marcoms"] + - ["Geoffrey Liu", "https://github.com/g-liu"] + - ["Connor Shea", "https://github.com/connorshea"] + - ["Deepanshu Utkarsh", "https://github.com/duci9y"] +translators: + - ["Rasendran Kirushan", "https://github.com/kirushanr"] +filename: learncss.css +lang:in-ta +--- + + +இணையத்தின் ஆரம்ப காலத்தில் முழுமையாக உரைகளை மட்டுமே கொண்டிருந்தன. +ஆனால் உலாவிகளில் கொண்டு வரப்பட்ட மாற்றங்களில் முழுமையான காட்சிபடுத்தல்களுடன் +கூடிய இணையதளங்கள் உருவாகின. + +CSS helps maintain separation between the content (HTML) and the look-and-feel of a web page. +CSS ஆனது HTML மற்றும் அதன் அழகுபடுத்கூடிய காரணிகளையும் வேறுபடுத்த உதவியது. + +ஒரு html இல் உள்ள உறுப்புகளை(elements) வெவ்வேறு வகையான காட்சி பண்புகளை வழங்க உதவுகிறது. + + +This guide has been written for CSS 2, though CSS 3 is fast becoming popular. +இந்த வழிகாட்டி CSS2 உக்கு எழுதப்பட்டுள்ளது, இருப்பினும் தற்போது CSS 3 வேகமாக பிரபல்யமாகி வருகிறது. + +**குறிப்பு:** +CSS ஆனது முற்று முழுதாக visual(காட்சி) மாற்றங்களை தருவதால் அதை நீங்கள் முயற்சிக்க +இதை உபயோகபடுத்தலாம் [dabblet](http://dabblet.com/). +இந்த வழிகாட்டியின் பிரதான நோக்கம் CSS இன் syntax மற்றும் மேலும் சில வழிமுறைகளை +உங்களுக்கு கற்று தருவதாகும் + +```css +/* css இல் குறிப்புகளை இப்படி இடலாம் */ + +/* #################### + ## SELECTORS + #################### */ + +/* ஒரு HTML பக்கத்தில் இருக்கும் உறுப்பை நாம் selector மூலம் தெரிவு செய்யலாம் +selector { property: value; /* more properties...*/ } + +/* +கிழே ஒரு உதாரணம் காட்டப்பட்டுள்ளது: + +
+*/ + +/* நீங்கள் அந்த உறுப்பை அதன் CSS class மூலம் தெரியலாம் */ +.class1 { } + +/* அல்லது இவ்வாறு இரண்டு class மூலம் தெரியலாம்! */ +.class1.class2 { } + +/* அல்லது அதன் பெயரை பாவித்து தெரியலாம் */ +div { } + +/* அல்லது அதன் id ஐ பயன்படுத்தி தெரியலாம்*/ +#anID { } + +/* அல்லது ஒரு உறுப்பின் பண்பு ஒன்றின் மூலம்! */ +[attr] { font-size:smaller; } + +/* அல்லது அந்த பண்பு ஒரு குறிப்பிட்ட பெறுமானத்தை கொண்டு இருப்பின் */ +[attr='value'] { font-size:smaller; } + +/* ஒரு பெறுமதியுடன் ஆரம்பமாகும் போது (CSS 3) */ +[attr^='val'] { font-size:smaller; } + +/* அல்லது ஒரு பெறுமதியுடன் முடிவடையும் போது (CSS 3) */ +[attr$='ue'] { font-size:smaller; } + +/* அல்லது காற்புள்ளியால் பிரிக்கப்பட்ட பெறுமானங்களை கொண்டு இருப்பின் */ +[otherAttr~='foo'] { } +[otherAttr~='bar'] { } + +/* அல்லது `-` பிரிக்கப்பட்ட பெறுமானங்களை கொண்டு இருப்பின், உ.ம்:-, "-" (U+002D) */ +[otherAttr|='en'] { font-size:smaller; } + + +/* நாம் இரண்டு selectors ஐ ஒன்றாக உபயோகித்தும் ஒரு உறுப்பை அணுக முடியும் , +அவற்றுக்கு இடயே இடைவெளி காணப்படகூடாது + */ +div.some-class[attr$='ue'] { } + +/*அல்லது ஒரு உறுப்பினுள் இருக்கும் இன்னொரு உறுப்பை (child element) அணுக */ +div.some-parent > .class-name { } + +/* ஒரு ஒரு பிரதான உறுப்பில் உள்ள உப உறுப்புகளை அணுக*/ +div.some-parent .class-name { } + +/* மேலே குறிபிட்ட அணுகுமுறையில் இடைவெளி காணப்படாது விடின் + அந்த selector வேலை செய்யாது + */ +div.some-parent.class-name { } + +/* அல்லது ஒரு உறுப்புக்கு அடுத்துள்ள */ +.i-am-just-before + .this-element { } + +/* or அல்லது அதற்கு முந்தய உறுப்பின் மூலம் */ +.i-am-any-element-before ~ .this-element { } + +/* There are some selectors called pseudo classes that can be used to select an + element when it is in a particular state + சில selectors ஐ pseudo class மூலம் அணுக முடியும் , எப்போது எனில் அவை + குறித்த ஒரு நிலையில் இருக்கும் போது ஆகும் + */ + +/* உதாரணமாக நாம் ஒரு உறுப்பின் மீதாக cursor ஐ நகர்த்தும் போது */ +selector:hover { } + +/* அல்லது ஒரு +பார்வையிட்ட இணைப்பு */ +selector:visited { } + +/* அல்லது ஒரு பார்வையிடபடாத இணைப்பு */ +selected:link { } + +/* அல்லது ஒரு element ஐ focus செய்யும் போது */ +selected:focus { } + +/* + எல்லா elementகளையும் ஒரே நேரத்தில் அணுக `*` +*/ +* { } /* all elements */ +.parent * { } /* all descendants */ +.parent > * { } /* all children */ + +/* #################### + ## பண்புகள் + #################### */ + +selector { + + /* நீளத்தின் அலகுகள் absolute அல்லது relative ஆக இருக்கலாம். */ + + /* Relative units */ + width: 50%; /* percentage of parent element width */ + font-size: 2em; /* multiples of element's original font-size */ + font-size: 2rem; /* or the root element's font-size */ + font-size: 2vw; /* multiples of 1% of the viewport's width (CSS 3) */ + font-size: 2vh; /* or its height */ + font-size: 2vmin; /* whichever of a vh or a vw is smaller */ + font-size: 2vmax; /* or greater */ + + /* Absolute units */ + width: 200px; /* pixels */ + font-size: 20pt; /* points */ + width: 5cm; /* centimeters */ + min-width: 50mm; /* millimeters */ + max-width: 5in; /* inches */ + + + /* Colors */ + color: #F6E; /* short hex format */ + color: #FF66EE; /* long hex format */ + color: tomato; /* a named color */ + color: rgb(255, 255, 255); /* as rgb values */ + color: rgb(10%, 20%, 50%); /* as rgb percentages */ + color: rgba(255, 0, 0, 0.3); /* as rgba values (CSS 3) Note: 0 < a < 1 */ + color: transparent; /* equivalent to setting the alpha to 0 */ + color: hsl(0, 100%, 50%); /* as hsl percentages (CSS 3) */ + color: hsla(0, 100%, 50%, 0.3); /* as hsla percentages with alpha */ + + /* Images as backgrounds of elements */ + background-image: url(/img-path/img.jpg); /* quotes inside url() optional */ + + /* Fonts */ + font-family: Arial; + /* if the font family name has a space, it must be quoted */ + font-family: "Courier New"; + /* if the first one is not found, the browser uses the next, and so on */ + font-family: "Courier New", Trebuchet, Arial, sans-serif; +} +``` + +## Usage + +ஒரு css file ஐ save செய்ய `.css`. + +```xml + + + + + + + +
+
+``` + +## Precedence or Cascade + +An element may be targeted by multiple selectors and may have a property set on it in more than once. In these cases, one of the rules takes precedence over others. Generally, a rule in a more specific selector take precedence over a less specific one, and a rule occuring later in the stylesheet overwrites a previous one. + +This process is called cascading, hence the name Cascading Style Sheets. + +ஒரு element ஆனது ஒன்றுக்கு மேற்பட்ட selectors மூலம் அணுகபடலாம் ,இவ்வாறான சந்தர்பங்களில் +ஒரு குறிபிட்ட விதிமுறையை பின்பற்றுகிறது இது cascading என அழைக்கபடுகிறது, அதனால் தன +இது Cascading Style Sheets என அழைக்கபடுகிறது. + + +கிழே தரப்பட்டுள்ள css இன் படி: + +```css +/* A */ +p.class1[attr='value'] + +/* B */ +p.class1 { } + +/* C */ +p.class2 { } + +/* D */ +p { } + +/* E */ +p { property: value !important; } +``` + +அத்துடன் கிழே தரப்பட்டுள்ள கட்டமைப்பின்படியும்: + +```xml +

+``` + +The precedence of style is as follows. Remember, the precedence is for each **property**, not for the entire block. +css முன்னுரிமை பின்வருமாறு +* `E` இதுவே அதிக முக்கியத்துவம் வாய்ந்தது காரணம் இது `!important` பயன்படுத்துகிறது. இதை பயன்படுத்துவதை தவிர்க்கவும் +* `F` இது இரண்டாவது காரணம் இது inline style. +* `A` இது மூன்றவதாக வருகிறது, காரணம் இது மூன்று காரணிகளை குறிக்கிறது : element(உறுப்பு) பெயர் `p`, அதன் class `class1`, an அதன் பண்பு(attribute) `attr='value'`. +* `C` இது அடுத்த நிலையில் உள்ளது கடைசி. +* `B` இது அடுத்தது. +* `D` இதுவே கடைசி . + +## css அம்சங்களின் பொருந்தகூடிய தன்மை + +பெரும்பாலான css 2 வின் அம்சங்கள் எல்லா உலாவிகளிலும் , கருவிகளிலும் உள்ளன. ஆனால் முன்கூட்டியே அந்த அம்சங்களை பரிசோதிப்பது நல்லது. + +## வளங்கள் + +* To run a quick compatibility check, [CanIUse](http://caniuse.com). +* CSS Playground [Dabblet](http://dabblet.com/). +* [Mozilla Developer Network's CSS documentation](https://developer.mozilla.org/en-US/docs/Web/CSS) +* [Codrops' CSS Reference](http://tympanus.net/codrops/css_reference/) + +## மேலும் வாசிக்க + +* [Understanding Style Precedence in CSS: Specificity, Inheritance, and the Cascade](http://www.vanseodesign.com/css/css-specificity-inheritance-cascaade/) +* [Selecting elements using attributes](https://css-tricks.com/almanac/selectors/a/attribute/) +* [QuirksMode CSS](http://www.quirksmode.org/css/) +* [Z-Index - The stacking context](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Understanding_z_index/The_stacking_context) +* [SASS](http://sass-lang.com/) and [LESS](http://lesscss.org/) for CSS pre-processing +* [CSS-Tricks](https://css-tricks.com) From 19a5714600892bedda76b4b4562d961fc579a890 Mon Sep 17 00:00:00 2001 From: Chris54721 Date: Sat, 17 Oct 2015 18:02:47 +0200 Subject: [PATCH 370/685] Added lang tag --- it-it/json-it.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/it-it/json-it.html.markdown b/it-it/json-it.html.markdown index 51bc9fc8..379bad73 100644 --- a/it-it/json-it.html.markdown +++ b/it-it/json-it.html.markdown @@ -7,6 +7,7 @@ contributors: translators: - ["Robert Margelli", "http://github.com/sinkswim/"] - ["Christian Grasso", "http://chris54721.net"] +lang: it-it --- JSON è un formato per l'interscambio di dati estremamente semplice, per cui questo sarà From 0f003ef3e9fc00c33741303e4979a44f285f5e05 Mon Sep 17 00:00:00 2001 From: Damaso Sanoja Date: Sat, 17 Oct 2015 11:35:56 -0430 Subject: [PATCH 371/685] Spanish translation version 1 --- es-es/amd-es.html.markdown | 241 +++---------------------------------- 1 file changed, 16 insertions(+), 225 deletions(-) diff --git a/es-es/amd-es.html.markdown b/es-es/amd-es.html.markdown index 3de23a6c..7a59ddd6 100644 --- a/es-es/amd-es.html.markdown +++ b/es-es/amd-es.html.markdown @@ -1,423 +1,214 @@ --- category: tool - tool: amd - contributors: - - ["Frederik Ring", "https://github.com/m90"] translators: - - ["Damaso Sanoja", "https://github.com/damasosanoja"] - filename: learnamd-es.js - lang: es-es - --- - - ## Iniciando con AMD - - -El API del **Módulo de Definición Asíncrono** especifica un mecanismo para definir módulos - -JavaScript de manera que tanto el módulo como sus dependencias puedan ser cargadas de manera asíncrona. Esto es particularmente adecuado para el entorno del navegador donde la carga sincronizada de los módulos genera problemas de rendimiento, usabilidad, depuración y acceso cruzado de dominios. - - +El API del **Módulo de Definición Asíncrono** especifica un mecanismo para definir módulos JavaScript de manera tal que tanto el módulo como sus dependencias puedan ser cargadas de manera asíncrona. Esto es particularmente adecuado para el entorno del navegador donde la carga sincronizada de los módulos genera problemas de rendimiento, usabilidad, depuración y acceso de multi-dominios. ### Conceptos básicos - ```javascript - -// El API básico de AMD consiste en nada más que dos métodos: `define` y `require` - +// El API básico de AMD consiste en tan solo dos métodos: `define` y `require` // y se basa en la definición y consumo de los módulos: - -// `define(id?, dependencies?, factory)` define un módulo - -// `require(dependencies, callback)` importa un conjunto de dependencias y - -// las consume en el callback invocado - - +// `define(id?, dependencias?, fábrica)` define un módulo +// `require(dependencias, callback)` importa un conjunto de dependencias y +// las consume al invocar el callback // Comencemos usando define para definir un nuevo módulo - // que no posee dependencias. Lo haremos enviando un nombre - -// y una función factoría para definirla: - +// y una función fábrica para definirla: define('awesomeAMD', function(){ - var isAMDAwesome = function(){ - return true; - }; - - // El valor que regresa de la función factoría del módulo es - - // aquello que los otros módulos o llamados require reciben cuando - - // solicitan nuestro módulo `awesomeAMD`. - + // El valor que regresa la función fábrica del módulo será + // lo que los otros módulos o llamados require recibirán cuando + // soliciten nuestro módulo `awesomeAMD`. // El valor exportado puede ser cualquier cosa, funciones (constructores), - // objetos, primitivos, incluso indefinidos (aunque eso no ayuda mucho). - return isAMDAwesome; - }); - - // Ahora definamos otro módulo que dependa de nuestro módulo `awesomeAMD`. - // Observe que ahora hay un argumento adicional que define - // las dependencias de nuestro módulo: - define('loudmouth', ['awesomeAMD'], function(awesomeAMD){ - - // las dependencias serán enviadas a los argumentos de la factoría - + // las dependencias serán enviadas a los argumentos de la fábrica // en el orden que sean especificadas - var tellEveryone = function(){ - if (awesomeAMD()){ - alert('This is sOoOo rad!'); - } else { - alert('Pretty dull, isn\'t it?'); - } - }; - return tellEveryone; - }); - - // Como ya sabemos utilizar define usemos ahora `require` para poner en marcha - // nuestro programa. La firma de `require` es `(arrayOfDependencies, callback)`. - require(['loudmouth'], function(loudmouth){ - loudmouth(); - }); - - // Para hacer que este tutorial corra código, vamos a implementar una - // versión muy básica (no-asíncrona) de AMD justo aquí: - function define(name, deps, factory){ - // observa como son manejados los módulos sin dependencias - define[name] = require(factory ? deps : [], factory || deps); - } - - function require(deps, callback){ - var args = []; - // primero recuperemos todas las dependencias que necesita - // el llamado require - for (var i = 0; i < deps.length; i++){ - args[i] = define[deps[i]]; - } - // satisfacer todas las dependencias del callback - return callback.apply(null, args); - } - // puedes ver este código en acción aquí: http://jsfiddle.net/qap949pd/ - ``` - - ### Uso en el mundo real con require.js - - En contraste con el ejemplo introductorio, `require.js` (la librería AMD más popular) implementa la **A** de **AMD**, permitiéndote cargar los módulos y sus dependencias asincrónicamente via XHR: - - ```javascript - /* file: app/main.js */ - require(['modules/someClass'], function(SomeClass){ - // el callback es diferido hasta que la dependencia sea cargada - var thing = new SomeClass(); - }); - console.log('So here we are, waiting!'); // esto correrá primero - ``` - - -Por convención, usualmente guardas un módulo en un fichero. `require.js` puede resolver los nombres de los módulos basados en rutas de archivo, de forma que no tienes que nombrar tus módulos, simplemente referenciarlos usando su ubicación. En el ejemplo `someClass` es asumido que se ubica en la carpeta `modules`, relativa a tu `baseUrl` configurada: - - +Por convención, usualmente guardas un módulo en un fichero. `require.js` puede resolver los nombres de los módulos basados en rutas de archivo, de forma que no tienes que nombrar tus módulos, simplemente referenciarlos usando su ubicación. En el ejemplo `someClass` asumimos que se ubica en la carpeta `modules`, relativa a tu `baseUrl` configurada: * app/ - * main.js - * modules/ - * someClass.js - * someHelpers.js - * ... - * daos/ - * things.js - * ... - - Esto significa que podemos definir `someClass` sin especificar su id de módulo: - - ```javascript - /* file: app/modules/someClass.js */ - define(['daos/things', 'modules/someHelpers'], function(thingsDao, helpers){ - // definición de módulo, por supuesto, ocurrirá también asincrónicamente - function SomeClass(){ - this.method = function(){/**/}; - // ... - } - return SomeClass; - }); - ``` Para alterar el comportamiento del mapeo de ruta usa `requirejs.config(configObj)` en tu `main.js`: - - ```javascript - /* file: main.js */ - requirejs.config({ - baseUrl : 'app', - paths : { - // también puedes cargar módulos desde otras ubicaciones - jquery : '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min', - coolLibFromBower : '../bower_components/cool-lib/coollib' - } - }); - require(['jquery', 'coolLibFromBower', 'modules/someHelpers'], function($, coolLib, helpers){ - // un fichero `main` necesita llamar a require al menos una vez, - // de otra forma jamás correrá el código - coolLib.doFancyStuffWith(helpers.transform($('#foo'))); - }); - ``` - Las aplicaciones basadas en `require.js` usualmente tendrán un solo punto de entrada (`main.js`) que se pasa a la etiqueta del script `require.js` como un atributo de datos. Será cargado y ejecutado automáticamente al cargar la página: - - ```html - - - - Cien etiquetas de script? Nunca más! - - - - - - ``` - - ### Optimizar todo un proyecto usando r.js - - -Muchas personas prefiere usar AMD para la sana organización del código durante el desarrollo, pero todavía prefiere enviar para producción un solo fichero en vez de ejecutar cientos de XHRs en las cargas de página. - - +Muchas personas prefieren usar AMD para la organización del código durante el desarrollo, pero quieren enviar para producción un solo fichero en vez de ejecutar cientos de XHRs en las cargas de página. `require.js` incluye un script llamado `r.js` (el que probablemente correrás en node.js, aunque Rhino también es soportado) que puede analizar el gráfico de dependencias de tu proyecto, y armar un solo fichero que contenga todos tus módulos (adecuadamente nombrados), minificado y listo para consumo. - - Instálalo usando `npm`: - ```shell - $ npm install requirejs -g - ``` - - Ahora puedes alimentarlo con un fichero de configuración: - ```shell - $ r.js -o app.build.js - ``` - - Para nuestro ejemplo anterior el archivo de configuración luciría así: - ```javascript - /* file : app.build.js */ - ({ - - name : 'main', // name of the entry point - - out : 'main-built.js', // name of the file to write the output to - + name : 'main', // nombre del punto de entrada + out : 'main-built.js', // nombre del fichero donde se escribirá la salida baseUrl : 'app', - paths : { - - // `empty:` tells r.js that this should still be loaded from the CDN, using - - // the location specified in `main.js` - + // `empty:` le dice a r.js que esto aún debe ser cargado desde el CDN, usando + // la ubicación especificada en `main.js` jquery : 'empty:', - coolLibFromBower : '../bower_components/cool-lib/coollib' - } - }) - ``` - - Para usar el fichero creado en producción, simplemente intercambia `data-main`: - ```html - - ``` - - Un increíblemente detallado [resumen de opciones de generación](https://github.com/jrburke/r.js/blob/master/build/example.build.js) está disponible en el repositorio de GitHub. - - ### Tópicos no cubiertos en este tutorial - * [Cargador de plugins / transformaciones](http://requirejs.org/docs/plugins.html) - * [Cargando y exportando estilos CommonJS](http://requirejs.org/docs/commonjs.html) - * [Configuración avanzada](http://requirejs.org/docs/api.html#config) - * [Configuración de Shim (cargando módulos no-AMD)](http://requirejs.org/docs/api.html#config-shim) - * [Cargando y optimizando CSS con require.js](http://requirejs.org/docs/optimization.html#onecss) - * [Usando almond.js para construcciones](https://github.com/jrburke/almond) - - ### Otras lecturas: - - * [Especificaciones oficiales](https://github.com/amdjs/amdjs-api/wiki/AMD) - * [¿Por qué AMD?](http://requirejs.org/docs/whyamd.html) - * [Definición Universal de Módulos](https://github.com/umdjs/umd) - - ### Implementaciones: - - * [require.js](http://requirejs.org) - * [dojo toolkit](http://dojotoolkit.org/documentation/tutorials/1.9/modules/) - * [cujo.js](http://cujojs.com/) - * [curl.js](https://github.com/cujojs/curl) - * [lsjs](https://github.com/zazl/lsjs) - * [mmd](https://github.com/alexlawrence/mmd) From a1939d8e89716378d4dd76c824a6908bf21bfe88 Mon Sep 17 00:00:00 2001 From: Adam Bard Date: Sun, 18 Oct 2015 00:13:47 +0800 Subject: [PATCH 372/685] Update latex.html.markdown Add opening tex tag --- latex.html.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/latex.html.markdown b/latex.html.markdown index e180e622..9b7b4feb 100644 --- a/latex.html.markdown +++ b/latex.html.markdown @@ -6,6 +6,8 @@ contributors: - ["Sricharan Chiruvolu", "http://sricharan.xyz"] filename: learn-latex.tex --- + +```tex % All comment lines start with % % There are no multi-line comments @@ -225,6 +227,7 @@ That's all for now! % end the document \end{document} ``` + ## More on LaTeX * The amazing LaTeX wikibook: [https://en.wikibooks.org/wiki/LaTeX](https://en.wikibooks.org/wiki/LaTeX) From a875e6d589b7e6e8a396417adc001bc0f88e82fd Mon Sep 17 00:00:00 2001 From: Persa Date: Sat, 17 Oct 2015 12:16:14 -0400 Subject: [PATCH 373/685] Fixes output on combining strings and operators --- ruby.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby.html.markdown b/ruby.html.markdown index f4de8038..4e9f8aee 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -109,7 +109,7 @@ placeholder = 'use string interpolation' 'hello ' + 3.to_s #=> "hello 3" # Combine strings and operators -'hello ' * 3 #=> "hello hello hello" +'hello ' * 3 #=> "hello hello hello " # Append to string 'hello' << ' world' #=> "hello world" From 85fa357b8a3e441e5c160f18ca6d19cdea7d0160 Mon Sep 17 00:00:00 2001 From: Adam Bard Date: Sun, 18 Oct 2015 00:26:19 +0800 Subject: [PATCH 374/685] Update clojure-fr.html.markdown --- fr-fr/clojure-fr.html.markdown | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fr-fr/clojure-fr.html.markdown b/fr-fr/clojure-fr.html.markdown index 25911ea8..1cedda1d 100644 --- a/fr-fr/clojure-fr.html.markdown +++ b/fr-fr/clojure-fr.html.markdown @@ -276,12 +276,14 @@ ressemblent à toutes les autres formes: (print "Saying hello to " name) (str "Hello " name)) ; => "Hello Urkel" (prints "Saying hello to Urkel") -; Utilisez les Threading Macros (-> et ->>) pour exprimer plus clairement vos transformations, en y pensant de manière multi-niveaux: -; La "flèche simple" ou "Thread-first", insère, à chaque niveau de la transformation, la forme courante en la seconde position de la forme suivante, constituant à chaque fois un nouvel étage de transformation.Par exemple: +; Utilisez les Threading Macros (-> et ->>) pour exprimer plus clairement vos transformations, en y pensant de manière multi-niveaux. + +; La "flèche simple" ou "Thread-first", insère, à chaque niveau de la transformation, la forme courante en la seconde position de la forme suivante, constituant à chaque fois un nouvel étage de transformation. Par exemple: (-> {:a 1 :b 2} (assoc :c 3) ;=> Génère ici (assoc {:a 1 :b 2} :c 3) (dissoc :b)) ;=> Génère ici (dissoc (assoc {:a 1 :b 2} :c 3) :b) + ; Cette expression est ré-écrite en: (dissoc (assoc {:a 1 :b 2} :c 3) :b) et est évaluée en : {:a 1 :c 3} ; La "flèche double" ou "Thread-last" procède de la même manière que "->", mais insère le résultat de la réécriture de chaque étage en dernière position. Par exemple: (->> From 085bc20c1afc7bb45aae9d269c12df06ba804a1e Mon Sep 17 00:00:00 2001 From: Adam Bard Date: Sun, 18 Oct 2015 00:27:50 +0800 Subject: [PATCH 375/685] Fix spacing. --- fr-fr/clojure-fr.html.markdown | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/fr-fr/clojure-fr.html.markdown b/fr-fr/clojure-fr.html.markdown index 1cedda1d..63bc25b5 100644 --- a/fr-fr/clojure-fr.html.markdown +++ b/fr-fr/clojure-fr.html.markdown @@ -276,16 +276,25 @@ ressemblent à toutes les autres formes: (print "Saying hello to " name) (str "Hello " name)) ; => "Hello Urkel" (prints "Saying hello to Urkel") -; Utilisez les Threading Macros (-> et ->>) pour exprimer plus clairement vos transformations, en y pensant de manière multi-niveaux. +; Utilisez les Threading Macros (-> et ->>) pour exprimer plus +; clairement vos transformations, en y pensant de manière multi-niveaux. -; La "flèche simple" ou "Thread-first", insère, à chaque niveau de la transformation, la forme courante en la seconde position de la forme suivante, constituant à chaque fois un nouvel étage de transformation. Par exemple: +; La "flèche simple" ou "Thread-first", insère, à chaque niveau +; de la transformation, la forme courante en la seconde position +; de la forme suivante, constituant à chaque fois un nouvel étage +; de transformation. Par exemple: (-> {:a 1 :b 2} (assoc :c 3) ;=> Génère ici (assoc {:a 1 :b 2} :c 3) (dissoc :b)) ;=> Génère ici (dissoc (assoc {:a 1 :b 2} :c 3) :b) -; Cette expression est ré-écrite en: (dissoc (assoc {:a 1 :b 2} :c 3) :b) et est évaluée en : {:a 1 :c 3} -; La "flèche double" ou "Thread-last" procède de la même manière que "->", mais insère le résultat de la réécriture de chaque étage en dernière position. Par exemple: +; Cette expression est ré-écrite en: +; (dissoc (assoc {:a 1 :b 2} :c 3) :b) +; et est évaluée en : {:a 1 :c 3} + +; La "flèche double" ou "Thread-last" procède de la même manière +; que "->", mais insère le résultat de la réécriture de chaque +; étage en dernière position. Par exemple: (->> (range 10) (map inc) ;=> Génère ici (map inc (range 10) From aea4d998b446185ab66a0800e470bc36c132362a Mon Sep 17 00:00:00 2001 From: Adam Bard Date: Sun, 18 Oct 2015 00:31:19 +0800 Subject: [PATCH 376/685] Copy arrow docs from french. --- clojure.html.markdown | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/clojure.html.markdown b/clojure.html.markdown index a125d18f..58e835c9 100644 --- a/clojure.html.markdown +++ b/clojure.html.markdown @@ -264,6 +264,31 @@ keymap ; => {:a 1, :b 2, :c 3} (print "Saying hello to " name) (str "Hello " name)) ; => "Hello Urkel" (prints "Saying hello to Urkel") + +; Use the threading macros (-> and ->>) to express transformations of +; data more clearly. + +; The "Thread-first" macro (->) inserts into each form the result of +; the previous, as the first argument (second item) +(-> + {:a 1 :b 2} + (assoc :c 3) ;=> (assoc {:a 1 :b 2} :c 3) + (dissoc :b)) ;=> (dissoc (assoc {:a 1 :b 2} :c 3) :b) + +; This expression could be written as: +; (dissoc (assoc {:a 1 :b 2} :c 3) :b) +; and evaluates to {:a 1 :c 3} + +; The double arrow does the same thing, but inserts the result of +; each line at the *end* of the form. This is useful for collection +; operations in particular: +(->> + (range 10) + (map inc) ;=> (map inc (range 10) + (filter odd?) ;=> (filter odd? (map inc (range 10)) + (into [])) ;=> (into [] (filter odd? (map inc (range 10))) + ; Result: [1 3 5 7 9] + ; Modules ;;;;;;;;;;;;;;; From 30413639edaa382a4667cc0411aca8d2752c508c Mon Sep 17 00:00:00 2001 From: Adam Bard Date: Sun, 18 Oct 2015 00:33:27 +0800 Subject: [PATCH 377/685] Update ruby-de.html.markdown --- de-de/ruby-de.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de-de/ruby-de.html.markdown b/de-de/ruby-de.html.markdown index 560d3958..bdeaa30b 100644 --- a/de-de/ruby-de.html.markdown +++ b/de-de/ruby-de.html.markdown @@ -13,7 +13,7 @@ contributors: - ["Rahil Momin", "https://github.com/iamrahil"] translators: - ["Christian Albrecht", "https://github.com/coastalchief"] -filename: ruby-de.html.markdown +filename: ruby-de.rb lang: de-de --- From 0ddc0b743d5512494df23a27a967c2c27b9873ca Mon Sep 17 00:00:00 2001 From: Adam Bard Date: Sun, 18 Oct 2015 00:33:54 +0800 Subject: [PATCH 378/685] Update scala-de.html.markdown --- de-de/scala-de.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/de-de/scala-de.html.markdown b/de-de/scala-de.html.markdown index 42808580..7fd299b4 100644 --- a/de-de/scala-de.html.markdown +++ b/de-de/scala-de.html.markdown @@ -7,7 +7,7 @@ contributors: - ["Ha-Duong Nguyen", "http://reference-error.org"] translators: - ["Christian Albrecht", "https://github.com/coastalchief"] -filename: scala-de.html.markdown +filename: learnscala-de.scala lang: de-de --- @@ -813,4 +813,4 @@ writer.close() * [The scala documentation](http://docs.scala-lang.org/) * [Try Scala in your browser](http://scalatutorials.com/tour/) * [Neophytes Guide to Scala](http://danielwestheide.com/scala/neophytes.html) -* Join the [Scala user group](https://groups.google.com/forum/#!forum/scala-user) \ No newline at end of file +* Join the [Scala user group](https://groups.google.com/forum/#!forum/scala-user) From 978c8fb15cc2ee89a4eedcb8c7955eb90bea5bfc Mon Sep 17 00:00:00 2001 From: Adam Bard Date: Sun, 18 Oct 2015 00:34:14 +0800 Subject: [PATCH 379/685] Update ruby-ecosystem-de.html.markdown --- de-de/ruby-ecosystem-de.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de-de/ruby-ecosystem-de.html.markdown b/de-de/ruby-ecosystem-de.html.markdown index e1f3c5e7..a7e1f75f 100644 --- a/de-de/ruby-ecosystem-de.html.markdown +++ b/de-de/ruby-ecosystem-de.html.markdown @@ -6,7 +6,7 @@ contributors: - ["Rafal Chmiel", "http://github.com/rafalchmiel"] translators: - ["Christian Albrecht", "https://github.com/coastalchief"] -filename: ruby-ecosystem-de.html.markdown +filename: ruby-ecosystem-de.txt lang: de-de --- From 9ecbf76fe4c89ae3ca577a42cbf41a4b3e3497f0 Mon Sep 17 00:00:00 2001 From: Damaso Sanoja Date: Sat, 17 Oct 2015 13:18:27 -0430 Subject: [PATCH 380/685] tmux spanish translation --- es-es/tmux-es.html.markdown | 253 ++++++++++++++++++++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 es-es/tmux-es.html.markdown diff --git a/es-es/tmux-es.html.markdown b/es-es/tmux-es.html.markdown new file mode 100644 index 00000000..a7354be1 --- /dev/null +++ b/es-es/tmux-es.html.markdown @@ -0,0 +1,253 @@ +--- +category: tool +tool: tmux +contributors: + - ["mdln", "https://github.com/mdln"] +filename: LearnTmux-es.txt +translators: + - ["Damaso Sanoja", "https://github.com/damasosanoja"] +lang: es-es +--- + + +[tmux](http://tmux.sourceforge.net) +es un terminal multiplexor: habilita la creación, acceso y control +de múltiples terminales controlados desde una sola pantalla. tmux +puede ser separado de una pantalla y continuar corriendo en el fondo +y luego ser insertado nuevamente. + + +``` + + tmux [command] # Corre un comando + # 'tmux' sin comandos creará una nueva sesión + + new # Crea una nueva sesión + -s "Session" # Crea sesión con nombre + -n "Window" # Crea ventana con nombre + -c "/dir" # Comienza en el directorio destino + + attach # Adjunta sesión última/disponible + -t "#" # Adjunta sesión destino + -d # Separa la sesión de otras instancias + + ls # Lista las sesiones abiertas + -a # Lista todas las sesiones abiertas + + lsw # Lista las ventanas + -a # Lista todas las ventanas + -s # Lista todas las ventanas en la sesión + + lsp # Lista los páneles + -a # Lista todos los páneles + -s # Lista todos los páneles de la sesión + -t # Lista los páneles de aplicación en el destino + + kill-window # Cierra la ventana actual + -t "#" # Cierra la ventana destino + -a # Cierra todas las ventanas + -a -t "#" # Cierra todas las ventanas menos el destino + + kill-session # Cierra la sesión actual + -t "#" # Cierra la sesión destino + -a # Cierra todas las sesiones + -a -t "#" # Cierra todas las sesiones menos el destino + +``` + + +### Atajos de Teclado + +El método para controlar una sesión adjunta tmux es mediante +combinaciones de teclas llamadas teclas 'Prefijo'. + +``` +---------------------------------------------------------------------- + (C-b) = Ctrl + b # combinación 'Prefijo' necesaria para usar atajos + + (M-1) = Meta + 1 -o- Alt + 1 +---------------------------------------------------------------------- + + ? # Lista todos los atajos de teclado + : # Entra en la línea de comandos tmux + r # Fuerza el redibujado del cliente adjuntado + c # Crea una nueva ventana + + ! # Separa el panel actual fuera de la ventana. + % # Separa el panel actual en dos, izquierdo y derecho + " # Separa el panel actual en dos, superior e inferior + + n # Cambia a la siguiente ventana + p # Cambia a la ventana previa + { # Intercambia el panel actual con el anterior + } # Intercambia el panel actual con el próximo + + s # Selecciona una nueva sesión para el cliente adjuntado + interactivamente + w # Elegir la ventana actual interactivamente + 0 al 9 # Seleccionar ventanas 0 al 9 + + d # Separa el cliente actual + D # Elige un cliente para separar + + & # Cierra la ventana actual + x # Cierra el panel actual + + Up, Down # Cambia al panel superior, inferior, izquierdo, o derecho + Left, Right + + M-1 to M-5 # Organizar páneles: + # 1) uniformes horizontales + # 2) uniformes verticales + # 3) principal horizontal + # 4) principal vertical + # 5) mozaico + + C-Up, C-Down # Redimensiona el panel actual en pasos de una celda + C-Left, C-Right + + M-Up, M-Down # Redimensiona el panel actual en pasos de cinco celdas + M-Left, M-Right + +``` + + +### Configurando ~/.tmux.conf + +tmux.conf puede usarse para establecer opciones automáticas al arrancar, parecido a como .vimrc o init.el hacen. + +``` +# Ejemplo de tmux.conf +# 2014.10 + + +### General +########################################################################### + +# Habilita UTF-8 +setw -g utf8 on +set-option -g status-utf8 on + +# Fuera de pantalla/Historia límite +set -g history-limit 2048 + +# Comienzo de índice +set -g base-index 1 + +# Ratón +set-option -g mouse-select-pane on + +# Forza recarga de fichero de configuración +unbind r +bind r source-file ~/.tmux.conf + + +### Atajos de teclado +########################################################################### + +# Desvincula C-b como el prefijo por defecto +unbind C-b + +# Establece el nuevo prefijo +set-option -g prefix ` + +# Regresa a la ventana previa cuando el prefijo es accionado dos veces +bind C-a last-window +bind ` last-window + +# Permite intercambiar C-a y ` usando F11/F12 +bind F11 set-option -g prefix C-a +bind F12 set-option -g prefix ` + +# Preferencias de atajos +setw -g mode-keys vi +set-option -g status-keys vi + +# Moviéndose entre paneles con movimientos de teclas vim +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +# Ciclo/Intercambio de Ventana +bind e previous-window +bind f next-window +bind E swap-window -t -1 +bind F swap-window -t +1 + +# División rápida de paneles +bind = split-window -h +bind - split-window -v +unbind '"' +unbind % + +# Activar sesión mas interna (cuando se anida tmux) para enviar comandos +bind a send-prefix + + +### Temas +########################################################################### + +# Paleta de Colores de la Barra de estado +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 + +# Paleta de Colores del Borde del Panel +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 + +# Paleta de Colores de Mensajes +set-option -g message-fg black +set-option -g message-bg green + +# Paleta de Colores de la Ventana +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 + + +### UI +########################################################################### + +# Notificación +setw -g monitor-activity on +set -g visual-activity on +set-option -g bell-action any +set-option -g visual-bell off + +# Establece automáticamente títulos de ventanas +set-option -g set-titles on +set-option -g set-titles-string '#H:#S.#I.#P #W #T' # window number,program name,active (or not) + +# Ajustes de barra de estado +set -g status-left "#[fg=red] #H#[fg=green]:#[fg=white]#S#[fg=green] |#[default]" + +# Muestra indicadores de rendimiento en barra de estado +# Requiere 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]" + +``` + + +### Referencias + +[Tmux | Inicio](http://tmux.sourceforge.net) + +[Tmux Manual](http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/tmux.1?query=tmux) + +[Gentoo Wiki](http://wiki.gentoo.org/wiki/Tmux) + +[Archlinux Wiki](https://wiki.archlinux.org/index.php/Tmux) + +[Mostrar CPU/MEM % en barra de estado](https://stackoverflow.com/questions/11558907/is-there-a-better-way-to-display-cpu-usage-in-tmux) From 8d809eac2e621daf92c609ed2cff6edeeedc983e Mon Sep 17 00:00:00 2001 From: Kirushan Rasendran Date: Sat, 17 Oct 2015 23:44:41 +0530 Subject: [PATCH 381/685] Updated translation --- ta_in/css.html.markdown | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ta_in/css.html.markdown b/ta_in/css.html.markdown index b55ab363..3a46816c 100644 --- a/ta_in/css.html.markdown +++ b/ta_in/css.html.markdown @@ -197,10 +197,6 @@ selector { ## Precedence or Cascade -An element may be targeted by multiple selectors and may have a property set on it in more than once. In these cases, one of the rules takes precedence over others. Generally, a rule in a more specific selector take precedence over a less specific one, and a rule occuring later in the stylesheet overwrites a previous one. - -This process is called cascading, hence the name Cascading Style Sheets. - ஒரு element ஆனது ஒன்றுக்கு மேற்பட்ட selectors மூலம் அணுகபடலாம் ,இவ்வாறான சந்தர்பங்களில் ஒரு குறிபிட்ட விதிமுறையை பின்பற்றுகிறது இது cascading என அழைக்கபடுகிறது, அதனால் தன இது Cascading Style Sheets என அழைக்கபடுகிறது. From 4143b1d87ed465eb8f0dffa07d299ebe82566d45 Mon Sep 17 00:00:00 2001 From: Kirushan Rasendran Date: Sat, 17 Oct 2015 23:46:03 +0530 Subject: [PATCH 382/685] removed EN Tamil translated added removed EN from markdown --- ta_in/css.html.markdown | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ta_in/css.html.markdown b/ta_in/css.html.markdown index 3a46816c..1e3aa9b0 100644 --- a/ta_in/css.html.markdown +++ b/ta_in/css.html.markdown @@ -102,8 +102,7 @@ div.some-parent.class-name { } /* or அல்லது அதற்கு முந்தய உறுப்பின் மூலம் */ .i-am-any-element-before ~ .this-element { } -/* There are some selectors called pseudo classes that can be used to select an - element when it is in a particular state +/* சில selectors ஐ pseudo class மூலம் அணுக முடியும் , எப்போது எனில் அவை குறித்த ஒரு நிலையில் இருக்கும் போது ஆகும் */ From 29e35f633534fe81d478694c53585718c350b632 Mon Sep 17 00:00:00 2001 From: Kirushan Rasendran Date: Sat, 17 Oct 2015 23:47:25 +0530 Subject: [PATCH 383/685] updated removed white spaces and removed old EN translation --- ta_in/css.html.markdown | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ta_in/css.html.markdown b/ta_in/css.html.markdown index 1e3aa9b0..93c29bae 100644 --- a/ta_in/css.html.markdown +++ b/ta_in/css.html.markdown @@ -17,13 +17,11 @@ lang:in-ta ஆனால் உலாவிகளில் கொண்டு வரப்பட்ட மாற்றங்களில் முழுமையான காட்சிபடுத்தல்களுடன் கூடிய இணையதளங்கள் உருவாகின. -CSS helps maintain separation between the content (HTML) and the look-and-feel of a web page. + CSS ஆனது HTML மற்றும் அதன் அழகுபடுத்கூடிய காரணிகளையும் வேறுபடுத்த உதவியது. ஒரு html இல் உள்ள உறுப்புகளை(elements) வெவ்வேறு வகையான காட்சி பண்புகளை வழங்க உதவுகிறது. - -This guide has been written for CSS 2, though CSS 3 is fast becoming popular. இந்த வழிகாட்டி CSS2 உக்கு எழுதப்பட்டுள்ளது, இருப்பினும் தற்போது CSS 3 வேகமாக பிரபல்யமாகி வருகிறது. **குறிப்பு:** @@ -226,7 +224,7 @@ p { property: value !important; }

``` -The precedence of style is as follows. Remember, the precedence is for each **property**, not for the entire block. + css முன்னுரிமை பின்வருமாறு * `E` இதுவே அதிக முக்கியத்துவம் வாய்ந்தது காரணம் இது `!important` பயன்படுத்துகிறது. இதை பயன்படுத்துவதை தவிர்க்கவும் * `F` இது இரண்டாவது காரணம் இது inline style. From 6b2fa0cd2b3f49d60e15207d288d58c4a0ba72ad Mon Sep 17 00:00:00 2001 From: Kirushan Rasendran Date: Sat, 17 Oct 2015 23:49:43 +0530 Subject: [PATCH 384/685] Commited translation ta --- ta_in/css.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ta_in/css.html.markdown b/ta_in/css.html.markdown index 93c29bae..56f94ed0 100644 --- a/ta_in/css.html.markdown +++ b/ta_in/css.html.markdown @@ -192,7 +192,7 @@ selector {

``` -## Precedence or Cascade +## Precedence அல்லது Cascade ஒரு element ஆனது ஒன்றுக்கு மேற்பட்ட selectors மூலம் அணுகபடலாம் ,இவ்வாறான சந்தர்பங்களில் ஒரு குறிபிட்ட விதிமுறையை பின்பற்றுகிறது இது cascading என அழைக்கபடுகிறது, அதனால் தன From c245b7528501003a07fe7a88c23abfed480d12a5 Mon Sep 17 00:00:00 2001 From: Tommaso Date: Sat, 17 Oct 2015 20:20:33 +0200 Subject: [PATCH 385/685] Bring this version up to date with the english one The following commits were taken into consideration and translated into italian: 7bc99fcaf4329b3c25cca671f62a03b67aa4d46e 8b7a2fff9a71b8fa8754947434b8b1f184ed2de1 e4c261567533921f35ce4e65ebfe6621a128992b 8909457ae46dc8fb151ef146acb3f6b8402f3407 de676b62b83fcaaa9977cca9adb9c38383b64f35 acc9a73c018a28a9c8ead7b108dd1fdfee7a797b 960ee4a1856db8eadb96277bb2422edfa8f2a81c f4022052471d6dc0a9c2fb8794e1352253b4c5ad --- it-it/bash-it.html.markdown | 72 +++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 30 deletions(-) diff --git a/it-it/bash-it.html.markdown b/it-it/bash-it.html.markdown index f892845f..af8823c4 100644 --- a/it-it/bash-it.html.markdown +++ b/it-it/bash-it.html.markdown @@ -13,13 +13,14 @@ contributors: filename: LearnBash.sh translators: - ["Robert Margelli", "http://github.com/sinkswim/"] + - ["Tommaso Pifferi", "http://github.com/neslinesli93/"] lang: it-it --- Bash è il nome della shell di unix, la quale è stata distribuita anche come shell del sistema oprativo GNU e la shell di default su Linux e Mac OS X. Quasi tutti gli esempi sottostanti possono fare parte di uno shell script o eseguiti direttamente nella shell. -[Per saperne di piu'.](http://www.gnu.org/software/bash/manual/bashref.html) +[Per saperne di più.](http://www.gnu.org/software/bash/manual/bashref.html) ```bash #!/bin/bash @@ -34,32 +35,34 @@ echo Ciao mondo! echo 'Questa è la prima riga'; echo 'Questa è la seconda riga' # Per dichiarare una variabile: -VARIABILE="Una stringa" +Variabile="Una stringa" # Ma non così: -VARIABILE = "Una stringa" -# Bash stabilirà che VARIABILE è un comando da eseguire e darà un errore +Variabile = "Una stringa" +# Bash stabilirà che Variabile è un comando da eseguire e darà un errore # perchè non esiste. # Usare la variabile: -echo $VARIABILE -echo "$VARIABILE" -echo '$VARIABILE' +echo $Variabile +echo "$Variabile" +echo '$Variabile' # Quando usi la variabile stessa - assegnala, esportala, oppure — scrivi # il suo nome senza $. Se vuoi usare il valore della variabile, devi usare $. # Nota che ' (singolo apice) non espande le variabili! # Sostituzione di stringhe nelle variabili -echo ${VARIABILE/Una/A} +echo ${Variabile/Una/A} # Questo sostituirà la prima occorrenza di "Una" con "La" # Sottostringa di una variabile -echo ${VARIABILE:0:7} +Lunghezza=7 +echo ${Variabile:0:Lunghezza} # Questo ritornerà solamente i primi 7 caratteri # Valore di default per la variabile -echo ${FOO:-"ValoreDiDefaultSeFOOMancaOÈ Vuoto"} -# Questo funziona per null (FOO=), stringa vuota (FOO=""), zero (FOO=0) ritorna 0 +echo ${Foo:-"ValoreDiDefaultSeFooMancaOppureÈVuoto"} +# Questo funziona per null (Foo=), stringa vuota (Foo=""), zero (Foo=0) ritorna 0 +# Nota: viene ritornato il valore di default, il contenuto della variabile pero' non cambia. # Variabili builtin: # Ci sono delle variabili builtin molto utili, come @@ -71,31 +74,40 @@ echo "Argomenti dello script separati in variabili distinte: $1 $2..." # Leggere un valore di input: echo "Come ti chiami?" -read NOME # Nota che non abbiamo dovuto dichiarare una nuova variabile -echo Ciao, $NOME! +read Nome # Nota che non abbiamo dovuto dichiarare una nuova variabile +echo Ciao, $Nome! # Classica struttura if: # usa 'man test' per maggiori informazioni sulle condizionali -if [ $NOME -ne $USER ] +if [ $Nome -ne $USER ] then echo "Il tuo nome non è lo username" else echo "Il tuo nome è lo username" fi +# Nota: se $Name è vuoto, la condizione precedente viene interpretata come: +if [ -ne $USER ] +# che genera un errore di sintassi. Quindi il metodo sicuro per usare +# variabili che possono contenere stringhe vuote è il seguente: +if [ "$Name" -ne $USER ] ... +# che viene interpretato come: +if [ "" -ne $USER ] ... +# e dunque funziona correttamente. + # C'è anche l'esecuzione condizionale echo "Sempre eseguito" || echo "Eseguito solo se la prima condizione fallisce" echo "Sempre eseguito" && echo "Eseguito solo se la prima condizione NON fallisce" # Per usare && e || con l'if, c'è bisogno di piu' paia di parentesi quadre: -if [ $NOME == "Steve" ] && [ $ETA -eq 15 ] +if [ "$Nome" == "Steve" ] && [ "$Eta" -eq 15 ] then - echo "Questo verrà eseguito se $NOME è Steve E $ETA è 15." + echo "Questo verrà eseguito se $Nome è Steve E $Eta è 15." fi -if [ $NOME == "Daniya" ] || [ $NOME == "Zach" ] +if [ "$Nome" == "Daniya" ] || [ "$Nome" == "Zach" ] then - echo "Questo verrà eseguito se $NAME è Daniya O Zach." + echo "Questo verrà eseguito se $Nome è Daniya O Zach." fi # Le espressioni sono nel seguente formato: @@ -137,7 +149,7 @@ python hello.py > /dev/null 2>&1 # se invece vuoi appendere usa ">>": python hello.py >> "output.out" 2>> "error.err" -# Sovrascrivi output.txt, appendi a error.err, e conta le righe: +# Sovrascrivi output.out, appendi a error.err, e conta le righe: info bash 'Basic Shell Features' 'Redirections' > output.out 2>> error.err wc -l output.out error.err @@ -145,7 +157,7 @@ wc -l output.out error.err # vedi: man fd echo <(echo "#ciaomondo") -# Sovrascrivi output.txt con "#helloworld": +# Sovrascrivi output.out con "#helloworld": cat > output.out <(echo "#helloworld") echo "#helloworld" > output.out echo "#helloworld" | cat > output.out @@ -164,7 +176,7 @@ echo "Ci sono $(ls | wc -l) oggetti qui." echo "Ci sono `ls | wc -l` oggetti qui." # Bash utilizza uno statemente case che funziona in maniera simile allo switch in Java e C++: -case "$VARIABILE" in +case "$Variabile" in #Lista di pattern per le condizioni che vuoi soddisfare 0) echo "C'è uno zero.";; 1) echo "C'è un uno.";; @@ -172,10 +184,10 @@ case "$VARIABILE" in esac # I cicli for iterano per ogni argomento fornito: -# I contenuti di $VARIABILE sono stampati tre volte. -for VARIABILE in {1..3} +# I contenuti di $Variabile sono stampati tre volte. +for Variabile in {1..3} do - echo "$VARIABILE" + echo "$Variabile" done # O scrivilo con il "ciclo for tradizionale": @@ -186,16 +198,16 @@ done # Possono essere usati anche per agire su file.. # Questo eseguirà il comando 'cat' su file1 e file2 -for VARIABILE in file1 file2 +for Variabile in file1 file2 do - cat "$VARIABILE" + cat "$Variabile" done # ..o dall'output di un comando # Questo eseguirà cat sull'output di ls. -for OUTPUT in $(ls) +for Output in $(ls) do - cat "$OUTPUT" + cat "$Output" done # while loop: @@ -223,7 +235,7 @@ bar () } # Per chiamare la funzione -foo "Il mio nome è" $NOME +foo "Il mio nome è" $Nome # Ci sono un sacco di comandi utili che dovresti imparare: # stampa le ultime 10 righe di file.txt @@ -245,7 +257,7 @@ grep "^foo.*bar$" file.txt grep -c "^foo.*bar$" file.txt # se vuoi letteralmente cercare la stringa, # e non la regex, usa fgrep (o grep -F) -fgrep "^foo.*bar$" file.txt +fgrep "^foo.*bar$" file.txt # Leggi la documentazione dei builtin di bash con il builtin 'help' di bash: From a1217767d3dceb40dba35159abb523b233cf0005 Mon Sep 17 00:00:00 2001 From: Damaso Sanoja Date: Sat, 17 Oct 2015 14:05:01 -0430 Subject: [PATCH 386/685] tmux spanish translation --- es-es/tmux-es.html.markdown | 253 ++++++++++++++++++++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 es-es/tmux-es.html.markdown diff --git a/es-es/tmux-es.html.markdown b/es-es/tmux-es.html.markdown new file mode 100644 index 00000000..a7354be1 --- /dev/null +++ b/es-es/tmux-es.html.markdown @@ -0,0 +1,253 @@ +--- +category: tool +tool: tmux +contributors: + - ["mdln", "https://github.com/mdln"] +filename: LearnTmux-es.txt +translators: + - ["Damaso Sanoja", "https://github.com/damasosanoja"] +lang: es-es +--- + + +[tmux](http://tmux.sourceforge.net) +es un terminal multiplexor: habilita la creación, acceso y control +de múltiples terminales controlados desde una sola pantalla. tmux +puede ser separado de una pantalla y continuar corriendo en el fondo +y luego ser insertado nuevamente. + + +``` + + tmux [command] # Corre un comando + # 'tmux' sin comandos creará una nueva sesión + + new # Crea una nueva sesión + -s "Session" # Crea sesión con nombre + -n "Window" # Crea ventana con nombre + -c "/dir" # Comienza en el directorio destino + + attach # Adjunta sesión última/disponible + -t "#" # Adjunta sesión destino + -d # Separa la sesión de otras instancias + + ls # Lista las sesiones abiertas + -a # Lista todas las sesiones abiertas + + lsw # Lista las ventanas + -a # Lista todas las ventanas + -s # Lista todas las ventanas en la sesión + + lsp # Lista los páneles + -a # Lista todos los páneles + -s # Lista todos los páneles de la sesión + -t # Lista los páneles de aplicación en el destino + + kill-window # Cierra la ventana actual + -t "#" # Cierra la ventana destino + -a # Cierra todas las ventanas + -a -t "#" # Cierra todas las ventanas menos el destino + + kill-session # Cierra la sesión actual + -t "#" # Cierra la sesión destino + -a # Cierra todas las sesiones + -a -t "#" # Cierra todas las sesiones menos el destino + +``` + + +### Atajos de Teclado + +El método para controlar una sesión adjunta tmux es mediante +combinaciones de teclas llamadas teclas 'Prefijo'. + +``` +---------------------------------------------------------------------- + (C-b) = Ctrl + b # combinación 'Prefijo' necesaria para usar atajos + + (M-1) = Meta + 1 -o- Alt + 1 +---------------------------------------------------------------------- + + ? # Lista todos los atajos de teclado + : # Entra en la línea de comandos tmux + r # Fuerza el redibujado del cliente adjuntado + c # Crea una nueva ventana + + ! # Separa el panel actual fuera de la ventana. + % # Separa el panel actual en dos, izquierdo y derecho + " # Separa el panel actual en dos, superior e inferior + + n # Cambia a la siguiente ventana + p # Cambia a la ventana previa + { # Intercambia el panel actual con el anterior + } # Intercambia el panel actual con el próximo + + s # Selecciona una nueva sesión para el cliente adjuntado + interactivamente + w # Elegir la ventana actual interactivamente + 0 al 9 # Seleccionar ventanas 0 al 9 + + d # Separa el cliente actual + D # Elige un cliente para separar + + & # Cierra la ventana actual + x # Cierra el panel actual + + Up, Down # Cambia al panel superior, inferior, izquierdo, o derecho + Left, Right + + M-1 to M-5 # Organizar páneles: + # 1) uniformes horizontales + # 2) uniformes verticales + # 3) principal horizontal + # 4) principal vertical + # 5) mozaico + + C-Up, C-Down # Redimensiona el panel actual en pasos de una celda + C-Left, C-Right + + M-Up, M-Down # Redimensiona el panel actual en pasos de cinco celdas + M-Left, M-Right + +``` + + +### Configurando ~/.tmux.conf + +tmux.conf puede usarse para establecer opciones automáticas al arrancar, parecido a como .vimrc o init.el hacen. + +``` +# Ejemplo de tmux.conf +# 2014.10 + + +### General +########################################################################### + +# Habilita UTF-8 +setw -g utf8 on +set-option -g status-utf8 on + +# Fuera de pantalla/Historia límite +set -g history-limit 2048 + +# Comienzo de índice +set -g base-index 1 + +# Ratón +set-option -g mouse-select-pane on + +# Forza recarga de fichero de configuración +unbind r +bind r source-file ~/.tmux.conf + + +### Atajos de teclado +########################################################################### + +# Desvincula C-b como el prefijo por defecto +unbind C-b + +# Establece el nuevo prefijo +set-option -g prefix ` + +# Regresa a la ventana previa cuando el prefijo es accionado dos veces +bind C-a last-window +bind ` last-window + +# Permite intercambiar C-a y ` usando F11/F12 +bind F11 set-option -g prefix C-a +bind F12 set-option -g prefix ` + +# Preferencias de atajos +setw -g mode-keys vi +set-option -g status-keys vi + +# Moviéndose entre paneles con movimientos de teclas vim +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +# Ciclo/Intercambio de Ventana +bind e previous-window +bind f next-window +bind E swap-window -t -1 +bind F swap-window -t +1 + +# División rápida de paneles +bind = split-window -h +bind - split-window -v +unbind '"' +unbind % + +# Activar sesión mas interna (cuando se anida tmux) para enviar comandos +bind a send-prefix + + +### Temas +########################################################################### + +# Paleta de Colores de la Barra de estado +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 + +# Paleta de Colores del Borde del Panel +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 + +# Paleta de Colores de Mensajes +set-option -g message-fg black +set-option -g message-bg green + +# Paleta de Colores de la Ventana +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 + + +### UI +########################################################################### + +# Notificación +setw -g monitor-activity on +set -g visual-activity on +set-option -g bell-action any +set-option -g visual-bell off + +# Establece automáticamente títulos de ventanas +set-option -g set-titles on +set-option -g set-titles-string '#H:#S.#I.#P #W #T' # window number,program name,active (or not) + +# Ajustes de barra de estado +set -g status-left "#[fg=red] #H#[fg=green]:#[fg=white]#S#[fg=green] |#[default]" + +# Muestra indicadores de rendimiento en barra de estado +# Requiere 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]" + +``` + + +### Referencias + +[Tmux | Inicio](http://tmux.sourceforge.net) + +[Tmux Manual](http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/tmux.1?query=tmux) + +[Gentoo Wiki](http://wiki.gentoo.org/wiki/Tmux) + +[Archlinux Wiki](https://wiki.archlinux.org/index.php/Tmux) + +[Mostrar CPU/MEM % en barra de estado](https://stackoverflow.com/questions/11558907/is-there-a-better-way-to-display-cpu-usage-in-tmux) From ba4f6d2bfb2f09ecc2892ab4dc0b8b35bb21fc1b Mon Sep 17 00:00:00 2001 From: Kirushan Rasendran Date: Sun, 18 Oct 2015 00:11:56 +0530 Subject: [PATCH 387/685] XML commits --- ta_in/xml.html.markdown | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/ta_in/xml.html.markdown b/ta_in/xml.html.markdown index 3ec0ab70..a9bfa9cd 100644 --- a/ta_in/xml.html.markdown +++ b/ta_in/xml.html.markdown @@ -42,15 +42,7 @@ HTML போல் அன்றி , XML ஆனது தகவலை மட் - - + - + From 989615be41c78eee9bfe5d7f3786dd5a90a40565 Mon Sep 17 00:00:00 2001 From: Gloria Dwomoh Date: Sun, 18 Oct 2015 00:02:18 +0300 Subject: [PATCH 388/685] Update scala-gr.html.markdown --- el-gr/scala-gr.html.markdown | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/el-gr/scala-gr.html.markdown b/el-gr/scala-gr.html.markdown index e29c7e70..415fda5c 100644 --- a/el-gr/scala-gr.html.markdown +++ b/el-gr/scala-gr.html.markdown @@ -40,7 +40,7 @@ Scala - Η επεκτάσιμη γλώσσα /* Τα σχόλια που επεκτείνονται σε πολλές γραμμές , όπως μπορείτε - να δείτε , φαίνοται κάπως έτσι. + να δείτε , φαίνονται κάπως έτσι. */ // Εκτύπωση με νέα γραμμή στην επόμενη εκτύπωση @@ -59,12 +59,12 @@ var y = 10 y = 20 // το y είναι τώρα 20 /* - Η Scala είναι στατικού τύπου γλώσσα, εν τούτις προσέξτε ότι στις παραπάνω + Η Scala είναι στατικού τύπου γλώσσα, εν τούτοις προσέξτε ότι στις παραπάνω δηλώσεις , δεν προσδιορίσαμε κάποιον τύπο. Αυτό συμβαίνει λόγω ενός χαρακτηριστικού της Scala που λέγεται συμπερασματολογία τύπων. Στις περισσότερες των περιπτώσεων, ο μεταγλωττιστής της Scala μπορεί να - μαντέψει ποιός είναι ο τύπος μιας μεταβλητής. Μπορούμε να δηλώσουμε - αναλυτικά τον τύπο μιάς μεταβλητής ως εξής: + μαντέψει ποιος είναι ο τύπος μιας μεταβλητής. Μπορούμε να δηλώσουμε + αναλυτικά τον τύπο μιας μεταβλητής ως εξής: */ val z: Int = 10 val a: Double = 1.0 @@ -85,7 +85,7 @@ false true == false // false 10 > 5 // true -// Η αριθμιτική είναι όπως τα συνηθισμένα +// Η αριθμητική είναι όπως τα συνηθισμένα 1 + 1 // 2 2 - 1 // 1 5 * 3 // 15 @@ -117,14 +117,14 @@ true == false // false "Τα αλφαριθμητικά στην Scala περικλείονται από διπλά εισαγωγικά" 'a' // Ένας χαρακτήρας στην Scala // res30: Char = a -// 'Αλφαριθημτικά με μονά εισαγωγικά δεν υφίστανται <= Αυτό θα προκαλέσει σφάλμα. +// Αλφαριθημτικά με μονά εισαγωγικά δεν υφίστανται <= Αυτό θα προκαλέσει σφάλμα. // Τα αλφαριθμητικά έχουν τις συνηθισμένες μεθόδους της Java ορισμένες πάνω τους. "hello world".length "hello world".substring(2, 6) "hello world".replace("C", "3") -// Έχουν επίσης μερικές επιπλένον μεθόδους Scala. +// Έχουν επίσης μερικές επιπλέον μεθόδους Scala. // Δείτε επίσης : scala.collection.immutable.StringOps "hello world".take(5) "hello world".drop(5) @@ -253,7 +253,7 @@ r foreach println var i = 0 while (i < 10) { println("i " + i); i+=1 } -while (i < 10) { println("i " + i); i+=1 } // Ναι ξανά! Τι συνέβει; Γιατί; +while (i < 10) { println("i " + i); i+=1 } // Ναι ξανά! Τι συνέβη; Γιατί; i // Εμφάνισε την τιμή του i. Σημειώστε ότι ένας βρόχος while είναι βρόχος // με την κλασική έννοια - εκτελείται σειριακά καθώς αλλάζει η μεταβλητή @@ -268,8 +268,8 @@ do { } while (x < 10) // Η αναδρομή ουράς είναι ένας ιδιωματικός τρόπος να κάνεις επαναλαμβανόμενα -// πράγματα στην Scala. Οι αναδρομικές συναρτήσεις απαιτούν να γράφτεί -// ρητά ο τύπος που θα επιστρέψουν , αλλιώς ο μεταγλωττιστής δεν μπορεί +// πράγματα στην Scala. Οι αναδρομικές συναρτήσεις απαιτούν να γραφτεί +// ρητά ο τύπος που θα επιστρέψουν, αλλιώς ο μεταγλωττιστής δεν μπορεί // αλλιώς να τον συνάγει. Παρακάτω είναι μια συνάρτηση που επιστρέφει Unit. def showNumbersInRange(a:Int, b:Int):Unit = { print(a) @@ -332,7 +332,7 @@ s(1) val divideInts = (x:Int, y:Int) => (x / y, x % y) divideInts(10,3) // Η συνάρτηση divideInts επιστρέφει το αποτέλεσμα - // της ακαίρεας διαίρεσης και το υπόλοιπο. + // της ακέραιας διαίρεσης και το υπόλοιπο. // Για να έχουμε πρόσβαση στα στοιχεία μιας πλειάδας, χρησιμοποιούμε το _._n // όπου το n είναι ο δείκτης με βάση το 1 του στοιχείου. @@ -349,7 +349,7 @@ d._2 /* Ότι έχουμε κάνει ως τώρα σε αυτό το tutorial ήταν απλές εκφράσεις - (τιμές , συναρτήσεις , κτλ). Αυτές οι εκφράσεις βολεύουν όταν τις + (τιμές, συναρτήσεις, κτλ.). Αυτές οι εκφράσεις βολεύουν όταν τις γράφουμε στο REPL για γρήγορες δοκιμές, αλλά δεν μπορούν να υπάρχουν από μόνες τους σε ένα αρχείο Scala. Για παράδειγμα , δεν μπορούμε να έχουμε μόνο ένα "val x = 5" στο αρχείο Scala. Αντί αυτού , τα μόνα @@ -394,7 +394,7 @@ println(mydog.bark) // => "Woof, woof!" // αυτές καθ' αυτές, αλλά η συμπρεριφορά που σχετίζεται με όλα τα instances // της κλάσης πάνε μέσα στο object. Η διαφορά είναι παρόμοια με τις // μεθόδους κλάσεων σε σχέση με στατικές μεθόδους σε άλλες γλώσσες. -// Προσέξτε οτι τα objects και οι κλάσεις μπορούν να έχουν το ίδιο όνομα. +// Προσέξτε ότι τα objects και οι κλάσεις μπορούν να έχουν το ίδιο όνομα. object Dog { def allKnownBreeds = List("pitbull", "shepherd", "retriever") def createDog(breed: String) = new Dog(breed) @@ -402,7 +402,7 @@ object Dog { // Οι κλάσεις περίπτωσης (case classes) είναι που έχουν την επιπλέον // λειτουργικότητα ενσωματωμένη. Μιά συνήθης ερώτηση για αρχάριους στην -// Scala είναι πότε να χρησιμοπούνται κλάσεις και πότε case κλάσεις. +// Scala είναι πότε να χρησιμοποιούνται κλάσεις και πότε case κλάσεις. // Γενικά οι κλάσεις τείνουν να εστιάζουν στην ενθυλάκωση, τον // πολυμορφισμό και τη συμπεριφορά. Οι τιμές μέσα σε αυτές τις κλάσεις // τείνουν να είναι private , και μόνο οι μέθοδοι είναι εκτεθειμένες. @@ -411,7 +411,7 @@ object Dog { // έχουν παρενέργειες. case class Person(name: String, phoneNumber: String) -// Δημιουργία ενός instance. Πραρατηρήστε ότι τα case classes +// Δημιουργία ενός instance. Παρατηρήστε ότι τα case classes // δεν χρειάζονται την λέξη "new" . val george = Person("George", "1234") val kate = Person("Kate", "4567") @@ -419,7 +419,7 @@ val kate = Person("Kate", "4567") // Με τα case classes, παίρνεις μερικά προνόμια δωρεάν , όπως: george.phoneNumber // => "1234" -// Ελέχγεται η ισότητα για κάθε πεδίο (δεν χρειάζεται να +// Ελέγχεται η ισότητα για κάθε πεδίο (δεν χρειάζεται να // κάνουμε override στο .equals) Person("George", "1234") == Person("Kate", "1236") // => false @@ -509,7 +509,7 @@ List(1, 2, 3) map (x => x + 10) // ένα όρισμα στην ανώνυμη συνάρτηση. Έτσι δεσμεύεται ως η μεταβλητή. List(1, 2, 3) map (_ + 10) -// Αν το μπλόκ της ανώνυμης συνάρτησης ΚΑΙ η συνάρτηση που εφαρμόζεται +// Αν το μπλοκ της ανώνυμης συνάρτησης ΚΑΙ η συνάρτηση που εφαρμόζεται // (στην περίπτωσή μας το foreach και το println) παίρνουν ένα όρισμα // μπορείτε να παραλείψετε την κάτω παύλα. List("Dom", "Bob", "Natalia") foreach println From 3253734d4c03f93aa9b6a59d62733f0a3b683392 Mon Sep 17 00:00:00 2001 From: Lucas Moreira Date: Sat, 17 Oct 2015 19:53:33 -0300 Subject: [PATCH 389/685] =?UTF-8?q?Corre=C3=A7=C3=A3o=20de=20palavra.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt-br/json-pt.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt-br/json-pt.html.markdown b/pt-br/json-pt.html.markdown index fc63b126..e4f10a61 100644 --- a/pt-br/json-pt.html.markdown +++ b/pt-br/json-pt.html.markdown @@ -35,7 +35,7 @@ tudo o que é vai ser 100% JSON válido. Felizmente, isso meio que fala por si. "array": [0, 1, 2, 3, "Arrays podem ter qualquer coisa em si.", 5], "outro objeto": { - "ccomentário": "Estas coisas podem ser aninhadas, muito úteis." + "comentário": "Estas coisas podem ser aninhadas, muito úteis." } }, From 65f951d87c80deff6c447faa4690dcfe1bb4d36a Mon Sep 17 00:00:00 2001 From: "chris@chriszimmerman.net" Date: Sat, 17 Oct 2015 19:37:47 -0400 Subject: [PATCH 390/685] Added documentation on receive do blocks in Elixir. --- elixir.html.markdown | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/elixir.html.markdown b/elixir.html.markdown index 9fdf37e9..60f0b01c 100644 --- a/elixir.html.markdown +++ b/elixir.html.markdown @@ -369,6 +369,13 @@ spawn(f) #=> #PID<0.40.0> # messages to the process. To do message passing we use the `send` operator. # For all of this to be useful we need to be able to receive messages. This is # achieved with the `receive` mechanism: + +# The `receive do` block is used to listen for messages and process +# them when they are received. A `receive do` block will only +# process one received message. In order to process multiple +# messages, a function with a `receive do` block must recursively +# call itself to get into the `receive do` block again. + defmodule Geometry do def area_loop do receive do From 9f510f3044138429ce616c390e42d8e0b6ceb2df Mon Sep 17 00:00:00 2001 From: "chris@chriszimmerman.net" Date: Sat, 17 Oct 2015 19:50:09 -0400 Subject: [PATCH 391/685] Fixed indentation in csharp file. --- csharp.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csharp.html.markdown b/csharp.html.markdown index 59f3e42b..31c0417e 100644 --- a/csharp.html.markdown +++ b/csharp.html.markdown @@ -395,8 +395,8 @@ on a new line! ""Wow!"", the masses cried"; ref int maxCount, // Pass by reference out int count) { - //the argument passed in as 'count' will hold the value of 15 outside of this function - count = 15; // out param must be assigned before control leaves the method + //the argument passed in as 'count' will hold the value of 15 outside of this function + count = 15; // out param must be assigned before control leaves the method } // GENERICS From c613e3bc6a3c59214faaa6e6273cb98ab8a97c1d Mon Sep 17 00:00:00 2001 From: Romin Irani Date: Sun, 18 Oct 2015 06:19:24 +0530 Subject: [PATCH 392/685] Added Git and Github Tutorial Link --- git.html.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git.html.markdown b/git.html.markdown index 72079f6c..e9d62b69 100644 --- a/git.html.markdown +++ b/git.html.markdown @@ -499,3 +499,6 @@ $ git rm /pather/to/the/file/HelloWorld.c * [Git - the simple guide](http://rogerdudler.github.io/git-guide/index.html) * [Pro Git](http://www.git-scm.com/book/en/v2) + +* [An introduction to Git and GitHub for Beginners (Tutorial)](http://product.hubspot.com/blog/git-and-github-tutorial-for-beginners) + From 07e04e7a2d0f2b7269e4495c338b039a30f70e64 Mon Sep 17 00:00:00 2001 From: "chris@chriszimmerman.net" Date: Sat, 17 Oct 2015 20:49:58 -0400 Subject: [PATCH 393/685] Fixed spacing with Elixir comment. --- elixir.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elixir.html.markdown b/elixir.html.markdown index 60f0b01c..eedeb227 100644 --- a/elixir.html.markdown +++ b/elixir.html.markdown @@ -391,7 +391,7 @@ end # Compile the module and create a process that evaluates `area_loop` in the shell pid = spawn(fn -> Geometry.area_loop() end) #=> #PID<0.40.0> -#Alternatively +# Alternatively pid = spawn(Geometry, :area_loop, []) # Send a message to `pid` that will match a pattern in the receive statement From 24f9fd6ba53213568192f5dbb61fc7b66f457841 Mon Sep 17 00:00:00 2001 From: Romin Irani Date: Sun, 18 Oct 2015 06:27:36 +0530 Subject: [PATCH 394/685] Added tmuxinator in References --- tmux.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tmux.html.markdown b/tmux.html.markdown index c11da5fc..49d1bba6 100644 --- a/tmux.html.markdown +++ b/tmux.html.markdown @@ -249,3 +249,7 @@ set -g status-right "#[fg=green] | #[fg=white]#(tmux-mem-cpu-load)#[fg=green] | [Archlinux Wiki](https://wiki.archlinux.org/index.php/Tmux) [Display CPU/MEM % in statusbar](https://stackoverflow.com/questions/11558907/is-there-a-better-way-to-display-cpu-usage-in-tmux) + +[tmuxinator - Manage complex tmux sessions](https://github.com/tmuxinator/tmuxinator) + + From 53366ebdbeecb502131c2768979e4b6ed9d59d9f Mon Sep 17 00:00:00 2001 From: venegu Date: Sat, 17 Oct 2015 22:21:25 -0400 Subject: [PATCH 395/685] Adding modulo division to JavaScript article --- javascript.html.markdown | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/javascript.html.markdown b/javascript.html.markdown index 34ba9b47..937354eb 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -54,6 +54,11 @@ doStuff() // Including uneven division. 5 / 2; // = 2.5 +// And modulo division. +10 % 2; // = 0 +30 % 4; // = 2 +18.5 % 7; // = 4.5 + // Bitwise operations also work; when you perform a bitwise operation your float // is converted to a signed int *up to* 32 bits. 1 << 2; // = 4 @@ -104,7 +109,7 @@ null == undefined; // = true // ...unless you use === "5" === 5; // = false -null === undefined; // = false +null === undefined; // = false // ...which can result in some weird behaviour... 13 + !0; // 14 @@ -220,15 +225,15 @@ for (var i = 0; i < 5; i++){ //The For/In statement loops iterates over every property across the entire prototype chain var description = ""; -var person = {fname:"Paul", lname:"Ken", age:18}; +var person = {fname:"Paul", lname:"Ken", age:18}; for (var x in person){ description += person[x] + " "; } -//If only want to consider properties attached to the object itself, +//If only want to consider properties attached to the object itself, //and not its prototypes use hasOwnProperty() check var description = ""; -var person = {fname:"Paul", lname:"Ken", age:18}; +var person = {fname:"Paul", lname:"Ken", age:18}; for (var x in person){ if (person.hasOwnProperty(x)){ description += person[x] + " "; From 0c227ddf87f8ea4bd849dbd98886a815178affad Mon Sep 17 00:00:00 2001 From: Kirushan Rasendran Date: Sun, 18 Oct 2015 11:35:38 +0530 Subject: [PATCH 396/685] json values translated to tamil --- ta_in/json.html.markdown | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ta_in/json.html.markdown b/ta_in/json.html.markdown index 777dfaeb..d85e0d82 100644 --- a/ta_in/json.html.markdown +++ b/ta_in/json.html.markdown @@ -42,29 +42,29 @@ Firefox(Mozilla) 3.5, Internet Explorer 8, Chrome, Opera 10, Safari 4. ```json { - "key": "value", + "key": "ஒரு சாவிக்கு ஒரு பெறுமதி உள்ளது ", - "keys": "must always be enclosed in double quotes", + "keys": "சாவிகள் , மற்றும் பெறுமானங்கள் மேற்கோள் குறிக்குள் இடல் வேண்டும்", "numbers": 0, - "strings": "Hellø, wørld. All unicode is allowed, along with \"escaping\".", + "strings": "Hellø, wørld. எல்லாவகையான unicode உம் அனுமதிக்கப்படும், அத்துடன் \"escaping\".", "has bools?": true, "nothingness": null, "big number": 1.2e+100, "objects": { - "comment": "Most of your structure will come from objects.", + "comment": "பெரும்பாலான கட்டமைப்புகள் objects இல் இருந்தே வருகின்றன", - "array": [0, 1, 2, 3, "Arrays can have anything in them.", 5], + "array": [0, 1, 2, 3, "array யானது எல்லாவகையான பெறுமானங்களையும் கொண்டிருக்கும்", 5], "another object": { - "comment": "These things can be nested, very useful." + "comment": "இவை ஒன்றுக்குள் இன்னொன்றை எழுத முடியும்" } }, "silliness": [ { - "sources of potassium": ["bananas"] + "sources of potassium": ["வாழைபழம்"] }, [ [1, 0, 0, 0], @@ -75,12 +75,12 @@ Firefox(Mozilla) 3.5, Internet Explorer 8, Chrome, Opera 10, Safari 4. ], "alternative style": { - "comment": "check this out!" + "comment": "இதை பார்க்கவும்" , "comma position": "doesn't matter - as long as it's before the value, then it's valid" , "another comment": "how nice" }, - "that was short": "And, you're done. You now know everything JSON has to offer." + "that was short": "நீங்கள் ஜேசன் பற்றி யாவற்றையும் கற்றுள்ளீர்கள்" } ``` From 10d0865214928a396bdb9d2ef187ed90b48a975c Mon Sep 17 00:00:00 2001 From: Saurabh Sandav Date: Sun, 18 Oct 2015 13:21:31 +0530 Subject: [PATCH 397/685] [whip/en] Fix typos --- whip.html.markdown | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/whip.html.markdown b/whip.html.markdown index 3faee98a..61c301a5 100644 --- a/whip.html.markdown +++ b/whip.html.markdown @@ -2,6 +2,7 @@ language: whip contributors: - ["Tenor Biel", "http://github.com/L8D"] + - ["Saurabh Sandav", "http://github.com/SaurabhSandav"] author: Tenor Biel author_url: http://github.com/L8D filename: whip.lisp @@ -93,13 +94,13 @@ null ; used to indicate a deliberate non-value undefined ; user to indicate a value that hasn't been set ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; 2. Vairbles, Lists, and Dicts +; 2. Variables, Lists, and Dicts ; Variables are declared with the `def` or `let` functions. ; Variables that haven't been set will be `undefined`. (def some_var 5) ; `def` will keep the variable in the global context. -; `let` will only have the variable inside its context, and has a wierder syntax. +; `let` will only have the variable inside its context, and has a weirder syntax. (let ((a_var 5)) (+ a_var 5)) ; => 10 (+ a_var 5) ; = undefined + 5 => undefined @@ -163,7 +164,7 @@ undefined ; user to indicate a value that hasn't been set (my_function 10 10) ; = (+ (+ 10 10) 10) => 30 -; Obiously, all lambdas by definition are anonymous and +; Obviously, all lambdas by definition are anonymous and ; technically always used anonymously. Redundancy. ((lambda (x) x) 10) ; => 10 @@ -191,7 +192,7 @@ undefined ; user to indicate a value that hasn't been set (slice (.. 1 5) 2) ; => (3 4 5) (\ (.. 0 100) -5) ; => (96 97 98 99 100) -; `append` or `<<` is self expanatory +; `append` or `<<` is self explanatory (append 4 (1 2 3)) ; => (1 2 3 4) (<< "bar" ("foo")) ; => ("foo" "bar") From 35b921505b38ff3686c79826aadde9847e9b2f53 Mon Sep 17 00:00:00 2001 From: Tommaso Date: Sun, 18 Oct 2015 11:42:37 +0200 Subject: [PATCH 398/685] [c++/it] Bring this version up to date with the english one The following commits were taken into consideration and translated into italian: 462ac892179d64437b1124263402378a6054e50b 3db1042157204ad05484d6b42140261f849040cc cea52ca43490b74316781c23779654fd46aaeab4 47d3cea47e8c5203efa857070a00dcfbff67b019 894792e1e17173823a5d50de24439427c69d63f4 06889be239622266d9c36c750f7ee755ccdae05d 97b97408eab97fbe322df4266cda9ab2ed21fceb 1d1def16a5d7925bb8f7fba7dc49182e33359e85 a230d76307ecbc0f53c4b359cdb90628720f915e fc9ae44e4887500634bf3a87343d687b4d7d4e3c 85f6ba0b57b9d894c694df66449b1e1c555c625b 8eb410208a8d9b0a42f6c52411455ace04c78101 ae86e4ebabb0c78c1bd8052e6ab5916446ef39c2 455afa3a7bf59fc272f3439825da55659765eec0 12286a4b78f82bde3907d4bf348e20c12dd6d46f 9bc553c46ce9b7154ec7c82451d71608f4beda82 87e8e77e5fd8d84a252dbb6d6697202118378774 3b246fd869564b0a7f7c847f44aecac82d318c78 9d64b532f8ccdfd95c2417dcf65257385956353a e32eb715ef41e411da0a91b40e6e35f150a9c2eb ca435fbb0dd09cdc9c70fe945a891ae3e6c19ab2 --- it-it/c++-it.html.markdown | 211 ++++++++++++++++++++++++++++++++----- 1 file changed, 185 insertions(+), 26 deletions(-) diff --git a/it-it/c++-it.html.markdown b/it-it/c++-it.html.markdown index e7e1d89e..92ebc165 100644 --- a/it-it/c++-it.html.markdown +++ b/it-it/c++-it.html.markdown @@ -4,6 +4,8 @@ filename: learncpp-it.cpp contributors: - ["Steven Basart", "http://github.com/xksteven"] - ["Matt Kline", "https://github.com/mrkline"] + - ["Geoff Liu", "http://geoffliu.me"] + - ["Connor Waters", "http://github.com/connorwaters"] translators: - ["Robert Margelli", "http://github.com/sinkswim/"] lang: it-it @@ -54,11 +56,11 @@ int main(int argc, char** argv) // Tuttavia, il C++ varia nei seguenti modi: -// In C++, i caratteri come letterali sono da un byte. -sizeof('c') == 1 +// In C++, i caratteri come letterali sono dei char. +sizeof('c') == sizeof(char) == 1 -// In C, i caratteri come letterali sono della stessa dimensione degli interi. -sizeof('c') == sizeof(10) +// In C, i caratteri come letterali sono degli interi. +sizeof('c') == sizeof(int) // C++ ha prototipizzazione rigida @@ -160,11 +162,14 @@ void foo() int main() { - // Assume che tutto venga dal namespace "Secondo" - // a meno che non venga dichiarato altrimenti. + // Include tutti i simboli del namespace Secondo nello scope attuale. + // Osserva che chiamare semplicemente foo() non va più bene perché è ambiguo: + // bisogna specificare se vogliamo chiamare foo definita nel namespace Secondo + // o foo definita nel livello principale del programma. + using namespace Secondo; - foo(); // stampa "Questa è Secondo::foo" + Secondo::foo(); // stampa "Questa è Secondo::foo" Primo::Annidato::foo(); // stampa "Questa è Primo::Annidato::foo" ::foo(); // stampa "Questa è foo globale" } @@ -244,12 +249,137 @@ cout << fooRef; // Stampa "Io sono foo. Ciao!" // Non riassegna "fooRef". Questo è come scrivere "foo = bar", e // foo == "Io sono bar" // dopo questa riga. +cout << &fooRef << endl; // Stampa l'indirizzo di foo fooRef = bar; +cout << &fooRef << endl; // Stampa lo stesso l'indirizzo di foo +cout << fooRef; // Stampa "Io sono bar" + +// L'indirizzo di fooRef rimane lo stesso, ovvero si riferisce ancora a foo. + const string& barRef = bar; // Crea un riferimento const a bar. // Come in C, i valori const (i puntatori e i riferimenti) non possono essere modificati. barRef += ". Ciao!"; // Errore, i riferimenti const non possono essere modificati. +// Facciamo un piccolo excursus: prima di approfondire ancora i riferimenti, è necessario +// introdurre il concetto di oggetto temporaneo. Supponiamo di avere il seguente codice: +string tempObjectFun() { ... } +string retVal = tempObjectFun(); + +// Nella seconda riga si ha che: +// - un oggetto di tipo stringa viene ritornato da tempObjectFun +// - viene costruita una nuova stringa, utilizzando l'oggetto ritornato come +// argomento per il costruttore +// - l'oggetto ritornato da tempObjectFun viene distrutto +// L'oggetto ritornato da tempObjectFun viene detto oggetto temporaneo. +// Un oggetto temporaneo viene creato quando una funzione ritorna un oggetto, e viene +// distrutto quando l'espressione che lo racchiude termina la sua esecuzione - questo +// comportamento viene definito dallo standard, ma i compilatori possono modificarlo +// a piacere. Cerca su google "return value optimization" se vuoi approfondire. +// Dunque nel seguente codice: +foo(bar(tempObjectFun())) + +// dando per scontato che foo e bar esistano, l'oggetto ritornato da tempObjectFun +// è passato a bar ed è distrutto prima dell'invocazione di foo. + +// Tornando ai riferimenti, c'è un'eccezione a quanto appena detto. +// Infatti un oggetto temporaneo "viene distrutto quando l'espressione +// che lo racchiude termina la sua esecuzione", tranne quando è legato ad un +// riferimento di tipo const. In tal caso la sua vita viene estesa per tutto +// lo scope attuale: + +void constReferenceTempObjectFun() { + // constRef riceve l'oggetto temporaneo, che non viene distrutto fino + // alla fine di questa funzione. + const string& constRef = tempObjectFun(); + ... +} + +// Un altro tipo di riferimento introdotto nel C++11 è specifico per gli +// oggetti temporanei. Non puoi dichiarare una variabile di quel tipo, ma +// ha la precedenza nella risoluzione degli overload: + +void someFun(string& s) { ... } // Riferimento normale +void someFun(string&& s) { ... } // Riferimento ad un oggetto temporaneo + +string foo; +someFun(foo); // Chiama la versione con il riferimento normale +someFun(tempObjectFun()); // Chiama la versione con il riferimento temporaneo + +// Ad esempio potrai vedere questi due costruttori per std::basic_string: +basic_string(const basic_string& other); +basic_string(basic_string&& other); + +// L'idea è che se noi costruiamo una nuova stringa a partire da un oggetto temporaneo +// (che in ogni caso verrà distrutto), possiamo avere un costruttore più efficiente +// che in un certo senso "recupera" parti di quella stringa temporanea. +// Ci si riferisce a questo concetto come "move semantics". + +///////////////////// +// Enum +///////////////////// + +// Gli enum sono un modo per assegnare un valore ad una costante, e sono +// principalmente usati per rendere il codice più leggibile. +enum ETipiMacchine +{ + AlfaRomeo, + Ferrari, + SUV, + Panda +}; + +ETipiMacchine GetPreferredCarType() +{ + return ETipiMacchine::Ferrari; +} + +// Dal C++11 in poi c'è un modo molto semplice per assegnare un tipo ad un enum, +// che può essere utile per la serializzazione dei dati o per convertire gli enum +// tra il tipo desiderato e le rispettive costanti. +enum ETipiMacchine : uint8_t +{ + AlfaRomeo, // 0 + Ferrari, // 1 + SUV = 254, // 254 + Ibrida // 255 +}; + +void WriteByteToFile(uint8_t InputValue) +{ + // Serializza InputValue in un file +} + +void WritePreferredCarTypeToFile(ETipiMacchine InputCarType) +{ + // L'enum viene implicitamente convertito ad un uint8_t poiché + // è stato dichiarato come tale + WriteByteToFile(InputCarType); +} + +// D'altro canto potresti voler evitare che un enum venga accidentalmente convertito +// in un intero o in un altro tipo, quindi è possibile create una classe enum che +// impedisce la conversione implicita. +enum class ETipiMacchine : uint8_t +{ + AlfaRomeo, // 0 + Ferrari, // 1 + SUV = 254, // 254 + Ibrida // 255 +}; + +void WriteByteToFile(uint8_t InputValue) +{ + // Serializza InputValue in un file +} + +void WritePreferredCarTypeToFile(ETipiMacchine InputCarType) +{ + // Il compilatore darà errore anche se ETipiMacchine è un uint8_t: questo + // perchè abbiamo dichiarato l'enum come "enum class"! + WriteByteToFile(InputCarType); +} + ////////////////////////////////////////////////// // Classi e programmazione orientata agli oggetti ///////////////////////////////////////////////// @@ -296,13 +426,16 @@ public: // Questi sono chiamati quando un oggetto è rimosso o esce dalla visibilità. // Questo permette paradigmi potenti come il RAII // (vedi sotto) - // I distruttori devono essere virtual per permettere a classi di essere derivate da questa. + // I distruttori devono essere virtual per permettere a classi di essere + // derivate da questa; altrimenti, il distruttore della classe derivata + // non viene chiamato se l'oggetto viene distrutto tramite un riferimento alla + // classe da cui ha ereditato o tramite un puntatore. virtual ~Dog(); }; // Un punto e virgola deve seguire la definizione della funzione // Le funzioni membro di una classe sono generalmente implementate in files .cpp . -void Cane::Cane() +Cane::Cane() { std::cout << "Un cane è stato costruito\n"; } @@ -325,7 +458,7 @@ void Cane::print() const std::cout << "Il cane è " << nome << " e pesa " << peso << "kg\n"; } -void Cane::~Cane() +Cane::~Cane() { cout << "Ciao ciao " << nome << "\n"; } @@ -340,10 +473,12 @@ int main() { // Ereditarietà: -// Questa classe eredita tutto ciò che è public e protected dalla classe Cane +// Questa classe eredita tutto ciò che è public e protected dalla classe Cane, +// ma anche ciò che privato: tuttavia non potrà accedere direttamente a membri/metodi +// privati se non c'è un metodo pubblico o privato che permetta di farlo. class MioCane : public Cane { - void impostaProprietario(const std::string& proprietarioCane) + void impostaProprietario(const std::string& proprietarioCane); // Sovrascrivi il comportamento della funzione print per tutti i MioCane. Vedi // http://it.wikipedia.org/wiki/Polimorfismo_%28informatica%29 @@ -447,6 +582,7 @@ int main () { // definire una classe o una funzione che prende un parametro di un dato tipo: template class Box { +public: // In questa classe, T può essere usato come qualsiasi tipo. void inserisci(const T&) { ... } }; @@ -519,19 +655,23 @@ printMessage<10>(); // Stampa "Impara il C++ più velocemente in soli 10 minuti // (vedi http://en.cppreference.com/w/cpp/error/exception) // ma ogni tipo può essere lanciato come eccezione #include +#include // Tutte le eccezioni lanciate all'interno del blocco _try_ possono essere catturate dai successivi // handlers _catch_. try { // Non allocare eccezioni nello heap usando _new_. - throw std::exception("È avvenuto un problema"); + throw std::runtime_error("C'è stato un problema."); } + // Cattura le eccezioni come riferimenti const se sono oggetti catch (const std::exception& ex) { - std::cout << ex.what(); + std::cout << ex.what(); +} + // Cattura ogni eccezioni non catturata dal blocco _catch_ precedente -} catch (...) +catch (...) { std::cout << "Catturata un'eccezione sconosciuta"; throw; // Rilancia l'eccezione @@ -541,7 +681,7 @@ catch (const std::exception& ex) // RAII /////// -// RAII sta per Resource Allocation Is Initialization. +// RAII sta per "Resource Allocation Is Initialization". // Spesso viene considerato come il più potente paradigma in C++. // È un concetto semplice: un costruttore di un oggetto // acquisisce le risorse di tale oggetto ed il distruttore le rilascia. @@ -563,9 +703,9 @@ void faiQualcosaConUnFile(const char* nomefile) // Sfortunatamente, le cose vengono complicate dalla gestione degli errori. // Supponiamo che fopen fallisca, e che faiQualcosaConUnFile e // faiQualcosAltroConEsso ritornano codici d'errore se falliscono. -// (Le eccezioni sono la maniera preferita per gestire i fallimenti, -// ma alcuni programmatori, specialmente quelli con un passato in C, -// non sono d'accordo con l'utilità delle eccezioni). +// (Le eccezioni sono la maniera preferita per gestire i fallimenti, +// ma alcuni programmatori, specialmente quelli con un passato in C, +// non sono d'accordo con l'utilità delle eccezioni). // Adesso dobbiamo verificare che ogni chiamata per eventuali fallimenti e chiudere il gestore di file // se un problema è avvenuto. bool faiQualcosaConUnFile(const char* nomefile) @@ -615,7 +755,7 @@ void faiQualcosaConUnFile(const char* nomefile) { FILE* fh = fopen(nomefile, "r"); // Apre il file in modalità lettura if (fh == nullptr) - throw std::exception("Non è stato possibile aprire il file."). + throw std::runtime_error("Errore nell'apertura del file."); try { faiQualcosaConIlFile(fh); @@ -678,26 +818,29 @@ class Foo { virtual void bar(); }; class FooSub : public Foo { - virtual void bar(); // sovrascrive Foo::bar! + virtual void bar(); // Sovrascrive Foo::bar! }; // 0 == false == NULL (la maggior parte delle volte)! bool* pt = new bool; -*pt = 0; // Setta il valore puntato da 'pt' come falso. +*pt = 0; // Setta il valore puntato da 'pt' come falso. pt = 0; // Setta 'pt' al puntatore null. Entrambe le righe vengono compilate senza warnings. // nullptr dovrebbe risolvere alcune di quei problemi: int* pt2 = new int; -*pt2 = nullptr; // Non compila +*pt2 = nullptr; // Non compila pt2 = nullptr; // Setta pt2 a null. -// Ma in qualche modo il tipo 'bool' è una eccezione (questo è per rendere compilabile `if (ptr)`. -*pt = nullptr; // Questo compila, anche se '*pt' è un bool! +// C'è un'eccezione per i bool. +// Questo permette di testare un puntatore a null con if(!ptr), ma +// come conseguenza non puoi assegnare nullptr a un bool direttamente! +*pt = nullptr; // Questo compila, anche se '*pt' è un bool! // '=' != '=' != '='! -// Chiama Foo::Foo(const Foo&) o qualche variante del costruttore di copia. +// Chiama Foo::Foo(const Foo&) o qualche variante (vedi "move semantics") +// del costruttore di copia. Foo f2; Foo f1 = f2; @@ -711,6 +854,22 @@ Foo f1 = fooSub; Foo f1; f1 = f2; + +// Come deallocare realmente le risorse all'interno di un vettore: +class Foo { ... }; +vector v; +for (int i = 0; i < 10; ++i) + v.push_back(Foo()); + +// La riga seguente riduce la dimensione di v a 0, ma il distruttore non +// viene chiamato e dunque le risorse non sono deallocate! +v.empty(); +v.push_back(Foo()); // Il nuovo valore viene copiato nel primo Foo che abbiamo inserito + +// Distrugge realmente tutti i valori dentro v. Vedi la sezione riguardante gli +// oggetti temporanei per capire come mai funziona così. +v.swap(vector()); + ``` Letture consigliate: From c23bba2b6010e659d518f144d689102d0e9fb147 Mon Sep 17 00:00:00 2001 From: Cameron Wood Date: Sun, 18 Oct 2015 05:46:35 -0400 Subject: [PATCH 399/685] [javascript/en] Small typo fix Just a simple 1-word typo fix --- javascript.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript.html.markdown b/javascript.html.markdown index 937354eb..9c4f06fc 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -324,7 +324,7 @@ i; // = 5 - not undefined as you'd expect in a block-scoped language // scope. (function(){ var temporary = 5; - // We can access the global scope by assiging to the "global object", which + // We can access the global scope by assigning to the "global object", which // in a web browser is always `window`. The global object may have a // different name in non-browser environments such as Node.js. window.permanent = 10; From b0ae4db5589ce91ca52f9aece0cf065524c027fe Mon Sep 17 00:00:00 2001 From: Claudson Martins Date: Sun, 18 Oct 2015 08:23:59 -0300 Subject: [PATCH 400/685] =?UTF-8?q?Iniciando=20tradu=C3=A7=C3=A3o=20do=20M?= =?UTF-8?q?atLab=20para=20PT-BR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt-br/matlab.html.markdown | 531 +++++++++++++++++++++++++++++++++++++ 1 file changed, 531 insertions(+) create mode 100644 pt-br/matlab.html.markdown diff --git a/pt-br/matlab.html.markdown b/pt-br/matlab.html.markdown new file mode 100644 index 00000000..7c0760d1 --- /dev/null +++ b/pt-br/matlab.html.markdown @@ -0,0 +1,531 @@ +--- +language: Matlab +contributors: + - ["mendozao", "http://github.com/mendozao"] + - ["jamesscottbrown", "http://jamesscottbrown.com"] + - ["Colton Kohnke", "http://github.com/voltnor"] +translators: + - ["Claudson Martins", "https://github.com/claudsonm"] +lang: pt-br + +--- + +MATLAB significa MATrix LABoratory. É uma poderosa linguagem de computação numérica geralmente utilizada em engenharia e matemática. + +Se você tem algum feedback, por favor fique a vontade para me contactar via +[@the_ozzinator](https://twitter.com/the_ozzinator), ou +[osvaldo.t.mendoza@gmail.com](mailto:osvaldo.t.mendoza@gmail.com). + +```matlab +% Comentários iniciam com um sinal de porcentagem + +%{ +Comentários de múltiplas linhas +parecem +com +algo assim +%} + +% comandos podem ocupar várinhas linhas, usando '...': + a = 1 + 2 + ... + + 4 + +% comandos podem ser passados para o sistema operacional +!ping google.com + +who % Exibe todas as variáveis na memória +whos % Exibe todas as variáveis na memória, com seus tipos +clear % Apaga todas as suas variáveis da memória +clear('A') % Apaga uma variável em particular +openvar('A') % Abre a variável no editor de variável + +clc % Apaga o conteúdo escrito na sua janela de comando +diary % Alterna o conteúdo escrito na janela de comando para um arquivo de texto +ctrl-c % Aborta a computação atual + +edit('minhafuncao.m') % Abre a função/script no editor +type('minhafuncao.m') % Imprime o código-fonte da função/script na janela de comando + +profile on % Ativa o perfil de código +profile off % Desativa o perfil de código +profile viewer % Visualiza os resultados na janela de Profiler + +help comando % Exibe a documentação do comando na janela de comando +doc comando % Exibe a documentação do comando na janela de ajuda +lookfor comando % Procura por comando na primeira linha comentada de todas as funções +lookfor comando -all % Procura por comando em todas as funções + + +% Formatação de saída +format short % 4 casas decimais em um número flutuante +format long % 15 casas decimais +format bank % 2 dígitos após o ponto decimal - para cálculos financeiros +fprintf('texto') % Imprime na tela "texto" +disp('texto') % Imprime na tela "texto" + +% Variáveis & Expressões +minhaVariavel = 4 % O painel Workspace mostra a variável recém-criada +minhaVariavel = 4; % Ponto e vírgula suprime a saída para a janela de comando +4 + 6 % Resposta = 10 +8 * minhaVariavel % Resposta = 32 +2 ^ 3 % Resposta = 8 +a = 2; b = 3; +c = exp(a)*sin(pi/2) % c = 7.3891 + +% A chamada de funções pode ser feita por uma das duas maneiras: +% Sintaxe de função padrão: +load('arquivo.mat', 'y') % Argumentos entre parênteses, separados por vírgula +% Sintaxe de comando: +load arquivo.mat y % Sem parênteses, e espaços ao invés de vírgulas +% Observe a falta de aspas no formulário de comando: entradas são sempre +% passadas como texto literal - não pode passar valores de variáveis. +% Além disso, não pode receber saída: +[V,D] = eig(A); % this has no equivalent in command form +[~,D] = eig(A); % if you only want D and not V + + + +% Logicals +1 > 5 % ans = 0 +10 >= 10 % ans = 1 +3 ~= 4 % Not equal to -> ans = 1 +3 == 3 % equal to -> ans = 1 +3 > 1 && 4 > 1 % AND -> ans = 1 +3 > 1 || 4 > 1 % OR -> ans = 1 +~1 % NOT -> ans = 0 + +% Logicals can be applied to matrices: +A > 5 +% for each element, if condition is true, that element is 1 in returned matrix +A( A > 5 ) +% returns a vector containing the elements in A for which condition is true + +% Strings +a = 'MyString' +length(a) % ans = 8 +a(2) % ans = y +[a,a] % ans = MyStringMyString + + +% Cells +a = {'one', 'two', 'three'} +a(1) % ans = 'one' - returns a cell +char(a(1)) % ans = one - returns a string + +% Structures +A.b = {'one','two'}; +A.c = [1 2]; +A.d.e = false; + +% Vectors +x = [4 32 53 7 1] +x(2) % ans = 32, indices in Matlab start 1, not 0 +x(2:3) % ans = 32 53 +x(2:end) % ans = 32 53 7 1 + +x = [4; 32; 53; 7; 1] % Column vector + +x = [1:10] % x = 1 2 3 4 5 6 7 8 9 10 + +% Matrices +A = [1 2 3; 4 5 6; 7 8 9] +% Rows are separated by a semicolon; elements are separated with space or comma +% A = + +% 1 2 3 +% 4 5 6 +% 7 8 9 + +A(2,3) % ans = 6, A(row, column) +A(6) % ans = 8 +% (implicitly concatenates columns into vector, then indexes into that) + + +A(2,3) = 42 % Update row 2 col 3 with 42 +% A = + +% 1 2 3 +% 4 5 42 +% 7 8 9 + +A(2:3,2:3) % Creates a new matrix from the old one +%ans = + +% 5 42 +% 8 9 + +A(:,1) % All rows in column 1 +%ans = + +% 1 +% 4 +% 7 + +A(1,:) % All columns in row 1 +%ans = + +% 1 2 3 + +[A ; A] % Concatenation of matrices (vertically) +%ans = + +% 1 2 3 +% 4 5 42 +% 7 8 9 +% 1 2 3 +% 4 5 42 +% 7 8 9 + +% this is the same as +vertcat(A,A); + + +[A , A] % Concatenation of matrices (horizontally) + +%ans = + +% 1 2 3 1 2 3 +% 4 5 42 4 5 42 +% 7 8 9 7 8 9 + +% this is the same as +horzcat(A,A); + + +A(:, [3 1 2]) % Rearrange the columns of original matrix +%ans = + +% 3 1 2 +% 42 4 5 +% 9 7 8 + +size(A) % ans = 3 3 + +A(1, :) =[] % Delete the first row of the matrix +A(:, 1) =[] % Delete the first column of the matrix + +transpose(A) % Transpose the matrix, which is the same as: +A one +ctranspose(A) % Hermitian transpose the matrix +% (the transpose, followed by taking complex conjugate of each element) + + + + +% Element by Element Arithmetic vs. Matrix Arithmetic +% On their own, the arithmetic operators act on whole matrices. When preceded +% by a period, they act on each element instead. For example: +A * B % Matrix multiplication +A .* B % Multiple each element in A by its corresponding element in B + +% There are several pairs of functions, where one acts on each element, and +% the other (whose name ends in m) acts on the whole matrix. +exp(A) % exponentiate each element +expm(A) % calculate the matrix exponential +sqrt(A) % take the square root of each element +sqrtm(A) % find the matrix whose square is A + + +% Plotting +x = 0:.10:2*pi; % Creates a vector that starts at 0 and ends at 2*pi with increments of .1 +y = sin(x); +plot(x,y) +xlabel('x axis') +ylabel('y axis') +title('Plot of y = sin(x)') +axis([0 2*pi -1 1]) % x range from 0 to 2*pi, y range from -1 to 1 + +plot(x,y1,'-',x,y2,'--',x,y3,':') % For multiple functions on one plot +legend('Line 1 label', 'Line 2 label') % Label curves with a legend + +% Alternative method to plot multiple functions in one plot. +% while 'hold' is on, commands add to existing graph rather than replacing it +plot(x, y) +hold on +plot(x, z) +hold off + +loglog(x, y) % A log-log plot +semilogx(x, y) % A plot with logarithmic x-axis +semilogy(x, y) % A plot with logarithmic y-axis + +fplot (@(x) x^2, [2,5]) % plot the function x^2 from x=2 to x=5 + +grid on % Show grid; turn off with 'grid off' +axis square % Makes the current axes region square +axis equal % Set aspect ratio so data units are the same in every direction + +scatter(x, y); % Scatter-plot +hist(x); % Histogram + +z = sin(x); +plot3(x,y,z); % 3D line plot + +pcolor(A) % Heat-map of matrix: plot as grid of rectangles, coloured by value +contour(A) % Contour plot of matrix +mesh(A) % Plot as a mesh surface + +h = figure % Create new figure object, with handle f +figure(h) % Makes the figure corresponding to handle h the current figure +close(h) % close figure with handle h +close all % close all open figure windows +close % close current figure window + +shg % bring an existing graphics window forward, or create new one if needed +clf clear % clear current figure window, and reset most figure properties + +% Properties can be set and changed through a figure handle. +% You can save a handle to a figure when you create it. +% The function gcf returns a handle to the current figure +h = plot(x, y); % you can save a handle to a figure when you create it +set(h, 'Color', 'r') +% 'y' yellow; 'm' magenta, 'c' cyan, 'r' red, 'g' green, 'b' blue, 'w' white, 'k' black +set(h, 'LineStyle', '--') + % '--' is solid line, '---' dashed, ':' dotted, '-.' dash-dot, 'none' is no line +get(h, 'LineStyle') + + +% The function gca returns a handle to the axes for the current figure +set(gca, 'XDir', 'reverse'); % reverse the direction of the x-axis + +% To create a figure that contains several axes in tiled positions, use subplot +subplot(2,3,1); % select the first position in a 2-by-3 grid of subplots +plot(x1); title('First Plot') % plot something in this position +subplot(2,3,2); % select second position in the grid +plot(x2); title('Second Plot') % plot something there + + +% To use functions or scripts, they must be on your path or current directory +path % display current path +addpath /path/to/dir % add to path +rmpath /path/to/dir % remove from path +cd /path/to/move/into % change directory + + +% Variables can be saved to .mat files +save('myFileName.mat') % Save the variables in your Workspace +load('myFileName.mat') % Load saved variables into Workspace + +% M-file Scripts +% A script file is an external file that contains a sequence of statements. +% They let you avoid repeatedly typing the same code in the Command Window +% Have .m extensions + +% M-file Functions +% Like scripts, and have the same .m extension +% But can accept input arguments and return an output +% Also, they have their own workspace (ie. different variable scope). +% Function name should match file name (so save this example as double_input.m). +% 'help double_input.m' returns the comments under line beginning function +function output = double_input(x) + %double_input(x) returns twice the value of x + output = 2*x; +end +double_input(6) % ans = 12 + + +% You can also have subfunctions and nested functions. +% Subfunctions are in the same file as the primary function, and can only be +% called by functions in the file. Nested functions are defined within another +% functions, and have access to both its workspace and their own workspace. + +% If you want to create a function without creating a new file you can use an +% anonymous function. Useful when quickly defining a function to pass to +% another function (eg. plot with fplot, evaluate an indefinite integral +% with quad, find roots with fzero, or find minimum with fminsearch). +% Example that returns the square of it's input, assigned to to the handle sqr: +sqr = @(x) x.^2; +sqr(10) % ans = 100 +doc function_handle % find out more + +% User input +a = input('Enter the value: ') + +% Stops execution of file and gives control to the keyboard: user can examine +% or change variables. Type 'return' to continue execution, or 'dbquit' to exit +keyboard + +% Reading in data (also xlsread/importdata/imread for excel/CSV/image files) +fopen(filename) + +% Output +disp(a) % Print out the value of variable a +disp('Hello World') % Print out a string +fprintf % Print to Command Window with more control + +% Conditional statements (the parentheses are optional, but good style) +if (a > 15) + disp('Greater than 15') +elseif (a == 23) + disp('a is 23') +else + disp('neither condition met') +end + +% Looping +% NB. looping over elements of a vector/matrix is slow! +% Where possible, use functions that act on whole vector/matrix at once +for k = 1:5 + disp(k) +end + +k = 0; +while (k < 5) + k = k + 1; +end + +% Timing code execution: 'toc' prints the time since 'tic' was called +tic +A = rand(1000); +A*A*A*A*A*A*A; +toc + +% Connecting to a MySQL Database +dbname = 'database_name'; +username = 'root'; +password = 'root'; +driver = 'com.mysql.jdbc.Driver'; +dburl = ['jdbc:mysql://localhost:8889/' dbname]; +javaclasspath('mysql-connector-java-5.1.xx-bin.jar'); %xx depends on version, download available at http://dev.mysql.com/downloads/connector/j/ +conn = database(dbname, username, password, driver, dburl); +sql = ['SELECT * from table_name where id = 22'] % Example sql statement +a = fetch(conn, sql) %a will contain your data + + +% Common math functions +sin(x) +cos(x) +tan(x) +asin(x) +acos(x) +atan(x) +exp(x) +sqrt(x) +log(x) +log10(x) +abs(x) +min(x) +max(x) +ceil(x) +floor(x) +round(x) +rem(x) +rand % Uniformly distributed pseudorandom numbers +randi % Uniformly distributed pseudorandom integers +randn % Normally distributed pseudorandom numbers + +% Common constants +pi +NaN +inf + +% Solving matrix equations (if no solution, returns a least squares solution) +% The \ and / operators are equivalent to the functions mldivide and mrdivide +x=A\b % Solves Ax=b. Faster and more numerically accurate than using inv(A)*b. +x=b/A % Solves xA=b + +inv(A) % calculate the inverse matrix +pinv(A) % calculate the pseudo-inverse + +% Common matrix functions +zeros(m,n) % m x n matrix of 0's +ones(m,n) % m x n matrix of 1's +diag(A) % Extracts the diagonal elements of a matrix A +diag(x) % Construct a matrix with diagonal elements listed in x, and zeroes elsewhere +eye(m,n) % Identity matrix +linspace(x1, x2, n) % Return n equally spaced points, with min x1 and max x2 +inv(A) % Inverse of matrix A +det(A) % Determinant of A +eig(A) % Eigenvalues and eigenvectors of A +trace(A) % Trace of matrix - equivalent to sum(diag(A)) +isempty(A) % Tests if array is empty +all(A) % Tests if all elements are nonzero or true +any(A) % Tests if any elements are nonzero or true +isequal(A, B) % Tests equality of two arrays +numel(A) % Number of elements in matrix +triu(x) % Returns the upper triangular part of x +tril(x) % Returns the lower triangular part of x +cross(A,B) % Returns the cross product of the vectors A and B +dot(A,B) % Returns scalar product of two vectors (must have the same length) +transpose(A) % Returns the transpose of A +fliplr(A) % Flip matrix left to right +flipud(A) % Flip matrix up to down + +% Matrix Factorisations +[L, U, P] = lu(A) % LU decomposition: PA = LU,L is lower triangular, U is upper triangular, P is permutation matrix +[P, D] = eig(A) % eigen-decomposition: AP = PD, P's columns are eigenvectors and D's diagonals are eigenvalues +[U,S,V] = svd(X) % SVD: XV = US, U and V are unitary matrices, S has non-negative diagonal elements in decreasing order + +% Common vector functions +max % largest component +min % smallest component +length % length of a vector +sort % sort in ascending order +sum % sum of elements +prod % product of elements +mode % modal value +median % median value +mean % mean value +std % standard deviation +perms(x) % list all permutations of elements of x + + +% Classes +% Matlab can support object-oriented programming. +% Classes must be put in a file of the class name with a .m extension. +% To begin, we create a simple class to store GPS waypoints. +% Begin WaypointClass.m +classdef WaypointClass % The class name. + properties % The properties of the class behave like Structures + latitude + longitude + end + methods + % This method that has the same name of the class is the constructor. + function obj = WaypointClass(lat, lon) + obj.latitude = lat; + obj.longitude = lon; + end + + % Other functions that use the Waypoint object + function r = multiplyLatBy(obj, n) + r = n*[obj.latitude]; + end + + % If we want to add two Waypoint objects together without calling + % a special function we can overload Matlab's arithmetic like so: + function r = plus(o1,o2) + r = WaypointClass([o1.latitude] +[o2.latitude], ... + [o1.longitude]+[o2.longitude]); + end + end +end +% End WaypointClass.m + +% We can create an object of the class using the constructor +a = WaypointClass(45.0, 45.0) + +% Class properties behave exactly like Matlab Structures. +a.latitude = 70.0 +a.longitude = 25.0 + +% Methods can be called in the same way as functions +ans = multiplyLatBy(a,3) + +% The method can also be called using dot notation. In this case, the object +% does not need to be passed to the method. +ans = a.multiplyLatBy(a,1/3) + +% Matlab functions can be overloaded to handle objects. +% In the method above, we have overloaded how Matlab handles +% the addition of two Waypoint objects. +b = WaypointClass(15.0, 32.0) +c = a + b + +``` + +## More on Matlab + +* The official website [http://http://www.mathworks.com/products/matlab/](http://www.mathworks.com/products/matlab/) +* The official MATLAB Answers forum: [http://www.mathworks.com/matlabcentral/answers/](http://www.mathworks.com/matlabcentral/answers/) + From 1aaf79b6e56b7d4947335dd60613f8096b66b0d9 Mon Sep 17 00:00:00 2001 From: Tommaso Date: Sun, 18 Oct 2015 13:26:58 +0200 Subject: [PATCH 401/685] [coffeescript/it] Bring this version up to date with the english one The following commits were taken into consideration and translated into italian: 7afadb01811e1fb97a928a0e2d8b1a3b7a3a42f6 960ee4a1856db8eadb96277bb2422edfa8f2a81c a67d9d9e0ed3d351ce0139de18a4b212b47ab9cb d115a86ac8602c680a059e7a53d227cbccdf157a ef40704f9b66ae85d7a8a6853abbbf8810af3b90 --- it-it/coffeescript-it.html.markdown | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/it-it/coffeescript-it.html.markdown b/it-it/coffeescript-it.html.markdown index 16eb9bd4..d30ba819 100644 --- a/it-it/coffeescript-it.html.markdown +++ b/it-it/coffeescript-it.html.markdown @@ -59,34 +59,34 @@ matematica = quadrato: quadrato cubo: (x) -> x * quadrato x #=> var matematica = { -# "radice": Math.sqrt, -# "quadrato": quadrato, -# "cubo": function(x) { return x * quadrato(x); } -#} +# "radice": Math.sqrt, +# "quadrato": quadrato, +# "cubo": function(x) { return x * quadrato(x); } +# } # Splats: gara = (vincitore, partecipanti...) -> print vincitore, partecipanti #=>gara = function() { -# var partecipanti, vincitore; -# vincitore = arguments[0], partecipanti = 2 <= arguments.length ? __slice.call(arguments, 1) : []; -# return print(vincitore, partecipanti); -#}; +# var partecipanti, vincitore; +# vincitore = arguments[0], partecipanti = 2 <= arguments.length ? __slice.call(arguments, 1) : []; +# return print(vincitore, partecipanti); +# }; # Esistenza: alert "Lo sapevo!" if elvis? #=> if(typeof elvis !== "undefined" && elvis !== null) { alert("Lo sapevo!"); } # Comprensione degli Array: -cubi = (matematica.cubo num for num in lista) +cubi = (matematica.cubo num for num in lista) #=>cubi = (function() { -# var _i, _len, _results; -# _results = []; -# for (_i = 0, _len = lista.length; _i < _len; _i++) { -# num = lista[_i]; -# _results.push(matematica.cubo(num)); -# } -# return _results; +# var _i, _len, _results; +# _results = []; +# for (_i = 0, _len = lista.length; _i < _len; _i++) { +# num = lista[_i]; +# _results.push(matematica.cubo(num)); +# } +# return _results; # })(); cibi = ['broccoli', 'spinaci', 'cioccolato'] From ade3e872abaa21bb00bc0eaafdabce8bc5039399 Mon Sep 17 00:00:00 2001 From: Tommaso Date: Sun, 18 Oct 2015 13:34:40 +0200 Subject: [PATCH 402/685] [elixir/it] Bring this version up to date with the english one The following commits were taken into consideration and translated into italian: d8001da79909734d333de31079ca2f4d884a6b21 65f951d87c80deff6c447faa4690dcfe1bb4d36a 07e04e7a2d0f2b7269e4495c338b039a30f70e64 --- it-it/elixir-it.html.markdown | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/it-it/elixir-it.html.markdown b/it-it/elixir-it.html.markdown index f5d0c172..d4a7ab54 100644 --- a/it-it/elixir-it.html.markdown +++ b/it-it/elixir-it.html.markdown @@ -379,6 +379,12 @@ spawn(f) #=> #PID<0.40.0> # Per passare messaggi si usa l'operatore `send`. # Perché tutto questo sia utile dobbiamo essere capaci di ricevere messaggi, # oltre ad inviarli. Questo è realizzabile con `receive`: + +# Il blocco `receive do` viene usato per mettersi in ascolto di messaggi +# ed elaborarli quando vengono ricevuti. Un blocco `receive do` elabora +# un solo messaggio ricevuto: per fare elaborazione multipla di messaggi, +# una funzione con un blocco `receive do` al suo intero dovrà chiamare +# ricorsivamente sé stessa per entrare di nuovo nel blocco `receive do`. defmodule Geometria do def calcolo_area do receive do @@ -394,6 +400,8 @@ end # Compila il modulo e crea un processo che esegue `calcolo_area` nella shell pid = spawn(fn -> Geometria.calcolo_area() end) #=> #PID<0.40.0> +# Alternativamente +pid = spawn(Geometria, :calcolo_area, []) # Invia un messaggio a `pid` che farà match su un pattern nel blocco in receive send pid, {:rettangolo, 2, 3} From 90334770b6ffe4e690aedc20f678be95a93177d4 Mon Sep 17 00:00:00 2001 From: Tommaso Date: Sun, 18 Oct 2015 13:36:42 +0200 Subject: [PATCH 403/685] Add myself as a translator --- it-it/coffeescript-it.html.markdown | 2 ++ it-it/elixir-it.html.markdown | 2 ++ 2 files changed, 4 insertions(+) diff --git a/it-it/coffeescript-it.html.markdown b/it-it/coffeescript-it.html.markdown index d30ba819..31973369 100644 --- a/it-it/coffeescript-it.html.markdown +++ b/it-it/coffeescript-it.html.markdown @@ -4,6 +4,8 @@ contributors: - ["Luca 'Kino' Maroni", "http://github.com/kino90"] - ["Tenor Biel", "http://github.com/L8D"] - ["Xavier Yao", "http://github.com/xavieryao"] +translators: + - ["Tommaso Pifferi","http://github.com/neslinesli93"] filename: coffeescript-it.coffee lang: it-it --- diff --git a/it-it/elixir-it.html.markdown b/it-it/elixir-it.html.markdown index d4a7ab54..60301b1a 100644 --- a/it-it/elixir-it.html.markdown +++ b/it-it/elixir-it.html.markdown @@ -4,6 +4,8 @@ contributors: - ["Luca 'Kino' Maroni", "https://github.com/kino90"] - ["Joao Marques", "http://github.com/mrshankly"] - ["Dzianis Dashkevich", "https://github.com/dskecse"] +translators: + - ["Tommaso Pifferi","http://github.com/neslinesli93"] filename: learnelixir-it.ex lang: it-it --- From 670e71c4990aefe739f108e15bf707eaf795f922 Mon Sep 17 00:00:00 2001 From: Chris54721 Date: Sun, 18 Oct 2015 13:47:03 +0200 Subject: [PATCH 404/685] [git/en] Fixed 'git pull' documentation While translating git.html.markdown to Italian, I found a mistake: `git pull` does not default to `git pull origin master`. By default, it updates the current branch by merging changes from its remote-tracking branch. --- git.html.markdown | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/git.html.markdown b/git.html.markdown index f678f9d1..ed9aec15 100644 --- a/git.html.markdown +++ b/git.html.markdown @@ -371,9 +371,12 @@ Pulls from a repository and merges it with another branch. # Update your local repo, by merging in new changes # from the remote "origin" and "master" branch. # git pull -# git pull => implicitly defaults to => git pull origin master $ git pull origin master +# By default, git pull will update your current branch +# by merging in new changes from its remote-tracking branch +$ git pull + # Merge in changes from remote branch and rebase # branch commits onto your local repo, like: "git pull , git rebase " $ git pull origin master --rebase From 6d20f58cbd3022fb8990ace8f88f8f4c15591a88 Mon Sep 17 00:00:00 2001 From: Chris54721 Date: Sun, 18 Oct 2015 13:54:06 +0200 Subject: [PATCH 405/685] [git/en] Fixed 'git push' documentation The 'git push' documentation had the same problem of the 'git pull' one I just fixed. --- git.html.markdown | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/git.html.markdown b/git.html.markdown index ed9aec15..bedc9853 100644 --- a/git.html.markdown +++ b/git.html.markdown @@ -390,9 +390,12 @@ Push and merge changes from a branch to a remote & branch. # Push and merge changes from a local repo to a # remote named "origin" and "master" branch. # git push -# git push => implicitly defaults to => git push origin master $ git push origin master +# By default, git push will push and merge changes from +# the current branch to its remote-tracking branch +$ git push + # To link up current local branch with a remote branch, add -u flag: $ git push -u origin master # Now, anytime you want to push from that same local branch, use shortcut: From 5c84b03a49553856049e4d9c677b09c9a7eb9419 Mon Sep 17 00:00:00 2001 From: Gnomino Date: Sun, 18 Oct 2015 18:38:01 +0200 Subject: [PATCH 406/685] [css/fr] Corrects some French mistakes --- fr-fr/css-fr.html.markdown | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fr-fr/css-fr.html.markdown b/fr-fr/css-fr.html.markdown index bdab9715..a3a5cf55 100644 --- a/fr-fr/css-fr.html.markdown +++ b/fr-fr/css-fr.html.markdown @@ -8,7 +8,7 @@ translators: lang: fr-fr --- -Au début du web, il n'y avait pas d'élements visuels, simplement du texte pure. Mais avec le dévelopement des navigateurs, +Au début du web, il n'y avait pas d'élements visuels, simplement du texte pur. Mais avec le dévelopement des navigateurs, des pages avec du contenu visuel sont arrivées. CSS est le langage standard qui existe et permet de garder une séparation entre le contenu (HTML) et le style d'une page web. @@ -16,8 +16,8 @@ le contenu (HTML) et le style d'une page web. En résumé, CSS fournit une syntaxe qui vous permet de cibler des élements présents sur une page HTML afin de leur donner des propriétés visuelles différentes. -Comme tous les autres langages, CSS a plusieurs versions. Ici, nous allons parlons de CSS2.0 -qui n'est pas le plus récent, mais qui reste le plus utilisé et le plus compatible avec les différents navigateur. +Comme tous les autres langages, CSS a plusieurs versions. Ici, nous allons parler de CSS2.0 +qui n'est pas le plus récent, mais qui reste le plus utilisé et le plus compatible avec les différents navigateurs. **NOTE :** Vous pouvez tester les effets visuels que vous ajoutez au fur et à mesure du tutoriel sur des sites comme [dabblet](http://dabblet.com/) afin de voir les résultats, comprendre, et vous familiariser avec le langage. Cet article porte principalement sur la syntaxe et quelques astuces. @@ -33,7 +33,7 @@ Cet article porte principalement sur la syntaxe et quelques astuces. /* Généralement, la première déclaration en CSS est très simple */ selecteur { propriete: valeur; /* autres proprietés...*/ } -/* Le sélécteur sert à cibler un élément du HTML +/* Le sélecteur sert à cibler un élément du HTML Vous pouvez cibler tous les éléments d'une page! */ * { color:red; } @@ -81,7 +81,7 @@ div.une-classe[attr$='eu'] { } /* Un élément qui est en enfant direct */ div.un-parent > .enfant {} -/* Cela cible aussi les .enfants plus profonds dans la structure HTML */ +/* dans la structure HTML */ div.un-parent .enfants {} /* Attention : le même sélecteur sans espace a un autre sens. */ From fe4ed9080dc258e35a9fffd3a52d097eb457c745 Mon Sep 17 00:00:00 2001 From: Gnomino Date: Sun, 18 Oct 2015 18:39:21 +0200 Subject: [PATCH 407/685] Brings text back --- fr-fr/css-fr.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fr-fr/css-fr.html.markdown b/fr-fr/css-fr.html.markdown index a3a5cf55..35673c47 100644 --- a/fr-fr/css-fr.html.markdown +++ b/fr-fr/css-fr.html.markdown @@ -81,7 +81,7 @@ div.une-classe[attr$='eu'] { } /* Un élément qui est en enfant direct */ div.un-parent > .enfant {} -/* dans la structure HTML */ +/* Cela cible aussi les .enfants plus profonds dans la structure HTML */ div.un-parent .enfants {} /* Attention : le même sélecteur sans espace a un autre sens. */ From 603d72e9eaca53aeb3610eceecb9af7d0aa84e0d Mon Sep 17 00:00:00 2001 From: Claudson Martins Date: Sun, 18 Oct 2015 13:41:14 -0300 Subject: [PATCH 408/685] Matlab portuguese translation The markdown is completely translated --- pt-br/matlab.html.markdown | 498 +++++++++++++++++++------------------ 1 file changed, 251 insertions(+), 247 deletions(-) diff --git a/pt-br/matlab.html.markdown b/pt-br/matlab.html.markdown index 7c0760d1..4e822a60 100644 --- a/pt-br/matlab.html.markdown +++ b/pt-br/matlab.html.markdown @@ -26,11 +26,11 @@ com algo assim %} -% comandos podem ocupar várinhas linhas, usando '...': +% Comandos podem ocupar várinhas linhas, usando '...': a = 1 + 2 + ... + 4 -% comandos podem ser passados para o sistema operacional +% Comandos podem ser passados para o sistema operacional !ping google.com who % Exibe todas as variáveis na memória @@ -46,7 +46,7 @@ ctrl-c % Aborta a computação atual edit('minhafuncao.m') % Abre a função/script no editor type('minhafuncao.m') % Imprime o código-fonte da função/script na janela de comando -profile on % Ativa o perfil de código +profile on % Ativa o perfil de código profile off % Desativa o perfil de código profile viewer % Visualiza os resultados na janela de Profiler @@ -77,97 +77,98 @@ c = exp(a)*sin(pi/2) % c = 7.3891 load('arquivo.mat', 'y') % Argumentos entre parênteses, separados por vírgula % Sintaxe de comando: load arquivo.mat y % Sem parênteses, e espaços ao invés de vírgulas -% Observe a falta de aspas no formulário de comando: entradas são sempre -% passadas como texto literal - não pode passar valores de variáveis. +% Observe a falta de aspas na forma de comando: entradas são sempre passadas +% como texto literal - não pode passar valores de variáveis. % Além disso, não pode receber saída: -[V,D] = eig(A); % this has no equivalent in command form -[~,D] = eig(A); % if you only want D and not V +[V,D] = eig(A); % Isto não tem um equivalente na forma de comando +[~,D] = eig(A); % Se você só deseja D e não V -% Logicals -1 > 5 % ans = 0 -10 >= 10 % ans = 1 -3 ~= 4 % Not equal to -> ans = 1 -3 == 3 % equal to -> ans = 1 -3 > 1 && 4 > 1 % AND -> ans = 1 -3 > 1 || 4 > 1 % OR -> ans = 1 -~1 % NOT -> ans = 0 +% Operadores Lógicos e Relacionais +1 > 5 % Resposta = 0 +10 >= 10 % Resposta = 1 +3 ~= 4 % Diferente de -> Resposta = 1 +3 == 3 % Igual a -> Resposta = 1 +3 > 1 && 4 > 1 % E -> Resposta = 1 +3 > 1 || 4 > 1 % OU -> Resposta = 1 +~1 % NOT -> Resposta = 0 -% Logicals can be applied to matrices: +% Operadores Lógicos e Relacionais podem ser aplicados a matrizes A > 5 -% for each element, if condition is true, that element is 1 in returned matrix +% Para cada elemento, caso seja verdade, esse elemento será 1 na matriz retornada A( A > 5 ) -% returns a vector containing the elements in A for which condition is true +% Retorna um vetor com os elementos de A para os quais a condição é verdadeira -% Strings -a = 'MyString' -length(a) % ans = 8 -a(2) % ans = y -[a,a] % ans = MyStringMyString +% Cadeias de caracteres (Strings) +a = 'MinhaString' +length(a) % Resposta = 11 +a(2) % Resposta = i +[a,a] % Resposta = MinhaStringMinhaString -% Cells -a = {'one', 'two', 'three'} -a(1) % ans = 'one' - returns a cell -char(a(1)) % ans = one - returns a string +% Vetores de células +a = {'um', 'dois', 'três'} +a(1) % Resposta = 'um' - retorna uma célula +char(a(1)) % Resposta = um - retorna uma string -% Structures -A.b = {'one','two'}; +% Estruturas +A.b = {'um','dois'}; A.c = [1 2]; A.d.e = false; -% Vectors +% Vetores x = [4 32 53 7 1] -x(2) % ans = 32, indices in Matlab start 1, not 0 -x(2:3) % ans = 32 53 -x(2:end) % ans = 32 53 7 1 +x(2) % Resposta = 32, índices no Matlab começam por 1, não 0 +x(2:3) % Resposta = 32 53 +x(2:end) % Resposta = 32 53 7 1 -x = [4; 32; 53; 7; 1] % Column vector +x = [4; 32; 53; 7; 1] % Vetor coluna x = [1:10] % x = 1 2 3 4 5 6 7 8 9 10 -% Matrices +% Matrizes A = [1 2 3; 4 5 6; 7 8 9] -% Rows are separated by a semicolon; elements are separated with space or comma +% Linhas são separadas por um ponto e vírgula; +% Elementos são separados com espaço ou vírgula % A = % 1 2 3 % 4 5 6 % 7 8 9 -A(2,3) % ans = 6, A(row, column) -A(6) % ans = 8 -% (implicitly concatenates columns into vector, then indexes into that) +A(2,3) % Resposta = 6, A(linha, coluna) +A(6) % Resposta = 8 +% (implicitamente encadeia as colunas do vetor, e então as indexa) -A(2,3) = 42 % Update row 2 col 3 with 42 +A(2,3) = 42 % Atualiza a linha 2 coluna 3 com o valor 42 % A = % 1 2 3 % 4 5 42 % 7 8 9 -A(2:3,2:3) % Creates a new matrix from the old one -%ans = +A(2:3,2:3) % Cria uma nova matriz a partir da antiga +%Resposta = % 5 42 % 8 9 -A(:,1) % All rows in column 1 -%ans = +A(:,1) % Todas as linhas na coluna 1 +%Resposta = % 1 % 4 % 7 -A(1,:) % All columns in row 1 -%ans = +A(1,:) % Todas as colunas na linha 1 +%Resposta = % 1 2 3 -[A ; A] % Concatenation of matrices (vertically) -%ans = +[A ; A] % Concatenação de matrizes (verticalmente) +%Resposta = % 1 2 3 % 4 5 42 @@ -176,195 +177,197 @@ A(1,:) % All columns in row 1 % 4 5 42 % 7 8 9 -% this is the same as +% Isto é o mesmo de vertcat(A,A); -[A , A] % Concatenation of matrices (horizontally) +[A , A] % Concatenação de matrizes (horizontalmente) -%ans = +%Resposta = % 1 2 3 1 2 3 % 4 5 42 4 5 42 % 7 8 9 7 8 9 -% this is the same as +% Isto é o mesmo de horzcat(A,A); -A(:, [3 1 2]) % Rearrange the columns of original matrix -%ans = +A(:, [3 1 2]) % Reorganiza as colunas da matriz original +%Resposta = % 3 1 2 % 42 4 5 % 9 7 8 -size(A) % ans = 3 3 +size(A) % Resposta = 3 3 -A(1, :) =[] % Delete the first row of the matrix -A(:, 1) =[] % Delete the first column of the matrix +A(1, :) =[] % Remove a primeira linha da matriz +A(:, 1) =[] % Remove a primeira coluna da matriz -transpose(A) % Transpose the matrix, which is the same as: +transpose(A) % Transposta a matriz, que é o mesmo de: A one -ctranspose(A) % Hermitian transpose the matrix -% (the transpose, followed by taking complex conjugate of each element) +ctranspose(A) % Transposta a matriz +% (a transposta, seguida pelo conjugado complexo de cada elemento) -% Element by Element Arithmetic vs. Matrix Arithmetic -% On their own, the arithmetic operators act on whole matrices. When preceded -% by a period, they act on each element instead. For example: -A * B % Matrix multiplication -A .* B % Multiple each element in A by its corresponding element in B +% Aritmética Elemento por Elemento vs. Aritmética com Matriz +% Naturalmente, os operadores aritméticos agem em matrizes inteiras. Quando +% precedidos por um ponto, eles atuam em cada elemento. Por exemplo: +A * B % Multiplicação de matrizes +A .* B % Multiplica cada elemento em A por seu correspondente em B -% There are several pairs of functions, where one acts on each element, and -% the other (whose name ends in m) acts on the whole matrix. -exp(A) % exponentiate each element -expm(A) % calculate the matrix exponential -sqrt(A) % take the square root of each element -sqrtm(A) % find the matrix whose square is A +% Existem vários pares de funções nas quais uma atua sob cada elemento, e a +% outra (cujo nome termina com m) age na matriz por completo. +exp(A) % Exponencia cada elemento +expm(A) % Calcula o exponencial da matriz +sqrt(A) % Tira a raiz quadrada de cada elemento +sqrtm(A) % Procura a matriz cujo quadrado é A -% Plotting -x = 0:.10:2*pi; % Creates a vector that starts at 0 and ends at 2*pi with increments of .1 +% Gráficos +x = 0:.10:2*pi; % Vetor que começa em 0 e termina em 2*pi com incrementos de 0,1 y = sin(x); plot(x,y) -xlabel('x axis') -ylabel('y axis') -title('Plot of y = sin(x)') -axis([0 2*pi -1 1]) % x range from 0 to 2*pi, y range from -1 to 1 +xlabel('eixo x') +ylabel('eixo y') +title('Gráfico de y = sin(x)') +axis([0 2*pi -1 1]) % x vai de 0 a 2*pi, y vai de -1 a 1 -plot(x,y1,'-',x,y2,'--',x,y3,':') % For multiple functions on one plot -legend('Line 1 label', 'Line 2 label') % Label curves with a legend +plot(x,y1,'-',x,y2,'--',x,y3,':') % Para várias funções em um só gráfico +legend('Descrição linha 1', 'Descrição linha 2') % Curvas com uma legenda -% Alternative method to plot multiple functions in one plot. -% while 'hold' is on, commands add to existing graph rather than replacing it +% Método alternativo para traçar várias funções em um só gráfico: +% Enquanto 'hold' estiver ativo, os comandos serão adicionados ao gráfico +% existente ao invés de o substituirem. plot(x, y) hold on plot(x, z) hold off -loglog(x, y) % A log-log plot -semilogx(x, y) % A plot with logarithmic x-axis -semilogy(x, y) % A plot with logarithmic y-axis +loglog(x, y) % Plotar em escala loglog +semilogx(x, y) % Um gráfico com eixo x logarítmico +semilogy(x, y) % Um gráfico com eixo y logarítmico -fplot (@(x) x^2, [2,5]) % plot the function x^2 from x=2 to x=5 +fplot (@(x) x^2, [2,5]) % Plotar a função x^2 para x=2 até x=5 -grid on % Show grid; turn off with 'grid off' -axis square % Makes the current axes region square -axis equal % Set aspect ratio so data units are the same in every direction +grid on % Exibe as linhas de grade; Oculta com 'grid off' +axis square % Torna quadrada a região dos eixos atuais +axis equal % Taxa de proporção onde as unidades serão as mesmas em todas direções -scatter(x, y); % Scatter-plot -hist(x); % Histogram +scatter(x, y); % Gráfico de dispersão ou bolha +hist(x); % Histograma z = sin(x); -plot3(x,y,z); % 3D line plot +plot3(x,y,z); % Plotar em espaço em 3D -pcolor(A) % Heat-map of matrix: plot as grid of rectangles, coloured by value -contour(A) % Contour plot of matrix -mesh(A) % Plot as a mesh surface +pcolor(A) % Mapa de calor da matriz: traça uma grade de retângulos, coloridos pelo valor +contour(A) % Plotar de contorno da matriz +mesh(A) % Plotar malha 3D -h = figure % Create new figure object, with handle f -figure(h) % Makes the figure corresponding to handle h the current figure -close(h) % close figure with handle h -close all % close all open figure windows -close % close current figure window +h = figure % Cria uma nova figura objeto, com identificador h +figure(h) % Cria uma nova janela de figura com h +close(h) % Fecha a figura h +close all % Fecha todas as janelas de figuras abertas +close % Fecha a janela de figura atual -shg % bring an existing graphics window forward, or create new one if needed -clf clear % clear current figure window, and reset most figure properties +shg % Traz uma janela gráfica existente para frente, ou cria uma nova se necessário +clf clear % Limpa a janela de figura atual e redefine a maioria das propriedades da figura -% Properties can be set and changed through a figure handle. -% You can save a handle to a figure when you create it. -% The function gcf returns a handle to the current figure -h = plot(x, y); % you can save a handle to a figure when you create it +% Propriedades podem ser definidas e alteradas através de um identificador. +% Você pode salvar um identificador para uma figura ao criá-la. +% A função gcf retorna o identificador da figura atual +h = plot(x, y); % Você pode salvar um identificador para a figura ao criá-la set(h, 'Color', 'r') -% 'y' yellow; 'm' magenta, 'c' cyan, 'r' red, 'g' green, 'b' blue, 'w' white, 'k' black +% 'y' amarelo; 'm' magenta, 'c' ciano, 'r' vermelho, 'g' verde, 'b' azul, 'w' branco, 'k' preto set(h, 'LineStyle', '--') - % '--' is solid line, '---' dashed, ':' dotted, '-.' dash-dot, 'none' is no line + % '--' linha sólida, '---' tracejada, ':' pontilhada, '-.' traço-ponto, 'none' sem linha get(h, 'LineStyle') -% The function gca returns a handle to the axes for the current figure -set(gca, 'XDir', 'reverse'); % reverse the direction of the x-axis +% A função gca retorna o identificador para os eixos da figura atual +set(gca, 'XDir', 'reverse'); % Inverte a direção do eixo x -% To create a figure that contains several axes in tiled positions, use subplot -subplot(2,3,1); % select the first position in a 2-by-3 grid of subplots -plot(x1); title('First Plot') % plot something in this position -subplot(2,3,2); % select second position in the grid -plot(x2); title('Second Plot') % plot something there +% Para criar uma figura que contém vários gráficos use subplot, o qual divide +% a janela de gráficos em m linhas e n colunas. +subplot(2,3,1); % Seleciona a primeira posição em uma grade de 2-por-3 +plot(x1); title('Primeiro Plot') % Plota algo nesta posição +subplot(2,3,2); % Seleciona a segunda posição na grade +plot(x2); title('Segundo Plot') % Plota algo ali -% To use functions or scripts, they must be on your path or current directory -path % display current path -addpath /path/to/dir % add to path -rmpath /path/to/dir % remove from path -cd /path/to/move/into % change directory +% Para usar funções ou scripts, eles devem estar no caminho ou na pasta atual +path % Exibe o caminho atual +addpath /caminho/para/pasta % Adiciona o diretório ao caminho +rmpath /caminho/para/pasta % Remove o diretório do caminho +cd /caminho/para/mudar % Muda o diretório -% Variables can be saved to .mat files -save('myFileName.mat') % Save the variables in your Workspace -load('myFileName.mat') % Load saved variables into Workspace +% Variáveis podem ser salvas em arquivos *.mat +save('meuArquivo.mat') % Salva as variáveis do seu Workspace +load('meuArquivo.mat') % Carrega as variáveis em seu Workspace -% M-file Scripts -% A script file is an external file that contains a sequence of statements. -% They let you avoid repeatedly typing the same code in the Command Window -% Have .m extensions +% Arquivos M (M-files) +% Um arquivo de script é um arquivo externo contendo uma sequência de instruções. +% Eles evitam que você digite os mesmos códigos repetidamente na janela de comandos. +% Possuem a extensão *.m -% M-file Functions -% Like scripts, and have the same .m extension -% But can accept input arguments and return an output -% Also, they have their own workspace (ie. different variable scope). -% Function name should match file name (so save this example as double_input.m). -% 'help double_input.m' returns the comments under line beginning function -function output = double_input(x) - %double_input(x) returns twice the value of x +% Arquivos M de Funções (M-file Functions) +% Assim como scripts e têm a mesma extensão *.m +% Mas podem aceitar argumentos de entrada e retornar uma saída. +% Além disso, possuem seu próprio workspace (ex. diferente escopo de variáveis). +% O nome da função deve coincidir com o nome do arquivo (salve o exemplo como dobra_entrada.m) +% 'help dobra_entrada.m' retorna os comentários abaixo da linha de início da função +function output = dobra_entrada(x) + %dobra_entrada(x) retorna duas vezes o valor de x output = 2*x; end -double_input(6) % ans = 12 +dobra_entrada(6) % Resposta = 12 -% You can also have subfunctions and nested functions. -% Subfunctions are in the same file as the primary function, and can only be -% called by functions in the file. Nested functions are defined within another -% functions, and have access to both its workspace and their own workspace. +% Você também pode ter subfunções e funções aninhadas. +% Subfunções estão no mesmo arquivo da função primária, e só podem ser chamados +% por funções dentro do arquivo. Funções aninhadas são definidas dentro de +% outras funções, e têm acesso a ambos workspaces. -% If you want to create a function without creating a new file you can use an -% anonymous function. Useful when quickly defining a function to pass to -% another function (eg. plot with fplot, evaluate an indefinite integral -% with quad, find roots with fzero, or find minimum with fminsearch). -% Example that returns the square of it's input, assigned to to the handle sqr: +% Se você quer criar uma função sem criar um novo arquivo, você pode usar uma +% função anônima. Úteis para definir rapidamente uma função para passar a outra +% função (ex. plotar com fplot, avaliar uma integral indefinida com quad, +% procurar raízes com fzero, ou procurar mínimo com fminsearch). +% Exemplo que retorna o quadrado de sua entrada, atribuído ao identificador sqr: sqr = @(x) x.^2; -sqr(10) % ans = 100 -doc function_handle % find out more +sqr(10) % Resposta = 100 +doc function_handle % Saiba mais -% User input -a = input('Enter the value: ') +% Entrada do usuário +a = input('Digite o valor: ') -% Stops execution of file and gives control to the keyboard: user can examine -% or change variables. Type 'return' to continue execution, or 'dbquit' to exit +% Para a execução do arquivo e passa o controle para o teclado: o usuário pode +% examinar ou alterar variáveis. Digite 'return' para continuar a execução, ou 'dbquit' para sair keyboard -% Reading in data (also xlsread/importdata/imread for excel/CSV/image files) -fopen(filename) +% Leitura de dados (ou xlsread/importdata/imread para arquivos excel/CSV/imagem) +fopen(nomedoarquivo) -% Output -disp(a) % Print out the value of variable a -disp('Hello World') % Print out a string -fprintf % Print to Command Window with more control +% Saída +disp(a) % Imprime o valor da variável a +disp('Olá Mundo') % Imprime a string +fprintf % Imprime na janela de comandos com mais controle -% Conditional statements (the parentheses are optional, but good style) +% Estruturas Condicionais (os parênteses são opicionais, porém uma boa prática) if (a > 15) - disp('Greater than 15') + disp('Maior que 15') elseif (a == 23) - disp('a is 23') + disp('a é 23') else - disp('neither condition met') + disp('Nenhuma condição reconheceu') end -% Looping -% NB. looping over elements of a vector/matrix is slow! -% Where possible, use functions that act on whole vector/matrix at once +% Estruturas de Repetição +% Nota: fazer o loop sobre elementos de um vetor/matriz é lento! +% Sempre que possível, use funções que atuem em todo o vetor/matriz de uma só vez. for k = 1:5 disp(k) end @@ -374,25 +377,26 @@ while (k < 5) k = k + 1; end -% Timing code execution: 'toc' prints the time since 'tic' was called +% Tempo de Execução de Código (Timing Code Execution): 'toc' imprime o tempo +% passado desde que 'tic' foi chamado. tic A = rand(1000); A*A*A*A*A*A*A; toc -% Connecting to a MySQL Database -dbname = 'database_name'; +% Conectando a uma base de dados MySQL +dbname = 'nome_base_de_dados'; username = 'root'; password = 'root'; driver = 'com.mysql.jdbc.Driver'; dburl = ['jdbc:mysql://localhost:8889/' dbname]; -javaclasspath('mysql-connector-java-5.1.xx-bin.jar'); %xx depends on version, download available at http://dev.mysql.com/downloads/connector/j/ +javaclasspath('mysql-connector-java-5.1.xx-bin.jar'); %xx depende da versão, download disponível em http://dev.mysql.com/downloads/connector/j/ conn = database(dbname, username, password, driver, dburl); -sql = ['SELECT * from table_name where id = 22'] % Example sql statement +sql = ['SELECT * FROM nome_tabela WHERE id = 22'] % Exemplo de uma consulta SQL a = fetch(conn, sql) %a will contain your data -% Common math functions +% Funções Matemáticas Comuns sin(x) cos(x) tan(x) @@ -410,122 +414,122 @@ ceil(x) floor(x) round(x) rem(x) -rand % Uniformly distributed pseudorandom numbers -randi % Uniformly distributed pseudorandom integers -randn % Normally distributed pseudorandom numbers +rand % Números pseudo-aleatórios uniformemente distribuídos +randi % Inteiros pseudo-aleatórios uniformemente distribuídos +randn % Números pseudo-aleatórios normalmente distribuídos -% Common constants +% Constantes Comuns pi NaN inf -% Solving matrix equations (if no solution, returns a least squares solution) -% The \ and / operators are equivalent to the functions mldivide and mrdivide -x=A\b % Solves Ax=b. Faster and more numerically accurate than using inv(A)*b. -x=b/A % Solves xA=b +% Resolvendo equações matriciais (se não houver solução, retorna uma solução de mínimos quadrados) +% Os operadores \ e / são equivalentes às funções mldivide e mrdivide +x=A\b % Resolve Ax=b. Mais rápido e numericamente mais preciso do que inv(A)*b. +x=b/A % Resolve xA=b -inv(A) % calculate the inverse matrix -pinv(A) % calculate the pseudo-inverse +inv(A) % Calcula a matriz inversa +pinv(A) % Calcula a pseudo-inversa -% Common matrix functions -zeros(m,n) % m x n matrix of 0's -ones(m,n) % m x n matrix of 1's -diag(A) % Extracts the diagonal elements of a matrix A -diag(x) % Construct a matrix with diagonal elements listed in x, and zeroes elsewhere -eye(m,n) % Identity matrix -linspace(x1, x2, n) % Return n equally spaced points, with min x1 and max x2 -inv(A) % Inverse of matrix A -det(A) % Determinant of A -eig(A) % Eigenvalues and eigenvectors of A -trace(A) % Trace of matrix - equivalent to sum(diag(A)) -isempty(A) % Tests if array is empty -all(A) % Tests if all elements are nonzero or true -any(A) % Tests if any elements are nonzero or true -isequal(A, B) % Tests equality of two arrays -numel(A) % Number of elements in matrix -triu(x) % Returns the upper triangular part of x -tril(x) % Returns the lower triangular part of x -cross(A,B) % Returns the cross product of the vectors A and B -dot(A,B) % Returns scalar product of two vectors (must have the same length) -transpose(A) % Returns the transpose of A -fliplr(A) % Flip matrix left to right -flipud(A) % Flip matrix up to down +% Funções Matriciais Comuns +zeros(m,n) % Matriz de zeros m x n +ones(m,n) % Matriz de 1's m x n +diag(A) % Extrai os elementos diagonais da matriz A +diag(x) % Constrói uma matriz com os elementos diagonais listados em x, e zero nas outras posições +eye(m,n) % Matriz identidade +linspace(x1, x2, n) % Retorna n pontos igualmente espaçados, com min x1 e max x2 +inv(A) % Inverso da matriz A +det(A) % Determinante da matriz A +eig(A) % Valores e vetores próprios de A +trace(A) % Traço da matriz - equivalente a sum(diag(A)) +isempty(A) % Testa se a matriz está vazia +all(A) % Testa se todos os elementos são diferentes de zero ou verdadeiro +any(A) % Testa se algum elemento é diferente de zero ou verdadeiro +isequal(A, B) % Testa a igualdade de duas matrizes +numel(A) % Número de elementos na matriz +triu(x) % Retorna a parte triangular superior de x +tril(x) % Retorna a parte triangular inferior de x +cross(A,B) % Retorna o produto cruzado das matrizes A e B +dot(A,B) % Retorna o produto escalar de duas matrizes (devem possuir mesmo tamanho) +transpose(A) % Retorna a matriz transposta de A +fliplr(A) % Inverte a matriz da esquerda para a direita +flipud(A) % Inverte a matriz de cima para baixo -% Matrix Factorisations -[L, U, P] = lu(A) % LU decomposition: PA = LU,L is lower triangular, U is upper triangular, P is permutation matrix -[P, D] = eig(A) % eigen-decomposition: AP = PD, P's columns are eigenvectors and D's diagonals are eigenvalues -[U,S,V] = svd(X) % SVD: XV = US, U and V are unitary matrices, S has non-negative diagonal elements in decreasing order +% Fatorações de Matrizes +[L, U, P] = lu(A) % Decomposição LU: PA = LU,L é triangular inferior, U é triangular superior, P é a matriz de permutação +[P, D] = eig(A) % Decomposição em Autovalores: AP = PD, colunas de P são autovetores e as diagonais de D são autovalores +[U,S,V] = svd(X) % SVD: XV = US, U e V são matrizes unitárias, S possui elementos não negativos na diagonal em ordem decrescente -% Common vector functions -max % largest component -min % smallest component -length % length of a vector -sort % sort in ascending order -sum % sum of elements -prod % product of elements -mode % modal value -median % median value -mean % mean value -std % standard deviation -perms(x) % list all permutations of elements of x +% Funções Vetoriais Comuns +max % Maior componente +min % Menor componente +length % Tamanho do vetor +sort % Ordena em orcer ascendente +sum % Soma de elementos +prod % Produto de elementos +mode % Valor modal +median % Valor mediano +mean % Valor médio +std % Desvio padrão +perms(x) % Lista todas as permutações de elementos de x % Classes -% Matlab can support object-oriented programming. -% Classes must be put in a file of the class name with a .m extension. -% To begin, we create a simple class to store GPS waypoints. -% Begin WaypointClass.m -classdef WaypointClass % The class name. - properties % The properties of the class behave like Structures +% Matlab pode suportar programação orientada a objetos. +% Classes devem ser colocadas em um arquivo de mesmo nome com a extensão *.m +% Para começar, criamos uma simples classe que armazena posições de GPS +% Início ClassePosicoesGPS.m +classdef ClassePosicoesGPS % O nome da classe. + properties % As propriedades da classe comportam-se como estruturas latitude longitude end methods - % This method that has the same name of the class is the constructor. - function obj = WaypointClass(lat, lon) + % Este método que tem o mesmo nome da classe é o construtor. + function obj = ClassePosicoesGPS(lat, lon) obj.latitude = lat; obj.longitude = lon; end - % Other functions that use the Waypoint object - function r = multiplyLatBy(obj, n) + % Outras funções que usam os objetos de PosicoesGPS + function r = multiplicarLatPor(obj, n) r = n*[obj.latitude]; end - % If we want to add two Waypoint objects together without calling - % a special function we can overload Matlab's arithmetic like so: + % Se quisermos somar dois objetos de PosicoesGPS juntos sem chamar + % uma função especial nós podemos sobrepor a aritmética do Matlab, desta maneira: function r = plus(o1,o2) - r = WaypointClass([o1.latitude] +[o2.latitude], ... + r = ClassePosicoesGPS([o1.latitude] +[o2.latitude], ... [o1.longitude]+[o2.longitude]); end end end -% End WaypointClass.m +% End ClassePosicoesGPS.m -% We can create an object of the class using the constructor -a = WaypointClass(45.0, 45.0) +% Podemos criar um objeto da classe usando o construtor +a = ClassePosicoesGPS(45.0, 45.0) -% Class properties behave exactly like Matlab Structures. +% Propriedades da classe se comportam exatamente como estruturas Matlab a.latitude = 70.0 a.longitude = 25.0 -% Methods can be called in the same way as functions -ans = multiplyLatBy(a,3) +% Métodos podem ser chamados da mesma forma que funções +ans = multiplicarLatPor(a,3) -% The method can also be called using dot notation. In this case, the object -% does not need to be passed to the method. -ans = a.multiplyLatBy(a,1/3) +% O método também pode ser chamado usando a notação de ponto. Neste caso, +% o objeto não precisa ser passado para o método. +ans = a.multiplicarLatPor(a,1/3) -% Matlab functions can be overloaded to handle objects. -% In the method above, we have overloaded how Matlab handles -% the addition of two Waypoint objects. -b = WaypointClass(15.0, 32.0) +% Funções do Matlab podem ser sobrepostas para lidar com objetos. +% No método abaixo, nós sobrepomos a forma como o Matlab lida com a soma de +% dois objetos PosicoesGPS. +b = ClassePosicoesGPS(15.0, 32.0) c = a + b ``` -## More on Matlab +## Mais sobre Matlab -* The official website [http://http://www.mathworks.com/products/matlab/](http://www.mathworks.com/products/matlab/) -* The official MATLAB Answers forum: [http://www.mathworks.com/matlabcentral/answers/](http://www.mathworks.com/matlabcentral/answers/) +* O site oficial [http://http://www.mathworks.com/products/matlab/](http://www.mathworks.com/products/matlab/) +* O fórum oficial de respostas: [http://www.mathworks.com/matlabcentral/answers/](http://www.mathworks.com/matlabcentral/answers/) From a98f1d041b5d492490d8b14c71b5a33fb4bad00e Mon Sep 17 00:00:00 2001 From: Claudson Martins Date: Sun, 18 Oct 2015 13:46:27 -0300 Subject: [PATCH 409/685] Fixing some linebreaks Some lines were broken to be better presented --- pt-br/matlab.html.markdown | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pt-br/matlab.html.markdown b/pt-br/matlab.html.markdown index 4e822a60..ea320d07 100644 --- a/pt-br/matlab.html.markdown +++ b/pt-br/matlab.html.markdown @@ -390,7 +390,8 @@ username = 'root'; password = 'root'; driver = 'com.mysql.jdbc.Driver'; dburl = ['jdbc:mysql://localhost:8889/' dbname]; -javaclasspath('mysql-connector-java-5.1.xx-bin.jar'); %xx depende da versão, download disponível em http://dev.mysql.com/downloads/connector/j/ +%Abaixo, o xx depende da versão, download disponível em http://dev.mysql.com/downloads/connector/j/ +javaclasspath('mysql-connector-java-5.1.xx-bin.jar'); conn = database(dbname, username, password, driver, dburl); sql = ['SELECT * FROM nome_tabela WHERE id = 22'] % Exemplo de uma consulta SQL a = fetch(conn, sql) %a will contain your data @@ -456,9 +457,12 @@ fliplr(A) % Inverte a matriz da esquerda para a direita flipud(A) % Inverte a matriz de cima para baixo % Fatorações de Matrizes -[L, U, P] = lu(A) % Decomposição LU: PA = LU,L é triangular inferior, U é triangular superior, P é a matriz de permutação -[P, D] = eig(A) % Decomposição em Autovalores: AP = PD, colunas de P são autovetores e as diagonais de D são autovalores -[U,S,V] = svd(X) % SVD: XV = US, U e V são matrizes unitárias, S possui elementos não negativos na diagonal em ordem decrescente +% Decomposição LU: PA = LU,L é triangular inferior, U é triangular superior, P é a matriz de permutação +[L, U, P] = lu(A) +% Decomposição em Autovalores: AP = PD, colunas de P são autovetores e as diagonais de D são autovalores +[P, D] = eig(A) +% SVD: XV = US, U e V são matrizes unitárias, S possui elementos não negativos na diagonal em ordem decrescente +[U,S,V] = svd(X) % Funções Vetoriais Comuns max % Maior componente From ada99b909743220fd7df2f379dbdb4859e4e5c2a Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Sun, 18 Oct 2015 11:56:16 -0500 Subject: [PATCH 410/685] Update ColdFusion header --- coldfusion.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coldfusion.html.markdown b/coldfusion.html.markdown index e2f0737d..70804a1e 100644 --- a/coldfusion.html.markdown +++ b/coldfusion.html.markdown @@ -1,14 +1,14 @@ --- -language: ColdFusion +language: coldfusion +filename: learncoldfusion.cfm contributors: - ["Wayne Boka", "http://wboka.github.io"] -filename: LearnColdFusion.cfm --- ColdFusion is a scripting language for web development. [Read more here.](http://www.adobe.com/products/coldfusion-family.html) -```ColdFusion +```html HTML tags have been provided for output readability From 9ee5d3739fac053c2c156e071162638392149e1d Mon Sep 17 00:00:00 2001 From: Claudson Martins Date: Sun, 18 Oct 2015 14:12:16 -0300 Subject: [PATCH 411/685] Rename matlab.html.markdown to matlab-pt.html.markdown --- pt-br/{matlab.html.markdown => matlab-pt.html.markdown} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename pt-br/{matlab.html.markdown => matlab-pt.html.markdown} (100%) diff --git a/pt-br/matlab.html.markdown b/pt-br/matlab-pt.html.markdown similarity index 100% rename from pt-br/matlab.html.markdown rename to pt-br/matlab-pt.html.markdown From 3a968a826b621c0e484268532d6b96a7b2865c8a Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Sun, 18 Oct 2015 12:22:33 -0500 Subject: [PATCH 412/685] Fix issue with calling block code. Fixes https://github.com/adambard/learnxinyminutes-docs/issues/1598 --- objective-c.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/objective-c.html.markdown b/objective-c.html.markdown index 30bb8843..f130ea0c 100644 --- a/objective-c.html.markdown +++ b/objective-c.html.markdown @@ -688,7 +688,7 @@ addUp = ^(int n) { // Remove (int n) to have a block that doesn't take in any pa mutableVar = 32; // Assigning new value to __block variable. return n + outsideVar; // Return statements are optional. } -int addUp = add(10 + 16); // Calls block code with arguments. +int addUp = addUp(10 + 16); // Calls block code with arguments. // Blocks are often used as arguments to functions to be called later, or for callbacks. @implementation BlockExample : NSObject From 05f7cd1a2420d5659ef89d1c5ab185600c6c153a Mon Sep 17 00:00:00 2001 From: Claudson Martins Date: Sun, 18 Oct 2015 16:37:24 -0300 Subject: [PATCH 413/685] Adding filename markdown --- pt-br/matlab-pt.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/pt-br/matlab-pt.html.markdown b/pt-br/matlab-pt.html.markdown index ea320d07..eb660d4c 100644 --- a/pt-br/matlab-pt.html.markdown +++ b/pt-br/matlab-pt.html.markdown @@ -7,6 +7,7 @@ contributors: translators: - ["Claudson Martins", "https://github.com/claudsonm"] lang: pt-br +filename: learnmatlab-pt.mat --- From ed4ac31d97b36866a48faf3b9328c320ba55074f Mon Sep 17 00:00:00 2001 From: Sawyer Charles Date: Sun, 18 Oct 2015 17:46:23 -0500 Subject: [PATCH 414/685] Added variable amount of parameters as of php 5.6+ --- php.html.markdown | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/php.html.markdown b/php.html.markdown index 5bc2ddce..e7b57b4b 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -445,6 +445,16 @@ function parameters() { parameters('Hello', 'World'); // Hello | 0 - Hello | 1 - World | +// Since PHP 5.6 you can get a variable number of arguments +function variable($word, ...$list) { + echo $word . " || "; + foreach ($list as $item) { + echo $item . ' | '; + } +} + +variable("Separate", "Hello", "World") // Separate || Hello | world | + /******************************** * Includes */ From b4c8ff365ee1d633470ced72de5f540744fa921a Mon Sep 17 00:00:00 2001 From: Sawyer Charles Date: Sun, 18 Oct 2015 17:47:42 -0500 Subject: [PATCH 415/685] capital letter --- php.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php.html.markdown b/php.html.markdown index e7b57b4b..71f23871 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -453,7 +453,7 @@ function variable($word, ...$list) { } } -variable("Separate", "Hello", "World") // Separate || Hello | world | +variable("Separate", "Hello", "World") // Separate || Hello | World | /******************************** * Includes From 087dbecb2f25c2d372ed4e007f7641cbc87c0571 Mon Sep 17 00:00:00 2001 From: Tom Duff Date: Sun, 18 Oct 2015 20:21:42 -0400 Subject: [PATCH 416/685] Add more examples and explanations Added some clarifying examples to sections on echo(), constants, and cleaned up formatting on others. Added further explanation about the spaceship operator. --- php.html.markdown | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/php.html.markdown b/php.html.markdown index 5bc2ddce..127e601b 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -104,7 +104,8 @@ END; echo 'This string ' . 'is concatenated'; // Strings can be passed in as parameters to echo -echo 'Multiple', 'Parameters', 'Valid'; +echo 'Multiple', 'Parameters', 'Valid'; // Returns 'MultipleParametersValid' + /******************************** * Constants @@ -117,8 +118,10 @@ echo 'Multiple', 'Parameters', 'Valid'; // followed by any number of letters, numbers, or underscores. define("FOO", "something"); -// access to a constant is possible by direct using the choosen name -echo 'This outputs '.FOO; +// 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' + /******************************** @@ -159,9 +162,9 @@ echo('Hello World!'); print('Hello World!'); // The same as echo -// echo is actually a language construct, so you can drop the parentheses. +// echo and print are language constructs too, so you can drop the parentheses echo 'Hello World!'; -print 'Hello World!'; // So is print +print 'Hello World!'; $paragraph = 'paragraph'; @@ -219,7 +222,11 @@ assert($a !== $d); assert(1 === '1'); assert(1 !== '1'); -// spaceship operator since PHP 7 +// 'Spaceship' operator (since PHP 7) +// Returns 0 if values on either side are equal +// Returns 1 if value on the left is greater +// Returns -1 if the value on the right is greater + $a = 100; $b = 1000; From b782df007bd961f55af0d9a57c75c7bf490ec445 Mon Sep 17 00:00:00 2001 From: Erick Bernal Date: Sun, 18 Oct 2015 23:25:01 -0500 Subject: [PATCH 417/685] Update and fix typos on ruby translation --- es-es/ruby-es.html.markdown | 247 ++++++++++++++++++++++++++++++++---- 1 file changed, 222 insertions(+), 25 deletions(-) diff --git a/es-es/ruby-es.html.markdown b/es-es/ruby-es.html.markdown index 66a5d0fe..d8b67fe7 100644 --- a/es-es/ruby-es.html.markdown +++ b/es-es/ruby-es.html.markdown @@ -5,8 +5,18 @@ contributors: - ["David Underwood", "http://theflyingdeveloper.com"] - ["Joel Walden", "http://joelwalden.net"] - ["Luke Holder", "http://twitter.com/lukeholder"] + - ["Tristan Hume", "http://thume.ca/"] + - ["Nick LaMuro", "https://github.com/NickLaMuro"] + - ["Marcos Brizeno", "http://www.about.me/marcosbrizeno"] + - ["Ariel Krakowski", "http://www.learneroo.com"] + - ["Dzianis Dashkevich", "https://github.com/dskecse"] + - ["Levi Bostian", "https://github.com/levibostian"] + - ["Rahil Momin", "https://github.com/iamrahil"] + - ["Gabriel Halley", "https://github.com/ghalley"] + - ["Persa Zula", "http://persazula.com"] translators: - ["Camilo Garrido", "http://www.twitter.com/hirohope"] + - ["Erick Bernal", "http://www.twitter.com/billowkib"] lang: es-es --- @@ -33,6 +43,8 @@ Tu tampoco deberías 8 - 1 #=> 7 10 * 2 #=> 20 35 / 5 #=> 7 +2**5 #=> 32 +5 % 3 #=> 2 # La aritmética es sólo azúcar sintáctico # para llamar un método de un objeto @@ -55,8 +67,6 @@ false.class #=> FalseClass # Desigualdad 1 != 1 #=> false 2 != 1 #=> true -!true #=> false -!false #=> true # Además de 'false', 'nil' es otro valor falso @@ -70,14 +80,29 @@ false.class #=> FalseClass 2 <= 2 #=> true 2 >= 2 #=> true +# Operadores lógicos +true && false #=> false +true || false #=> true +!true #=> false + +# Existen versiones alternativas de los operadores lógicos con menor prioridad +# Estos son usados como constructores controladores de flujo que encadenan +# sentencias hasta que una de ellas retorne verdadero o falso + +# `has_otra_cosa` solo se llama si `has_algo` retorna verdadero. +has_algo() and has_otra_cosa() +# `registra_error` solo se llama si `has_algo` falla +has_algo() or registra_error() + + # Los strings son objetos 'Soy un string'.class #=> String "Soy un string también".class #=> String -referente = "usar interpolacion de strings" +referente = "usar interpolación de strings" "Yo puedo #{referente} usando strings de comillas dobles" -#=> "Yo puedo usar interpolacion de strings usando strings de comillas dobles" +#=> "Yo puedo usar interpolación de strings usando strings de comillas dobles" # Imprime a la salida estándar @@ -119,15 +144,16 @@ status == :aprovado #=> false # Arreglos # Esto es un arreglo -[1, 2, 3, 4, 5] #=> [1, 2, 3, 4, 5] +arreglo = [1, 2, 3, 4, 5] #=> [1, 2, 3, 4, 5] # Arreglos pueden contener elementos de distintos tipos -arreglo = [1, "hola", false] #=> => [1, "hola", false] +[1, "hola", false] #=> => [1, "hola", false] # Arreglos pueden ser indexados # Desde el frente arreglo[0] #=> 1 +arreglo.first #=> 1 arreglo[12] #=> nil # Tal como la aritmética, el acceso como variable[índice] @@ -138,15 +164,25 @@ arreglo.[] 12 #=> nil # Desde el final arreglo[-1] #=> 5 +arreglo.last #=> 5 -# Con un índice de inicio y final -arreglo[2, 4] #=> [3, 4, 5] +# Con un índice de inicio y longitud +arreglo[2, 3] #=> [3, 4, 5] + +# Invertir un arreglo +a = [1, 2, 3] +a.reverse! #=> [3, 2, 1] # O con rango arreglo[1..3] #=> [2, 3, 4] # Añade elementos a un arreglo así arreglo << 6 #=> [1, 2, 3, 4, 5, 6] +# O así +arreglo.push(6) #=> [1, 2, 3, 4, 5, 6] + +#Verifica si un elemento ya existe en ese arreglo +arreglo.include?(1) #=> true # Hashes son los diccionarios principales de Ruby con pares llave/valor. # Hashes se denotan con llaves: @@ -161,17 +197,16 @@ hash['numero'] #=> 5 # Preguntarle a un hash por una llave que no existe retorna 'nil': hash['nada aqui'] #=> nil -# Itera sobre un hash con el método 'each': -hash.each do |k, v| - puts "#{k} is #{v}" -end - # Desde Ruby 1.9, hay una sintaxis especial cuando se usa un símbolo como llave: nuevo_hash = { defcon: 3, accion: true} nuevo_hash.keys #=> [:defcon, :accion] +# Verifica la existencia de llaves y valores en el hash +new_hash.has_key?(:defcon) #=> true +new_hash.has_value?(3) #=> true + # Tip: Tanto los arreglos como los hashes son Enumerable (enumerables) # Comparten muchos métodos útiles tales como 'each', 'map', 'count', y más @@ -194,9 +229,15 @@ end #=> iteracion 4 #=> iteracion 5 -# Aunque -# Nadie usa los ciclos `for` -# Usa `each`, así: +# SIN EMBARGO, nadie usa ciclos `for` +# En su lugar debes usar el método "each" y pasarle un block (bloque). +# Un bloque es un fragmento código que puedes pasar a métodos como `each`. +# Es símilar a las funciones lambda, funciones anónimas o `closures` en otros +# lenguajes de programación. +# +# El método `each` de un Range (rango) ejecuta el bloque una vez por cada elemento. +# Al bloque se le pasa un contador como parametro. +# Usar el método `each` con un bloque se ve así: (1..5).each do |contador| puts "iteracion #{contador}" @@ -207,10 +248,27 @@ end #=> iteracion 4 #=> iteracion 5 -counter = 1 -while counter <= 5 do - puts "iteracion #{counter}" - counter += 1 +# También puedes envolver el bloque entre llaves: +(1..5).each { |counter| puts "iteración #{contador}" } + +#El contenido de las estructuras de datos en ruby puede ser iterado usando `each`. +arreglo.each do |elemento| + puts "#{elemento} es parte del arreglo" +end +hash.each do |llave, valor| + puts "#{llave} es #{valor}" +end + +# Si aún necesitas un índice puedes usar "each_with_index" y definir una variable +# índice. +arreglo.each_with_index do |element, index| + puts "#{element} tiene la posición #{index} en el arreglo" +end + +contador = 1 +while contador <= 5 do + puts "iteracion #{contador}" + contador += 1 end #=> iteracion 1 #=> iteracion 2 @@ -218,6 +276,19 @@ end #=> iteracion 4 #=> iteracion 5 +# Hay una gran variedad de otras funciones iterativas útiles en Ruby, +# por ejemplo `map`, `reduce`, `inject`, entre otras. Map, por ejemplo, +# toma el arreglo sobre el cuál está iterando, le hace cambios +# definidos en el bloque, y retorna un arreglo completamente nuevo. +arreglo = [1,2,3,4,5] +duplicado = array.map do |elemento| + elemento * 2 +end +puts duplicado +#=> [2,4,6,8,10] +puts array +#=> [1,2,3,4,5] + nota = 'B' case nota @@ -234,6 +305,34 @@ when 'F' else puts "Sistema alternativo de notas, ¿eh?" end +#=> "Mejor suerte para la proxima" + +# Los casos también pueden usar rangos +nota = 82 + +case nota +when 90..100 + puts 'Excelente!' +when 80..100 + puts 'Buen trabajo' +else + puts '¡Reprobaste!' +end +#=> "Buen trabajo" + +# Manejo de excepciones +begin + # código que podría causar excepción + raise NoMemoryError, 'Se te acabó la memoria' +rescue NoMemoryError => variable_de_excepcion + puts 'El error NoMemoryError ocurrió', variable_de_excepcion +rescue RuntimeError => otra_variable_de_excepcion + puts 'El error RuntimeError ocurrió' +else + puts 'Esto se ejecuta si ningun error ocurrió' +ensure + puts 'Este código siempre se ejecuta, sin importar que' +end # Funciones @@ -244,7 +343,7 @@ end # Funciones (y todos los bloques) implícitamente retornan el valor de la última instrucción doble(2) #=> 4 -# Paréntesis son opcionales cuando el resultado es ambiguo +# Paréntesis son opcionales cuando el resultado no es ambiguo doble 3 #=> 6 doble doble 3 #=> 12 @@ -259,7 +358,7 @@ suma 3, 4 #=> 7 suma suma(3,4), 5 #=> 12 # yield -# Todos los métodos tienen un parámetro de bloqueo opcional e implícitp +# Todos los métodos tienen un parámetro bloque opcional e implícito # puede llamarse con la palabra clave 'yield' def alrededor @@ -274,6 +373,17 @@ alrededor { puts 'hola mundo' } # hola mundo # } +# Puedes pasar un bloque a una función +# '&' representa una referencia a un bloque +def visitantes(&bloque) + bloque.call +end + +# Puedes pasar una lista de argumentos, que serán convertidos en un arreglo +# Para eso sirve el operador ('*') +def visitantes(*arreglo) + arreglo.each { |visitante| puts visitante } +end # Define una clase con la palabra clave 'class' class Humano @@ -299,16 +409,26 @@ class Humano @nombre end + # La funcionalidad anterior puede ser encapsulada usando el método attr_accessor + # de la siguiente manera + + attr_accessor :name + + # Los métodos de tipo getter y setter también se pueden crear de manera individual + # de la siguiente manera + + attr_reader :name + attr_writer :name + # Un método de clase usa 'self' (sí mismo) para distinguirse de métodos de instancia. # Sólo puede ser llamado en la clase, no por una instancia. def self.decir(mensaje) - puts "#{mensaje}" + puts mensaje end def especie @@especie end - end @@ -328,6 +448,23 @@ dwight.nombre #=> "Dwight K. Schrute" # Llama el método de clase Humano.decir("Hi") #=> "Hi" +# El alcance de las variables es definido por la manera en que las nombramos. +# Las variables que inician con $ tienen un alcance global +$var = "Soy una variable global" +defined? $var #=> "global-variable" + +# Las variables que empiezan con @ tienen un alcance de instancia +@var = "Soy una variable de instancia" +defined? @var #=> "instance-variable" + +# Variables que empiezan con @@ tienen un alcance de clase +@@var = "Soy una variable de clase" +defined? @@var #=> "class variable" + +# Las variables que empiezan con letra mayuscula son constantes +Var = "Soy una constante" +defined? Var #=> "constant" + # Las clases también son un objeto en ruby. Por lo cual, las clases también pueden tener variables de instancia. # Variables de clase son compartidas a través de la clase y todos sus descendientes. @@ -371,7 +508,67 @@ end class Doctor < Humano end -Human.bar # 0 +Humano.bar # 0 Doctor.bar # nil +module ModuloEjemplo + def foo + 'foo' + end +end + +# Al incluir un módulo sus métodos se comparten con las instancias de la clase +# Al extender un módulo sus métodos se comparten con la clase misma + +class Persona + include ModuloEjemplo +end + +class Libro + extend ModuloEjemplo +end + +Persona.foo # => NoMethodError: undefined method `foo' for Persona:Class +Persona.new.foo # => 'foo' +Libro.foo # => 'foo' +Libro.new.foo # => NoMethodError: undefined method `foo' + +# Las llamadas de retorno (callbacks) son ejecutadas cuando se incluye o +# extiende un módulo +module EjemploConcern + def self.incluido(base) + base.extend(MetodosClase) + base.send(:include, MetodosInstancia) + end + + module MetodosClase + def bar + 'bar' + end + end + + module MetodosInstancia + def qux + 'qux' + end + end +end + +class Algo + include EjemploConcern +end + +Algo.bar #=> 'bar' +Algo.qux #=> NoMethodError: undefined method `qux' +Algo.new.bar # => NoMethodError: undefined method `bar' +Algo.new.qux # => 'qux' ``` + +## Recursos adicionales +- [Aprende Ruby Mediante Ejemplo con Ejercicios](http://www.learneroo.com/modules/61/nodes/338) - Una variante de +esta referencia con ejercicios en navegador. +- [Documentación Oficial](http://www.ruby-doc.org/core-2.1.1/) +- [Ruby desde otros lenguajes](https://www.ruby-lang.org/en/documentation/ruby-from-other-languages/) +- [Programando Ruby](http://www.amazon.com/Programming-Ruby-1-9-2-0-Programmers/dp/1937785491/) - Una +[edición antigua](http://ruby-doc.com/docs/ProgrammingRuby/) gratuita disponible en línea. +- [Guía de estilo de Ruby](https://github.com/bbatsov/ruby-style-guide) - Guía de estilo creada por la comunidad. From 8b3cc63b3e3441b8a8f73a5983f0de0fdd10cf02 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 19 Oct 2015 14:33:11 +0800 Subject: [PATCH 418/685] Fixed pythonstatcomp doc naming --- ....markdown.html => pythonstatcomp.html.markdown | 0 template-translations.yaml | 15 --------------- 2 files changed, 15 deletions(-) rename pythonstatcomp.markdown.html => pythonstatcomp.html.markdown (100%) delete mode 100644 template-translations.yaml diff --git a/pythonstatcomp.markdown.html b/pythonstatcomp.html.markdown similarity index 100% rename from pythonstatcomp.markdown.html rename to pythonstatcomp.html.markdown diff --git a/template-translations.yaml b/template-translations.yaml deleted file mode 100644 index 527de122..00000000 --- a/template-translations.yaml +++ /dev/null @@ -1,15 +0,0 @@ -default: - title: Learn X in Y minutes - where: Where X= - getCode: "Get the code:" - share: Share this page - suggestions: "Got a suggestion? A correction, perhaps? Open an Issue on the Github Repo, or make a pull request yourself!" - contributor: "Originally contributed by %s, and updated by %d contributors." - -zh_CN: - title: X分钟速成Y - where: 其中 Y= - getCode: 源代码下载: - share: 分享此页 - suggestions: "有建议?或者发现什么错误?在Github上开一个issue,或者你自己也可以写一个pull request!" - contributor: "原著%s,并由%d个好心人修改。" From a8ebd498338183f3469e37f7763aad6d644780e1 Mon Sep 17 00:00:00 2001 From: aceawan Date: Mon, 19 Oct 2015 13:34:59 +0200 Subject: [PATCH 419/685] [d/fr] adds translation --- fr-fr/d.html.markdown | 291 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 291 insertions(+) create mode 100644 fr-fr/d.html.markdown diff --git a/fr-fr/d.html.markdown b/fr-fr/d.html.markdown new file mode 100644 index 00000000..dfc3519d --- /dev/null +++ b/fr-fr/d.html.markdown @@ -0,0 +1,291 @@ +--- +language: D +filename: learnd.d +contributors: + - ["Nick Papanastasiou", "www.nickpapanastasiou.github.io"] + - ["Quentin Ladeveze", "aceawan.eu"] +lang: fr +--- + +```d +// Commençons par un classique +module hello; + +import std.stdio; + +// args n'est pas obligatoire +void main(string[] args) { + writeln("Bonjour le monde !"); +} +``` + +Si vous êtes comme moi et que vous passez beaucoup trop de temps sur internet, il y a +de grandes chances pour que vous ayez déjà entendu parler du [D](http://dlang.org/). +D est un langage de programmation moderne, généraliste, multi-paradigme qui contient +des fonctionnalités aussi bien de bas-niveau que haut-niveau. + +D is actively developed by a large group of super-smart people and is spearheaded by +[Walter Bright](https://en.wikipedia.org/wiki/Walter_Bright) and +[Andrei Alexandrescu](https://en.wikipedia.org/wiki/Andrei_Alexandrescu). +With all that out of the way, let's look at some examples! + +D est activement développé par de nombreuses personnes très intelligents, guidées par +[Walter Bright](https://fr.wikipedia.org/wiki/Walter_Bright))) et +[Andrei Alexandrescu](https://fr.wikipedia.org/wiki/Andrei_Alexandrescu). +Après cette petite introduction, jetons un coup d'oeil à quelques exemples. + +```d +import std.stdio; + +void main() { + + //Les conditions et les boucles sont classiques. + for(int i = 0; i < 10000; i++) { + writeln(i); + } + + // On peut utiliser auto pour inférer automatiquement le + // type d'une variable. + auto n = 1; + + // On peut faciliter la lecture des valeurs numériques + // en y insérant des `_`. + while(n < 10_000) { + n += n; + } + + do { + n -= (n / 2); + } while(n > 0); + + // For et while sont très utiles, mais en D, on préfère foreach. + // Les deux points : '..', créent un intervalle continue de valeurs + // incluant la première mais excluant la dernière. + foreach(i; 1..1_000_000) { + if(n % 2 == 0) + writeln(i); + } + + // On peut également utiliser foreach_reverse pour itérer à l'envers. + foreach_reverse(i; 1..int.max) { + if(n % 2 == 1) { + writeln(i); + } else { + writeln("Non !"); + } + } +} +``` + +We can define new types with `struct`, `class`, `union`, and `enum`. Structs and unions +are passed to functions by value (i.e. copied) and classes are passed by reference. Futhermore, +we can use templates to parameterize all of these on both types and values! + +On peut définir de nouveaux types avec les mots-clés `struct`, `class`, +`union` et `enum`. Les structures et les unions sont passées au fonctions par +valeurs (elle sont copiées) et les classes sont passées par référence. De plus, +On peut utiliser les templates pour rendre toutes ces abstractions génériques. + +```d +// Ici, 'T' est un paramètre de type. Il est similaire au de C++/C#/Java. +struct LinkedList(T) { + T data = null; + + // Utilisez '!' pour instancier un type paramétré. + // Encore une fois semblable à '' + LinkedList!(T)* next; +} + +class BinTree(T) { + T data = null; + + // Si il n'y a qu'un seul paramètre de template, + // on peut s'abstenir de parenthèses. + BinTree!T left; + BinTree!T right; +} + +enum Day { + Sunday, + Monday, + Tuesday, + Wednesday, + Thursday, + Friday, + Saturday, +} + +// Utilisez alias pour créer des abreviations pour les types. +alias IntList = LinkedList!int; +alias NumTree = BinTree!double; + +// On peut tout aussi bien créer des templates de function ! +T max(T)(T a, T b) { + if(a < b) + return b; + + return a; +} + +// On peut utiliser le mot-clé ref pour s'assurer que quelque chose est passé +// par référence, et ceci, même si a et b sont d'ordinaire passés par valeur. +// Ici ils seront toujours passés par référence à 'swap()'. +void swap(T)(ref T a, ref T b) { + auto temp = a; + + a = b; + b = temp; +} + +// Avec les templates, on peut également passer des valeurs en paramètres. +class Matrix(uint m, uint n, T = int) { + T[m] rows; + T[n] columns; +} + +auto mat = new Matrix!(3, 3); // T est 'int' par défaut + +``` +À propos de classes, parlons des propriétés. Une propriété est, en gros, +une méthode qui peut se comporter comme une lvalue. On peut donc utiliser +la syntaxe des structures classiques (`struct.x = 7`) comme si il +s'agissait de méthodes getter ou setter. + +```d +// Considérons une classe paramétrée avec les types 'T' et 'U' +class MyClass(T, U) { + T _data; + U _other; +} + +// Et des méthodes "getter" et "setter" comme suit: +class MyClass(T, U) { + T _data; + U _other; + + // Les constructeurs s'apellent toujours 'this'. + this(T t, U u) { + // Ceci va appeller les setters ci-dessous. + data = t; + other = u; + } + + // getters + @property T data() { + return _data; + } + + @property U other() { + return _other; + } + + // setters + @property void data(T t) { + _data = t; + } + + @property void other(U u) { + _other = u; + } +} + +// Et on l'utilise de cette façon: +void main() { + auto mc = new MyClass!(int, string)(7, "seven"); + + // Importer le module 'stdio' de la bibliothèque standard permet + // d'écrire dans la console (les imports peuvent être locaux à une portée) + import std.stdio; + + // On appelle les getters pour obtenir les valeurs. + writefln("Earlier: data = %d, str = %s", mc.data, mc.other); + + // On appelle les setter pour assigner de nouvelles valeurs. + mc.data = 8; + mc.other = "eight"; + + // On appelle les setter pour obtenir les nouvelles valeurs. + writefln("Later: data = %d, str = %s", mc.data, mc.other); +} +``` + +With properties, we can add any amount of logic to +our getter and setter methods, and keep the clean syntax of +accessing members directly! + +Other object-oriented goodies at our disposal +include `interface`s, `abstract class`es, +and `override`ing methods. D does inheritance just like Java: +Extend one class, implement as many interfaces as you please. + +We've seen D's OOP facilities, but let's switch gears. D offers +functional programming with first-class functions, `pure` +functions, and immutable data. In addition, all of your favorite +functional algorithms (map, filter, reduce and friends) can be +found in the wonderful `std.algorithm` module! + +Avec les propriétés, on peut constuire nos setters et nos getters +comme on le souhaite, tout en gardant un syntaxe très propre, +comme si on accédait directement à des membres de la classe. + +Les autres fonctionnalités orientées objets à notre disposition +incluent les interfaces, les classes abstraites, et la surcharge +de méthodes. D gère l'héritage comme Java: On ne peut hériter que +d'une seule classe et implémenter autant d'interface que voulu. + +Nous venons d'explorer les fonctionnalités objet du D, mais changeons +un peu de domaine. D permet la programmation fonctionelle, avec les fonctions +de premier ordre, les fonctions `pure` et les données immuables. +De plus, tout vos algorithmes fonctionelles favoris (map, reduce, filter) +sont disponibles dans le module `std.algorithm`. + +```d +import std.algorithm : map, filter, reduce; +import std.range : iota; // construit un intervalle excluant la dernière valeur. + +void main() { + // On veut un algorithm qui affiche la somme de la listes des carrés + // des entiers paires de 1 à 100. Un jeu d'enfant ! + + // On se content de passer des expressions lambda en paramètre à des templates. + // On peut fournier au template n'importe quelle fonction, mais dans notre + // cas, les lambdas sont pratiques. + auto num = iota(1, 101).filter!(x => x % 2 == 0) + .map!(y => y ^^ 2) + .reduce!((a, b) => a + b); + + writeln(num); +} +``` + +Vous voyez comme on a calculé `num` comme on le ferait en haskell par exemple ? +C'est grâce à une innvoation de D qu'on appelle "Uniform Function Call Syntax". +Avec l'UFCS, on peut choisir d'écrire un appelle à une fonction de manière +classique, ou comme un appelle à une méthode. Walter Brighter a écrit un +article en anglais sur l'UFCS [ici.](http://www.drdobbs.com/cpp/uniform-function-call-syntax/232700394) +Pour faire court, on peut appeller une fonction dont le premier paramètre +est de type A, comme si c'était une méthode de A. + +J'aime le parallélisme. Vous aimez les parallélisme ? Bien sur que vous aimez ça +Voyons comment on le fait en D ! + +```d +import std.stdio; +import std.parallelism : parallel; +import std.math : sqrt; + +void main() { + // On veut calculer la racine carré de tous les nombres + // dans notre tableau, et profiter de tous les coeurs + // à notre disposition. + auto arr = new double[1_000_000]; + + // On utilise un index et une référence à chaque élément du tableau. + // On appelle juste la fonction parallel sur notre tableau ! + foreach(i, ref elem; parallel(arr)) { + ref = sqrt(i + 1.0); + } +} + + +``` From 6313536895742385f743b05ed84c1efc274204f7 Mon Sep 17 00:00:00 2001 From: aceawan Date: Mon, 19 Oct 2015 13:35:38 +0200 Subject: [PATCH 420/685] [d/fr] adds translation --- fr-fr/d.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fr-fr/d.html.markdown b/fr-fr/d.html.markdown index dfc3519d..5d72a2d0 100644 --- a/fr-fr/d.html.markdown +++ b/fr-fr/d.html.markdown @@ -1,10 +1,10 @@ --- language: D -filename: learnd.d +filename: learnd-fr.d contributors: - ["Nick Papanastasiou", "www.nickpapanastasiou.github.io"] - ["Quentin Ladeveze", "aceawan.eu"] -lang: fr +lang: fr-f --- ```d From 7f8b8d036302ee7e7ba2c47b11c3833b864bffab Mon Sep 17 00:00:00 2001 From: aceawan Date: Mon, 19 Oct 2015 13:38:10 +0200 Subject: [PATCH 421/685] correct translator name --- fr-fr/d.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/fr-fr/d.html.markdown b/fr-fr/d.html.markdown index 5d72a2d0..f9dececb 100644 --- a/fr-fr/d.html.markdown +++ b/fr-fr/d.html.markdown @@ -3,6 +3,7 @@ language: D filename: learnd-fr.d contributors: - ["Nick Papanastasiou", "www.nickpapanastasiou.github.io"] +translators: - ["Quentin Ladeveze", "aceawan.eu"] lang: fr-f --- From 5507a389903c4b2ff66aa811f6952a78e99c3c7a Mon Sep 17 00:00:00 2001 From: aceawan Date: Mon, 19 Oct 2015 13:39:05 +0200 Subject: [PATCH 422/685] correct language --- fr-fr/d.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fr-fr/d.html.markdown b/fr-fr/d.html.markdown index f9dececb..2c90a628 100644 --- a/fr-fr/d.html.markdown +++ b/fr-fr/d.html.markdown @@ -5,7 +5,7 @@ contributors: - ["Nick Papanastasiou", "www.nickpapanastasiou.github.io"] translators: - ["Quentin Ladeveze", "aceawan.eu"] -lang: fr-f +lang: fr-fr --- ```d From c759b6ea2bc1dd1ddad8d08bcdf5741d7e7711b0 Mon Sep 17 00:00:00 2001 From: aceawan Date: Mon, 19 Oct 2015 13:39:44 +0200 Subject: [PATCH 423/685] removes english text --- fr-fr/d.html.markdown | 5 ----- 1 file changed, 5 deletions(-) diff --git a/fr-fr/d.html.markdown b/fr-fr/d.html.markdown index 2c90a628..d75f1083 100644 --- a/fr-fr/d.html.markdown +++ b/fr-fr/d.html.markdown @@ -25,11 +25,6 @@ de grandes chances pour que vous ayez déjà entendu parler du [D](http://dlang. D est un langage de programmation moderne, généraliste, multi-paradigme qui contient des fonctionnalités aussi bien de bas-niveau que haut-niveau. -D is actively developed by a large group of super-smart people and is spearheaded by -[Walter Bright](https://en.wikipedia.org/wiki/Walter_Bright) and -[Andrei Alexandrescu](https://en.wikipedia.org/wiki/Andrei_Alexandrescu). -With all that out of the way, let's look at some examples! - D est activement développé par de nombreuses personnes très intelligents, guidées par [Walter Bright](https://fr.wikipedia.org/wiki/Walter_Bright))) et [Andrei Alexandrescu](https://fr.wikipedia.org/wiki/Andrei_Alexandrescu). From 00182d32f4e2eebf46d12910e885b0dde3eabdbc Mon Sep 17 00:00:00 2001 From: aceawan Date: Mon, 19 Oct 2015 13:40:27 +0200 Subject: [PATCH 424/685] removes english text --- fr-fr/d.html.markdown | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/fr-fr/d.html.markdown b/fr-fr/d.html.markdown index d75f1083..702de206 100644 --- a/fr-fr/d.html.markdown +++ b/fr-fr/d.html.markdown @@ -72,11 +72,6 @@ void main() { } } ``` - -We can define new types with `struct`, `class`, `union`, and `enum`. Structs and unions -are passed to functions by value (i.e. copied) and classes are passed by reference. Futhermore, -we can use templates to parameterize all of these on both types and values! - On peut définir de nouveaux types avec les mots-clés `struct`, `class`, `union` et `enum`. Les structures et les unions sont passées au fonctions par valeurs (elle sont copiées) et les classes sont passées par référence. De plus, @@ -204,22 +199,6 @@ void main() { writefln("Later: data = %d, str = %s", mc.data, mc.other); } ``` - -With properties, we can add any amount of logic to -our getter and setter methods, and keep the clean syntax of -accessing members directly! - -Other object-oriented goodies at our disposal -include `interface`s, `abstract class`es, -and `override`ing methods. D does inheritance just like Java: -Extend one class, implement as many interfaces as you please. - -We've seen D's OOP facilities, but let's switch gears. D offers -functional programming with first-class functions, `pure` -functions, and immutable data. In addition, all of your favorite -functional algorithms (map, filter, reduce and friends) can be -found in the wonderful `std.algorithm` module! - Avec les propriétés, on peut constuire nos setters et nos getters comme on le souhaite, tout en gardant un syntaxe très propre, comme si on accédait directement à des membres de la classe. From c60ddc6ef5d80cc87b051b848ccce0b7f335f5f1 Mon Sep 17 00:00:00 2001 From: MDS Date: Tue, 20 Oct 2015 01:01:14 +1300 Subject: [PATCH 425/685] Updated official python docs to always use the latest version of python 2 --- python.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python.html.markdown b/python.html.markdown index 675967f4..42a52bcf 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -707,7 +707,7 @@ print say(say_please=True) # Can you buy me a beer? Please! I am poor :( * [Automate the Boring Stuff with Python](https://automatetheboringstuff.com) * [Learn Python The Hard Way](http://learnpythonthehardway.org/book/) * [Dive Into Python](http://www.diveintopython.net/) -* [The Official Docs](http://docs.python.org/2.6/) +* [The Official Docs](http://docs.python.org/2/) * [Hitchhiker's Guide to Python](http://docs.python-guide.org/en/latest/) * [Python Module of the Week](http://pymotw.com/2/) * [A Crash Course in Python for Scientists](http://nbviewer.ipython.org/5920182) From 5f7a161f44e683d15d85126db78a6de5f1e0bfab Mon Sep 17 00:00:00 2001 From: Claudson Martins Date: Mon, 19 Oct 2015 10:17:14 -0300 Subject: [PATCH 426/685] Figure handle and some text issues fixed - File name added to the header; - Fixed figure handle letter; - Unnecessary extra word removed; --- matlab.html.markdown | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/matlab.html.markdown b/matlab.html.markdown index 0cbc6f57..4d97834c 100644 --- a/matlab.html.markdown +++ b/matlab.html.markdown @@ -1,10 +1,11 @@ --- language: Matlab +filename: learnmatlab.mat contributors: - ["mendozao", "http://github.com/mendozao"] - ["jamesscottbrown", "http://jamesscottbrown.com"] - ["Colton Kohnke", "http://github.com/voltnor"] - + - ["Claudson Martins", "http://github.com/claudsonm"] --- MATLAB stands for MATrix LABoratory. It is a powerful numerical computing language commonly used in engineering and mathematics. @@ -261,7 +262,7 @@ pcolor(A) % Heat-map of matrix: plot as grid of rectangles, coloured by value contour(A) % Contour plot of matrix mesh(A) % Plot as a mesh surface -h = figure % Create new figure object, with handle f +h = figure % Create new figure object, with handle h figure(h) % Makes the figure corresponding to handle h the current figure close(h) % close figure with handle h close all % close all open figure windows @@ -329,7 +330,7 @@ double_input(6) % ans = 12 % anonymous function. Useful when quickly defining a function to pass to % another function (eg. plot with fplot, evaluate an indefinite integral % with quad, find roots with fzero, or find minimum with fminsearch). -% Example that returns the square of it's input, assigned to to the handle sqr: +% Example that returns the square of it's input, assigned to the handle sqr: sqr = @(x) x.^2; sqr(10) % ans = 100 doc function_handle % find out more From 69263413a137d69c14c307f286e13b440ccdb139 Mon Sep 17 00:00:00 2001 From: Claudson Martins Date: Mon, 19 Oct 2015 10:25:57 -0300 Subject: [PATCH 427/685] Revert "Figure handle and some text issues fixed" This reverts commit 5f7a161f44e683d15d85126db78a6de5f1e0bfab. --- matlab.html.markdown | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/matlab.html.markdown b/matlab.html.markdown index 4d97834c..0cbc6f57 100644 --- a/matlab.html.markdown +++ b/matlab.html.markdown @@ -1,11 +1,10 @@ --- language: Matlab -filename: learnmatlab.mat contributors: - ["mendozao", "http://github.com/mendozao"] - ["jamesscottbrown", "http://jamesscottbrown.com"] - ["Colton Kohnke", "http://github.com/voltnor"] - - ["Claudson Martins", "http://github.com/claudsonm"] + --- MATLAB stands for MATrix LABoratory. It is a powerful numerical computing language commonly used in engineering and mathematics. @@ -262,7 +261,7 @@ pcolor(A) % Heat-map of matrix: plot as grid of rectangles, coloured by value contour(A) % Contour plot of matrix mesh(A) % Plot as a mesh surface -h = figure % Create new figure object, with handle h +h = figure % Create new figure object, with handle f figure(h) % Makes the figure corresponding to handle h the current figure close(h) % close figure with handle h close all % close all open figure windows @@ -330,7 +329,7 @@ double_input(6) % ans = 12 % anonymous function. Useful when quickly defining a function to pass to % another function (eg. plot with fplot, evaluate an indefinite integral % with quad, find roots with fzero, or find minimum with fminsearch). -% Example that returns the square of it's input, assigned to the handle sqr: +% Example that returns the square of it's input, assigned to to the handle sqr: sqr = @(x) x.^2; sqr(10) % ans = 100 doc function_handle % find out more From f8a2b28890d5d68a252d5bc0fd8247495b680e09 Mon Sep 17 00:00:00 2001 From: aceawan Date: Mon, 19 Oct 2015 15:28:43 +0200 Subject: [PATCH 428/685] fix indentation and typos --- fr-fr/d.html.markdown | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/fr-fr/d.html.markdown b/fr-fr/d.html.markdown index 702de206..6782142d 100644 --- a/fr-fr/d.html.markdown +++ b/fr-fr/d.html.markdown @@ -4,7 +4,7 @@ filename: learnd-fr.d contributors: - ["Nick Papanastasiou", "www.nickpapanastasiou.github.io"] translators: - - ["Quentin Ladeveze", "aceawan.eu"] + - ["Quentin Ladeveze", "aceawan.eu"] lang: fr-fr --- @@ -22,8 +22,8 @@ void main(string[] args) { Si vous êtes comme moi et que vous passez beaucoup trop de temps sur internet, il y a de grandes chances pour que vous ayez déjà entendu parler du [D](http://dlang.org/). -D est un langage de programmation moderne, généraliste, multi-paradigme qui contient -des fonctionnalités aussi bien de bas-niveau que haut-niveau. +D est un langage de programmation moderne, généraliste, multi-paradigmes qui contient +des fonctionnalités aussi bien de bas niveau que de haut niveau. D est activement développé par de nombreuses personnes très intelligents, guidées par [Walter Bright](https://fr.wikipedia.org/wiki/Walter_Bright))) et @@ -34,18 +34,17 @@ Après cette petite introduction, jetons un coup d'oeil à quelques exemples. import std.stdio; void main() { - - //Les conditions et les boucles sont classiques. + //Les conditions et les boucles sont classiques. for(int i = 0; i < 10000; i++) { writeln(i); } - // On peut utiliser auto pour inférer automatiquement le - // type d'une variable. + // On peut utiliser auto pour inférer automatiquement le + // type d'une variable. auto n = 1; // On peut faciliter la lecture des valeurs numériques - // en y insérant des `_`. + // en y insérant des `_`. while(n < 10_000) { n += n; } From 79d0e7cd23635bb2fb545d897527fd199a9296d2 Mon Sep 17 00:00:00 2001 From: Claudson Martins Date: Mon, 19 Oct 2015 10:30:14 -0300 Subject: [PATCH 429/685] Figure handle and some text issues fixed - File name added to the header; - Fixed figure handle letter; - Unnecessary extra word removed. --- matlab.html.markdown | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/matlab.html.markdown b/matlab.html.markdown index 0cbc6f57..4d97834c 100644 --- a/matlab.html.markdown +++ b/matlab.html.markdown @@ -1,10 +1,11 @@ --- language: Matlab +filename: learnmatlab.mat contributors: - ["mendozao", "http://github.com/mendozao"] - ["jamesscottbrown", "http://jamesscottbrown.com"] - ["Colton Kohnke", "http://github.com/voltnor"] - + - ["Claudson Martins", "http://github.com/claudsonm"] --- MATLAB stands for MATrix LABoratory. It is a powerful numerical computing language commonly used in engineering and mathematics. @@ -261,7 +262,7 @@ pcolor(A) % Heat-map of matrix: plot as grid of rectangles, coloured by value contour(A) % Contour plot of matrix mesh(A) % Plot as a mesh surface -h = figure % Create new figure object, with handle f +h = figure % Create new figure object, with handle h figure(h) % Makes the figure corresponding to handle h the current figure close(h) % close figure with handle h close all % close all open figure windows @@ -329,7 +330,7 @@ double_input(6) % ans = 12 % anonymous function. Useful when quickly defining a function to pass to % another function (eg. plot with fplot, evaluate an indefinite integral % with quad, find roots with fzero, or find minimum with fminsearch). -% Example that returns the square of it's input, assigned to to the handle sqr: +% Example that returns the square of it's input, assigned to the handle sqr: sqr = @(x) x.^2; sqr(10) % ans = 100 doc function_handle % find out more From 13c9d9af5cc60ae747d42f73d795f360a15f3fd8 Mon Sep 17 00:00:00 2001 From: aceawan Date: Mon, 19 Oct 2015 15:33:48 +0200 Subject: [PATCH 430/685] fix indentation and typos --- fr-fr/d.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fr-fr/d.html.markdown b/fr-fr/d.html.markdown index 6782142d..ee69ca34 100644 --- a/fr-fr/d.html.markdown +++ b/fr-fr/d.html.markdown @@ -90,7 +90,7 @@ class BinTree(T) { T data = null; // Si il n'y a qu'un seul paramètre de template, - // on peut s'abstenir de parenthèses. + // on peut s'abstenir de mettre des parenthèses. BinTree!T left; BinTree!T right; } From d7e3def01ec674a7578581c1fb8b003cd164d335 Mon Sep 17 00:00:00 2001 From: aceawan Date: Mon, 19 Oct 2015 15:40:44 +0200 Subject: [PATCH 431/685] fix indentation and typos --- fr-fr/d.html.markdown | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fr-fr/d.html.markdown b/fr-fr/d.html.markdown index ee69ca34..96158683 100644 --- a/fr-fr/d.html.markdown +++ b/fr-fr/d.html.markdown @@ -72,9 +72,8 @@ void main() { } ``` On peut définir de nouveaux types avec les mots-clés `struct`, `class`, -`union` et `enum`. Les structures et les unions sont passées au fonctions par -valeurs (elle sont copiées) et les classes sont passées par référence. De plus, -On peut utiliser les templates pour rendre toutes ces abstractions génériques. +`union` et `enum`. Ces types sont passés au fonction par valeur (ils sont copiés) +De plus, on peut utiliser les templates pour rendre toutes ces abstractions génériques. ```d // Ici, 'T' est un paramètre de type. Il est similaire au de C++/C#/Java. From 3835cd26f5c58b05c547d2c9d51b39252e0eca15 Mon Sep 17 00:00:00 2001 From: Sawyer Charles Date: Mon, 19 Oct 2015 10:54:42 -0500 Subject: [PATCH 432/685] [javascript/en] Added setInterval Added the setInterval function provided by most browsers --- javascript.html.markdown | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/javascript.html.markdown b/javascript.html.markdown index d408e885..22a2959c 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -310,6 +310,12 @@ setTimeout(myFunction, 5000); // Note: setTimeout isn't part of the JS language, but is provided by browsers // and Node.js. +// Another function provided by browsers is setInterval +function myFunction(){ + // this code will be called every 5 seconds +} +setInterval(myFunction(), 5000); + // Function objects don't even have to be declared with a name - you can write // an anonymous function definition directly into the arguments of another. setTimeout(function(){ From d78518288bd8d37714ff00355274a7527e0e5a66 Mon Sep 17 00:00:00 2001 From: Sawyer Charles Date: Mon, 19 Oct 2015 12:42:23 -0500 Subject: [PATCH 433/685] removed () --- javascript.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript.html.markdown b/javascript.html.markdown index 22a2959c..81dc09a9 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -314,7 +314,7 @@ setTimeout(myFunction, 5000); function myFunction(){ // this code will be called every 5 seconds } -setInterval(myFunction(), 5000); +setInterval(myFunction, 5000); // Function objects don't even have to be declared with a name - you can write // an anonymous function definition directly into the arguments of another. From 406eb11b74c5ad5d0feb29523cf49582e3ebda7e Mon Sep 17 00:00:00 2001 From: Dennis Keller Date: Mon, 19 Oct 2015 20:59:53 +0200 Subject: [PATCH 434/685] typo fix --- de-de/go-de.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/de-de/go-de.html.markdown b/de-de/go-de.html.markdown index 765372e0..7e61bf81 100644 --- a/de-de/go-de.html.markdown +++ b/de-de/go-de.html.markdown @@ -3,6 +3,7 @@ language: Go filename: learngo-de.go contributors: - ["Joseph Adams", "https://github.com/jcla1"] + - ["Dennis Keller", "https://github.com/denniskeller"] lang: de-de --- Go wurde entwickelt, um Probleme zu lösen. Sie ist zwar nicht der neueste Trend in @@ -306,7 +307,7 @@ func (p pair) ServeHTTP(w http.ResponseWriter, r *http.Request) { ## Weitere Resourcen Alles zu Go finden Sie auf der [offiziellen Go Webseite](http://golang.org/). -Dort können sie der Tutorial folgen, interaktiv Quelltext ausprobieren und viel +Dort können sie dem Tutorial folgen, interaktiv Quelltext ausprobieren und viel Dokumentation lesen. Auch zu empfehlen ist die Spezifikation von Go, die nach heutigen Standards sehr From 7fdce9215acde388da6de41f524aefa8bfb05532 Mon Sep 17 00:00:00 2001 From: Sawyer Charles Date: Mon, 19 Oct 2015 16:00:22 -0500 Subject: [PATCH 435/685] Fixed bracket placement --- javascript.html.markdown | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/javascript.html.markdown b/javascript.html.markdown index 81dc09a9..a119be88 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -291,12 +291,9 @@ myFunction("foo"); // = "FOO" // Note that the value to be returned must start on the same line as the // `return` keyword, otherwise you'll always return `undefined` due to // automatic semicolon insertion. Watch out for this when using Allman style. -function myFunction() -{ +function myFunction(){ return // <- semicolon automatically inserted here - { - thisIsAn: 'object literal' - } + {thisIsAn: 'object literal'} } myFunction(); // = undefined From 9aca78c50a44a4e175798c1ebc66f843f82af80f Mon Sep 17 00:00:00 2001 From: David Hsieh Date: Mon, 19 Oct 2015 17:05:09 -0700 Subject: [PATCH 436/685] Fixed swift-es filename --- es-es/swift-es.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es-es/swift-es.html.markdown b/es-es/swift-es.html.markdown index 86f0aab6..dcc3a607 100644 --- a/es-es/swift-es.html.markdown +++ b/es-es/swift-es.html.markdown @@ -8,7 +8,7 @@ contributors: translators: - ["David Hsieh", "http://github.com/deivuh"] lang: es-es -filename: learnswift.swift +filename: learnswift-es.swift --- Swift es un lenguaje de programación para el desarrollo en iOS y OS X creado From a6eb459b611b67132c76e34095afd87a5aada78c Mon Sep 17 00:00:00 2001 From: Vipul Sharma Date: Tue, 20 Oct 2015 09:57:53 +0530 Subject: [PATCH 437/685] Modified string format [python/en] --- python.html.markdown | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python.html.markdown b/python.html.markdown index 42a52bcf..01e5d481 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -123,8 +123,11 @@ not False # => True # A string can be treated like a list of characters "This is a string"[0] # => 'T' -# % can be used to format strings, like this: -"%s can be %s" % ("strings", "interpolated") +#String formatting with % +#Even though the % string operator will be deprecated on Python 3.1 and removed later at some time, it may still be #good to know how it works. +x = 'apple' +y = 'lemon' +z = "The items in the basket are %s and %s" % (x,y) # A newer way to format strings is the format method. # This method is the preferred way From 60a1a43cd3d797d347d06ef4568f542ab473b2dc Mon Sep 17 00:00:00 2001 From: duci9y Date: Tue, 20 Oct 2015 13:53:47 +0530 Subject: [PATCH 438/685] [xml/en] Grammar, formatting. Made more 'inlined'. --- xml.html.markdown | 155 ++++++++++++++++++++++++++++------------------ 1 file changed, 96 insertions(+), 59 deletions(-) diff --git a/xml.html.markdown b/xml.html.markdown index b95d6088..b4b54330 100644 --- a/xml.html.markdown +++ b/xml.html.markdown @@ -4,18 +4,76 @@ filename: learnxml.xml contributors: - ["João Farias", "https://github.com/JoaoGFarias"] - ["Rachel Stiyer", "https://github.com/rstiyer"] + - ["Deepanshu Utkarsh", "https://github.com/duci9y"] --- -XML is a markup language designed to store and transport data. +XML is a markup language designed to store and transport data. It is supposed to be both human readable and machine readable. Unlike HTML, XML does not specify how to display or to format data, it just carries it. -* XML Syntax +Distinctions are made between the **content** and the **markup**. In short, content could be anything, markup is defined. + +## Some definitions and introductions + +XML Documents are basically made up of *elements* which can have *attributes* describing them and may contain some textual content or more elements as its children. All XML documents must have a root element, which is the ancestor of all the other elements in the document. + +XML Parsers are designed to be very strict, and will stop parsing malformed documents. Therefore it must be ensured that all XML documents follow the [XML Syntax Rules](http://www.w3schools.com/xml/xml_syntax.asp). ```xml - + + + + + + +Content + + + + + + + + + + + + + + + + + + + + + + + Text + + + + + + + Text + + +Text +``` + +## An XML document + +This is what makes XML versatile. It is human readable too. The following document tells us that it defines a bookstore which sells three books, one of which is Learning XML by Erik T. Ray. All this without having used an XML Parser yet. + +```xml + Everyday Italian @@ -36,85 +94,49 @@ Unlike HTML, XML does not specify how to display or to format data, it just carr 39.95 - - - - - - - - -computer.gif - - ``` -* Well-Formated Document x Validation +## Well-formedness and Validation -An XML document is well-formatted if it is syntactically correct. -However, it is possible to inject more constraints in the document, -using document definitions, such as DTD and XML Schema. - -An XML document which follows a document definition is called valid, -in regards to that document. - -With this tool, you can check the XML data outside the application logic. +A XML document is *well-formed* if it is syntactically correct. However, it is possible to add more constraints to the document, using Document Type Definitions (DTDs). A document whose elements are attributes are declared in a DTD and which follows the grammar specified in that DTD is called *valid* with respect to that DTD, in addition to being well-formed. ```xml - - - + - + + - Everyday Italian + Everyday Italian + Giada De Laurentiis + 2005 30.00 - - - - + + + + + ]> - - - - - + @@ -127,3 +149,18 @@ With this tool, you can check the XML data outside the application logic. ``` + +## DTD Compatibility and XML Schema Definitions + +Support for DTDs is ubiquitous because they are so old. Unfortunately, modern XML features like namespaces are not supported by DTDs. XML Schema Definitions (XSDs) are meant to replace DTDs for defining XML document grammar. + +## Resources + +* [Validate your XML](http://www.xmlvalidation.com) + +## Further Reading + +* [XML Schema Definitions Tutorial](http://www.w3schools.com/schema/) +* [DTD Tutorial](http://www.w3schools.com/xml/xml_dtd_intro.asp) +* [XML Tutorial](http://www.w3schools.com/xml/default.asp) +* [Using XPath queries to parse XML](http://www.w3schools.com/xml/xml_xpath.asp) From 76e72653b28590f6aaea9e08ae38f9a812cc65e2 Mon Sep 17 00:00:00 2001 From: duci9y Date: Tue, 20 Oct 2015 14:24:32 +0530 Subject: [PATCH 439/685] [json/en] Cut noise, formatting, links. Also removed some duplicate information. --- json.html.markdown | 53 ++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/json.html.markdown b/json.html.markdown index cde7bc40..a612cffe 100644 --- a/json.html.markdown +++ b/json.html.markdown @@ -8,27 +8,24 @@ contributors: - ["Michael Neth", "https://github.com/infernocloud"] --- -As JSON is an extremely simple data-interchange format, this is most likely going to be the simplest Learn X in Y Minutes ever. +JSON is an extremely simple data-interchange format. As [json.org](http://json.org) says, it is easy for humans to read and write and for machines to parse and generate. + +A piece of JSON must represent either: +* A collection of name/value pairs (`{ }`). In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array. +* An ordered list of values (`[ ]`). In various languages, this is realized as an array, vector, list, or sequence. + an array/list/sequence (`[ ]`) or a dictionary/object/associated array (`{ }`). JSON in its purest form has no actual comments, but most parsers will accept C-style (`//`, `/* */`) comments. Some parsers also tolerate a trailing comma (i.e. a comma after the last element of an array or the after the last property of an object), but they should be avoided for better compatibility. -For the purposes of this, however, everything is going to be 100% valid JSON. Luckily, it kind of speaks for itself. +For the purposes of this tutorial, everything is going to be 100% valid JSON. Luckily, it kind of speaks for itself. -A JSON value must be a number, a string, an array, an object, or one of the following 3 literal names: true, false, null. +Supported data types: -Supporting browsers are: Firefox 3.5+, Internet Explorer 8.0+, Chrome 1.0+, Opera 10.0+, and Safari 4.0+. - -File extension for JSON files is ".json" and the MIME type for JSON text is "application/json". - -Many programming languages have support for serializing (encoding) and unserializing (decoding) JSON data into native data structures. Javascript has implicit support for manipulating JSON text as data. - -More information can be found at http://www.json.org/ - -JSON is built on two structures: -* A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array. -* An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence. - -An object with various name/value pairs. +* Strings: `"hello"`, `"\"A quote.\""`, `"\u0abe"`, `"Newline.\n"` +* Numbers: `23`, `0.11`, `12e10`, `3.141e-10`, `1.23e+4` +* Objects: `{ "key": "value" }` +* Arrays: `["Values"]` +* Miscellaneous: `true`, `false`, `null` ```json { @@ -66,20 +63,20 @@ An object with various name/value pairs. "alternative style": { "comment": "check this out!" - , "comma position": "doesn't matter - as long as it's before the next key, then it's valid" + , "comma position": "doesn't matter, if it's before the next key, it's valid" , "another comment": "how nice" - } + }, + + + + "whitespace": "Does not matter.", + + + + "that was short": "And done. You now know everything JSON has to offer." } ``` -A single array of values by itself is also valid JSON. +## Further Reading -```json -[1, 2, 3, "text", true] -``` - -Objects can be a part of the array as well. - -```json -[{"name": "Bob", "age": 25}, {"name": "Jane", "age": 29}, {"name": "Jack", "age": 31}] -``` +* [JSON.org](http://json.org) All of JSON beautifully explained using flowchart-like graphics. From e8b9f47ce4102217d16707d80d31a663e683f716 Mon Sep 17 00:00:00 2001 From: Jason Yeo Date: Tue, 20 Oct 2015 22:26:37 +0800 Subject: [PATCH 440/685] Add a short tutorial for edn --- edn.html.markdown | 107 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 edn.html.markdown diff --git a/edn.html.markdown b/edn.html.markdown new file mode 100644 index 00000000..b8dc4e88 --- /dev/null +++ b/edn.html.markdown @@ -0,0 +1,107 @@ +--- +language: edn +filename: learnedn.edn +contributors: + - ["Jason Yeo", "https://github.com/jsyeo"] +--- + +Extensible Data Notation or EDN for short is a format for serializing data. + +The notation is used internally by Clojure to represent programs and +it is used commonly by Clojure and Clojurescript programs to transfer +data. Though there are implementations of EDN for many other +languages. + +The main benefit of EDN is that it is extensible, which we will see +how it is extended later on. + +```Clojure +; Comments start with a semicolon. +; Anythng after the semicolon is ignored. + +;;;;;;;;;;;;;;;;;;; +;;; Basic Types ;;; +;;;;;;;;;;;;;;;;;;; + +nil ; or aka null + +; Booleans +true +false + +; Strings are enclosed in double quotes +"hungarian breakfast" +"farmer's cheesy omelette" + +; Characters are preceeded by backslashes +\g \r \a \c \e + +; Keywords starts with a colon. They behave like enums. Kinda +; like symbols in ruby land. + +:eggs +:cheese +:olives + +; Symbols are used to represent identifiers. You can namespace symbols by +; using /. Whatever preceeds / is the namespace of the name. +#spoon +#kitchen/spoon ; not the same as #spoon +#kitchen/fork +#github/fork ; you can't eat with this + +; Integers and floats +42 +3.14159 + +; Lists are a sequence of values +(:bun :beef-patty 9 "yum!") + +; Vectors allow random access +[:gelato 1 2 -2] + +; Maps are associative data structures that associates the key with its value +{:eggs 2 + :lemon-juice 3.5 + :butter 1} + +; You're not restricted to using keywords as keys +{[1 2 3 4] "tell the people what she wore", + [5 6 7 8] "the more you see the more you hate"} + +; You may use commas for readability. They are treated as whitespaces. + +; Sets are collections that contain unique elements. +#{:a :b 88 "huat"} + +;;; Tagged Elements + +; EDN can be extended by tagging elements with # symbols. + +#MyYelpClone/MenuItem {:name "eggs-benedict" :rating 10} + +; Let me explain this with a clojure example. Suppose I want to transform that +; piece of edn into a MenuItem record. + +(defrecord MenuItem [name rating]) + +; To transform edn to clojure values, I will need to use the built in EDN +; reader, edn/read-string + +(edn/read-string "{:eggs 2 :butter 1 :flour 5}") +; -> {:eggs 2 :butter 1 :flour 5} + +; To transform tagged elements, define the reader function and pass a map +; that maps tags to reader functions to edn/read-string like so + +(edn/read-string {:readers {'MyYelpClone/MenuItem map->menu-item}} + "#MyYelpClone/MenuItem {:name \"eggs-benedict\" :rating 10}") +; -> #user.MenuItem{:name "eggs-benedict", :rating 10} + +``` + +# References + +- [EDN spec](https://github.com/edn-format/edn) +- [Implementations](https://github.com/edn-format/edn/wiki/Implementations) +- [Tagged Elements](http://www.compoundtheory.com/clojure-edn-walkthrough/) From 5789ae677260840f8239d0054b051b06ef32d98c Mon Sep 17 00:00:00 2001 From: Jason Yeo Date: Tue, 20 Oct 2015 22:35:07 +0800 Subject: [PATCH 441/685] Reword the intro, make section more obvious --- edn.html.markdown | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/edn.html.markdown b/edn.html.markdown index b8dc4e88..14bb25b4 100644 --- a/edn.html.markdown +++ b/edn.html.markdown @@ -7,13 +7,12 @@ contributors: Extensible Data Notation or EDN for short is a format for serializing data. -The notation is used internally by Clojure to represent programs and -it is used commonly by Clojure and Clojurescript programs to transfer -data. Though there are implementations of EDN for many other -languages. +The notation is used internally by Clojure to represent programs and it also +used as a data transfer format like JSON. Though it is more commonly used in +Clojure land, there are implementations of EDN for many other languages. -The main benefit of EDN is that it is extensible, which we will see -how it is extended later on. +The main benefit of EDN over JSON and YAML is that it is extensible, which we +will see how it is extended later on. ```Clojure ; Comments start with a semicolon. @@ -37,8 +36,7 @@ false \g \r \a \c \e ; Keywords starts with a colon. They behave like enums. Kinda -; like symbols in ruby land. - +; like symbols in ruby. :eggs :cheese :olives @@ -74,7 +72,9 @@ false ; Sets are collections that contain unique elements. #{:a :b 88 "huat"} -;;; Tagged Elements +;;;;;;;;;;;;;;;;;;;;;;; +;;; Tagged Elements ;;; +;;;;;;;;;;;;;;;;;;;;;;; ; EDN can be extended by tagging elements with # symbols. From 8b9c5561e7af0c5caca83ac13d306d756d6f227f Mon Sep 17 00:00:00 2001 From: Sawyer Charles Date: Mon, 19 Oct 2015 10:54:42 -0500 Subject: [PATCH 442/685] [javascript/en] Added setInterval Added the setInterval function provided by most browsers --- javascript.html.markdown | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/javascript.html.markdown b/javascript.html.markdown index d408e885..22a2959c 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -310,6 +310,12 @@ setTimeout(myFunction, 5000); // Note: setTimeout isn't part of the JS language, but is provided by browsers // and Node.js. +// Another function provided by browsers is setInterval +function myFunction(){ + // this code will be called every 5 seconds +} +setInterval(myFunction(), 5000); + // Function objects don't even have to be declared with a name - you can write // an anonymous function definition directly into the arguments of another. setTimeout(function(){ From c0171566ba8c9061fb23fc1ab17b11d974cdbb98 Mon Sep 17 00:00:00 2001 From: Sawyer Charles Date: Mon, 19 Oct 2015 12:42:23 -0500 Subject: [PATCH 443/685] removed () --- javascript.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript.html.markdown b/javascript.html.markdown index 22a2959c..81dc09a9 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -314,7 +314,7 @@ setTimeout(myFunction, 5000); function myFunction(){ // this code will be called every 5 seconds } -setInterval(myFunction(), 5000); +setInterval(myFunction, 5000); // Function objects don't even have to be declared with a name - you can write // an anonymous function definition directly into the arguments of another. From f6d070eeac64abce90550f309ab655846115b12e Mon Sep 17 00:00:00 2001 From: Sawyer Charles Date: Mon, 19 Oct 2015 16:00:22 -0500 Subject: [PATCH 444/685] Fixed bracket placement --- javascript.html.markdown | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/javascript.html.markdown b/javascript.html.markdown index 81dc09a9..a119be88 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -291,12 +291,9 @@ myFunction("foo"); // = "FOO" // Note that the value to be returned must start on the same line as the // `return` keyword, otherwise you'll always return `undefined` due to // automatic semicolon insertion. Watch out for this when using Allman style. -function myFunction() -{ +function myFunction(){ return // <- semicolon automatically inserted here - { - thisIsAn: 'object literal' - } + {thisIsAn: 'object literal'} } myFunction(); // = undefined From c1f573fb33e07fcb4e32b326c7e906b2576f2470 Mon Sep 17 00:00:00 2001 From: Gabriel SoHappy Date: Tue, 20 Oct 2015 23:02:18 +0800 Subject: [PATCH 445/685] fix broken link for java code conventions --- java.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java.html.markdown b/java.html.markdown index 38c9e490..94d266f6 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -709,7 +709,7 @@ The links provided here below are just to get an understanding of the topic, fee * [Generics](http://docs.oracle.com/javase/tutorial/java/generics/index.html) -* [Java Code Conventions](http://www.oracle.com/technetwork/java/codeconv-138413.html) +* [Java Code Conventions](http://www.oracle.com/technetwork/java/codeconvtoc-136057.html) **Online Practice and Tutorials** From c625be3463fb5fdc593635b7f269e6fbea5cb105 Mon Sep 17 00:00:00 2001 From: Gabriel SoHappy Date: Wed, 21 Oct 2015 02:08:54 +0800 Subject: [PATCH 446/685] fix java code conventions in the chinese version --- zh-cn/java-cn.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zh-cn/java-cn.html.markdown b/zh-cn/java-cn.html.markdown index 12afa59a..a8fd2a4c 100644 --- a/zh-cn/java-cn.html.markdown +++ b/zh-cn/java-cn.html.markdown @@ -405,4 +405,4 @@ class PennyFarthing extends Bicycle { * [泛型](http://docs.oracle.com/javase/tutorial/java/generics/index.html) -* [Java代码规范](http://www.oracle.com/technetwork/java/codeconv-138413.html) +* [Java代码规范](http://www.oracle.com/technetwork/java/codeconvtoc-136057.html) From a76be91a2d45c7c4a834c2ad6d5164ac907c1038 Mon Sep 17 00:00:00 2001 From: Greg Yang Date: Tue, 20 Oct 2015 12:05:16 -0700 Subject: [PATCH 447/685] modify function composition example --- haskell.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/haskell.html.markdown b/haskell.html.markdown index 369b1b20..c6d97496 100644 --- a/haskell.html.markdown +++ b/haskell.html.markdown @@ -195,11 +195,11 @@ foo 5 -- 15 -- function composition -- the (.) function chains functions together. -- For example, here foo is a function that takes a value. It adds 10 to it, --- multiplies the result of that by 5, and then returns the final value. -foo = (*5) . (+10) +-- multiplies the result of that by 4, and then returns the final value. +foo = (*4) . (+10) --- (5 + 10) * 5 = 75 -foo 5 -- 75 +-- (5 + 10) * 4 = 75 +foo 5 -- 60 -- fixing precedence -- Haskell has another operator called `$`. This operator applies a function From 18edced524b790fe3e6c9bb5f69507ca1bfb0553 Mon Sep 17 00:00:00 2001 From: Greg Yang Date: Tue, 20 Oct 2015 12:10:01 -0700 Subject: [PATCH 448/685] update the comment in as well --- haskell.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haskell.html.markdown b/haskell.html.markdown index c6d97496..e3b29937 100644 --- a/haskell.html.markdown +++ b/haskell.html.markdown @@ -198,7 +198,7 @@ foo 5 -- 15 -- multiplies the result of that by 4, and then returns the final value. foo = (*4) . (+10) --- (5 + 10) * 4 = 75 +-- (5 + 10) * 4 = 40 foo 5 -- 60 -- fixing precedence From f0bbebe789e310ecd76fcfdfa334291928591fb7 Mon Sep 17 00:00:00 2001 From: Greg Yang Date: Tue, 20 Oct 2015 12:10:50 -0700 Subject: [PATCH 449/685] really update the comment --- haskell.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haskell.html.markdown b/haskell.html.markdown index e3b29937..08611e63 100644 --- a/haskell.html.markdown +++ b/haskell.html.markdown @@ -198,7 +198,7 @@ foo 5 -- 15 -- multiplies the result of that by 4, and then returns the final value. foo = (*4) . (+10) --- (5 + 10) * 4 = 40 +-- (5 + 10) * 4 = 60 foo 5 -- 60 -- fixing precedence From 11aab085d656b79482e92a05acbbac81125bfb78 Mon Sep 17 00:00:00 2001 From: Kristin Linn Date: Tue, 20 Oct 2015 16:22:40 -0400 Subject: [PATCH 450/685] add statistical analysis section with general linear models --- r.html.markdown | 105 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 101 insertions(+), 4 deletions(-) diff --git a/r.html.markdown b/r.html.markdown index d3d725d3..3d0b9b9e 100644 --- a/r.html.markdown +++ b/r.html.markdown @@ -3,6 +3,7 @@ language: R contributors: - ["e99n09", "http://github.com/e99n09"] - ["isomorphismes", "http://twitter.com/isomorphisms"] + - ["kalinn", "http://github.com/kalinn"] filename: learnr.r --- @@ -196,6 +197,14 @@ class(NaN) # "numeric" # You can do arithmetic on two vectors with length greater than 1, # so long as the larger vector's length is an integer multiple of the smaller c(1,2,3) + c(1,2,3) # 2 4 6 +# Since a single number is a vector of length one, scalars are applied +# elementwise to vectors +(4 * c(1,2,3) - 2) / 2 # 1 3 5 +# Except for scalars, use caution when performing arithmetic on vectors with +# different lengths. Although it can be done, +c(1,2,3,1,2,3) * c(1,2) # 1 4 3 2 2 6 +# Matching lengths is better practice and easier to read +c(1,2,3,1,2,3) * c(1,2,1,2,1,2) # CHARACTERS # There's no difference between strings and characters in R @@ -234,6 +243,9 @@ class(NA) # "logical" TRUE | FALSE # TRUE # AND TRUE & FALSE # FALSE +# Applying | and & to vectors returns elementwise logic operations +c(TRUE,FALSE,FALSE) | c(FALSE,TRUE,FALSE) # TRUE TRUE FALSE +c(TRUE,FALSE,TRUE) & c(FALSE,TRUE,TRUE) # FALSE FALSE TRUE # You can test if x is TRUE isTRUE(TRUE) # TRUE # Here we get a logical vector with many elements: @@ -663,6 +675,95 @@ write.csv(pets, "pets2.csv") # to make a new .csv file +######################### +# Statistical Analysis +######################### + +# Linear regression! +linearModel <- lm(price ~ time, data = list1) +linearModel # outputs result of regression +# => +# Call: +# lm(formula = price ~ time, data = list1) +# +# Coefficients: +# (Intercept) time +# 0.1453 0.4943 +summary(linearModel) # more verbose output from the regression +# => +# Call: +# lm(formula = price ~ time, data = list1) +# +# Residuals: +# Min 1Q Median 3Q Max +# -8.3134 -3.0131 -0.3606 2.8016 10.3992 +# +# Coefficients: +# Estimate Std. Error t value Pr(>|t|) +# (Intercept) 0.14527 1.50084 0.097 0.923 +# time 0.49435 0.06379 7.749 2.44e-09 *** +# --- +# Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 +# +# Residual standard error: 4.657 on 38 degrees of freedom +# Multiple R-squared: 0.6124, Adjusted R-squared: 0.6022 +# F-statistic: 60.05 on 1 and 38 DF, p-value: 2.44e-09 +coef(linearModel) # extract estimated parameters +# => +# (Intercept) time +# 0.1452662 0.4943490 +summary(linearModel)$coefficients # another way to extract results +# => +# Estimate Std. Error t value Pr(>|t|) +# (Intercept) 0.1452662 1.50084246 0.09678975 9.234021e-01 +# time 0.4943490 0.06379348 7.74920901 2.440008e-09 +summary(linearModel)$coefficients[,4] # the p-values +# => +# (Intercept) time +# 9.234021e-01 2.440008e-09 + +# GENERAL LINEAR MODELS +# Logistic regression +set.seed(1) +list1$success = rbinom(length(list1$time), 1, .5) # random binary +glModel <- glm(success ~ time, data = list1, + family=binomial(link="logit")) +glModel # outputs result of logistic regression +# => +# Call: glm(formula = success ~ time, +# family = binomial(link = "logit"), data = list1) +# +# Coefficients: +# (Intercept) time +# 0.17018 -0.01321 +# +# Degrees of Freedom: 39 Total (i.e. Null); 38 Residual +# Null Deviance: 55.35 +# Residual Deviance: 55.12 AIC: 59.12 +summary(glModel) # more verbose output from the regression +# => +# Call: +# glm(formula = success ~ time, +# family = binomial(link = "logit"), data = list1) + +# Deviance Residuals: +# Min 1Q Median 3Q Max +# -1.245 -1.118 -1.035 1.202 1.327 +# +# Coefficients: +# Estimate Std. Error z value Pr(>|z|) +# (Intercept) 0.17018 0.64621 0.263 0.792 +# time -0.01321 0.02757 -0.479 0.632 +# +# (Dispersion parameter for binomial family taken to be 1) +# +# Null deviance: 55.352 on 39 degrees of freedom +# Residual deviance: 55.121 on 38 degrees of freedom +# AIC: 59.121 +# +# Number of Fisher Scoring iterations: 3 + + ######################### # Plots ######################### @@ -670,9 +771,6 @@ write.csv(pets, "pets2.csv") # to make a new .csv file # BUILT-IN PLOTTING FUNCTIONS # Scatterplots! plot(list1$time, list1$price, main = "fake data") -# Regressions! -linearModel <- lm(price ~ time, data = list1) -linearModel # outputs result of regression # Plot regression line on existing plot abline(linearModel, col = "red") # Get a variety of nice diagnostics @@ -696,7 +794,6 @@ pp + geom_point() # ggplot2 has excellent documentation (available http://docs.ggplot2.org/current/) - ``` ## How do I get R? From 622e03a141f586e858209fe98c649aa2a4bb9183 Mon Sep 17 00:00:00 2001 From: Kristin Linn Date: Tue, 20 Oct 2015 16:57:36 -0400 Subject: [PATCH 451/685] add statistical analysis section with general linear models --- r.html.markdown | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/r.html.markdown b/r.html.markdown index 61fc7a01..3d0b9b9e 100644 --- a/r.html.markdown +++ b/r.html.markdown @@ -16,8 +16,7 @@ R is a statistical computing language. It has lots of libraries for uploading an # You can't make multi-line comments, # but you can stack multiple comments like so. -# in Windows you can use CTRL-ENTER to execute a line. -# on Mac it is COMMAND-ENTER +# in Windows or Mac, hit COMMAND-ENTER to execute a line @@ -38,8 +37,8 @@ head(rivers) # peek at the data set length(rivers) # how many rivers were measured? # 141 summary(rivers) # what are some summary statistics? -# Min. 1st Qu. Median Mean 3rd Qu. Max. -# 135.0 310.0 425.0 591.2 680.0 3710.0 +# Min. 1st Qu. Median Mean 3rd Qu. Max. +# 135.0 310.0 425.0 591.2 680.0 3710.0 # make a stem-and-leaf plot (a histogram-like data visualization) stem(rivers) @@ -56,14 +55,14 @@ stem(rivers) # 14 | 56 # 16 | 7 # 18 | 9 -# 20 | +# 20 | # 22 | 25 # 24 | 3 -# 26 | -# 28 | -# 30 | -# 32 | -# 34 | +# 26 | +# 28 | +# 30 | +# 32 | +# 34 | # 36 | 1 stem(log(rivers)) # Notice that the data are neither normal nor log-normal! @@ -72,7 +71,7 @@ stem(log(rivers)) # Notice that the data are neither normal nor log-normal! # The decimal point is 1 digit(s) to the left of the | # # 48 | 1 -# 50 | +# 50 | # 52 | 15578 # 54 | 44571222466689 # 56 | 023334677000124455789 @@ -87,7 +86,7 @@ stem(log(rivers)) # Notice that the data are neither normal nor log-normal! # 74 | 84 # 76 | 56 # 78 | 4 -# 80 | +# 80 | # 82 | 2 # make a histogram: @@ -110,7 +109,7 @@ sort(discoveries) # [76] 4 4 4 4 5 5 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 8 9 10 12 stem(discoveries, scale=2) -# +# # The decimal point is at the | # # 0 | 000000000 @@ -124,14 +123,14 @@ stem(discoveries, scale=2) # 8 | 0 # 9 | 0 # 10 | 0 -# 11 | +# 11 | # 12 | 0 max(discoveries) # 12 summary(discoveries) -# Min. 1st Qu. Median Mean 3rd Qu. Max. -# 0.0 2.0 3.0 3.1 4.0 12.0 +# Min. 1st Qu. Median Mean 3rd Qu. Max. +# 0.0 2.0 3.0 3.1 4.0 12.0 # Roll a die a few times round(runif(7, min=.5, max=6.5)) @@ -275,7 +274,7 @@ class(NULL) # NULL parakeet = c("beak", "feathers", "wings", "eyes") parakeet # => -# [1] "beak" "feathers" "wings" "eyes" +# [1] "beak" "feathers" "wings" "eyes" parakeet <- NULL parakeet # => @@ -292,7 +291,7 @@ as.numeric("Bilbo") # => # [1] NA # Warning message: -# NAs introduced by coercion +# NAs introduced by coercion # Also note: those were just the basic data types # There are many more data types, such as for dates, time series, etc. @@ -432,10 +431,10 @@ mat %*% t(mat) mat2 <- cbind(1:4, c("dog", "cat", "bird", "dog")) mat2 # => -# [,1] [,2] -# [1,] "1" "dog" -# [2,] "2" "cat" -# [3,] "3" "bird" +# [,1] [,2] +# [1,] "1" "dog" +# [2,] "2" "cat" +# [3,] "3" "bird" # [4,] "4" "dog" class(mat2) # matrix # Again, note what happened! From 81c1b8334cdccd054d4131fc0309eeebebef53f9 Mon Sep 17 00:00:00 2001 From: Kristin Linn Date: Tue, 20 Oct 2015 17:06:41 -0400 Subject: [PATCH 452/685] fix spaces at end-of-lines --- r.html.markdown | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/r.html.markdown b/r.html.markdown index 3d0b9b9e..ce313ecc 100644 --- a/r.html.markdown +++ b/r.html.markdown @@ -16,9 +16,8 @@ R is a statistical computing language. It has lots of libraries for uploading an # You can't make multi-line comments, # but you can stack multiple comments like so. -# in Windows or Mac, hit COMMAND-ENTER to execute a line - - +# in Windows you can use CTRL-ENTER to execute a line. +# on Mac it is COMMAND-ENTER ############################################################################# # Stuff you can do without understanding anything about programming @@ -37,8 +36,8 @@ head(rivers) # peek at the data set length(rivers) # how many rivers were measured? # 141 summary(rivers) # what are some summary statistics? -# Min. 1st Qu. Median Mean 3rd Qu. Max. -# 135.0 310.0 425.0 591.2 680.0 3710.0 +# Min. 1st Qu. Median Mean 3rd Qu. Max. +# 135.0 310.0 425.0 591.2 680.0 3710.0 # make a stem-and-leaf plot (a histogram-like data visualization) stem(rivers) @@ -55,14 +54,14 @@ stem(rivers) # 14 | 56 # 16 | 7 # 18 | 9 -# 20 | +# 20 | # 22 | 25 # 24 | 3 -# 26 | -# 28 | -# 30 | -# 32 | -# 34 | +# 26 | +# 28 | +# 30 | +# 32 | +# 34 | # 36 | 1 stem(log(rivers)) # Notice that the data are neither normal nor log-normal! @@ -71,7 +70,7 @@ stem(log(rivers)) # Notice that the data are neither normal nor log-normal! # The decimal point is 1 digit(s) to the left of the | # # 48 | 1 -# 50 | +# 50 | # 52 | 15578 # 54 | 44571222466689 # 56 | 023334677000124455789 @@ -86,7 +85,7 @@ stem(log(rivers)) # Notice that the data are neither normal nor log-normal! # 74 | 84 # 76 | 56 # 78 | 4 -# 80 | +# 80 | # 82 | 2 # make a histogram: @@ -109,7 +108,7 @@ sort(discoveries) # [76] 4 4 4 4 5 5 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 8 9 10 12 stem(discoveries, scale=2) -# +# # The decimal point is at the | # # 0 | 000000000 @@ -130,7 +129,7 @@ max(discoveries) # 12 summary(discoveries) # Min. 1st Qu. Median Mean 3rd Qu. Max. -# 0.0 2.0 3.0 3.1 4.0 12.0 +# 0.0 2.0 3.0 3.1 4.0 12.0 # Roll a die a few times round(runif(7, min=.5, max=6.5)) @@ -274,7 +273,7 @@ class(NULL) # NULL parakeet = c("beak", "feathers", "wings", "eyes") parakeet # => -# [1] "beak" "feathers" "wings" "eyes" +# [1] "beak" "feathers" "wings" "eyes" parakeet <- NULL parakeet # => @@ -291,7 +290,7 @@ as.numeric("Bilbo") # => # [1] NA # Warning message: -# NAs introduced by coercion +# NAs introduced by coercion # Also note: those were just the basic data types # There are many more data types, such as for dates, time series, etc. @@ -431,10 +430,10 @@ mat %*% t(mat) mat2 <- cbind(1:4, c("dog", "cat", "bird", "dog")) mat2 # => -# [,1] [,2] -# [1,] "1" "dog" -# [2,] "2" "cat" -# [3,] "3" "bird" +# [,1] [,2] +# [1,] "1" "dog" +# [2,] "2" "cat" +# [3,] "3" "bird" # [4,] "4" "dog" class(mat2) # matrix # Again, note what happened! From 7ad97c290436d9f01ba9b5dd2a557869995efa0c Mon Sep 17 00:00:00 2001 From: Kristin Linn Date: Tue, 20 Oct 2015 17:10:58 -0400 Subject: [PATCH 453/685] fix spaces at end-of-lines again --- r.html.markdown | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/r.html.markdown b/r.html.markdown index ce313ecc..8539b10e 100644 --- a/r.html.markdown +++ b/r.html.markdown @@ -19,6 +19,8 @@ R is a statistical computing language. It has lots of libraries for uploading an # in Windows you can use CTRL-ENTER to execute a line. # on Mac it is COMMAND-ENTER + + ############################################################################# # Stuff you can do without understanding anything about programming ############################################################################# @@ -122,13 +124,13 @@ stem(discoveries, scale=2) # 8 | 0 # 9 | 0 # 10 | 0 -# 11 | +# 11 | # 12 | 0 max(discoveries) # 12 summary(discoveries) -# Min. 1st Qu. Median Mean 3rd Qu. Max. +# Min. 1st Qu. Median Mean 3rd Qu. Max. # 0.0 2.0 3.0 3.1 4.0 12.0 # Roll a die a few times @@ -793,6 +795,7 @@ pp + geom_point() # ggplot2 has excellent documentation (available http://docs.ggplot2.org/current/) + ``` ## How do I get R? From 401093269d1a5b0db14c54f2e355ff3461b43325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A1ssio=20B=C3=B6ck?= Date: Tue, 20 Oct 2015 23:53:25 -0200 Subject: [PATCH 454/685] Pogoscript to pt-br Partial translation to pt-br --- pt-br/pogo.html.markdown | 202 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 pt-br/pogo.html.markdown diff --git a/pt-br/pogo.html.markdown b/pt-br/pogo.html.markdown new file mode 100644 index 00000000..80972c98 --- /dev/null +++ b/pt-br/pogo.html.markdown @@ -0,0 +1,202 @@ +--- +language: pogoscript +contributors: + - ["Tim Macfarlane", "http://github.com/refractalize"] + - ["Cássio Böck", "https://github.com/cassiobsilva"] +filename: learnPogo.pogo +--- + +Pogoscript é uma linguagem de programação que possui tipos primitivos concorrents +e que compila para linguagem Javascript padrão. + +``` javascript +// definindo uma variável +water temperature = 24 + +// reatribuindo o valor de uma variável após a sua definição +water temperature := 26 + +// funções permitem que seus parâmetros sejam colocados em qualquer lugar +temperature at (a) altitude = 32 - a / 100 + +// funções longas são apenas indentadas +temperature at (a) altitude := + if (a < 0) + water temperature + else + 32 - a / 100 + +// chamada de uma função +current temperature = temperature at 3200 altitude + +// essa função cria um novo objeto com métodos +position (x, y) = { + x = x + y = y + + distance from position (p) = + dx = self.x - p.x + dy = self.y - p.y + Math.sqrt (dx * dx + dy * dy) +} + +// `self` é similiar ao `this` no Javascript, com exceção de que `self` não +// é redefinido em cada nova função + +// chamada de métodos +position (7, 2).distance from position (position (5, 1)) + +// assim como no Javascript, objetos também são hashes +position.'x' == position.x == position.('x') + +// arrays +positions = [ + position (1, 1) + position (1, 2) + position (1, 3) +] + +// indexando um array +positions.0.y + +n = 2 +positions.(n).y + +// strings +poem = 'Tail turned to red sunset on a juniper crown a lone magpie cawks. + Mad at Oryoki in the shrine-room -- Thistles blossomed late afternoon. + Put on my shirt and took it off in the sun walking the path to lunch. + A dandelion seed floats above the marsh grass with the mosquitos. + At 4 A.M. the two middleaged men sleeping together holding hands. + In the half-light of dawn a few birds warble under the Pleiades. + Sky reddens behind fir trees, larks twitter, sparrows cheep cheep cheep + cheep cheep.' + +// texto de Allen Ginsburg + +// interpolação +outlook = 'amazing!' +console.log "the weather tomorrow is going to be #(outlook)" + +// expressões regulares +r/(\d+)m/i +r/(\d+) degrees/mg + +// operadores +true @and true +false @or true +@not false +2 < 4 +2 >= 2 +2 > 1 + +// todos do Javascript também são suportados + +// definindo seu próprio operador +(p1) plus (p2) = + position (p1.x + p2.x, p1.y + p2.y) + +// `plus` pode ser usado com um operador +position (1, 1) @plus position (0, 2) +// ou como uma função +(position (1, 1)) plus (position (0, 2)) + +// retorno explícito +(x) times (y) = return (x * y) + +// new +now = @new Date () + +// funções podem receber argumentos opcionais +spark (position, color: 'black', velocity: {x = 0, y = 0}) = { + color = color + position = position + velocity = velocity +} + +red = spark (position 1 1, color: 'red') +fast black = spark (position 1 1, velocity: {x = 10, y = 0}) + +// functions can unsplat arguments too +log (messages, ...) = + console.log (messages, ...) + +// blocks are functions passed to other functions. +// This block takes two parameters, `spark` and `c`, +// the body of the block is the indented code after the +// function call + +render each @(spark) into canvas context @(c) + ctx.begin path () + ctx.stroke style = spark.color + ctx.arc ( + spark.position.x + canvas.width / 2 + spark.position.y + 3 + 0 + Math.PI * 2 + ) + ctx.stroke () + +// asynchronous calls + +// JavaScript both in the browser and on the server (with Node.js) +// makes heavy use of asynchronous IO with callbacks. Async IO is +// amazing for performance and making concurrency simple but it +// quickly gets complicated. +// Pogoscript has a few things to make async IO much much easier + +// Node.js includes the `fs` module for accessing the file system. +// Let's list the contents of a directory + +fs = require 'fs' +directory listing = fs.readdir! '.' + +// `fs.readdir()` is an asynchronous function, so we can call it +// using the `!` operator. The `!` operator allows you to call +// async functions with the same syntax and largely the same +// semantics as normal synchronous functions. Pogoscript rewrites +// it so that all subsequent code is placed in the callback function +// to `fs.readdir()`. + +// to catch asynchronous errors while calling asynchronous functions + +try + another directory listing = fs.readdir! 'a-missing-dir' +catch (ex) + console.log (ex) + +// in fact, if you don't use `try catch`, it will raise the error up the +// stack to the outer-most `try catch` or to the event loop, as you'd expect +// with non-async exceptions + +// all the other control structures work with asynchronous calls too +// here's `if else` +config = + if (fs.stat! 'config.json'.is file ()) + JSON.parse (fs.read file! 'config.json' 'utf-8') + else + { + color: 'red' + } + +// to run two asynchronous calls concurrently, use the `?` operator. +// The `?` operator returns a *future* which can be executed to +// wait for and obtain the result, again using the `!` operator + +// we don't wait for either of these calls to finish +a = fs.stat? 'a.txt' +b = fs.stat? 'b.txt' + +// now we wait for the calls to finish and print the results +console.log "size of a.txt is #(a!.size)" +console.log "size of b.txt is #(b!.size)" + +// futures in Pogoscript are analogous to Promises +``` + +That's it. + +Download [Node.js](http://nodejs.org/) and `npm install pogo`. + +There is plenty of documentation on [http://pogoscript.org/](http://pogoscript.org/), including a [cheat sheet](http://pogoscript.org/cheatsheet.html), a [guide](http://pogoscript.org/guide/), and how [Pogoscript translates to Javascript](http://featurist.github.io/pogo-examples/). Get in touch on the [google group](http://groups.google.com/group/pogoscript) if you have questions! From 5838e931b715e663482b335b5a20055ce2dcc0b9 Mon Sep 17 00:00:00 2001 From: Gautam Kotian Date: Wed, 21 Oct 2015 11:36:04 +0200 Subject: [PATCH 455/685] Improve code comments --- d.html.markdown | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/d.html.markdown b/d.html.markdown index 80c1dc65..4a362372 100644 --- a/d.html.markdown +++ b/d.html.markdown @@ -218,7 +218,7 @@ void main() { // from 1 to 100. Easy! // Just pass lambda expressions as template parameters! - // You can pass any old function you like, but lambdas are convenient here. + // You can pass any function you like, but lambdas are convenient here. auto num = iota(1, 101).filter!(x => x % 2 == 0) .map!(y => y ^^ 2) .reduce!((a, b) => a + b); @@ -228,7 +228,7 @@ void main() { ``` Notice how we got to build a nice Haskellian pipeline to compute num? -That's thanks to a D innovation know as Uniform Function Call Syntax. +That's thanks to a D innovation know as Uniform Function Call Syntax (UFCS). With UFCS, we can choose whether to write a function call as a method or free function call! Walter wrote a nice article on this [here.](http://www.drdobbs.com/cpp/uniform-function-call-syntax/232700394) @@ -238,21 +238,23 @@ is of some type A on any expression of type A as a method. I like parallelism. Anyone else like parallelism? Sure you do. Let's do some! ```c +// Let's say we want to populate a large array with the square root of all +// consecutive integers starting from 1 (up until the size of the array), and we +// want to do this concurrently taking advantage of as many cores as we have +// available. + import std.stdio; import std.parallelism : parallel; import std.math : sqrt; void main() { - // We want take the square root every number in our array, - // and take advantage of as many cores as we have available. + // Create your large array auto arr = new double[1_000_000]; - // Use an index, and an array element by referece, - // and just call parallel on the array! + // 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); } } - - ``` From 707551a1436daa163c60c8bf7496d17c2a030f32 Mon Sep 17 00:00:00 2001 From: Per Lilja Date: Wed, 21 Oct 2015 13:29:59 +0200 Subject: [PATCH 456/685] Added text about static code block. --- java.html.markdown | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/java.html.markdown b/java.html.markdown index 38c9e490..aae64ccf 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -450,6 +450,17 @@ class Bicycle { protected int gear; // Protected: Accessible from the class and subclasses String name; // default: Only accessible from within this package + static String className; // Static class variable + + // Static block + // Java has no implementation of static constructors, but + // has a static block that can be used to initialize class variables + // (static variables). + // This block will be called when the class is loaded. + static { + className = "Bicycle"; + } + // Constructors are a way of creating classes // This is a constructor public Bicycle() { From ef9331fa31ab84e5a04ee024ac490b24a6b5c4dc Mon Sep 17 00:00:00 2001 From: Raphael Nascimento Date: Wed, 21 Oct 2015 09:03:12 -0300 Subject: [PATCH 457/685] [java/en] Enum Type --- java.html.markdown | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/java.html.markdown b/java.html.markdown index 8544ecfc..86b0578e 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -7,7 +7,7 @@ contributors: - ["Simon Morgan", "http://sjm.io/"] - ["Zachary Ferguson", "http://github.com/zfergus2"] - ["Cameron Schermerhorn", "http://github.com/cschermerhorn"] - - ["Raphael Nascimento", "http://github.com/raphaelbn"] + - ["Rachel Stiyer", "https://github.com/rstiyer"] filename: LearnJava.java --- @@ -138,7 +138,7 @@ public class LearnJava { // // BigDecimal allows the programmer complete control over decimal // rounding. It is recommended to use BigDecimal with currency values - // and where exact decimal percision is required. + // and where exact decimal precision is required. // // BigDecimal can be initialized with an int, long, double or String // or by initializing the unscaled value (BigInteger) and scale (int). @@ -185,8 +185,12 @@ public class LearnJava { // LinkedLists - Implementation of doubly-linked list. All of the // operations perform as could be expected for a // doubly-linked list. - // Maps - A set of objects that maps keys to values. A map cannot - // contain duplicate keys; each key can map to at most one value. + // Maps - A set of objects that map keys to values. Map is + // an interface and therefore cannot be instantiated. + // The type of keys and values contained in a Map must + // be specified upon instantiation of the implementing + // class. Each key may map to only one corresponding value, + // and each key may appear only once (no duplicates). // HashMaps - This class uses a hashtable to implement the Map // interface. This allows the execution time of basic // operations, such as get and insert element, to remain @@ -251,7 +255,7 @@ public class LearnJava { // If statements are c-like int j = 10; - if (j == 10){ + if (j == 10) { System.out.println("I get printed"); } else if (j > 10) { System.out.println("I don't"); @@ -286,7 +290,18 @@ public class LearnJava { // Iterated 10 times, fooFor 0->9 } System.out.println("fooFor Value: " + fooFor); - + + // Nested For Loop Exit with Label + outer: + for (int i = 0; i < 10; i++) { + for (int j = 0; j < 10; j++) { + if (i == 5 && j ==5) { + break outer; + // breaks out of outer loop instead of only the inner one + } + } + } + // For Each Loop // The for loop is also able to iterate over arrays as well as objects // that implement the Iterable interface. @@ -321,7 +336,7 @@ public class LearnJava { // Starting in Java 7 and above, switching Strings works like this: String myAnswer = "maybe"; - switch(myAnswer){ + switch(myAnswer) { case "yes": System.out.println("You answered yes."); break; From b89c4a82c81ce8b26c14cb5fee8fc97eeb4e9ec1 Mon Sep 17 00:00:00 2001 From: Adam Bard Date: Wed, 21 Oct 2015 20:36:50 +0800 Subject: [PATCH 458/685] Update xml-id.html.markdown --- id-id/xml-id.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/id-id/xml-id.html.markdown b/id-id/xml-id.html.markdown index c1e985aa..8b8d72ae 100644 --- a/id-id/xml-id.html.markdown +++ b/id-id/xml-id.html.markdown @@ -1,6 +1,6 @@ --- language: xml -filename: learnxml.xml +filename: learnxml-id.xml contributors: - ["João Farias", "https://github.com/JoaoGFarias"] translators: From d226542f37988edd237544142911c67ecdc6b391 Mon Sep 17 00:00:00 2001 From: payet-s Date: Wed, 21 Oct 2015 17:36:46 +0200 Subject: [PATCH 459/685] [python/fr] Fix python3 link --- fr-fr/python-fr.html.markdown | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fr-fr/python-fr.html.markdown b/fr-fr/python-fr.html.markdown index 3f6dcabb..d78291be 100644 --- a/fr-fr/python-fr.html.markdown +++ b/fr-fr/python-fr.html.markdown @@ -14,8 +14,7 @@ Je suis tombé amoureux de Python de par la clarté de sa syntaxe. C'est pratiqu Vos retours sont grandement appréciés. Vous pouvez me contacter sur Twitter [@louiedinh](http://twitter.com/louiedinh) ou par e-mail: louiedinh [at] [google's email service] -NB: Cet artice s'applique spécifiquement à Python 2.7, mais devrait s'appliquer pour toute version Python 2.x -Vous pourrez bientôt trouver un article pour Python 3 en Français. Pour le moment vous pouvez jettez un coup d'oeil à l'article [Python 3 en Anglais](http://learnxinyminutes.com/docs/python3/). +N.B. : Cet article s'applique spécifiquement à Python 2.7, mais devrait s'appliquer pour toute version Python 2.x. Python 2.7 est en fin de vie et ne sera plus maintenu à partir de 2020, il est donc recommandé d'apprendre Python avec Python 3. Pour Python 3.x, il existe un autre [tutoriel pour Python 3](http://learnxinyminutes.com/docs/fr-fr/python3-fr/). ```python # Une ligne simple de commentaire commence par un dièse From ecbd4540681a99cb83a201f3f09deaf2af3fb58f Mon Sep 17 00:00:00 2001 From: Peter Elmers Date: Wed, 21 Oct 2015 11:48:12 -0500 Subject: [PATCH 460/685] Fix a few spots where inconsistently tabs and spaces are used for alignment. --- java.html.markdown | 6 +++--- matlab.html.markdown | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/java.html.markdown b/java.html.markdown index aae64ccf..efc4407b 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -186,9 +186,9 @@ public class LearnJava { // operations perform as could be expected for a // doubly-linked list. // Maps - A set of objects that map keys to values. Map is - // an interface and therefore cannot be instantiated. - // The type of keys and values contained in a Map must - // be specified upon instantiation of the implementing + // an interface and therefore cannot be instantiated. + // The type of keys and values contained in a Map must + // be specified upon instantiation of the implementing // class. Each key may map to only one corresponding value, // and each key may appear only once (no duplicates). // HashMaps - This class uses a hashtable to implement the Map diff --git a/matlab.html.markdown b/matlab.html.markdown index 4d97834c..ad42d9a9 100644 --- a/matlab.html.markdown +++ b/matlab.html.markdown @@ -262,7 +262,7 @@ pcolor(A) % Heat-map of matrix: plot as grid of rectangles, coloured by value contour(A) % Contour plot of matrix mesh(A) % Plot as a mesh surface -h = figure % Create new figure object, with handle h +h = figure % Create new figure object, with handle h figure(h) % Makes the figure corresponding to handle h the current figure close(h) % close figure with handle h close all % close all open figure windows @@ -460,7 +460,7 @@ length % length of a vector sort % sort in ascending order sum % sum of elements prod % product of elements -mode % modal value +mode % modal value median % median value mean % mean value std % standard deviation From 24ff15fe7a327232a0c33600ea70f8bc5c566eb3 Mon Sep 17 00:00:00 2001 From: aceawan Date: Wed, 21 Oct 2015 19:08:03 +0200 Subject: [PATCH 461/685] correct indentation --- fr-fr/d.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fr-fr/d.html.markdown b/fr-fr/d.html.markdown index 96158683..9eacc2aa 100644 --- a/fr-fr/d.html.markdown +++ b/fr-fr/d.html.markdown @@ -88,8 +88,8 @@ struct LinkedList(T) { class BinTree(T) { T data = null; - // Si il n'y a qu'un seul paramètre de template, - // on peut s'abstenir de mettre des parenthèses. + // Si il n'y a qu'un seul paramètre de template, + // on peut s'abstenir de mettre des parenthèses. BinTree!T left; BinTree!T right; } From a15486c2a843c7b1c76f0343da9436bf39d2e227 Mon Sep 17 00:00:00 2001 From: aceawan Date: Wed, 21 Oct 2015 19:08:52 +0200 Subject: [PATCH 462/685] correct indentation --- fr-fr/d.html.markdown | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fr-fr/d.html.markdown b/fr-fr/d.html.markdown index 9eacc2aa..d9bd9b48 100644 --- a/fr-fr/d.html.markdown +++ b/fr-fr/d.html.markdown @@ -248,13 +248,13 @@ import std.parallelism : parallel; import std.math : sqrt; void main() { - // On veut calculer la racine carré de tous les nombres - // dans notre tableau, et profiter de tous les coeurs - // à notre disposition. + // On veut calculer la racine carré de tous les nombres + // dans notre tableau, et profiter de tous les coeurs + // à notre disposition. auto arr = new double[1_000_000]; - // On utilise un index et une référence à chaque élément du tableau. - // On appelle juste la fonction parallel sur notre tableau ! + // On utilise un index et une référence à chaque élément du tableau. + // On appelle juste la fonction parallel sur notre tableau ! foreach(i, ref elem; parallel(arr)) { ref = sqrt(i + 1.0); } From 257533fe5aa5027dc71e78d10833a3ba0febb426 Mon Sep 17 00:00:00 2001 From: ven Date: Wed, 21 Oct 2015 23:18:38 +0200 Subject: [PATCH 463/685] fix #1726, thanks @fisktech --- javascript.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript.html.markdown b/javascript.html.markdown index a119be88..c1c59de1 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -21,7 +21,7 @@ Feedback would be highly appreciated! You can reach me at [adam@brenecki.id.au](mailto:adam@brenecki.id.au). ```js -// Comments are like C. Single-line comments start with two slashes, +// Comments are like C's. Single-line comments start with two slashes, /* and multiline comments start with slash-star and end with star-slash */ From f0daae643482918fce3c75b012087dc19f883d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A1ssio=20B=C3=B6ck?= Date: Wed, 21 Oct 2015 23:30:42 -0200 Subject: [PATCH 464/685] translation to pt-br translation to pt-br completed --- pt-br/pogo.html.markdown | 76 ++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/pt-br/pogo.html.markdown b/pt-br/pogo.html.markdown index 80972c98..5dc81ec0 100644 --- a/pt-br/pogo.html.markdown +++ b/pt-br/pogo.html.markdown @@ -3,7 +3,8 @@ language: pogoscript contributors: - ["Tim Macfarlane", "http://github.com/refractalize"] - ["Cássio Böck", "https://github.com/cassiobsilva"] -filename: learnPogo.pogo +filename: learnPogo-pt-br.pogo +lang: pt-br --- Pogoscript é uma linguagem de programação que possui tipos primitivos concorrents @@ -26,7 +27,7 @@ temperature at (a) altitude := else 32 - a / 100 -// chamada de uma função +// declarando uma função current temperature = temperature at 3200 altitude // essa função cria um novo objeto com métodos @@ -43,7 +44,7 @@ position (x, y) = { // `self` é similiar ao `this` no Javascript, com exceção de que `self` não // é redefinido em cada nova função -// chamada de métodos +// declaração de métodos position (7, 2).distance from position (position (5, 1)) // assim como no Javascript, objetos também são hashes @@ -117,14 +118,13 @@ spark (position, color: 'black', velocity: {x = 0, y = 0}) = { red = spark (position 1 1, color: 'red') fast black = spark (position 1 1, velocity: {x = 10, y = 0}) -// functions can unsplat arguments too +// funções também podem ser utilizadas para realizar o "unsplat" de argumentos log (messages, ...) = console.log (messages, ...) -// blocks are functions passed to other functions. -// This block takes two parameters, `spark` and `c`, -// the body of the block is the indented code after the -// function call +// blocos são funções passadas para outras funções. +// Este bloco recebe dois parâmetros, `spark` e `c`, +// o corpo do bloco é o código indentado após a declaração da função render each @(spark) into canvas context @(c) ctx.begin path () @@ -138,40 +138,40 @@ render each @(spark) into canvas context @(c) ) ctx.stroke () -// asynchronous calls +// chamadas assíncronas -// JavaScript both in the browser and on the server (with Node.js) -// makes heavy use of asynchronous IO with callbacks. Async IO is -// amazing for performance and making concurrency simple but it -// quickly gets complicated. -// Pogoscript has a few things to make async IO much much easier +// O Javascript, tanto no navegador quanto no servidor (através do Node.js) +// realiza um uso massivo de funções assíncronas de E/S (entrada/saída) com +// chamadas de retorno. E/S assíncrona é maravilhosa para a performance e +// torna a concorrência simples, porém pode rapidamente se tornar algo complicado. +// O Pogoscript possui algumas coisas que tornam o uso de E/S assíncrono mosquitos +// mais fácil -// Node.js includes the `fs` module for accessing the file system. -// Let's list the contents of a directory +// O Node.js inclui o móduolo `fs` para acessar o sistema de arquivos. +// Vamos listar o conteúdo de um diretório fs = require 'fs' directory listing = fs.readdir! '.' -// `fs.readdir()` is an asynchronous function, so we can call it -// using the `!` operator. The `!` operator allows you to call -// async functions with the same syntax and largely the same -// semantics as normal synchronous functions. Pogoscript rewrites -// it so that all subsequent code is placed in the callback function -// to `fs.readdir()`. +// `fs.readdir()` é uma função assíncrona, então nos a chamamos usando o +// operador `!`. O operador `!` permite que você chame funções assíncronas +// com a mesma sintaxe e praticamente a mesma semântica do que as demais +// funções síncronas. O Pogoscript reescreve a função para que todo código +// inserido após o operador seja inserido em uma função de callback para o +// `fs.readdir()`. -// to catch asynchronous errors while calling asynchronous functions +// para se obter erros ao utilizar funções assíncronas try another directory listing = fs.readdir! 'a-missing-dir' catch (ex) console.log (ex) -// in fact, if you don't use `try catch`, it will raise the error up the -// stack to the outer-most `try catch` or to the event loop, as you'd expect -// with non-async exceptions +// na verdade, se você não usar o `try catch`, o erro será passado para o +// `try catch` mais externo do evento, assim como é feito nas exceções síncronas -// all the other control structures work with asynchronous calls too -// here's `if else` +// todo o controle de estrutura funciona com chamadas assíncronas também +// aqui um exemplo de `if else` config = if (fs.stat! 'config.json'.is file ()) JSON.parse (fs.read file! 'config.json' 'utf-8') @@ -180,23 +180,23 @@ config = color: 'red' } -// to run two asynchronous calls concurrently, use the `?` operator. -// The `?` operator returns a *future* which can be executed to -// wait for and obtain the result, again using the `!` operator +// para executar duas chamadas assíncronas de forma concorrente, use o +// operador `?`. +// O operador `?` retorna um *future* que pode ser executado aguardando +// o resultado, novamente utilizando o operador `o` -// we don't wait for either of these calls to finish +// nós não esperamos nenhuma dessas chamadas serem concluídas a = fs.stat? 'a.txt' b = fs.stat? 'b.txt' -// now we wait for the calls to finish and print the results +// agora nos aguardamos o término das chamadas e escrevemos os resultados console.log "size of a.txt is #(a!.size)" console.log "size of b.txt is #(b!.size)" -// futures in Pogoscript are analogous to Promises +// no Pogoscript, futures são semelhantes a Promises ``` +E encerramos por aqui. -That's it. +Baixe o [Node.js](http://nodejs.org/) e execute `npm install pogo`. -Download [Node.js](http://nodejs.org/) and `npm install pogo`. - -There is plenty of documentation on [http://pogoscript.org/](http://pogoscript.org/), including a [cheat sheet](http://pogoscript.org/cheatsheet.html), a [guide](http://pogoscript.org/guide/), and how [Pogoscript translates to Javascript](http://featurist.github.io/pogo-examples/). Get in touch on the [google group](http://groups.google.com/group/pogoscript) if you have questions! +Há bastante documentação em [http://pogoscript.org/](http://pogoscript.org/), incluindo um material para [consulta rápida](http://pogoscript.org/cheatsheet.html), um [guia](http://pogoscript.org/guide/), e como o [Pogoscript é traduzido para o Javascript](http://featurist.github.io/pogo-examples/). Entre em contato através do [grupo do Google](http://groups.google.com/group/pogoscript) se você possui dúvidas! From 4c9f38665d291e4abe2c7d57e633f5aed9eb72ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A1ssio=20B=C3=B6ck?= Date: Thu, 22 Oct 2015 00:35:27 -0200 Subject: [PATCH 465/685] grammar fixes Portuguese changes to a better text understanding --- pt-br/pogo.html.markdown | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pt-br/pogo.html.markdown b/pt-br/pogo.html.markdown index 5dc81ec0..124b32f7 100644 --- a/pt-br/pogo.html.markdown +++ b/pt-br/pogo.html.markdown @@ -41,7 +41,7 @@ position (x, y) = { Math.sqrt (dx * dx + dy * dy) } -// `self` é similiar ao `this` no Javascript, com exceção de que `self` não +// `self` é similiar ao `this` do Javascript, com exceção de que `self` não // é redefinido em cada nova função // declaração de métodos @@ -91,7 +91,7 @@ false @or true 2 >= 2 2 > 1 -// todos do Javascript também são suportados +// os operadores padrão do Javascript também são suportados // definindo seu próprio operador (p1) plus (p2) = @@ -142,9 +142,10 @@ render each @(spark) into canvas context @(c) // O Javascript, tanto no navegador quanto no servidor (através do Node.js) // realiza um uso massivo de funções assíncronas de E/S (entrada/saída) com -// chamadas de retorno. E/S assíncrona é maravilhosa para a performance e -// torna a concorrência simples, porém pode rapidamente se tornar algo complicado. -// O Pogoscript possui algumas coisas que tornam o uso de E/S assíncrono mosquitos +// chamadas de retorno (callbacks). A E/S assíncrona é ótima para a performance e +// torna a utilização da concorrência simples, porém pode rapidamente se tornar +// algo complicado. +// O Pogoscript possui algumas coisas que tornam o uso de E/S assíncrono muito // mais fácil // O Node.js inclui o móduolo `fs` para acessar o sistema de arquivos. @@ -155,12 +156,11 @@ directory listing = fs.readdir! '.' // `fs.readdir()` é uma função assíncrona, então nos a chamamos usando o // operador `!`. O operador `!` permite que você chame funções assíncronas -// com a mesma sintaxe e praticamente a mesma semântica do que as demais -// funções síncronas. O Pogoscript reescreve a função para que todo código -// inserido após o operador seja inserido em uma função de callback para o -// `fs.readdir()`. +// com a mesma sintaxe e a mesma semântica do que as demais funções síncronas. +// O Pogoscript reescreve a função para que todo código inserido após o +// operador seja inserido em uma função de callback para o `fs.readdir()`. -// para se obter erros ao utilizar funções assíncronas +// obtendo erros ao utilizar funções assíncronas try another directory listing = fs.readdir! 'a-missing-dir' @@ -168,9 +168,9 @@ catch (ex) console.log (ex) // na verdade, se você não usar o `try catch`, o erro será passado para o -// `try catch` mais externo do evento, assim como é feito nas exceções síncronas +// `try catch` mais externo do evento, assim como é feito em exceções síncronas -// todo o controle de estrutura funciona com chamadas assíncronas também +// todo o controle de estrutura também funciona com chamadas assíncronas // aqui um exemplo de `if else` config = if (fs.stat! 'config.json'.is file ()) @@ -182,8 +182,8 @@ config = // para executar duas chamadas assíncronas de forma concorrente, use o // operador `?`. -// O operador `?` retorna um *future* que pode ser executado aguardando -// o resultado, novamente utilizando o operador `o` +// O operador `?` retorna um *future*, que pode ser executado para +// aguardar o resultado, novamente utilizando o operador `!` // nós não esperamos nenhuma dessas chamadas serem concluídas a = fs.stat? 'a.txt' From 9fcfa2c91feb2af119e67c9d1897340e87f03daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A1ssio=20B=C3=B6ck?= Date: Thu, 22 Oct 2015 00:37:46 -0200 Subject: [PATCH 466/685] File name changed --- pt-br/{pogo.html.markdown => pogo-pt.html.markdown} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename pt-br/{pogo.html.markdown => pogo-pt.html.markdown} (100%) diff --git a/pt-br/pogo.html.markdown b/pt-br/pogo-pt.html.markdown similarity index 100% rename from pt-br/pogo.html.markdown rename to pt-br/pogo-pt.html.markdown From 1f9096f79ae9ad1e132b1f601f003c10ed2e5b96 Mon Sep 17 00:00:00 2001 From: hack1m Date: Thu, 22 Oct 2015 15:42:48 +0800 Subject: [PATCH 467/685] [CoffeeScript/ms-my] Added Malay (Malaysia) translation for CoffeeScript --- ms-my/coffeescript-my.html.markdown | 105 ++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 ms-my/coffeescript-my.html.markdown diff --git a/ms-my/coffeescript-my.html.markdown b/ms-my/coffeescript-my.html.markdown new file mode 100644 index 00000000..bb67478f --- /dev/null +++ b/ms-my/coffeescript-my.html.markdown @@ -0,0 +1,105 @@ +--- +language: coffeescript +contributors: + - ["Tenor Biel", "http://github.com/L8D"] + - ["Xavier Yao", "http://github.com/xavieryao"] +filename: coffeescript.coffee +translators: + - ["hack1m", "https://github.com/hack1m"] +lang: ms-my +--- + +CoffeeScript adalah bahasa kecil yang menyusun/kompil satu-per-satu menjadi setara JavaScript, dan tidak ada interpretasi di runtime. +Sebagai salah satu pengganti kepada JavaScript, CoffeeScript mencuba yang terbaik untuk output kod JavaScript yang mudah dibaca, cantik-dicetak dan berfungsi lancar, yang mana berfungsi baik pada setiap runtime JavaScript. + +Lihat juga [Laman sesawang CoffeeScript](http://coffeescript.org/), yang mana ada tutorial lengkap untuk CoffeeScript. + +```coffeescript +# CoffeeScript adalah bahasa hipster. +# Ia beredar mengikut trend kebanyakkan bahasa moden. +# Jadi komen sama seperti Ruby dan Python, ia menggunakan simbol nombor. + +### +Blok komen seperti ini, dan ia terjemah terus ke '/ *'s dan '* /'s +untuk keputusan kod JavaScript. + +Sebelum meneruskan anda perlu faham kebanyakkan daripada +JavaScript adalah semantik. +### + +# Menetapkan: +number = 42 #=> var number = 42; +opposite = true #=> var opposite = true; + +# Bersyarat: +number = -42 if opposite #=> if(opposite) { number = -42; } + +# Fungsi: +square = (x) -> x * x #=> var square = function(x) { return x * x; } + +fill = (container, liquid = "coffee") -> + "Filling the #{container} with #{liquid}..." +#=>var fill; +# +#fill = function(container, liquid) { +# if (liquid == null) { +# liquid = "coffee"; +# } +# return "Filling the " + container + " with " + liquid + "..."; +#}; + +# Julat: +list = [1..5] #=> var list = [1, 2, 3, 4, 5]; + +# Objek: +math = + root: Math.sqrt + square: square + cube: (x) -> x * square x +#=> var math = { +# "root": Math.sqrt, +# "square": square, +# "cube": function(x) { return x * square(x); } +# }; + +# Splats: +race = (winner, runners...) -> + print winner, runners +#=>race = function() { +# var runners, winner; +# winner = arguments[0], runners = 2 <= arguments.length ? __slice.call(arguments, 1) : []; +# return print(winner, runners); +# }; + +# Kewujudan: +alert "I knew it!" if elvis? +#=> if(typeof elvis !== "undefined" && elvis !== null) { alert("I knew it!"); } + +# Pemahaman array: +cubes = (math.cube num for num in list) +#=>cubes = (function() { +# var _i, _len, _results; +# _results = []; +# for (_i = 0, _len = list.length; _i < _len; _i++) { +# num = list[_i]; +# _results.push(math.cube(num)); +# } +# return _results; +# })(); + +foods = ['broccoli', 'spinach', 'chocolate'] +eat food for food in foods when food isnt 'chocolate' +#=>foods = ['broccoli', 'spinach', 'chocolate']; +# +#for (_k = 0, _len2 = foods.length; _k < _len2; _k++) { +# food = foods[_k]; +# if (food !== 'chocolate') { +# eat(food); +# } +#} +``` + +## Sumber tambahan + +- [Smooth CoffeeScript](http://autotelicum.github.io/Smooth-CoffeeScript/) +- [CoffeeScript Ristretto](https://leanpub.com/coffeescript-ristretto/read) From a657d0d559014cc676abfaf06cb57dddd07b0853 Mon Sep 17 00:00:00 2001 From: hack1m Date: Thu, 22 Oct 2015 16:33:02 +0800 Subject: [PATCH 468/685] Added ms for filename --- ms-my/coffeescript-my.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ms-my/coffeescript-my.html.markdown b/ms-my/coffeescript-my.html.markdown index bb67478f..9820a561 100644 --- a/ms-my/coffeescript-my.html.markdown +++ b/ms-my/coffeescript-my.html.markdown @@ -3,7 +3,7 @@ language: coffeescript contributors: - ["Tenor Biel", "http://github.com/L8D"] - ["Xavier Yao", "http://github.com/xavieryao"] -filename: coffeescript.coffee +filename: coffeescript-ms.coffee translators: - ["hack1m", "https://github.com/hack1m"] lang: ms-my From b238a58c9768d3b7694c4f02cbfe5ba2cac0015a Mon Sep 17 00:00:00 2001 From: payet-s Date: Wed, 21 Oct 2015 17:48:04 +0200 Subject: [PATCH 469/685] [python/en] Fix typos --- python.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python.html.markdown b/python.html.markdown index 42a52bcf..753d6e8c 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -15,8 +15,8 @@ executable pseudocode. Feedback would be highly appreciated! You can reach me at [@louiedinh](http://twitter.com/louiedinh) or louiedinh [at] [google's email service] Note: This article applies to Python 2.7 specifically, but should be applicable -to Python 2.x. Python 2.7 is reachong end of life and will stop beeign maintained in 2020, -it is though recommended to start learnign Python with Python 3. +to Python 2.x. Python 2.7 is reaching end of life and will stop being maintained in 2020, +it is though recommended to start learning Python with Python 3. For Python 3.x, take a look at the [Python 3 tutorial](http://learnxinyminutes.com/docs/python3/). It is also possible to write Python code which is compatible with Python 2.7 and 3.x at the same time, From 1c0eee17a6022d135ae8911105719ddaa81b187c Mon Sep 17 00:00:00 2001 From: Saurabh Sandav Date: Thu, 22 Oct 2015 18:39:33 +0530 Subject: [PATCH 470/685] [elisp/en] Fix typo --- elisp.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/elisp.html.markdown b/elisp.html.markdown index 3bed5d1c..da86cab3 100644 --- a/elisp.html.markdown +++ b/elisp.html.markdown @@ -2,6 +2,7 @@ language: elisp contributors: - ["Bastien Guerry", "http://bzg.fr"] + - ["Saurabh Sandav", "http://github.com/SaurabhSandav"] filename: learn-emacs-lisp.el --- @@ -26,7 +27,7 @@ filename: learn-emacs-lisp.el ;; ;; Going through this tutorial won't damage your computer unless ;; you get so angry that you throw it on the floor. In that case, -;; I hereby decline any responsability. Have fun! +;; I hereby decline any responsibility. Have fun! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; From 50910728738eb1b9abf54955fb3dca85f3a64b0b Mon Sep 17 00:00:00 2001 From: Saurabh Sandav Date: Thu, 22 Oct 2015 18:58:23 +0530 Subject: [PATCH 471/685] [lua/en] Fix typo --- lua.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua.html.markdown b/lua.html.markdown index 0809215f..3d95c146 100644 --- a/lua.html.markdown +++ b/lua.html.markdown @@ -190,7 +190,7 @@ end -------------------------------------------------------------------------------- -- A table can have a metatable that gives the table operator-overloadish --- behavior. Later we'll see how metatables support js-prototypey behavior. +-- behavior. Later we'll see how metatables support js-prototypey behaviour. f1 = {a = 1, b = 2} -- Represents the fraction a/b. f2 = {a = 2, b = 3} From c69ef3115bb900a5b2f716ebd9791a38ca113ab7 Mon Sep 17 00:00:00 2001 From: labrack Date: Thu, 22 Oct 2015 13:06:15 -0400 Subject: [PATCH 472/685] [php/en] Un-beef a comment block closing Somebody beefed a closing on the 'Late Static Binding' Comment block, causing the next 18 or so lines to be included in the comment instead of parsed for syntax properly. --- php.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php.html.markdown b/php.html.markdown index 127e601b..403fc41d 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -723,7 +723,7 @@ $cls = new SomeOtherNamespace\MyClass(); /********************** * Late Static Binding * -* / +*/ class ParentClass { public static function who() { From ba7b8a613b445d1ee79ad190ceed6a008595116c Mon Sep 17 00:00:00 2001 From: Jana Trestikova Date: Fri, 23 Oct 2015 06:55:00 +0200 Subject: [PATCH 473/685] Fix Typos --- d.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d.html.markdown b/d.html.markdown index 80c1dc65..3915b005 100644 --- a/d.html.markdown +++ b/d.html.markdown @@ -70,7 +70,7 @@ void main() { ``` We can define new types with `struct`, `class`, `union`, and `enum`. Structs and unions -are passed to functions by value (i.e. copied) and classes are passed by reference. Futhermore, +are passed to functions by value (i.e. copied) and classes are passed by reference. Furthermore, we can use templates to parameterize all of these on both types and values! ```c From db4160710dee1ee76d750c35452294c3134061fa Mon Sep 17 00:00:00 2001 From: Hunter Stevens Date: Fri, 23 Oct 2015 13:14:38 -0400 Subject: [PATCH 474/685] Remove "feedback", fix link markdown --- javascript.html.markdown | 48 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/javascript.html.markdown b/javascript.html.markdown index c1c59de1..cce488e1 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -16,10 +16,6 @@ JavaScript isn't just limited to web browsers, though: Node.js, a project that provides a standalone runtime for Google Chrome's V8 JavaScript engine, is becoming more and more popular. -Feedback would be highly appreciated! You can reach me at -[@adambrenecki](https://twitter.com/adambrenecki), or -[adam@brenecki.id.au](mailto:adam@brenecki.id.au). - ```js // Comments are like C's. Single-line comments start with two slashes, /* and multiline comments start with slash-star @@ -534,28 +530,32 @@ if (Object.create === undefined){ // don't overwrite it if it exists ## Further Reading -The [Mozilla Developer -Network](https://developer.mozilla.org/en-US/docs/Web/JavaScript) provides -excellent documentation for JavaScript as it's used in browsers. Plus, it's a -wiki, so as you learn more you can help others out by sharing your own -knowledge. +The [Mozilla Developer Network][1] provides excellent documentation for +JavaScript as it's used in browsers. Plus, it's a wiki, so as you learn more you +can help others out by sharing your own knowledge. -MDN's [A re-introduction to -JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript) -covers much of the concepts covered here in more detail. This guide has quite -deliberately only covered the JavaScript language itself; if you want to learn -more about how to use JavaScript in web pages, start by learning about the -[Document Object -Model](https://developer.mozilla.org/en-US/docs/Using_the_W3C_DOM_Level_1_Core) +MDN's [A re-introduction to JavaScript][2] covers much of the concepts covered +here in more detail. This guide has quite deliberately only covered the +JavaScript language itself; if you want to learn more about how to use +JavaScript in web pages, start by learning about the [Document Object Model][3]. -[Learn Javascript by Example and with Challenges](http://www.learneroo.com/modules/64/nodes/350) is a variant of this reference with built-in challenges. +[Learn Javascript by Example and with Challenges][4] is a variant of this +reference with built-in challenges. -[JavaScript Garden](http://bonsaiden.github.io/JavaScript-Garden/) is an in-depth -guide of all the counter-intuitive parts of the language. +[JavaScript Garden][5] is an in-depth guide of all the counter-intuitive parts +of the language. -[JavaScript: The Definitive Guide](http://www.amazon.com/gp/product/0596805527/) is a classic guide / reference book. +[JavaScript: The Definitive Guide][6] is a classic guide and reference book. -In addition to direct contributors to this article, some content is adapted -from Louie Dinh's Python tutorial on this site, and the [JS -Tutorial](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript) -on the Mozilla Developer Network. +In addition to direct contributors to this article, some content is adapted from +Louie Dinh's Python tutorial on this site, and the [JS Tutorial][7] on the +Mozilla Developer Network. + + +[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript +[2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript +[3]: https://developer.mozilla.org/en-US/docs/Using_the_W3C_DOM_Level_1_Core +[4]: http://www.learneroo.com/modules/64/nodes/350 +[5]: http://bonsaiden.github.io/JavaScript-Garden/ +[6]: http://www.amazon.com/gp/product/0596805527/ +[7]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript From a1a45c7dff31d953f693efad49ed1293b3d79d49 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Oct 2015 23:01:30 +0200 Subject: [PATCH 475/685] [go/de] fixed some typos --- de-de/go-de.html.markdown | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/de-de/go-de.html.markdown b/de-de/go-de.html.markdown index 7e61bf81..d3a192fe 100644 --- a/de-de/go-de.html.markdown +++ b/de-de/go-de.html.markdown @@ -25,7 +25,7 @@ aktive Community. zeiliger Kommentar */ // Eine jede Quelldatei beginnt mit einer Paket-Klausel. -// "main" ist ein besonderer Pkaetname, da er ein ausführbares Programm +// "main" ist ein besonderer Paketname, da er ein ausführbares Programm // einleitet, im Gegensatz zu jedem anderen Namen, der eine Bibliothek // deklariert. package main @@ -38,7 +38,7 @@ import ( "strconv" // Zeichenkettenmanipulation ) -// Es folgt die Definition einer Funktions, in diesem Fall von "main". Auch hier +// Es folgt die Definition einer Funktion, in diesem Fall von "main". Auch hier // ist der Name wieder besonders. "main" markiert den Eintrittspunkt des // Programms. Vergessen Sie nicht die geschweiften Klammern! func main() { @@ -56,7 +56,7 @@ func beyondHello() { var x int // Deklaration einer Variable, muss vor Gebrauch geschehen. x = 3 // Zuweisung eines Werts. // Kurze Deklaration: Benutzen Sie ":=", um die Typisierung automatisch zu - // folgern, die Variable zu deklarieren und ihr einen Wert zu zuweisen. + // folgern, die Variable zu deklarieren und ihr einen Wert zuzuweisen. y := 4 // Eine Funktion mit mehreren Rückgabewerten. @@ -147,7 +147,7 @@ func learnFlowControl() { if false { // nicht hier } else { - // sonder hier! spielt die Musik + // sondern hier! spielt die Musik } // Benutzen Sie ein "switch" Statement anstatt eine Anreihung von if-s @@ -166,7 +166,7 @@ func learnFlowControl() { // Ab hier gilt wieder: x == 1 // For ist die einzige Schleifenform in Go, sie hat aber mehrere Formen: - for { // Endloschleife + for { // Endlosschleife break // nur ein Spaß continue // wird nie ausgeführt } @@ -263,10 +263,10 @@ func learnConcurrency() { // Auslesen und dann Ausgeben der drei berechneten Werte. // Man kann nicht im voraus feststellen in welcher Reihenfolge die Werte // ankommen. - fmt.Println(<-c, <-c, <-c) // mit dem Kannal rechts ist <- der Empfangs-Operator + fmt.Println(<-c, <-c, <-c) // mit dem Kanal rechts ist <- der Empfangs-Operator - cs := make(chan string) // ein weiterer Kannal, diesmal für strings - cc := make(chan chan string) // ein Kannal für string Kannäle + cs := make(chan string) // ein weiterer Kanal, diesmal für strings + cc := make(chan chan string) // ein Kanal für string Kanäle // Start einer neuen Goroutine, nur um einen Wert zu senden go func() { c <- 84 }() @@ -283,7 +283,7 @@ func learnConcurrency() { fmt.Println("wird nicht passieren.") } // Hier wird eine der beiden Goroutines fertig sein, die andere nicht. - // Sie wird warten bis der Wert den sie sendet von dem Kannal gelesen wird. + // Sie wird warten bis der Wert den sie sendet von dem Kanal gelesen wird. learnWebProgramming() // Go kann es und Sie hoffentlich auch bald. } @@ -301,7 +301,7 @@ func learnWebProgramming() { // Methode implementieren: ServeHTTP func (p pair) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Senden von Daten mit einer Methode des http.ResponseWriter - w.Write([]byte("Sie habe Go in Y Minuten gelernt!")) + w.Write([]byte("Sie haben Go in Y Minuten gelernt!")) } ``` From 8e4d294227590194285cec139bae5930d470eaf2 Mon Sep 17 00:00:00 2001 From: Jana Trestikova Date: Fri, 23 Oct 2015 23:54:45 +0200 Subject: [PATCH 476/685] Fix typos undestanding -> understanding uninterupted -> uninterrupted --- chapel.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapel.html.markdown b/chapel.html.markdown index 7252a3e4..866e92d2 100644 --- a/chapel.html.markdown +++ b/chapel.html.markdown @@ -629,7 +629,7 @@ for (i, j) in zip( toThisArray.domain, -100..#5 ){ } writeln( toThisArray ); -// This is all very important in undestanding why the statement +// This is all very important in understanding why the statement // var iterArray : [1..10] int = [ i in 1..10 ] if ( i % 2 == 1 ) then j; // exhibits a runtime error. // Even though the domain of the array and the loop-expression are @@ -914,7 +914,7 @@ proc main(){ [ val in myBigArray ] val = 1 / val; // Parallel operation // Atomic variables, common to many languages, are ones whose operations - // occur uninterupted. Multiple threads can both modify atomic variables + // occur uninterrupted. Multiple threads can both modify atomic variables // and can know that their values are safe. // Chapel atomic variables can be of type bool, int, uint, and real. var uranium: atomic int; From 9aad08bf78196758a568ec1272c94029221c2dd5 Mon Sep 17 00:00:00 2001 From: Amru Eliwat Date: Fri, 23 Oct 2015 23:13:29 -0700 Subject: [PATCH 477/685] Fixed typos for 'overriding' and 'reference' and fixed formatting issue that may have caused confusion --- d.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/d.html.markdown b/d.html.markdown index 80c1dc65..6f3710ab 100644 --- a/d.html.markdown +++ b/d.html.markdown @@ -199,8 +199,8 @@ our getter and setter methods, and keep the clean syntax of accessing members directly! Other object-oriented goodies at our disposal -include `interface`s, `abstract class`es, -and `override`ing methods. D does inheritance just like Java: +include interfaces, abstract classes, +and overriding methods. D does inheritance just like Java: Extend one class, implement as many interfaces as you please. We've seen D's OOP facilities, but let's switch gears. D offers @@ -247,7 +247,7 @@ void main() { // and take advantage of as many cores as we have available. auto arr = new double[1_000_000]; - // Use an index, and an array element by referece, + // Use an index, and an array element by reference, // and just call parallel on the array! foreach(i, ref elem; parallel(arr)) { ref = sqrt(i + 1.0); From 4edbfa9e0394a4abb9301391cdebcc857559a5c7 Mon Sep 17 00:00:00 2001 From: Amru Eliwat Date: Fri, 23 Oct 2015 23:17:35 -0700 Subject: [PATCH 478/685] Fixed 'modeling' and 'compatibility' typos --- fsharp.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fsharp.html.markdown b/fsharp.html.markdown index 76318d7d..a2a87d57 100644 --- a/fsharp.html.markdown +++ b/fsharp.html.markdown @@ -335,10 +335,10 @@ module DataTypeExamples = let worker = Worker jdoe // ------------------------------------ - // Modelling with types + // Modeling with types // ------------------------------------ - // Union types are great for modelling state without using flags + // Union types are great for modeling state without using flags type EmailAddress = | ValidEmailAddress of string | InvalidEmailAddress of string @@ -526,7 +526,7 @@ module AsyncExample = |> Async.RunSynchronously // start them off // ================================================ -// .NET compatability +// .NET compatibility // ================================================ module NetCompatibilityExamples = From 8648f24a80d27683393aef122115fa4dd1980f9f Mon Sep 17 00:00:00 2001 From: Amru Eliwat Date: Fri, 23 Oct 2015 23:21:00 -0700 Subject: [PATCH 479/685] Fixed small 'responsibility' typo in disclaimer --- elisp.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elisp.html.markdown b/elisp.html.markdown index 3bed5d1c..f1a4afbc 100644 --- a/elisp.html.markdown +++ b/elisp.html.markdown @@ -26,7 +26,7 @@ filename: learn-emacs-lisp.el ;; ;; Going through this tutorial won't damage your computer unless ;; you get so angry that you throw it on the floor. In that case, -;; I hereby decline any responsability. Have fun! +;; I hereby decline any responsibility. Have fun! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; From a019e2c16bbad5a4dd396f952cdfeb733eed6978 Mon Sep 17 00:00:00 2001 From: Saurabh Sandav Date: Sat, 24 Oct 2015 12:22:11 +0530 Subject: [PATCH 480/685] [lua/en] Fix typo --- lua.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua.html.markdown b/lua.html.markdown index 0809215f..3d95c146 100644 --- a/lua.html.markdown +++ b/lua.html.markdown @@ -190,7 +190,7 @@ end -------------------------------------------------------------------------------- -- A table can have a metatable that gives the table operator-overloadish --- behavior. Later we'll see how metatables support js-prototypey behavior. +-- behavior. Later we'll see how metatables support js-prototypey behaviour. f1 = {a = 1, b = 2} -- Represents the fraction a/b. f2 = {a = 2, b = 3} From 4de15e41b3d47963ab7749a6a4dc6704d5d3af27 Mon Sep 17 00:00:00 2001 From: Robert Brown Date: Sat, 24 Oct 2015 13:56:20 +0100 Subject: [PATCH 481/685] correct minor grammar and formatting to improve readability --- go.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/go.html.markdown b/go.html.markdown index a857a76c..dc684227 100644 --- a/go.html.markdown +++ b/go.html.markdown @@ -108,12 +108,13 @@ can include line breaks.` // Same string type. bs := []byte("a slice") // Type conversion syntax. // Because they are dynamic, slices can be appended to on-demand. - // To append elements to a slice, built-in append() function is used. + // To append elements to a slice, the built-in append() function is used. // First argument is a slice to which we are appending. Commonly, // the array variable is updated in place, as in example below. s := []int{1, 2, 3} // Result is a slice of length 3. s = append(s, 4, 5, 6) // Added 3 elements. Slice now has length of 6. fmt.Println(s) // Updated slice is now [1 2 3 4 5 6] + // To append another slice, instead of list of atomic elements we can // pass a reference to a slice or a slice literal like this, with a // trailing ellipsis, meaning take a slice and unpack its elements, From 0053fdbd2f479640e53282582f8393be44fba130 Mon Sep 17 00:00:00 2001 From: Michal Martinek Date: Sat, 24 Oct 2015 19:42:34 +0200 Subject: [PATCH 482/685] Czech translation for Markdown --- cs-cz/markdown.html.markdown | 258 +++++++++++++++++++++++++++++++++++ 1 file changed, 258 insertions(+) create mode 100644 cs-cz/markdown.html.markdown diff --git a/cs-cz/markdown.html.markdown b/cs-cz/markdown.html.markdown new file mode 100644 index 00000000..637f0ab6 --- /dev/null +++ b/cs-cz/markdown.html.markdown @@ -0,0 +1,258 @@ +--- +language: markdown +contributors: + - ["Dan Turkel", "http://danturkel.com/"] +translators: + - ["Michal Martinek", "https://github.com/MichalMartinek"] +filename: markdown.md +--- + +Markdown byl vytvořen Johnem Gruberem v roce 2004. Je zamýšlen jako lehce čitelná +a psatelná syntaxe, která je jednoduše převeditelná do HTML (a dnes i do mnoha +dalších formátů) + +```markdown + + + + + + +# Toto je

+## Toto je

+### Toto je

+#### Toto je

+##### Toto je

+###### Toto je
+ + +Toto je h1 +========== + +Toto je h2 +---------- + + + + +*Tento text je kurzívou;* +_Stejně jako tento._ + +**Tento text je tučně** +__Stejně jako tento.__ + +***Tento text je obojí*** +**_Jako tento!_** +*__A tento!__* + + + +~~Tento text je prošktrnutý.~~ + + + +Toto je odstavec. Píši odstavec, není to zábava? + +Teď jsem v odstavci 2. +Jsem pořád v odstavci 2! + + +Toto je odstavec 3. + + + +Tento odstavec končí dvěma mezerami. + +Nad tímto odstavcem je
! + + + +> Toto je bloková citace. Můžete dokonce +> manuálně rozdělit řádky, a před každý vložit >, nebo nechat vaše řádky jakkoliv dlouhé, ať se zarovnají sami. +> Nedělá to rozdíl, dokud začínáte vždy znakem >. + +> Můžu použít více než jednu +>> odsazení? +> Jak je to úhledné, že? + + + + +* Položka +* Položka +* Jinná položka + +nebo + ++ Položka ++ Položka ++ Další položka + +nebo + +- Položka +- Položka +- Další položka + + + +1. Položka jedna +2. Položka dvě +3. Položka tři + + + +1. Položka jedna +1. Položka dvě +1. Položka tři + + + + +1. Položka jedna +2. Položka dvě +3. Položka tři + * Podpoložka + * Podpoložka +4. Položka čtyři + + + +Boxy níže bez 'x' jsou nezašktrnuté checkboxy. +- [ ] První úkol +- [ ] Druhý úkol +Tento box bude zašktrnutý +- [x] Tento úkol byl dokončen + + + + + Toto je kód + Stejně jako toto + + + + moje_pole.each do |i| + puts i + end + + + +Jan nevědel, jak se dělá `go_to()` funkce! + + + +\`\`\`ruby +def neco + puts "Ahoj světe!" +end +\`\`\` + + + + + + +*** +--- +- - - +**************** + + + + +[Klikni na mě!](http://test.com/) + + + +[Klikni na mě!](http://test.com/ "Odkaz na Test.com") + + + +[Jdi na hudbu](/hudba/). + + + +[Klikni na tento odkaz][link1] pro více informací! +[Taky zkontrolujte tento odkaz][neco], když chcete. + +[link1]: http://test.com/ "Cool!" +[neco]: http://neco.czz/ "Dobře!" + + + + + +[Toto][] je odkaz.. + +[toto]: http://totojelink.cz/ + + + + + + +![Toto je atribut alt pro obrázek](http://imgur.com/myimage.jpg "Nepovinný titulek") + + + +![Toto je atribut alt][mujobrazek] + +[mujobrazek]: relativni/cesta/obrazek.jpg "a toto by byl titulek" + + + + + je stejná jako +[http://stranka.cz/](http://stranka.cz/) + + + + + + + +Chci napsat *tento text obklopený hvězdičkami*, ale nechci aby to bylo kurzívou, tak udělám: \*tento text obklopený hvězdičkami\*. + + + + +Váš počítač přestal pracovat? Zkuste +Ctrl+Alt+Del + + + + +| Sloupec1 | Sloupec2 | Sloupec3 | +| :----------- | :------: | ------------: | +| Vlevo zarovn.| Na střed | Vpravo zarovn.| +| blah | blah | blah | + + + +Sloupec 1 | Sloupec2 | Sloupec3 +:-- | :-: | --: +Ohh toto je tak ošklivé | radši to | nedělejte + + + +``` + +Pro více informací, prozkoumejte oficiální článek o syntaxi od Johna Grubera + [zde](http://daringfireball.net/projects/markdown/syntax) a skvělý tahák od Adama Pritcharda [zde](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). From 4e32ff9cd9dabe634f40191f8cee82787ea9e918 Mon Sep 17 00:00:00 2001 From: Navdeep Singh Date: Sun, 25 Oct 2015 02:39:50 +0530 Subject: [PATCH 483/685] fixed typo mistakes --- matlab.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matlab.html.markdown b/matlab.html.markdown index 4d97834c..e8a6cc0b 100644 --- a/matlab.html.markdown +++ b/matlab.html.markdown @@ -72,7 +72,7 @@ c = exp(a)*sin(pi/2) % c = 7.3891 % Calling functions can be done in either of two ways: % Standard function syntax: -load('myFile.mat', 'y') % arguments within parantheses, spererated by commas +load('myFile.mat', 'y') % arguments within parentheses, separated by commas % Command syntax: load myFile.mat y % no parentheses, and spaces instead of commas % Note the lack of quote marks in command form: inputs are always passed as @@ -273,7 +273,7 @@ clf clear % clear current figure window, and reset most figure properties % Properties can be set and changed through a figure handle. % You can save a handle to a figure when you create it. -% The function gcf returns a handle to the current figure +% The function get returns a handle to the current figure h = plot(x, y); % you can save a handle to a figure when you create it set(h, 'Color', 'r') % 'y' yellow; 'm' magenta, 'c' cyan, 'r' red, 'g' green, 'b' blue, 'w' white, 'k' black From 069e127ff83820ba809bc437bfadda9839d91062 Mon Sep 17 00:00:00 2001 From: chris-hranj Date: Sat, 24 Oct 2015 23:53:17 -0400 Subject: [PATCH 484/685] update Data Structures section to show outputs --- scala.html.markdown | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/scala.html.markdown b/scala.html.markdown index 7f545196..192e03d7 100644 --- a/scala.html.markdown +++ b/scala.html.markdown @@ -278,21 +278,21 @@ val text = if (x == 10) "yeah" else "nope" ///////////////////////////////////////////////// val a = Array(1, 2, 3, 5, 8, 13) -a(0) -a(3) +a(0) // Int = 1 +a(3) // Int = 5 a(21) // Throws an exception val m = Map("fork" -> "tenedor", "spoon" -> "cuchara", "knife" -> "cuchillo") -m("fork") -m("spoon") +m("fork") // java.lang.String = tenedor +m("spoon") // java.lang.String = cuchara m("bottle") // Throws an exception val safeM = m.withDefaultValue("no lo se") -safeM("bottle") +safeM("bottle") // java.lang.String = no lo se val s = Set(1, 3, 7) -s(0) -s(1) +s(0) // Boolean = false +s(1) // Boolean = true /* Look up the documentation of map here - * http://www.scala-lang.org/api/current/index.html#scala.collection.immutable.Map @@ -313,15 +313,16 @@ s(1) // Why have this? val divideInts = (x: Int, y: Int) => (x / y, x % y) -divideInts(10, 3) // The function divideInts gives you the result and the remainder +// The function divideInts gives you the result and the remainder +divideInts(10, 3) // (Int, Int) = (3,1) // To access the elements of a tuple, use _._n where n is the 1-based index of // the element -val d = divideInts(10, 3) +val d = divideInts(10, 3) // (Int, Int) = (3,1) -d._1 +d._1 // Int = 3 -d._2 +d._2 // Int = 1 ///////////////////////////////////////////////// From d9d8de0d229443534272e2a1976fb7f0e69631b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A1ssio=20B=C3=B6ck?= Date: Sun, 25 Oct 2015 15:44:35 -0200 Subject: [PATCH 485/685] Translator section added Changed my name from contributor section to the translator section --- pt-br/pogo-pt.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/pt-br/pogo-pt.html.markdown b/pt-br/pogo-pt.html.markdown index 124b32f7..80dcfcd5 100644 --- a/pt-br/pogo-pt.html.markdown +++ b/pt-br/pogo-pt.html.markdown @@ -2,6 +2,7 @@ language: pogoscript contributors: - ["Tim Macfarlane", "http://github.com/refractalize"] +translators: - ["Cássio Böck", "https://github.com/cassiobsilva"] filename: learnPogo-pt-br.pogo lang: pt-br From 8323f873c4079132d92e5d4a9f355489ea38abca Mon Sep 17 00:00:00 2001 From: Diego Ponce Date: Sun, 25 Oct 2015 13:38:15 -0600 Subject: [PATCH 486/685] Fix typos --- es-es/markdown-es.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/es-es/markdown-es.html.markdown b/es-es/markdown-es.html.markdown index d90e3eb5..bc481df7 100644 --- a/es-es/markdown-es.html.markdown +++ b/es-es/markdown-es.html.markdown @@ -11,7 +11,7 @@ lang: es-es Markdown fue creado por John Gruber en 2004. Su propósito es ser una sintaxis fácil de leer y escribir que se convierta fácilmente a HTML (y, actualmente, otros formatos también). -¡Denme todo la retroalimentación que quieran! / ¡Sientanse en la libertad de hacer forks o pull requests! +¡Denme toda la retroalimentación que quieran! / ¡Sientanse en la libertad de hacer forks o pull requests! ```markdown @@ -44,7 +44,7 @@ Esto es un h2 ------------- - *Este texto está en itálicas.* @@ -62,7 +62,7 @@ Markdown en Github, también tenemos: --> ~~Este texto está tachado.~~ - Este es un párrafo. Estoy escribiendo un párrafo, ¿No es divertido? From ee4bef264c71252900858a5bbfe00d2e0644eedd Mon Sep 17 00:00:00 2001 From: Jefftree Date: Sun, 25 Oct 2015 15:55:44 -0400 Subject: [PATCH 487/685] Added alternative way to enter math mode for latex --- latex.html.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/latex.html.markdown b/latex.html.markdown index 9b7b4feb..31231a70 100644 --- a/latex.html.markdown +++ b/latex.html.markdown @@ -106,6 +106,9 @@ Here's how you state all y that belong to X, $\forall$ x $\in$ X. \\ % However, the math symbols only exist in math-mode. % We can enter math-mode from text mode with the $ signs. % The opposite also holds true. Variable can also be rendered in math-mode. +% We can also enter math mode with \[\] + +\[a^2 + b^2 = c^2 \] My favorite Greek letter is $\xi$. I also like $\beta$, $\gamma$ and $\sigma$. I haven't found a Greek letter that yet that LaTeX doesn't know about! From 341b92141c28b13cac8b41913f25a50a0a8b6066 Mon Sep 17 00:00:00 2001 From: Tyler Date: Sun, 25 Oct 2015 17:15:23 -0600 Subject: [PATCH 488/685] Update CSS for clarity. - More relevant introduction - More consistent and clear wording - More consistent formatting --- css.html.markdown | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/css.html.markdown b/css.html.markdown index d8f30ca3..8ee4f4b9 100644 --- a/css.html.markdown +++ b/css.html.markdown @@ -6,20 +6,21 @@ contributors: - ["Geoffrey Liu", "https://github.com/g-liu"] - ["Connor Shea", "https://github.com/connorshea"] - ["Deepanshu Utkarsh", "https://github.com/duci9y"] + - ["Tyler Mumford", "https://tylermumford.com"] filename: learncss.css --- -In the early days of the web there were no visual elements, just pure text. But with further development of web browsers, fully visual web pages also became common. +Web pages are built with HTML, which specifies the content of a page. CSS (Cascading Style Sheets) is a separate language which specifies a page's **appearance**. -CSS helps maintain separation between the content (HTML) and the look-and-feel of a web page. +CSS code is made of static *rules*. Each rule takes one or more *selectors* and gives specific *values* to a number of visual *properties*. Those properties are then applied to the page elements indicated by the selectors. -CSS lets you target different elements on an HTML page and assign different visual properties to them. +This guide has been written with CSS 2 in mind, which is extended by the new features of CSS 3. -This guide has been written for CSS 2, though CSS 3 is fast becoming popular. - -**NOTE:** Because CSS produces visual results, in order to learn it, you need try everything in a CSS playground like [dabblet](http://dabblet.com/). +**NOTE:** Because CSS produces visual results, in order to learn it, you need to try everything in a CSS playground like [dabblet](http://dabblet.com/). The main focus of this article is on the syntax and some general tips. +## Syntax + ```css /* comments appear inside slash-asterisk, just like this line! there are no "one-line comments"; this is the only comment style */ @@ -28,7 +29,7 @@ The main focus of this article is on the syntax and some general tips. ## SELECTORS #################### */ -/* the selector is used to target an element on a page. +/* the selector is used to target an element on a page. */ selector { property: value; /* more properties...*/ } /* @@ -69,7 +70,7 @@ div { } [otherAttr|='en'] { font-size:smaller; } -/* You can concatenate different selectors to create a narrower selector. Don't +/* You can combine different selectors to create a more focused selector. Don't put spaces between them. */ div.some-class[attr$='ue'] { } @@ -92,7 +93,7 @@ div.some-parent.class-name { } .i-am-any-element-before ~ .this-element { } /* There are some selectors called pseudo classes that can be used to select an - element when it is in a particular state */ + element only when it is in a particular state */ /* for example, when the cursor hovers over an element */ selector:hover { } @@ -103,7 +104,7 @@ selector:visited { } /* or hasn't been visited */ selected:link { } -/* or an element in focus */ +/* or an element is in focus */ selected:focus { } /* any element that is the first child of its parent */ @@ -156,10 +157,10 @@ selector { color: tomato; /* a named color */ color: rgb(255, 255, 255); /* as rgb values */ color: rgb(10%, 20%, 50%); /* as rgb percentages */ - color: rgba(255, 0, 0, 0.3); /* as rgba values (CSS 3) Note: 0 < a < 1 */ + color: rgba(255, 0, 0, 0.3); /* as rgba values (CSS 3) Note: 0 <= a <= 1 */ color: transparent; /* equivalent to setting the alpha to 0 */ color: hsl(0, 100%, 50%); /* as hsl percentages (CSS 3) */ - color: hsla(0, 100%, 50%, 0.3); /* as hsla percentages with alpha */ + color: hsla(0, 100%, 50%, 0.3); /* as hsl percentages with alpha */ /* Images as backgrounds of elements */ background-image: url(/img-path/img.jpg); /* quotes inside url() optional */ @@ -194,7 +195,7 @@ Save a CSS stylesheet with the extension `.css`. ## Precedence or Cascade -An element may be targeted by multiple selectors and may have a property set on it in more than once. In these cases, one of the rules takes precedence over others. Generally, a rule in a more specific selector take precedence over a less specific one, and a rule occuring later in the stylesheet overwrites a previous one. +An element may be targeted by multiple selectors and may have a property set on it in more than once. In these cases, one of the rules takes precedence over others. Rules with a more specific selector take precedence over a less specific one, and a rule occuring later in the stylesheet overwrites a previous one. This process is called cascading, hence the name Cascading Style Sheets. @@ -238,10 +239,10 @@ Most of the features in CSS 2 (and many in CSS 3) are available across all brows ## Resources -* To run a quick compatibility check, [CanIUse](http://caniuse.com). -* CSS Playground [Dabblet](http://dabblet.com/). -* [Mozilla Developer Network's CSS documentation](https://developer.mozilla.org/en-US/docs/Web/CSS) -* [Codrops' CSS Reference](http://tympanus.net/codrops/css_reference/) +* [CanIUse](http://caniuse.com) (Detailed compatibility info) +* [Dabblet](http://dabblet.com/) (CSS playground) +* [Mozilla Developer Network's CSS documentation](https://developer.mozilla.org/en-US/docs/Web/CSS) (Tutorials and reference) +* [Codrops' CSS Reference](http://tympanus.net/codrops/css_reference/) (Reference) ## Further Reading From d41fdbcba9a8d764ffcd1eaca453c7870567784f Mon Sep 17 00:00:00 2001 From: Kristian Date: Mon, 26 Oct 2015 17:56:28 +1000 Subject: [PATCH 489/685] Fixed typo in docs + Added a better description for 'nil' --- ruby.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruby.html.markdown b/ruby.html.markdown index 998b4bf7..a3fc859e 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -49,7 +49,7 @@ You shouldn't either 10.* 5 #=> 50 # Special values are objects -nil # Nothing to see here +nil # equivalent to null in other languages true # truth false # falsehood @@ -122,7 +122,7 @@ puts "I'm printing!" # print to the output without a newline print "I'm printing!" -#=> I'm printing! => nill +#=> I'm printing! => nil # Variables x = 25 #=> 25 From b31fda3a8e9f4d0ff021dc707f1e47af4add90ac Mon Sep 17 00:00:00 2001 From: Jody Leonard Date: Mon, 26 Oct 2015 19:38:36 -0400 Subject: [PATCH 490/685] Edit variable-length array example The current example seems to be trying to set a size for a char buffer, use fgets to populate that buffer, and then use strtoul to convert the char content to an unsigned integer. However, this doesn't work as intended (in fact, it results in printing "sizeof array = 0"), and so adapt to a simpler fscanf example. Also remove some ambiguous language in the example output. --- c.html.markdown | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/c.html.markdown b/c.html.markdown index 3d632eab..7c2386ef 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -148,15 +148,10 @@ int main (int argc, char** argv) printf("Enter the array size: "); // ask the user for an array size int size; fscanf(stdin, "%d", &size); - char buf[size]; - fgets(buf, sizeof buf, stdin); - - // strtoul parses a string to an unsigned integer - size_t size2 = strtoul(buf, NULL, 10); - int var_length_array[size2]; // declare the VLA + int var_length_array[size]; // declare the VLA printf("sizeof array = %zu\n", sizeof var_length_array); - // A possible outcome of this program may be: + // Example: // > Enter the array size: 10 // > sizeof array = 40 From 469541783d5ef25395d6bfe343a414c383236468 Mon Sep 17 00:00:00 2001 From: sholland Date: Mon, 26 Oct 2015 22:21:02 -0500 Subject: [PATCH 491/685] [fsharp/en] correct a few simple mistakes change github flavored markdown programming language to fsharp correct typos --- fsharp.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fsharp.html.markdown b/fsharp.html.markdown index 76318d7d..4cc233e3 100644 --- a/fsharp.html.markdown +++ b/fsharp.html.markdown @@ -16,7 +16,7 @@ The syntax of F# is different from C-style languages: If you want to try out the code below, you can go to [tryfsharp.org](http://www.tryfsharp.org/Create) and paste it into an interactive REPL. -```csharp +```fsharp // single line comments use a double slash (* multi line comments use (* . . . *) pair @@ -248,7 +248,7 @@ module SequenceExamples = // sequences can use yield and // can contain subsequences let strange = seq { - // "yield! adds one element + // "yield" adds one element yield 1; yield 2; // "yield!" adds a whole subsequence @@ -297,7 +297,7 @@ module DataTypeExamples = let person1 = {First="John"; Last="Doe"} // Pattern match to unpack - let {First=first} = person1 //sets first="john" + let {First=first} = person1 //sets first="John" // ------------------------------------ // Union types (aka variants) have a set of choices @@ -426,7 +426,7 @@ module ActivePatternExamples = // ----------------------------------- // You can create partial matching patterns as well - // Just use undercore in the defintion, and return Some if matched. + // Just use underscore in the defintion, and return Some if matched. let (|MultOf3|_|) i = if i % 3 = 0 then Some MultOf3 else None let (|MultOf5|_|) i = if i % 5 = 0 then Some MultOf5 else None From 9c3c3dff4518671e82cd3324c0d6fdddd506dfd3 Mon Sep 17 00:00:00 2001 From: Leonardy Kristianto Date: Wed, 28 Oct 2015 02:04:34 +0800 Subject: [PATCH 492/685] Added resources to read for Javascript --- javascript.html.markdown | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/javascript.html.markdown b/javascript.html.markdown index cce488e1..dc573b0e 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -547,6 +547,11 @@ of the language. [JavaScript: The Definitive Guide][6] is a classic guide and reference book. +[Eloquent Javascript][8] by Marijn Haverbeke is an excellent JS book/ebook with attached terminal + +[Javascript: The Right Way][9] is a guide intended to introduce new developers to JavaScript and help experienced developers learn more about its best practices. + + In addition to direct contributors to this article, some content is adapted from Louie Dinh's Python tutorial on this site, and the [JS Tutorial][7] on the Mozilla Developer Network. @@ -559,3 +564,5 @@ Mozilla Developer Network. [5]: http://bonsaiden.github.io/JavaScript-Garden/ [6]: http://www.amazon.com/gp/product/0596805527/ [7]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript +[8]: http://eloquentjavascript.net/ +[9]: http://jstherightway.org/ From 3015cfb4367ffe7e06df5232cb4aa5924194715d Mon Sep 17 00:00:00 2001 From: Leonardy Kristianto Date: Wed, 28 Oct 2015 02:14:13 +0800 Subject: [PATCH 493/685] Rename go.html.markdown to go-hu.html.markdown --- hu-hu/{go.html.markdown => go-hu.html.markdown} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename hu-hu/{go.html.markdown => go-hu.html.markdown} (100%) diff --git a/hu-hu/go.html.markdown b/hu-hu/go-hu.html.markdown similarity index 100% rename from hu-hu/go.html.markdown rename to hu-hu/go-hu.html.markdown From f1d18e7e493c468f372598620837fedfb07271bf Mon Sep 17 00:00:00 2001 From: Leonardy Kristianto Date: Wed, 28 Oct 2015 02:14:30 +0800 Subject: [PATCH 494/685] Rename ruby.html.markdown to ruby-hu.html.markdown --- hu-hu/{ruby.html.markdown => ruby-hu.html.markdown} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename hu-hu/{ruby.html.markdown => ruby-hu.html.markdown} (100%) diff --git a/hu-hu/ruby.html.markdown b/hu-hu/ruby-hu.html.markdown similarity index 100% rename from hu-hu/ruby.html.markdown rename to hu-hu/ruby-hu.html.markdown From d684a44259348f52ed86d6e02b773f83b1547fad Mon Sep 17 00:00:00 2001 From: Leonardy Kristianto Date: Wed, 28 Oct 2015 02:15:29 +0800 Subject: [PATCH 495/685] Rename css.html.markdown to css-ta.html.markdown --- ta_in/{css.html.markdown => css-ta.html.markdown} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ta_in/{css.html.markdown => css-ta.html.markdown} (100%) diff --git a/ta_in/css.html.markdown b/ta_in/css-ta.html.markdown similarity index 100% rename from ta_in/css.html.markdown rename to ta_in/css-ta.html.markdown From 7d4522b5125da0a97ed0fe1f684cb50606e7b12d Mon Sep 17 00:00:00 2001 From: Leonardy Kristianto Date: Wed, 28 Oct 2015 02:15:46 +0800 Subject: [PATCH 496/685] Rename javascript.html.markdown to javascript-ta.html.markdown --- ta_in/{javascript.html.markdown => javascript-ta.html.markdown} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ta_in/{javascript.html.markdown => javascript-ta.html.markdown} (100%) diff --git a/ta_in/javascript.html.markdown b/ta_in/javascript-ta.html.markdown similarity index 100% rename from ta_in/javascript.html.markdown rename to ta_in/javascript-ta.html.markdown From 32d040d3b4c4f1e8b022e27614531a462c9bb344 Mon Sep 17 00:00:00 2001 From: Leonardy Kristianto Date: Wed, 28 Oct 2015 02:15:57 +0800 Subject: [PATCH 497/685] Rename json.html.markdown to json-ta.html.markdown --- ta_in/{json.html.markdown => json-ta.html.markdown} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ta_in/{json.html.markdown => json-ta.html.markdown} (100%) diff --git a/ta_in/json.html.markdown b/ta_in/json-ta.html.markdown similarity index 100% rename from ta_in/json.html.markdown rename to ta_in/json-ta.html.markdown From c677ba561290866ef791c2cb813afaf1aae09a32 Mon Sep 17 00:00:00 2001 From: Leonardy Kristianto Date: Wed, 28 Oct 2015 02:16:12 +0800 Subject: [PATCH 498/685] Rename xml.html.markdown to xml-ta.html.markdown --- ta_in/{xml.html.markdown => xml-ta.html.markdown} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ta_in/{xml.html.markdown => xml-ta.html.markdown} (100%) diff --git a/ta_in/xml.html.markdown b/ta_in/xml-ta.html.markdown similarity index 100% rename from ta_in/xml.html.markdown rename to ta_in/xml-ta.html.markdown From 897159a9392b3c9be6a548c9cd0d85b6c4e20f37 Mon Sep 17 00:00:00 2001 From: Leonardy Kristianto Date: Wed, 28 Oct 2015 02:16:49 +0800 Subject: [PATCH 499/685] Rename brainfuck.html.markdown to brainfuck-fa.html.markdown --- fa-ir/{brainfuck.html.markdown => brainfuck-fa.html.markdown} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename fa-ir/{brainfuck.html.markdown => brainfuck-fa.html.markdown} (100%) diff --git a/fa-ir/brainfuck.html.markdown b/fa-ir/brainfuck-fa.html.markdown similarity index 100% rename from fa-ir/brainfuck.html.markdown rename to fa-ir/brainfuck-fa.html.markdown From 5cbf6497b954ab97a89f207a4bdf69e77771c981 Mon Sep 17 00:00:00 2001 From: Leonardy Kristianto Date: Wed, 28 Oct 2015 02:17:06 +0800 Subject: [PATCH 500/685] Rename javascript.html.markdown to javascript-fa.html.markdown --- fa-ir/{javascript.html.markdown => javascript-fa.html.markdown} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename fa-ir/{javascript.html.markdown => javascript-fa.html.markdown} (100%) diff --git a/fa-ir/javascript.html.markdown b/fa-ir/javascript-fa.html.markdown similarity index 100% rename from fa-ir/javascript.html.markdown rename to fa-ir/javascript-fa.html.markdown From 3cf044d1232f605f99df148dfc55e712020481c2 Mon Sep 17 00:00:00 2001 From: sholland1 Date: Tue, 27 Oct 2015 18:54:39 -0500 Subject: [PATCH 501/685] change language in examples back to csharp parser does not support fsharp syntax highlighting --- fsharp.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsharp.html.markdown b/fsharp.html.markdown index 4cc233e3..b5c47ed7 100644 --- a/fsharp.html.markdown +++ b/fsharp.html.markdown @@ -16,7 +16,7 @@ The syntax of F# is different from C-style languages: If you want to try out the code below, you can go to [tryfsharp.org](http://www.tryfsharp.org/Create) and paste it into an interactive REPL. -```fsharp +```csharp // single line comments use a double slash (* multi line comments use (* . . . *) pair From 61aa6a3e0146faed45230111b0bdcf1b0c2209f8 Mon Sep 17 00:00:00 2001 From: Corban Mailloux Date: Tue, 27 Oct 2015 22:18:02 -0400 Subject: [PATCH 502/685] "wan't" -> "want" --- javascript.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript.html.markdown b/javascript.html.markdown index dc573b0e..b54434e0 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -145,7 +145,7 @@ someOtherVar = 10; // Variables declared without being assigned to are set to undefined. var someThirdVar; // = undefined -// if you wan't to declare a couple of variables, then you could use a comma +// if you want to declare a couple of variables, then you could use a comma // separator var someFourthVar = 2, someFifthVar = 4; From a8d5105fab5e40923d834fb5848aabf561bc1701 Mon Sep 17 00:00:00 2001 From: Corban Mailloux Date: Tue, 27 Oct 2015 22:47:03 -0400 Subject: [PATCH 503/685] [javascript/en] Spacing and capitalization of comments ... and a few grammar fixes. --- javascript.html.markdown | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/javascript.html.markdown b/javascript.html.markdown index b54434e0..5bac3aa7 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -136,7 +136,7 @@ undefined; // used to indicate a value is not currently present (although // character. var someVar = 5; -// if you leave the var keyword off, you won't get an error... +// If you leave the var keyword off, you won't get an error... someOtherVar = 10; // ...but your variable will be created in the global scope, not in the scope @@ -145,7 +145,7 @@ someOtherVar = 10; // Variables declared without being assigned to are set to undefined. var someThirdVar; // = undefined -// if you want to declare a couple of variables, then you could use a comma +// If you want to declare a couple of variables, then you could use a comma // separator var someFourthVar = 2, someFifthVar = 4; @@ -223,15 +223,15 @@ for (var i = 0; i < 5; i++){ // will run 5 times } -//The For/In statement loops iterates over every property across the entire prototype chain +// The for/in statement iterates over every property across the entire prototype chain. var description = ""; var person = {fname:"Paul", lname:"Ken", age:18}; for (var x in person){ description += person[x] + " "; } -//If only want to consider properties attached to the object itself, -//and not its prototypes use hasOwnProperty() check +// To only consider properties attached to the object itself +// and not its prototypes, use the `hasOwnProperty()` check. var description = ""; var person = {fname:"Paul", lname:"Ken", age:18}; for (var x in person){ @@ -240,8 +240,9 @@ for (var x in person){ } } -//for/in should not be used to iterate over an Array where the index order is important. -//There is no guarantee that for/in will return the indexes in any particular order +// For/in should not be used to iterate over an Array where the index order +// is important, as there is no guarantee that for/in will return the indexes +// in any particular order. // && is logical and, || is logical or if (house.size == "big" && house.colour == "blue"){ @@ -256,7 +257,7 @@ var name = otherName || "default"; // The `switch` statement checks for equality with `===`. -// use 'break' after each case +// Use 'break' after each case // or the cases after the correct one will be executed too. grade = 'B'; switch (grade) { From c83eb6c6bca63b28a11b975cc64db5723e94b240 Mon Sep 17 00:00:00 2001 From: Adam Brenecki Date: Wed, 28 Oct 2015 13:26:24 +1030 Subject: [PATCH 504/685] [javascript/en] Move comparisons to other languages into preamble --- javascript.html.markdown | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/javascript.html.markdown b/javascript.html.markdown index 5bac3aa7..3f9eb641 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -16,9 +16,14 @@ JavaScript isn't just limited to web browsers, though: Node.js, a project that provides a standalone runtime for Google Chrome's V8 JavaScript engine, is becoming more and more popular. +JavaScript has a C-like syntax, so if you've used languages like C or Java, +a lot of the basic syntax will already be familiar. Despite this, and despite +the similarity in name, JavaScript's object model is significantly different to +Java's. + ```js -// Comments are like C's. Single-line comments start with two slashes, -/* and multiline comments start with slash-star +// Single-line comments start with two slashes. +/* Multiline comments start with slash-star, and end with star-slash */ // Statements can be terminated by ; @@ -145,7 +150,7 @@ someOtherVar = 10; // Variables declared without being assigned to are set to undefined. var someThirdVar; // = undefined -// If you want to declare a couple of variables, then you could use a comma +// If you want to declare a couple of variables, then you could use a comma // separator var someFourthVar = 2, someFifthVar = 4; @@ -194,8 +199,6 @@ myObj.myFourthKey; // = undefined /////////////////////////////////// // 3. Logic and Control Structures -// The syntax for this section is almost identical to Java's. - // The `if` structure works as you'd expect. var count = 1; if (count == 3){ From d4d471ef50fb2e84dc8f1656a7037795bd44a89a Mon Sep 17 00:00:00 2001 From: Adam Brenecki Date: Wed, 28 Oct 2015 13:27:48 +1030 Subject: [PATCH 505/685] [javascript/en] Formatting fix --- javascript.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript.html.markdown b/javascript.html.markdown index 3f9eb641..b5c3a3c8 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -41,7 +41,7 @@ doStuff() // JavaScript has one number type (which is a 64-bit IEEE 754 double). // Doubles have a 52-bit mantissa, which is enough to store integers -// up to about 9✕10¹⁵ precisely. +// up to about 9✕10¹⁵ precisely. 3; // = 3 1.5; // = 1.5 From c3a66e60a61de0b98ea3e86568dfddf76eae1069 Mon Sep 17 00:00:00 2001 From: Adam Brenecki Date: Wed, 28 Oct 2015 13:48:53 +1030 Subject: [PATCH 506/685] [javascript/en] Re-add note about truthiness of wrapped primitives Previous incarnations of this section had `Number(0)` instead of `new Number(0)`, which actually returns `0` due to the absence of the `new` keyword; this commit re-adds that section and better still, makes it actually correct! --- javascript.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/javascript.html.markdown b/javascript.html.markdown index b5c3a3c8..cd75b0d2 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -507,6 +507,10 @@ myNumber === myNumberObj; // = false if (0){ // This code won't execute, because 0 is falsy. } +if (new Number(0)){ + // This code will execute, because wrapped numbers are objects, and objects + // are always truthy. +} // However, the wrapper objects and the regular builtins share a prototype, so // you can actually add functionality to a string, for instance. From 2c99b0a9553f25a7ac43b04a14c4e2d78fe2b318 Mon Sep 17 00:00:00 2001 From: Dennis Keller Date: Wed, 28 Oct 2015 08:18:27 +0100 Subject: [PATCH 507/685] [scala/de] Fix ``` usage --- de-de/scala-de.html.markdown | 524 ++++++++++++++++++----------------- 1 file changed, 274 insertions(+), 250 deletions(-) diff --git a/de-de/scala-de.html.markdown b/de-de/scala-de.html.markdown index 7fd299b4..456403a2 100644 --- a/de-de/scala-de.html.markdown +++ b/de-de/scala-de.html.markdown @@ -5,6 +5,7 @@ contributors: - ["Dominic Bou-Samra", "http://dbousamra.github.com"] - ["Geoff Liu", "http://geoffliu.me"] - ["Ha-Duong Nguyen", "http://reference-error.org"] + - ["Dennis Keller", "github.com/denniskeller"] translators: - ["Christian Albrecht", "https://github.com/coastalchief"] filename: learnscala-de.scala @@ -16,167 +17,172 @@ für die Java Virtual Machine (JVM), um allgemeine Programmieraufgaben zu erledigen. Scala hat einen akademischen Hintergrund und wurde an der EPFL (Lausanne / Schweiz) unter der Leitung von Martin Odersky entwickelt. - -# 0. Umgebung einrichten +```scala +/* Scala Umgebung einrichten: 1. Scala binaries herunterladen- http://www.scala-lang.org/downloads 2. Unzip/untar in ein Verzeichnis 3. das bin Unterverzeichnis der `PATH` Umgebungsvariable hinzufügen 4. Mit dem Kommando `scala` wird die REPL gestartet und zeigt als Prompt: -``` + scala> -``` Die REPL (Read-Eval-Print Loop) ist der interaktive Scala Interpreter. Hier kann man jeden Scala Ausdruck verwenden und das Ergebnis wird direkt ausgegeben. Als nächstes beschäftigen wir uns mit ein paar Scala Basics. +*/ -# 1. Basics -Einzeilige Kommentare beginnen mit zwei vorwärts Slash +///////////////////////////////////////////////// +// 1. Basics +///////////////////////////////////////////////// + +// Einzeilige Kommentare beginnen mit zwei Slashes /* - Mehrzeilige Kommentare, werden starten - mit Slash-Stern und enden mit Stern-Slash + Mehrzeilige Kommentare, starten + mit einem Slash-Stern und enden mit einem Stern-Slash */ // Einen Wert, und eine zusätzliche neue Zeile ausgeben -``` + println("Hello world!") println(10) -``` + // Einen Wert, ohne eine zusätzliche neue Zeile ausgeben -``` -print("Hello world") -``` -// Variablen werden entweder mit var oder val deklariert. -// Deklarationen mit val sind immutable, also unveränderlich -// Deklarationen mit var sind mutable, also veränderlich -// Immutability ist gut. -``` +print("Hello world") + +/* + Variablen werden entweder mit var oder val deklariert. + Deklarationen mit val sind immutable, also unveränderlich + Deklarationen mit var sind mutable, also veränderlich + Immutability ist gut. +*/ val x = 10 // x ist 10 x = 20 // error: reassignment to val var y = 10 y = 20 // y ist jetzt 20 -``` -Scala ist eine statisch getypte Sprache, auch wenn in dem o.g. Beispiel +/* +Scala ist eine statisch getypte Sprache, auch wenn wir in dem o.g. Beispiel keine Typen an x und y geschrieben haben. -In Scala ist etwas eingebaut, was sich Type Inference nennt. D.h. das der -Scala Compiler in den meisten Fällen erraten kann, von welchen Typ eine ist, -so dass der Typ nicht jedes mal angegeben werden soll. +In Scala ist etwas eingebaut, was sich Type Inference nennt. Das heißt das der +Scala Compiler in den meisten Fällen erraten kann, von welchen Typ eine Variable ist, +so dass der Typ nicht jedes mal angegeben werden muss. Einen Typ gibt man bei einer Variablendeklaration wie folgt an: -``` +*/ val z: Int = 10 val a: Double = 1.0 -``` + // Bei automatischer Umwandlung von Int auf Double wird aus 10 eine 10.0 -``` + val b: Double = 10 -``` + // Boolean Werte -``` + true false -``` + // Boolean Operationen -``` + !true // false !false // true true == false // false 10 > 5 // true -``` + // Mathematische Operationen sind wie gewohnt -``` + 1 + 1 // 2 2 - 1 // 1 5 * 3 // 15 6 / 2 // 3 6 / 4 // 1 6.0 / 4 // 1.5 -``` + // Die Auswertung eines Ausdrucks in der REPL gibt den Typ // und das Ergebnis zurück. -``` + scala> 1 + 7 res29: Int = 8 -``` +/* Das bedeutet, dass das Resultat der Auswertung von 1 + 7 ein Objekt von Typ Int ist und einen Wert 0 hat. "res29" ist ein sequentiell generierter name, um das Ergebnis des Ausdrucks zu speichern. Dieser Wert kann bei Dir anders sein... - +*/ "Scala strings werden in doppelten Anführungszeichen eingeschlossen" 'a' // A Scala Char // 'Einzeln ge-quotete strings gibt es nicht!' <= This causes an error // Für Strings gibt es die üblichen Java Methoden -``` + "hello world".length "hello world".substring(2, 6) "hello world".replace("C", "3") -``` + // Zusätzlich gibt es noch extra Scala Methoden // siehe: scala.collection.immutable.StringOps -``` + "hello world".take(5) "hello world".drop(5) -``` + // String interpolation: prefix "s" -``` + val n = 45 s"We have $n apples" // => "We have 45 apples" -``` -// Ausdrücke im innern von interpolierten Strings gibt es auch -``` + +// Ausdrücke im Innern von interpolierten Strings gibt es auch + val a = Array(11, 9, 6) val n = 100 s"My second daughter is ${a(0) - a(2)} years old." // => "My second daughter is 5 years old." s"We have double the amount of ${n / 2.0} in apples." // => "We have double the amount of 22.5 in apples." s"Power of 2: ${math.pow(2, 2)}" // => "Power of 2: 4" -``` + // Formatierung der interpolierten Strings mit dem prefix "f" -``` + f"Power of 5: ${math.pow(5, 2)}%1.0f" // "Power of 5: 25" f"Square root of 122: ${math.sqrt(122)}%1.4f" // "Square root of 122: 11.0454" -``` + // Raw Strings, ignorieren Sonderzeichen. -``` + raw"New line feed: \n. Carriage return: \r." // => "New line feed: \n. Carriage return: \r." -``` + // Manche Zeichen müssen "escaped" werden, z.B. // ein doppeltes Anführungszeichen in innern eines Strings. -``` + "They stood outside the \"Rose and Crown\"" // => "They stood outside the "Rose and Crown"" -``` + // Dreifache Anführungszeichen erlauben es, dass ein String über mehrere Zeilen geht // und Anführungszeichen enthalten kann. -``` + val html = """

Press belo', Joe

""" -``` -# 2. Funktionen + +///////////////////////////////////////////////// +// 2. Funktionen +///////////////////////////////////////////////// // Funktionen werden so definiert // @@ -184,74 +190,74 @@ val html = """
// // Beachte: Es gibt kein return Schlüsselwort. In Scala ist der letzte Ausdruck // in einer Funktion der Rückgabewert. -``` + def sumOfSquares(x: Int, y: Int): Int = { val x2 = x * x val y2 = y * y x2 + y2 } -``` + // Die geschweiften Klammern können weggelassen werden, wenn // die Funktion nur aus einem einzigen Ausdruck besteht: -``` + def sumOfSquaresShort(x: Int, y: Int): Int = x * x + y * y -``` + // Syntax für Funktionsaufrufe: -``` + sumOfSquares(3, 4) // => 25 -``` + // In den meisten Fällen (mit Ausnahme von rekursiven Funktionen), können // Rückgabetypen auch weggelassen werden, da dieselbe Typ Inference, wie bei // Variablen, auch bei Funktionen greift: -``` + def sq(x: Int) = x * x // Compiler errät, dass der return type Int ist -``` + // Funktionen können default parameter haben: -``` + def addWithDefault(x: Int, y: Int = 5) = x + y addWithDefault(1, 2) // => 3 addWithDefault(1) // => 6 -``` + // Anonyme Funktionen sehen so aus: -``` + (x: Int) => x * x -``` + // Im Gegensatz zu def bei normalen Funktionen, kann bei anonymen Funktionen // sogar der Eingabetyp weggelassen werden, wenn der Kontext klar ist. // Beachte den Typ "Int => Int", dies beschreibt eine Funktion, // welche Int als Parameter erwartet und Int zurückgibt. -``` + val sq: Int => Int = x => x * x -``` + // Anonyme Funktionen benutzt man ganz normal: -``` + sq(10) // => 100 -``` + // Wenn ein Parameter einer anonymen Funktion nur einmal verwendet wird, // bietet Scala einen sehr kurzen Weg diesen Parameter zu benutzen, // indem die Parameter als Unterstrich "_" in der Parameterreihenfolge // verwendet werden. Diese anonymen Funktionen werden sehr häufig // verwendet. -``` + val addOne: Int => Int = _ + 1 val weirdSum: (Int, Int) => Int = (_ * 2 + _ * 3) addOne(5) // => 6 weirdSum(2, 4) // => 16 -``` + // Es gibt einen keyword return in Scala. Allerdings ist seine Verwendung // nicht immer ratsam und kann fehlerbehaftet sein. "return" gibt nur aus // dem innersten def, welches den return Ausdruck umgibt, zurück. // "return" hat keinen Effekt in anonymen Funktionen: -``` + def foo(x: Int): Int = { val anonFunc: Int => Int = { z => if (z > 5) @@ -261,28 +267,30 @@ def foo(x: Int): Int = { } anonFunc(x) // Zeile ist der return Wert von foo } -``` -# 3. Flow Control -## Wertebereiche und Schleifen -``` +///////////////////////////////////////////////// +// 3. Flow Control +///////////////////////////////////////////////// + +// Wertebereiche und Schleifen + 1 to 5 val r = 1 to 5 r.foreach(println) r foreach println (5 to 1 by -1) foreach (println) -``` -// Scala ist syntaktisch sehr grosszügig, Semikolons am Zeilenende + +// Scala ist syntaktisch sehr großzügig, Semikolons am Zeilenende // sind optional, beim Aufruf von Methoden können die Punkte // und Klammern entfallen und Operatoren sind im Grunde austauschbare Methoden // while Schleife -``` + var i = 0 while (i < 10) { println("i " + i); i += 1 } i // i ausgeben, res3: Int = 10 -``` + // Beachte: while ist eine Schleife im klassischen Sinne - // Sie läuft sequentiell ab und verändert die loop-Variable. @@ -291,28 +299,28 @@ i // i ausgeben, res3: Int = 10 // und zu parellelisieren. // Ein do while Schleife -``` + do { println("x ist immer noch weniger wie 10") x += 1 } while (x < 10) -``` + // Endrekursionen sind ideomatisch um sich wiederholende // Dinge in Scala zu lösen. Rekursive Funtionen benötigen explizit einen // return Typ, der Compiler kann ihn nicht erraten. // Unit, in diesem Beispiel. -``` + def showNumbersInRange(a: Int, b: Int): Unit = { print(a) if (a < b) showNumbersInRange(a + 1, b) } showNumbersInRange(1, 14) -``` -## Conditionals -``` + +// Conditionals + val x = 10 if (x == 1) println("yeah") if (x == 10) println("yeah") @@ -320,186 +328,193 @@ if (x == 11) println("yeah") if (x == 11) println ("yeah") else println("nay") println(if (x == 10) "yeah" else "nope") val text = if (x == 10) "yeah" else "nope" -``` -# 4. Daten Strukturen (Array, Map, Set, Tuples) -## Array -``` +///////////////////////////////////////////////// +// 4. Daten Strukturen (Array, Map, Set, Tuples) +///////////////////////////////////////////////// + +// Array + val a = Array(1, 2, 3, 5, 8, 13) a(0) a(3) a(21) // Exception -``` -## Map - Speichert Key-Value-Paare -``` + +// Map - Speichert Key-Value-Paare + val m = Map("fork" -> "tenedor", "spoon" -> "cuchara", "knife" -> "cuchillo") m("fork") m("spoon") m("bottle") // Exception val safeM = m.withDefaultValue("no lo se") safeM("bottle") -``` -## Set - Speichert Unikate, unsortiert (sortiert -> SortedSet) -``` + +// Set - Speichert Unikate, unsortiert (sortiert -> SortedSet) + val s = Set(1, 3, 7) s(0) //false s(1) //true val s = Set(1,1,3,3,7) s: scala.collection.immutable.Set[Int] = Set(1, 3, 7) -``` -## Tuple - Speichert beliebige Daten und "verbindet" sie miteinander + +// Tuple - Speichert beliebige Daten und "verbindet" sie miteinander // Ein Tuple ist keine Collection. -``` + (1, 2) (4, 3, 2) (1, 2, "three") (a, 2, "three") -``` + // Hier ist der Rückgabewert der Funktion ein Tuple // Die Funktion gibt das Ergebnis, so wie den Rest zurück. -``` + val divideInts = (x: Int, y: Int) => (x / y, x % y) divideInts(10, 3) -``` + // Um die Elemente eines Tuples anzusprechen, benutzt man diese // Notation: _._n wobei n der index des Elements ist (Index startet bei 1) -``` + val d = divideInts(10, 3) d._1 d._2 -``` -# 5. Objekt Orientierte Programmierung -Bislang waren alle gezeigten Sprachelemente einfache Ausdrücke, welche zwar -zum Ausprobieren und Lernen in der REPL gut geeignet sind, jedoch in -einem Scala file selten alleine zu finden sind. -Die einzigen Top-Level Konstrukte in Scala sind nämlich: -- Klassen (classes) -- Objekte (objects) -- case classes -- traits +///////////////////////////////////////////////// +// 5. Objektorientierte Programmierung +///////////////////////////////////////////////// -Diesen Sprachelemente wenden wir uns jetzt zu. +/* + Bislang waren alle gezeigten Sprachelemente einfache Ausdrücke, welche zwar + zum Ausprobieren und Lernen in der REPL gut geeignet sind, jedoch in + einem Scala file selten alleine zu finden sind. + Die einzigen Top-Level Konstrukte in Scala sind nämlich: -## Klassen + - Klassen (classes) + - Objekte (objects) + - case classes + - traits + + Diesen Sprachelemente wenden wir uns jetzt zu. +*/ + +// Klassen // Zum Erstellen von Objekten benötigt man eine Klasse, wie in vielen // anderen Sprachen auch. // erzeugt Klasse mit default Konstruktor -``` + class Hund scala> val t = new Hund t: Hund = Hund@7103745 -``` + // Der Konstruktor wird direkt hinter dem Klassennamen deklariert. -``` + class Hund(sorte: String) scala> val t = new Hund("Dackel") t: Hund = Hund@14be750c scala> t.sorte //error: value sorte is not a member of Hund -``` + // Per val wird aus dem Attribut ein unveränderliches Feld der Klasse // Per var wird aus dem Attribut ein veränderliches Feld der Klasse -``` + class Hund(val sorte: String) scala> val t = new Hund("Dackel") t: Hund = Hund@74a85515 scala> t.sorte res18: String = Dackel -``` + // Methoden werden mit def geschrieben -``` + def bark = "Woof, woof!" -``` + // Felder und Methoden können public, protected und private sein // default ist public // private ist nur innerhalb des deklarierten Bereichs sichtbar -``` + class Hund { private def x = ... def y = ... } -``` + // protected ist nur innerhalb des deklarierten und aller // erbenden Bereiche sichtbar -``` + class Hund { protected def x = ... } class Dackel extends Hund { // x ist sichtbar } -``` -## Object -Wird ein Objekt ohne das Schlüsselwort "new" instanziert, wird das sog. -"companion object" aufgerufen. Mit dem "object" Schlüsselwort wird so -ein Objekt (Typ UND Singleton) erstellt. Damit kann man dann eine Klasse -benutzen ohne ein Objekt instanziieren zu müssen. -Ein gültiges companion Objekt einer Klasse ist es aber erst dann, wenn -es genauso heisst und in derselben Datei wie die Klasse definiert wurde. -``` + +// Object +// Wird ein Objekt ohne das Schlüsselwort "new" instanziert, wird das sog. +// "companion object" aufgerufen. Mit dem "object" Schlüsselwort wird so +// ein Objekt (Typ UND Singleton) erstellt. Damit kann man dann eine Klasse +// benutzen ohne ein Objekt instanziieren zu müssen. +// Ein gültiges companion Objekt einer Klasse ist es aber erst dann, wenn +// es genauso heisst und in derselben Datei wie die Klasse definiert wurde. + object Hund { def alleSorten = List("Pitbull", "Dackel", "Retriever") def createHund(sorte: String) = new Hund(sorte) } -``` -## Case classes -Fallklassen bzw. Case classes sind Klassen die normale Klassen um extra -Funktionalität erweitern. Mit Case Klassen bekommt man ein paar -Dinge einfach dazu, ohne sich darum kümmern zu müssen. Z.B. -ein companion object mit den entsprechenden Methoden, -Hilfsmethoden wie toString(), equals() und hashCode() und auch noch -Getter für unsere Attribute (das Angeben von val entfällt dadurch) -``` + +// Case classes +// Fallklassen bzw. Case classes sind Klassen die normale Klassen um extra +// Funktionalität erweitern. Mit Case Klassen bekommt man ein paar +// Dinge einfach dazu, ohne sich darum kümmern zu müssen. Z.B. +// ein companion object mit den entsprechenden Methoden, +// Hilfsmethoden wie toString(), equals() und hashCode() und auch noch +// Getter für unsere Attribute (das Angeben von val entfällt dadurch) + class Person(val name: String) class Hund(val sorte: String, val farbe: String, val halter: Person) -``` + // Es genügt das Schlüsselwort case vor die Klasse zu schreiben. -``` + case class Person(name: String) case class Hund(sorte: String, farbe: String, halter: Person) -``` + // Für neue Instanzen brauch man kein "new" -``` + val dackel = Hund("dackel", "grau", Person("peter")) val dogge = Hund("dogge", "grau", Person("peter")) -``` + // getter -``` + dackel.halter // => Person = Person(peter) -``` + // equals -``` + dogge == dackel // => false -``` + // copy // otherGeorge == Person("george", "9876") -``` + val otherGeorge = george.copy(phoneNumber = "9876") -``` -## Traits -Ähnlich wie Java interfaces, definiert man mit traits einen Objekttyp -und Methodensignaturen. Scala erlaubt allerdings das teilweise -implementieren dieser Methoden. Konstruktorparameter sind nicht erlaubt. -Traits können von anderen Traits oder Klassen erben, aber nur von -parameterlosen. -``` + +// Traits +// Ähnlich wie Java interfaces, definiert man mit traits einen Objekttyp +// und Methodensignaturen. Scala erlaubt allerdings das teilweise +// implementieren dieser Methoden. Konstruktorparameter sind nicht erlaubt. +// Traits können von anderen Traits oder Klassen erben, aber nur von +// parameterlosen. + trait Hund { def sorte: String def farbe: String @@ -511,9 +526,9 @@ class Bernhardiner extends Hund{ val farbe = "braun" def beissen = false } -``` + -``` + scala> b res0: Bernhardiner = Bernhardiner@3e57cd70 scala> b.sorte @@ -522,10 +537,10 @@ scala> b.bellen res2: Boolean = true scala> b.beissen res3: Boolean = false -``` + // Traits können auch via Mixins (Schlüsselwort "with") eingebunden werden -``` + trait Bellen { def bellen: String = "Woof" } @@ -541,25 +556,27 @@ scala> val b = new Bernhardiner b: Bernhardiner = Bernhardiner@7b69c6ba scala> b.bellen res0: String = Woof -``` -# 6. Pattern Matching -Pattern matching in Scala ist ein sehr nützliches und wesentlich -mächtigeres Feature als Vergleichsfunktionen in Java. In Scala -benötigt ein case Statement kein "break", ein fall-through gibt es nicht. -Mehrere Überprüfungen können mit einem Statement gemacht werden. -Pattern matching wird mit dem Schlüsselwort "match" gemacht. -``` +///////////////////////////////////////////////// +// 6. Pattern Matching +///////////////////////////////////////////////// + +// Pattern matching in Scala ist ein sehr nützliches und wesentlich +// mächtigeres Feature als Vergleichsfunktionen in Java. In Scala +// benötigt ein case Statement kein "break", ein fall-through gibt es nicht. +// Mehrere Überprüfungen können mit einem Statement gemacht werden. +// Pattern matching wird mit dem Schlüsselwort "match" gemacht. + val x = ... x match { case 2 => case 3 => case _ => } -``` + // Pattern Matching kann auf beliebige Typen prüfen -``` + val any: Any = ... val gleicht = any match { case 2 | 3 | 5 => "Zahl" @@ -568,19 +585,19 @@ val gleicht = any match { case 45.35 => "Double" case _ => "Unbekannt" } -``` + // und auf Objektgleichheit -``` + def matchPerson(person: Person): String = person match { case Person("George", nummer) => "George! Die Nummer ist " + number case Person("Kate", nummer) => "Kate! Die Nummer ist " + nummer case Person(name, nummer) => "Irgendjemand: " + name + ", Telefon: " + nummer } -``` + // Und viele mehr... -``` + val email = "(.*)@(.*)".r // regex def matchEverything(obj: Any): String = obj match { // Werte: @@ -600,18 +617,21 @@ def matchEverything(obj: Any): String = obj match { // Patterns kann man ineinander schachteln: case List(List((1, 2, "YAY"))) => "Got a list of list of tuple" } -``` + // Jedes Objekt mit einer "unapply" Methode kann per Pattern geprüft werden // Ganze Funktionen können Patterns sein -``` + val patternFunc: Person => String = { case Person("George", number) => s"George's number: $number" case Person(name, number) => s"Random person's number: $number" } -``` -# 7. Higher-order functions + +///////////////////////////////////////////////// +// 37. Higher-order functions +///////////////////////////////////////////////// + Scala erlaubt, das Methoden und Funktion wiederum Funtionen und Methoden als Aufrufparameter oder Return Wert verwenden. Diese Methoden heissen higher-order functions @@ -621,116 +641,117 @@ Nennenswerte sind: "filter", "map", "reduce", "foldLeft"/"foldRight", "exists", "forall" ## List -``` + def isGleichVier(a:Int) = a == 4 val list = List(1, 2, 3, 4) val resultExists4 = list.exists(isEqualToFour) -``` + ## map // map nimmt eine Funktion und führt sie auf jedem Element aus und erzeugt // eine neue Liste // Funktion erwartet ein Int und returned ein Int -``` + val add10: Int => Int = _ + 10 -``` + // add10 wird auf jedes Element angewendet -``` + List(1, 2, 3) map add10 // => List(11, 12, 13) -``` + // Anonyme Funktionen können anstatt definierter Funktionen verwendet werden -``` + List(1, 2, 3) map (x => x + 10) -``` + // Der Unterstrich wird anstelle eines Parameters einer anonymen Funktion // verwendet. Er wird an die Variable gebunden. -``` + List(1, 2, 3) map (_ + 10) -``` + // Wenn der anonyme Block und die Funtion beide EIN Argument erwarten, // kann sogar der Unterstrich weggelassen werden. -``` -List("Dom", "Bob", "Natalia") foreach println -``` -## filter +List("Dom", "Bob", "Natalia") foreach println + + +// filter // filter nimmt ein Prädikat (eine Funktion von A -> Boolean) und findet // alle Elemente die auf das Prädikat passen -``` + List(1, 2, 3) filter (_ > 2) // => List(3) case class Person(name: String, age: Int) List( Person(name = "Dom", age = 23), Person(name = "Bob", age = 30) ).filter(_.age > 25) // List(Person("Bob", 30)) -``` -## reduce + +// reduce // reduce nimmt zwei Elemente und kombiniert sie zu einem Element, // und zwar solange bis nur noch ein Element da ist. -## foreach +// foreach // foreach gibt es für einige Collections -``` + val aListOfNumbers = List(1, 2, 3, 4, 10, 20, 100) aListOfNumbers foreach (x => println(x)) aListOfNumbers foreach println -``` -## For comprehensions + +// For comprehensions // Eine for-comprehension definiert eine Beziehung zwischen zwei Datensets. // Dies ist keine for-Schleife. -``` + for { n <- s } yield sq(n) val nSquared2 = for { n <- s } yield sq(n) for { n <- nSquared2 if n < 10 } yield n for { n <- s; nSquared = n * n if nSquared < 10} yield nSquared -``` + ///////////////////////////////////////////////// -# 8. Implicits +// 8. Implicits ///////////////////////////////////////////////// -**ACHTUNG:** -Implicits sind ein sehr mächtiges Sprachfeature von Scala. Es sehr einfach -sie falsch zu benutzen und Anfänger sollten sie mit Vorsicht oder am -besten erst dann benutzen, wenn man versteht wie sie funktionieren. -Dieses Tutorial enthält Implicits, da sie in Scala an jeder Stelle -vorkommen und man auch mit einer Lib die Implicits benutzt nichts sinnvolles -machen kann. -Hier soll ein Grundverständnis geschaffen werden, wie sie funktionieren. +// **ACHTUNG:** +// Implicits sind ein sehr mächtiges Sprachfeature von Scala. +// Es sehr einfach +// sie falsch zu benutzen und Anfänger sollten sie mit Vorsicht oder am +// besten erst dann benutzen, wenn man versteht wie sie funktionieren. +// Dieses Tutorial enthält Implicits, da sie in Scala an jeder Stelle +// vorkommen und man auch mit einer Lib die Implicits benutzt nichts sinnvolles +// machen kann. +// Hier soll ein Grundverständnis geschaffen werden, wie sie funktionieren. // Mit dem Schlüsselwort implicit können Methoden, Werte, Funktion, Objekte // zu "implicit Methods" werden. -``` + implicit val myImplicitInt = 100 implicit def myImplicitFunction(sorte: String) = new Hund("Golden " + sorte) -``` + // implicit ändert nicht das Verhalten eines Wertes oder einer Funktion -``` + myImplicitInt + 2 // => 102 myImplicitFunction("Pitbull").sorte // => "Golden Pitbull" -``` + // Der Unterschied ist, dass diese Werte ausgewählt werden können, wenn ein // anderer Codeteil einen implicit Wert benötigt, zum Beispiel innerhalb von // implicit Funktionsparametern // Diese Funktion hat zwei Parameter: einen normalen und einen implicit -``` + def sendGreetings(toWhom: String)(implicit howMany: Int) = s"Hello $toWhom, $howMany blessings to you and yours!" -``` + // Werden beide Parameter gefüllt, verhält sich die Funktion wie erwartet -``` + sendGreetings("John")(1000) // => "Hello John, 1000 blessings to you and yours!" -``` + // Wird der implicit Parameter jedoch weggelassen, wird ein anderer // implicit Wert vom gleichen Typ genommen. Der Compiler sucht im @@ -739,66 +760,69 @@ sendGreetings("John")(1000) // => "Hello John, 1000 blessings to you and yours! // geforderten Typ konvertieren kann. // Hier also: "myImplicitInt", da ein Int gesucht wird -``` + sendGreetings("Jane") // => "Hello Jane, 100 blessings to you and yours!" -``` + // bzw. "myImplicitFunction" // Der String wird erst mit Hilfe der Funktion in Hund konvertiert, und // dann wird die Methode aufgerufen -``` -"Retriever".sorte // => "Golden Retriever" -``` -# 9. Misc -## Importe -``` +"Retriever".sorte // => "Golden Retriever" + + +///////////////////////////////////////////////// +// 19. Misc +///////////////////////////////////////////////// +// Importe + import scala.collection.immutable.List -``` + // Importiere alle Unterpackages -``` + import scala.collection.immutable._ -``` + // Importiere verschiedene Klassen mit einem Statement -``` + import scala.collection.immutable.{List, Map} -``` + // Einen Import kann man mit '=>' umbenennen -``` + import scala.collection.immutable.{List => ImmutableList} -``` + // Importiere alle Klasses, mit Ausnahem von.... // Hier ohne: Map and Set: -``` + import scala.collection.immutable.{Map => _, Set => _, _} -``` -## Main -``` + +// Main + object Application { def main(args: Array[String]): Unit = { - // stuff goes here. + // Sachen kommen hierhin } } -``` -## I/O + +// I/O // Eine Datei Zeile für Zeile lesen -``` + import scala.io.Source for(line <- Source.fromFile("myfile.txt").getLines()) println(line) -``` + // Eine Datei schreiben -``` + val writer = new PrintWriter("myfile.txt") writer.write("Schreibe Zeile" + util.Properties.lineSeparator) writer.write("Und noch eine Zeile" + util.Properties.lineSeparator) writer.close() + ``` ## Weiterführende Hinweise From 7a6d3b15490b882cd387f7eeb9b14d5ab20c55b1 Mon Sep 17 00:00:00 2001 From: Saurabh Sandav Date: Wed, 28 Oct 2015 13:16:13 +0530 Subject: [PATCH 508/685] [elisp/en] Fix typo --- lua.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua.html.markdown b/lua.html.markdown index 3d95c146..2cd4d7bb 100644 --- a/lua.html.markdown +++ b/lua.html.markdown @@ -190,7 +190,7 @@ end -------------------------------------------------------------------------------- -- A table can have a metatable that gives the table operator-overloadish --- behavior. Later we'll see how metatables support js-prototypey behaviour. +-- behaviour. Later we'll see how metatables support js-prototypey behaviour. f1 = {a = 1, b = 2} -- Represents the fraction a/b. f2 = {a = 2, b = 3} From 4ff79b2554ca3d16e4b64d0d4b367191cdc31887 Mon Sep 17 00:00:00 2001 From: Jason Yeo Date: Wed, 28 Oct 2015 17:46:57 +0800 Subject: [PATCH 509/685] Fix minor typographical errors --- edn.html.markdown | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/edn.html.markdown b/edn.html.markdown index 14bb25b4..b303d63c 100644 --- a/edn.html.markdown +++ b/edn.html.markdown @@ -22,7 +22,7 @@ will see how it is extended later on. ;;; Basic Types ;;; ;;;;;;;;;;;;;;;;;;; -nil ; or aka null +nil ; also known in other languages as null ; Booleans true @@ -35,14 +35,15 @@ false ; Characters are preceeded by backslashes \g \r \a \c \e -; Keywords starts with a colon. They behave like enums. Kinda -; like symbols in ruby. +; Keywords start with a colon. They behave like enums. Kinda +; like symbols in Ruby. :eggs :cheese :olives -; Symbols are used to represent identifiers. You can namespace symbols by -; using /. Whatever preceeds / is the namespace of the name. +; Symbols are used to represent identifiers. They start with #. +; You can namespace symbols by using /. Whatever preceeds / is +; the namespace of the name. #spoon #kitchen/spoon ; not the same as #spoon #kitchen/fork @@ -52,7 +53,7 @@ false 42 3.14159 -; Lists are a sequence of values +; Lists are sequences of values (:bun :beef-patty 9 "yum!") ; Vectors allow random access From 5f6d0d030001c465656661632fbea540a54bae69 Mon Sep 17 00:00:00 2001 From: Jason Yeo Date: Wed, 28 Oct 2015 17:51:18 +0800 Subject: [PATCH 510/685] Kinda -> Kind of --- edn.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edn.html.markdown b/edn.html.markdown index b303d63c..655c20f1 100644 --- a/edn.html.markdown +++ b/edn.html.markdown @@ -35,7 +35,7 @@ false ; Characters are preceeded by backslashes \g \r \a \c \e -; Keywords start with a colon. They behave like enums. Kinda +; Keywords start with a colon. They behave like enums. Kind of ; like symbols in Ruby. :eggs :cheese From 951a51379aaf95eac83e6df2fdb8717ff0e64ec0 Mon Sep 17 00:00:00 2001 From: Morgan Date: Wed, 28 Oct 2015 11:52:21 +0100 Subject: [PATCH 511/685] [livescript/fr] Correct the translator github repository --- fr-fr/livescript-fr.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fr-fr/livescript-fr.html.markdown b/fr-fr/livescript-fr.html.markdown index 9c3b8003..13bbffe5 100644 --- a/fr-fr/livescript-fr.html.markdown +++ b/fr-fr/livescript-fr.html.markdown @@ -4,7 +4,7 @@ filename: learnLivescript-fr.ls contributors: - ["Christina Whyte", "http://github.com/kurisuwhyte/"] translators: - - ["Morgan Bohn", "https://github.com/morganbohn"] + - ["Morgan Bohn", "https://github.com/dotmobo"] lang: fr-fr --- From db903ac5b6c80fa4b0e8502fb4b3abfd1bed07ee Mon Sep 17 00:00:00 2001 From: Srinivasan R Date: Wed, 28 Oct 2015 16:25:54 +0530 Subject: [PATCH 512/685] Add one more string formatting example --- python.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/python.html.markdown b/python.html.markdown index 753d6e8c..3d63183c 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -128,6 +128,7 @@ not False # => True # A newer way to format strings is the format method. # This method is the preferred way +"{} is a {}".format("This", "placeholder") "{0} can be {1}".format("strings", "formatted") # You can use keywords if you don't want to count. "{name} wants to eat {food}".format(name="Bob", food="lasagna") From 08e6aa4e6e0344082517ad94d29fb33b81e827a9 Mon Sep 17 00:00:00 2001 From: Kyle Mendes Date: Wed, 28 Oct 2015 17:25:44 -0400 Subject: [PATCH 513/685] Adding a small blurb to extend upon string concatination --- javascript.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/javascript.html.markdown b/javascript.html.markdown index cd75b0d2..e285ca4e 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -101,6 +101,10 @@ false; // Strings are concatenated with + "Hello " + "world!"; // = "Hello world!" +// ... which works with more than just strings +"1, 2, " + 3; // = "1, 2, 3" +"Hello " + ["world", "!"] // = "Hello world,!" + // and are compared with < and > "a" < "b"; // = true From dc3c1ce2f58da378dd354f6c34233123fa6e3d44 Mon Sep 17 00:00:00 2001 From: ditam Date: Wed, 28 Oct 2015 22:43:07 +0100 Subject: [PATCH 514/685] add Hungarian translation --- hu-hu/coffeescript-hu.html.markdown | 106 ++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 hu-hu/coffeescript-hu.html.markdown diff --git a/hu-hu/coffeescript-hu.html.markdown b/hu-hu/coffeescript-hu.html.markdown new file mode 100644 index 00000000..111a0a85 --- /dev/null +++ b/hu-hu/coffeescript-hu.html.markdown @@ -0,0 +1,106 @@ +--- +language: coffeescript +contributors: + - ["Tenor Biel", "http://github.com/L8D"] + - ["Xavier Yao", "http://github.com/xavieryao"] +translators: + - ["Tamás Diószegi", "http://github.com/ditam"] +filename: coffeescript.coffee +--- + +A CoffeeScript egy apró nyelv ami egy-az-egyben egyenértékű Javascript kódra fordul, és így futásidőben már nem szükséges interpretálni. +Mint a JavaScript egyik követője, a CoffeeScript mindent megtesz azért, hogy olvasható, jól formázott és jól futó JavaScript kódot állítson elő, ami minden JavaScript futtatókörnyezetben jól működik. + +Rézletekért lásd még a [CoffeeScript weboldalát](http://coffeescript.org/), ahol egy teljes CoffeScript tutorial is található. + +```coffeescript +# A CoffeeScript egy hipszter nyelv. +# Követi több modern nyelv trendjeit. +# Így a kommentek, mint Ruby-ban és Python-ban, a szám szimbólummal kezdődnek. + +### +A komment blokkok ilyenek, és közvetlenül '/ *' és '* /' jelekre fordítódnak +az eredményül kapott JavaScript kódban. + +Mielőtt tovább olvasol, jobb, ha a JavaScript alapvető szemantikájával +tisztában vagy. + +(A kód példák alatt kommentként látható a fordítás után kapott JavaScript kód.) +### + +# Értékadás: +number = 42 #=> var number = 42; +opposite = true #=> var opposite = true; + +# Feltételes utasítások: +number = -42 if opposite #=> if(opposite) { number = -42; } + +# Függvények: +square = (x) -> x * x #=> var square = function(x) { return x * x; } + +fill = (container, liquid = "coffee") -> + "Filling the #{container} with #{liquid}..." +#=>var fill; +# +#fill = function(container, liquid) { +# if (liquid == null) { +# liquid = "coffee"; +# } +# return "Filling the " + container + " with " + liquid + "..."; +#}; + +# Szám tartományok: +list = [1..5] #=> var list = [1, 2, 3, 4, 5]; + +# Objektumok: +math = + root: Math.sqrt + square: square + cube: (x) -> x * square x +#=> var math = { +# "root": Math.sqrt, +# "square": square, +# "cube": function(x) { return x * square(x); } +# }; + +# "Splat" jellegű függvény-paraméterek: +race = (winner, runners...) -> + print winner, runners +#=>race = function() { +# var runners, winner; +# winner = arguments[0], runners = 2 <= arguments.length ? __slice.call(arguments, 1) : []; +# return print(winner, runners); +# }; + +# Létezés-vizsgálat: +alert "I knew it!" if elvis? +#=> if(typeof elvis !== "undefined" && elvis !== null) { alert("I knew it!"); } + +# Tömb értelmezések: (array comprehensions) +cubes = (math.cube num for num in list) +#=>cubes = (function() { +# var _i, _len, _results; +# _results = []; +# for (_i = 0, _len = list.length; _i < _len; _i++) { +# num = list[_i]; +# _results.push(math.cube(num)); +# } +# return _results; +# })(); + +foods = ['broccoli', 'spinach', 'chocolate'] +eat food for food in foods when food isnt 'chocolate' +#=>foods = ['broccoli', 'spinach', 'chocolate']; +# +#for (_k = 0, _len2 = foods.length; _k < _len2; _k++) { +# food = foods[_k]; +# if (food !== 'chocolate') { +# eat(food); +# } +#} +``` + +## További források + +- [Smooth CoffeeScript](http://autotelicum.github.io/Smooth-CoffeeScript/) +- [CoffeeScript Ristretto](https://leanpub.com/coffeescript-ristretto/read) \ No newline at end of file From 360bd6ef9b5b1b6779d1d86bd57e12e97239007a Mon Sep 17 00:00:00 2001 From: ditam Date: Wed, 28 Oct 2015 23:45:15 +0100 Subject: [PATCH 515/685] add language suffix to filename --- hu-hu/coffeescript-hu.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hu-hu/coffeescript-hu.html.markdown b/hu-hu/coffeescript-hu.html.markdown index 111a0a85..267db4d0 100644 --- a/hu-hu/coffeescript-hu.html.markdown +++ b/hu-hu/coffeescript-hu.html.markdown @@ -5,7 +5,7 @@ contributors: - ["Xavier Yao", "http://github.com/xavieryao"] translators: - ["Tamás Diószegi", "http://github.com/ditam"] -filename: coffeescript.coffee +filename: coffeescript-hu.coffee --- A CoffeeScript egy apró nyelv ami egy-az-egyben egyenértékű Javascript kódra fordul, és így futásidőben már nem szükséges interpretálni. From cdd64ecee34af20ed101ba5dc8d7dc73a8189c15 Mon Sep 17 00:00:00 2001 From: Vipul Sharma Date: Thu, 29 Oct 2015 15:23:37 +0530 Subject: [PATCH 516/685] 80 char and proper commenting --- python.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python.html.markdown b/python.html.markdown index 01e5d481..ff4471e9 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -124,7 +124,8 @@ not False # => True "This is a string"[0] # => 'T' #String formatting with % -#Even though the % string operator will be deprecated on Python 3.1 and removed later at some time, it may still be #good to know how it works. +#Even though the % string operator will be deprecated on Python 3.1 and removed +#later at some time, it may still be good to know how it works. x = 'apple' y = 'lemon' z = "The items in the basket are %s and %s" % (x,y) From 7a9787755b4e0f0ca99487833835b081c9d4de8a Mon Sep 17 00:00:00 2001 From: Nasgul Date: Thu, 29 Oct 2015 16:05:27 +0200 Subject: [PATCH 517/685] Delete unnecessary line on english. Delete unnecessary line on english. --- ru-ru/php-ru.html.markdown | 2 -- 1 file changed, 2 deletions(-) diff --git a/ru-ru/php-ru.html.markdown b/ru-ru/php-ru.html.markdown index 5672aa90..dc254bf8 100644 --- a/ru-ru/php-ru.html.markdown +++ b/ru-ru/php-ru.html.markdown @@ -420,8 +420,6 @@ include_once 'my-file.php'; require 'my-file.php'; require_once 'my-file.php'; -// Same as include(), except require() will cause a fatal error if the -// file cannot be included. // Действует также как и include(), но если файл не удалось подключить, // функция выдает фатальную ошибку From eb5d2d62616219837ad447dd4cb585a6e75bb89a Mon Sep 17 00:00:00 2001 From: Kyle Mendes Date: Thu, 29 Oct 2015 10:05:36 -0400 Subject: [PATCH 518/685] [sass/en] Cleaning up wording and formatting --- sass.html.markdown | 203 ++++++++++++++++++++++----------------------- 1 file changed, 100 insertions(+), 103 deletions(-) diff --git a/sass.html.markdown b/sass.html.markdown index 02bec47f..4d4ece71 100644 --- a/sass.html.markdown +++ b/sass.html.markdown @@ -4,40 +4,41 @@ filename: learnsass.scss contributors: - ["Laura Kyle", "https://github.com/LauraNK"] - ["Sean Corrales", "https://github.com/droidenator"] + - ["Kyle Mendes", "https://github.com/pink401k"] --- -Sass is a CSS extension language that adds features such as variables, nesting, mixins and more. -Sass (and other preprocessors, such as [Less](http://lesscss.org/)) help developers to write maintainable and DRY (Don't Repeat Yourself) code. +Sass is a CSS extension language that adds features such as variables, nesting, mixins and more. +Sass (and other preprocessors, such as [Less](http://lesscss.org/)) help developers write maintainable and DRY (Don't Repeat Yourself) code. -Sass has two different syntax options to choose from. SCSS, which has the same syntax as CSS but with the added features of Sass. Or Sass (the original syntax), which uses indentation rather than curly braces and semicolons. +Sass has two different syntax options to choose from. SCSS, which has the same syntax as CSS but with the added features of Sass. Or Sass (the original syntax), which uses indentation rather than curly braces and semicolons. This tutorial is written using SCSS. -If you're already familiar with CSS3, you'll be able to pick up Sass relatively quickly. It does not provide any new styling options but rather the tools to write your CSS more efficiently and make maintenance much easier. +If you're already familiar with CSS3, you'll be able to pick up Sass relatively quickly. It does not provide any new styling properties but rather the tools to write your CSS more efficiently and make maintenance much easier. ```scss - + //Single line comments are removed when Sass is compiled to CSS. -/*Multi line comments are preserved. */ - - - -/*Variables -==============================*/ - - +/* Multi line comments are preserved. */ + + + +/* Variables +============================== */ + + /* You can store a CSS value (such as a color) in a variable. Use the '$' symbol to create a variable. */ - + $primary-color: #A3A4FF; $secondary-color: #51527F; -$body-font: 'Roboto', sans-serif; +$body-font: 'Roboto', sans-serif; + +/* You can use the variables throughout your stylesheet. +Now if you want to change a color, you only have to make the change once. */ -/* You can use the variables throughout your stylesheet. -Now if you want to change a color, you only have to make the change once.*/ - body { background-color: $primary-color; color: $secondary-color; @@ -54,18 +55,18 @@ body { /* This is much more maintainable than having to change the color each time it appears throughout your stylesheet. */ - -/*Mixins -==============================*/ + +/* Mixins +============================== */ /* If you find you are writing the same code for more than one element, you might want to store that code in a mixin. -Use the '@mixin' directive, plus a name for your mixin.*/ +Use the '@mixin' directive, plus a name for your mixin. */ @mixin center { display: block; @@ -82,7 +83,7 @@ div { background-color: $primary-color; } -/*Which would compile to: */ +/* Which would compile to: */ div { display: block; margin-left: auto; @@ -99,8 +100,8 @@ div { width: $width; height: $height; } - -/*Which you can invoke by passing width and height arguments. */ + +/* Which you can invoke by passing width and height arguments. */ .rectangle { @include size(100px, 60px); @@ -110,31 +111,31 @@ div { @include size(40px, 40px); } -/* This compiles to: */ +/* Compiles to: */ .rectangle { width: 100px; - height: 60px; + height: 60px; } .square { width: 40px; - height: 40px; + height: 40px; } -/*Functions -==============================*/ - - - -/* Sass provides functions that can be used to accomplish a variety of +/* Functions +============================== */ + + + +/* Sass provides functions that can be used to accomplish a variety of tasks. Consider the following */ -/* Functions can be invoked by using their name and passing in the +/* Functions can be invoked by using their name and passing in the required arguments */ body { - width: round(10.25px); + width: round(10.25px); } .footer { @@ -149,18 +150,18 @@ body { .footer { background-color: rgba(0, 0, 0, 0.75); -} - -/* You may also define your own functions. Functions are very similar to +} + +/* You may also define your own functions. Functions are very similar to mixins. When trying to choose between a function or a mixin, remember - that mixins are best for generating CSS while functions are better for - logic that might be used throughout your Sass code. The examples in - the Math Operators' section are ideal candidates for becoming a reusable + that mixins are best for generating CSS while functions are better for + logic that might be used throughout your Sass code. The examples in + the Math Operators' section are ideal candidates for becoming a reusable function. */ -/* This function will take a target size and the parent size and calculate +/* This function will take a target size and the parent size and calculate and return the percentage */ - + @function calculate-percentage($target-size, $parent-size) { @return $target-size / $parent-size * 100%; } @@ -187,12 +188,12 @@ $main-content: calculate-percentage(600px, 960px); -/*Extend (Inheritance) -==============================*/ +/* Extend (Inheritance) +============================== */ -/*Extend is a way to share the properties of one selector with another. */ +/* Extend is a way to share the properties of one selector with another. */ .display { @include size(5em, 5em); @@ -208,36 +209,36 @@ $main-content: calculate-percentage(600px, 960px); .display, .display-success { width: 5em; height: 5em; - border: 5px solid #51527F; + border: 5px solid #51527F; } .display-success { - border-color: #22df56; + border-color: #22df56; } -/* Extending a CSS statement is preferable to creating a mixin - because of the way it groups together the classes that all share - the same base styling. If this was done with a mixin, the width, - height, and border would be duplicated for each statement that +/* Extending a CSS statement is preferable to creating a mixin + because of the way Sass groups together the classes that all share + the same base styling. If this was done with a mixin, the width, + height, and border would be duplicated for each statement that called the mixin. While it won't affect your workflow, it will add unnecessary bloat to the files created by the Sass compiler. */ - -/*Nesting -==============================*/ + +/* Nesting +============================== */ -/*Sass allows you to nest selectors within selectors */ +/* Sass allows you to nest selectors within selectors */ ul { list-style-type: none; margin-top: 2em; - + li { - background-color: #FF0000; - } + background-color: #FF0000; + } } /* '&' will be replaced by the parent selector. */ @@ -249,18 +250,18 @@ For example: */ ul { list-style-type: none; margin-top: 2em; - + li { background-color: red; - + &:hover { background-color: blue; } - + a { color: white; } - } + } } /* Compiles to: */ @@ -284,17 +285,17 @@ ul li a { -/*Partials and Imports -==============================*/ - - - +/* Partials and Imports +============================== */ + + + /* Sass allows you to create partial files. This can help keep your Sass code modularized. Partial files should begin with an '_', e.g. _reset.css. Partials are not generated into CSS. */ - + /* Consider the following CSS which we'll put in a file called _reset.css */ - + html, body, ul, @@ -302,14 +303,14 @@ ol { margin: 0; padding: 0; } - + /* Sass offers @import which can be used to import partials into a file. - This differs from the traditional CSS @import statement which makes - another HTTP request to fetch the imported file. Sass takes the + This differs from the traditional CSS @import statement which makes + another HTTP request to fetch the imported file. Sass takes the imported file and combines it with the compiled code. */ - + @import 'reset'; - + body { font-size: 16px; font-family: Helvetica, Arial, Sans-serif; @@ -320,25 +321,25 @@ body { html, body, ul, ol { margin: 0; padding: 0; -} +} body { font-size: 16px; font-family: Helvetica, Arial, Sans-serif; } - - -/*Placeholder Selectors -==============================*/ - - - + + +/* Placeholder Selectors +============================== */ + + + /* Placeholders are useful when creating a CSS statement to extend. If you wanted to create a CSS statement that was exclusively used with @extend, you can do so using a placeholder. Placeholders begin with a '%' instead of '.' or '#'. Placeholders will not appear in the compiled CSS. */ - + %content-window { font-size: 14px; padding: 10px; @@ -364,18 +365,18 @@ body { background-color: #0000ff; } - - -/*Math Operations -==============================*/ - - - + + +/* Math Operations +============================== */ + + + /* Sass provides the following operators: +, -, *, /, and %. These can be useful for calculating values directly in your Sass files instead of using values that you've already calculated by hand. Below is an example of a setting up a simple two column design. */ - + $content-area: 960px; $main-content: 600px; $sidebar-content: 300px; @@ -418,14 +419,11 @@ body { width: 6.25%; } - -``` - - +``` ## SASS or Sass? -Have you ever wondered whether Sass is an acronym or not? You probably haven't, but I'll tell you anyway. The name of the language is a word, "Sass", and not an acronym. -Because people were constantly writing it as "SASS", the creator of the language jokingly called it "Syntactically Awesome StyleSheets". +Have you ever wondered whether Sass is an acronym or not? You probably haven't, but I'll tell you anyway. The name of the language is a word, "Sass", and not an acronym. +Because people were constantly writing it as "SASS", the creator of the language jokingly called it "Syntactically Awesome StyleSheets". ## Practice Sass @@ -434,14 +432,13 @@ You can use either syntax, just go into the settings and select either Sass or S ## Compatibility - Sass can be used in any project as long as you have a program to compile it into CSS. You'll want to verify that the CSS you're using is compatible -with your target browsers. +with your target browsers. + +[QuirksMode CSS](http://www.quirksmode.org/css/) and [CanIUse](http://caniuse.com) are great resources for checking compatibility. -[QuirksMode CSS](http://www.quirksmode.org/css/) and [CanIUse](http://caniuse.com) are great resources for checking compatibility. - ## Further reading * [Official Documentation](http://sass-lang.com/documentation/file.SASS_REFERENCE.html) * [The Sass Way](http://thesassway.com/) provides tutorials (beginner-advanced) and articles. From 03ef96b2f11133701a3db64b9133f634a9709e94 Mon Sep 17 00:00:00 2001 From: Raphael Nascimento Date: Thu, 29 Oct 2015 12:46:59 -0300 Subject: [PATCH 519/685] [java/en] Enum Type --- java.html.markdown | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/java.html.markdown b/java.html.markdown index 86b0578e..1813f81c 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -186,9 +186,9 @@ public class LearnJava { // operations perform as could be expected for a // doubly-linked list. // Maps - A set of objects that map keys to values. Map is - // an interface and therefore cannot be instantiated. - // The type of keys and values contained in a Map must - // be specified upon instantiation of the implementing + // an interface and therefore cannot be instantiated. + // The type of keys and values contained in a Map must + // be specified upon instantiation of the implementing // class. Each key may map to only one corresponding value, // and each key may appear only once (no duplicates). // HashMaps - This class uses a hashtable to implement the Map @@ -450,6 +450,17 @@ class Bicycle { protected int gear; // Protected: Accessible from the class and subclasses String name; // default: Only accessible from within this package + static String className; // Static class variable + + // Static block + // Java has no implementation of static constructors, but + // has a static block that can be used to initialize class variables + // (static variables). + // This block will be called when the class is loaded. + static { + className = "Bicycle"; + } + // Constructors are a way of creating classes // This is a constructor public Bicycle() { @@ -767,7 +778,7 @@ The links provided here below are just to get an understanding of the topic, fee * [Generics](http://docs.oracle.com/javase/tutorial/java/generics/index.html) -* [Java Code Conventions](http://www.oracle.com/technetwork/java/codeconv-138413.html) +* [Java Code Conventions](http://www.oracle.com/technetwork/java/codeconvtoc-136057.html) **Online Practice and Tutorials** From fe1c5e86ede2786580c414bf608bb09d5c7ceb40 Mon Sep 17 00:00:00 2001 From: Nasgul Date: Thu, 29 Oct 2015 22:15:40 +0200 Subject: [PATCH 520/685] Edit descriptions for function setdefault. Edit descriptions for function setdefault. --- ru-ru/python-ru.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ru-ru/python-ru.html.markdown b/ru-ru/python-ru.html.markdown index 3852a550..43142eff 100644 --- a/ru-ru/python-ru.html.markdown +++ b/ru-ru/python-ru.html.markdown @@ -280,7 +280,7 @@ filled_dict.get("four", 4) #=> 4 # Присваивайте значение ключам так же, как и в списках filled_dict["four"] = 4 # теперь filled_dict["four"] => 4 -# Метод setdefault вставляет() пару ключ-значение, только если такого ключа нет +# Метод setdefault() вставляет пару ключ-значение, только если такого ключа нет filled_dict.setdefault("five", 5) #filled_dict["five"] возвращает 5 filled_dict.setdefault("five", 6) #filled_dict["five"] по-прежнему возвращает 5 From eef69b0d092a0b1396ff2494984b07b9aa76d020 Mon Sep 17 00:00:00 2001 From: Nasgul Date: Thu, 29 Oct 2015 22:25:00 +0200 Subject: [PATCH 521/685] Edit translate for creating object. Edit translate for creating new object of class using new. --- ru-ru/php-ru.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ru-ru/php-ru.html.markdown b/ru-ru/php-ru.html.markdown index dc254bf8..37b6a86e 100644 --- a/ru-ru/php-ru.html.markdown +++ b/ru-ru/php-ru.html.markdown @@ -483,7 +483,7 @@ echo MyClass::MY_CONST; // Выведет 'value'; echo MyClass::$staticVar; // Выведет 'static'; MyClass::myStaticMethod(); // Выведет 'I am static'; -// Новый экземпляр класса используя new +// Создание нового экземпляра класса используя new $my_class = new MyClass('An instance property'); // Если аргументы отсутствуют, можно не ставить круглые скобки From 36c551affb006583bf7960b7a613b45699a819cc Mon Sep 17 00:00:00 2001 From: Nasgul Date: Thu, 29 Oct 2015 22:38:04 +0200 Subject: [PATCH 522/685] Edit Title for 5 part. Edit Title for 5 part. --- ru-ru/javascript-ru.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ru-ru/javascript-ru.html.markdown b/ru-ru/javascript-ru.html.markdown index 8655ae4a..54499f46 100644 --- a/ru-ru/javascript-ru.html.markdown +++ b/ru-ru/javascript-ru.html.markdown @@ -330,7 +330,7 @@ function sayHelloInFiveSeconds(name) { sayHelloInFiveSeconds("Адам"); // Через 5 с откроется окно «Привет, Адам!» /////////////////////////////////// -// 5. Подробнее об объектах; конструкторы и прототипы +// 5. Подробнее об объектах; Конструкторы и Прототипы // Объекты могут содержать в себе функции. var myObj = { From 7e90054b5cb91c5df3cbae38c0ae0e29fe114d0e Mon Sep 17 00:00:00 2001 From: Nasgul Date: Thu, 29 Oct 2015 22:57:17 +0200 Subject: [PATCH 523/685] Fix typo. Fix typo. --- ru-ru/java-ru.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ru-ru/java-ru.html.markdown b/ru-ru/java-ru.html.markdown index 005495cc..b24ad555 100644 --- a/ru-ru/java-ru.html.markdown +++ b/ru-ru/java-ru.html.markdown @@ -451,7 +451,7 @@ public class Fruit implements Edible, Digestible { } } -// В Java Вы можете наследоватьтолько один класс, однако можете реализовывать +// В Java Вы можете наследовать только один класс, однако можете реализовывать // несколько интерфейсов. Например: public class ExampleClass extends ExampleClassParent implements InterfaceOne, InterfaceTwo { public void InterfaceOneMethod() { From 14c85ba0ffbb66d9c2a056006cedaa90df8f22f4 Mon Sep 17 00:00:00 2001 From: yihong Date: Fri, 30 Oct 2015 05:04:41 +0800 Subject: [PATCH 524/685] add more details on truthiness --- python.html.markdown | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/python.html.markdown b/python.html.markdown index 42a52bcf..7055689e 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -63,7 +63,7 @@ allow you to write Python 3 code that will run on Python 2, so check out the Pyt # to carry out normal division with just one '/'. from __future__ import division 11/4 # => 2.75 ...normal division -11//4 # => 2 ...floored division +11//4 # => 2 ...floored division # Modulo operation 7 % 3 # => 1 @@ -144,8 +144,16 @@ None is None # => True # very useful when dealing with primitive values, but is # very useful when dealing with objects. -# None, 0, and empty strings/lists all evaluate to False. -# All other values are True +# Any object can be used in a Boolean context. +# The following values are considered falsey: +# - None +# - zero of any numeric type (e.g., 0, 0L, 0.0, 0j) +# - empty sequences (e.g., '', (), []) +# - empty containers (e.g., {}, set()) +# - instances of user-defined classes meeting certain conditions +# see: https://docs.python.org/2/reference/datamodel.html#object.__nonzero__ +# +# All other values are truthy (using the bool() function on them returns True). bool(0) # => False bool("") # => False From d35663f1752c0815ee48fb6b66f0b6c6d7deaab9 Mon Sep 17 00:00:00 2001 From: Victor Date: Thu, 29 Oct 2015 22:09:43 -0200 Subject: [PATCH 525/685] fixing selector(color) name that was improperly translated --- pt-br/css-pt.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pt-br/css-pt.html.markdown b/pt-br/css-pt.html.markdown index ed6f6c4c..b1fbd961 100644 --- a/pt-br/css-pt.html.markdown +++ b/pt-br/css-pt.html.markdown @@ -159,11 +159,11 @@ seletor {     color: # FF66EE; /* Formato hexadecimal longo */     color: tomato; /* Uma cor nomeada */     color: rgb (255, 255, 255); /* Como valores rgb */ -    cor: RGB (10%, 20%, 50%); /* Como porcentagens rgb */ -    cor: rgba (255, 0, 0, 0,3); /* Como valores RGBA (CSS 3) NOTA: 0 Date: Thu, 29 Oct 2015 23:17:09 -0200 Subject: [PATCH 526/685] English content removed The pt-br file had english content after translation. That content is now removed. --- pt-br/pogo-pt.html.markdown | 203 ------------------------------------ pt-br/sass-pt.html.markdown | 27 +---- 2 files changed, 1 insertion(+), 229 deletions(-) delete mode 100644 pt-br/pogo-pt.html.markdown diff --git a/pt-br/pogo-pt.html.markdown b/pt-br/pogo-pt.html.markdown deleted file mode 100644 index 80dcfcd5..00000000 --- a/pt-br/pogo-pt.html.markdown +++ /dev/null @@ -1,203 +0,0 @@ ---- -language: pogoscript -contributors: - - ["Tim Macfarlane", "http://github.com/refractalize"] -translators: - - ["Cássio Böck", "https://github.com/cassiobsilva"] -filename: learnPogo-pt-br.pogo -lang: pt-br ---- - -Pogoscript é uma linguagem de programação que possui tipos primitivos concorrents -e que compila para linguagem Javascript padrão. - -``` javascript -// definindo uma variável -water temperature = 24 - -// reatribuindo o valor de uma variável após a sua definição -water temperature := 26 - -// funções permitem que seus parâmetros sejam colocados em qualquer lugar -temperature at (a) altitude = 32 - a / 100 - -// funções longas são apenas indentadas -temperature at (a) altitude := - if (a < 0) - water temperature - else - 32 - a / 100 - -// declarando uma função -current temperature = temperature at 3200 altitude - -// essa função cria um novo objeto com métodos -position (x, y) = { - x = x - y = y - - distance from position (p) = - dx = self.x - p.x - dy = self.y - p.y - Math.sqrt (dx * dx + dy * dy) -} - -// `self` é similiar ao `this` do Javascript, com exceção de que `self` não -// é redefinido em cada nova função - -// declaração de métodos -position (7, 2).distance from position (position (5, 1)) - -// assim como no Javascript, objetos também são hashes -position.'x' == position.x == position.('x') - -// arrays -positions = [ - position (1, 1) - position (1, 2) - position (1, 3) -] - -// indexando um array -positions.0.y - -n = 2 -positions.(n).y - -// strings -poem = 'Tail turned to red sunset on a juniper crown a lone magpie cawks. - Mad at Oryoki in the shrine-room -- Thistles blossomed late afternoon. - Put on my shirt and took it off in the sun walking the path to lunch. - A dandelion seed floats above the marsh grass with the mosquitos. - At 4 A.M. the two middleaged men sleeping together holding hands. - In the half-light of dawn a few birds warble under the Pleiades. - Sky reddens behind fir trees, larks twitter, sparrows cheep cheep cheep - cheep cheep.' - -// texto de Allen Ginsburg - -// interpolação -outlook = 'amazing!' -console.log "the weather tomorrow is going to be #(outlook)" - -// expressões regulares -r/(\d+)m/i -r/(\d+) degrees/mg - -// operadores -true @and true -false @or true -@not false -2 < 4 -2 >= 2 -2 > 1 - -// os operadores padrão do Javascript também são suportados - -// definindo seu próprio operador -(p1) plus (p2) = - position (p1.x + p2.x, p1.y + p2.y) - -// `plus` pode ser usado com um operador -position (1, 1) @plus position (0, 2) -// ou como uma função -(position (1, 1)) plus (position (0, 2)) - -// retorno explícito -(x) times (y) = return (x * y) - -// new -now = @new Date () - -// funções podem receber argumentos opcionais -spark (position, color: 'black', velocity: {x = 0, y = 0}) = { - color = color - position = position - velocity = velocity -} - -red = spark (position 1 1, color: 'red') -fast black = spark (position 1 1, velocity: {x = 10, y = 0}) - -// funções também podem ser utilizadas para realizar o "unsplat" de argumentos -log (messages, ...) = - console.log (messages, ...) - -// blocos são funções passadas para outras funções. -// Este bloco recebe dois parâmetros, `spark` e `c`, -// o corpo do bloco é o código indentado após a declaração da função - -render each @(spark) into canvas context @(c) - ctx.begin path () - ctx.stroke style = spark.color - ctx.arc ( - spark.position.x + canvas.width / 2 - spark.position.y - 3 - 0 - Math.PI * 2 - ) - ctx.stroke () - -// chamadas assíncronas - -// O Javascript, tanto no navegador quanto no servidor (através do Node.js) -// realiza um uso massivo de funções assíncronas de E/S (entrada/saída) com -// chamadas de retorno (callbacks). A E/S assíncrona é ótima para a performance e -// torna a utilização da concorrência simples, porém pode rapidamente se tornar -// algo complicado. -// O Pogoscript possui algumas coisas que tornam o uso de E/S assíncrono muito -// mais fácil - -// O Node.js inclui o móduolo `fs` para acessar o sistema de arquivos. -// Vamos listar o conteúdo de um diretório - -fs = require 'fs' -directory listing = fs.readdir! '.' - -// `fs.readdir()` é uma função assíncrona, então nos a chamamos usando o -// operador `!`. O operador `!` permite que você chame funções assíncronas -// com a mesma sintaxe e a mesma semântica do que as demais funções síncronas. -// O Pogoscript reescreve a função para que todo código inserido após o -// operador seja inserido em uma função de callback para o `fs.readdir()`. - -// obtendo erros ao utilizar funções assíncronas - -try - another directory listing = fs.readdir! 'a-missing-dir' -catch (ex) - console.log (ex) - -// na verdade, se você não usar o `try catch`, o erro será passado para o -// `try catch` mais externo do evento, assim como é feito em exceções síncronas - -// todo o controle de estrutura também funciona com chamadas assíncronas -// aqui um exemplo de `if else` -config = - if (fs.stat! 'config.json'.is file ()) - JSON.parse (fs.read file! 'config.json' 'utf-8') - else - { - color: 'red' - } - -// para executar duas chamadas assíncronas de forma concorrente, use o -// operador `?`. -// O operador `?` retorna um *future*, que pode ser executado para -// aguardar o resultado, novamente utilizando o operador `!` - -// nós não esperamos nenhuma dessas chamadas serem concluídas -a = fs.stat? 'a.txt' -b = fs.stat? 'b.txt' - -// agora nos aguardamos o término das chamadas e escrevemos os resultados -console.log "size of a.txt is #(a!.size)" -console.log "size of b.txt is #(b!.size)" - -// no Pogoscript, futures são semelhantes a Promises -``` -E encerramos por aqui. - -Baixe o [Node.js](http://nodejs.org/) e execute `npm install pogo`. - -Há bastante documentação em [http://pogoscript.org/](http://pogoscript.org/), incluindo um material para [consulta rápida](http://pogoscript.org/cheatsheet.html), um [guia](http://pogoscript.org/guide/), e como o [Pogoscript é traduzido para o Javascript](http://featurist.github.io/pogo-examples/). Entre em contato através do [grupo do Google](http://groups.google.com/group/pogoscript) se você possui dúvidas! diff --git a/pt-br/sass-pt.html.markdown b/pt-br/sass-pt.html.markdown index 105896b2..3d91f1ca 100644 --- a/pt-br/sass-pt.html.markdown +++ b/pt-br/sass-pt.html.markdown @@ -6,6 +6,7 @@ contributors: - ["Sean Corrales", "https://github.com/droidenator"] translators: - ["Gabriel Gomes", "https://github.com/gabrielgomesferraz"] + - ["Cássio Böck", "https://github.com/cassiobsilva"] lang: pt-br --- @@ -155,16 +156,6 @@ body { background-color: rgba(0, 0, 0, 0.75); } -/* You may also define your own functions. Functions are very similar to - mixins. When trying to choose between a function or a mixin, remember - that mixins are best for generating CSS while functions are better for - logic that might be used throughout your Sass code. The examples in - the Math Operators' section are ideal candidates for becoming a reusable - function. */ - -/* This function will take a target size and the parent size and calculate - and return the percentage */ - /* Você também pode definir suas próprias funções. As funções são muito semelhantes aos    mixins. Ao tentar escolher entre uma função ou um mixin, lembre-    que mixins são os melhores para gerar CSS enquanto as funções são melhores para @@ -319,11 +310,6 @@ ol { padding: 0; } -/* Sass offers @import which can be used to import partials into a file. - This differs from the traditional CSS @import statement which makes - another HTTP request to fetch the imported file. Sass takes the - imported file and combines it with the compiled code. */ - /* Sass oferece @import que pode ser usado para importar parciais em um arquivo.    Isso difere da declaração CSS @import tradicional, que faz    outra solicitação HTTP para buscar o arquivo importado. Sass converte os @@ -354,12 +340,6 @@ body { ==============================*/ - -/* Placeholders are useful when creating a CSS statement to extend. If you - wanted to create a CSS statement that was exclusively used with @extend, - you can do so using a placeholder. Placeholders begin with a '%' instead - of '.' or '#'. Placeholders will not appear in the compiled CSS. */ - /* Os espaços reservados são úteis na criação de uma declaração CSS para ampliar. Se você    queria criar uma instrução CSS que foi usado exclusivamente com @extend,    Você pode fazer isso usando um espaço reservado. Espaços reservados começar com um '%' em vez @@ -396,11 +376,6 @@ body { ============================== * / -/* Sass provides the following operators: +, -, *, /, and %. These can - be useful for calculating values directly in your Sass files instead - of using values that you've already calculated by hand. Below is an example - of a setting up a simple two column design. */ - /* Sass fornece os seguintes operadores: +, -, *, /, e %. estes podem    ser úteis para calcular os valores diretamente no seu Sass arquivos em vez    de usar valores que você já calculados pela mão. Abaixo está um exemplo From 762af2de245ab665af0e4b1397acc960d25932f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A1ssio=20B=C3=B6ck?= Date: Thu, 29 Oct 2015 23:29:46 -0200 Subject: [PATCH 527/685] Fixing typos Fixing pt-br typos --- pt-br/c-pt.html.markdown | 71 ++++++------- pt-br/pogo-pt.html.markdown | 203 ------------------------------------ 2 files changed, 36 insertions(+), 238 deletions(-) delete mode 100644 pt-br/pogo-pt.html.markdown diff --git a/pt-br/c-pt.html.markdown b/pt-br/c-pt.html.markdown index 43688724..2c274f12 100644 --- a/pt-br/c-pt.html.markdown +++ b/pt-br/c-pt.html.markdown @@ -7,29 +7,30 @@ contributors: translators: - ["João Farias", "https://github.com/JoaoGFarias"] - ["Elton Viana", "https://github.com/eltonvs"] + - ["Cássio Böck", "https://github.com/cassiobsilva"] lang: pt-br filename: c-pt.el --- Ah, C. Ainda é **a** linguagem de computação de alta performance. -C é a liguangem de mais baixo nível que a maioria dos programadores -irão usar, e isso dá a ela uma grande velocidade bruta. Apenas fique -antento que este manual de gerenciamento de memória e C vai levanter-te -tão longe quanto você precisa. +C é a linguagem de mais baixo nível que a maioria dos programadores +utilizarão, e isso dá a ela uma grande velocidade bruta. Apenas fique +atento se este manual de gerenciamento de memória e C vai te levar +tão longe quanto precisa. ```c // Comentários de uma linha iniciam-se com // - apenas disponível a partir do C99 /* -Comentários de multiplas linhas se parecem com este. +Comentários de múltiplas linhas se parecem com este. Funcionam no C89 também. */ // Constantes: #define #definie DAY_IN_YEAR 365 -//enumarações também são modos de definir constantes. +//enumerações também são modos de definir constantes. enum day {DOM = 1, SEG, TER, QUA, QUI, SEX, SAB}; // SEG recebe 2 automaticamente, TER recebe 3, etc. @@ -54,13 +55,13 @@ int soma_dois_ints(int x1, int x2); // protótipo de função // O ponto de entrada do teu programa é uma função // chamada main, com tipo de retorno inteiro int main() { - // Usa-se printf para escrever na tela, + // Usa-se printf para escrever na tela, // para "saída formatada" // %d é um inteiro, \n é uma nova linha printf("%d\n", 0); // => Imprime 0 // Todos as declarações devem acabar com // ponto e vírgula - + /////////////////////////////////////// // Tipos /////////////////////////////////////// @@ -78,7 +79,7 @@ int main() { // longs tem entre 4 e 8 bytes; longs long tem garantia // de ter pelo menos 64 bits long x_long = 0; - long long x_long_long = 0; + long long x_long_long = 0; // floats são normalmente números de ponto flutuante // com 32 bits @@ -93,7 +94,7 @@ int main() { unsigned int ux_int; unsigned long long ux_long_long; - // caracteres dentro de aspas simples são inteiros + // caracteres dentro de aspas simples são inteiros // no conjunto de caracteres da máquina. '0' // => 48 na tabela ASCII. 'A' // => 65 na tabela ASCII. @@ -104,7 +105,7 @@ int main() { // Se o argumento do operador `sizeof` é uma expressão, então seus argumentos // não são avaliados (exceto em VLAs (veja abaixo)). - // O valor devolve, neste caso, é uma constante de tempo de compilação. + // O valor devolve, neste caso, é uma constante de tempo de compilação. int a = 1; // size_t é um inteiro sem sinal com pelo menos 2 bytes que representa // o tamanho de um objeto. @@ -120,7 +121,7 @@ int main() { // Você pode inicializar um array com 0 desta forma: char meu_array[20] = {0}; - // Indexar um array é semelhante a outras linguages + // Indexar um array é semelhante a outras linguagens // Melhor dizendo, outras linguagens são semelhantes a C meu_array[0]; // => 0 @@ -129,7 +130,7 @@ int main() { printf("%d\n", meu_array[1]); // => 2 // No C99 (e como uma features opcional em C11), arrays de tamanho variável - // VLA (do inglês), podem ser declarados também. O tamanho destes arrays + // VLA (do inglês), podem ser declarados também. O tamanho destes arrays // não precisam ser uma constante de tempo de compilação: printf("Entre o tamanho do array: "); // Pergunta ao usuário pelo tamanho char buf[0x100]; @@ -144,14 +145,14 @@ int main() { // > Entre o tamanho do array: 10 // > sizeof array = 40 - // String são apenas arrays de caracteres terminados por um + // String são apenas arrays de caracteres terminados por um // byte nulo (0x00), representado em string pelo caracter especial '\0'. // (Não precisamos incluir o byte nulo em literais de string; o compilador // o insere ao final do array para nós.) - char uma_string[20] = "Isto é uma string"; + char uma_string[20] = "Isto é uma string"; // Observe que 'é' não está na tabela ASCII // A string vai ser salva, mas a saída vai ser estranha - // Porém, comentários podem conter acentos + // Porém, comentários podem conter acentos printf("%s\n", uma_string); // %s formata a string printf("%d\n", uma_string[17]); // => 0 @@ -175,7 +176,7 @@ int main() { /////////////////////////////////////// // Atalho para multiplas declarações: - int i1 = 1, i2 = 2; + int i1 = 1, i2 = 2; float f1 = 1.0, f2 = 2.0; int a, b, c; @@ -206,7 +207,7 @@ int main() { 2 <= 2; // => 1 2 >= 2; // => 1 - // C não é Python - comparações não se encadeam. + // C não é Python - comparações não se encadeiam. int a = 1; // Errado: int entre_0_e_2 = 0 < a < 2; @@ -231,7 +232,7 @@ int main() { char *s = "iLoveC"; int j = 0; s[j++]; // => "i". Retorna o j-ésimo item de s E DEPOIS incrementa o valor de j. - j = 0; + j = 0; s[++j]; // => "L". Incrementa o valor de j. E DEPOIS retorna o j-ésimo item de s. // o mesmo com j-- e --j @@ -308,7 +309,7 @@ int main() { exit(-1); break; } - + /////////////////////////////////////// // Cast de tipos @@ -327,8 +328,8 @@ int main() { // Tipos irão ter overflow sem aviso printf("%d\n", (unsigned char) 257); // => 1 (Max char = 255 se char tem 8 bits) - // Para determinar o valor máximo de um `char`, de um `signed char` e de - // um `unisigned char`, respectivamente, use as macros CHAR_MAX, SCHAR_MAX + // Para determinar o valor máximo de um `char`, de um `signed char` e de + // um `unisigned char`, respectivamente, use as macros CHAR_MAX, SCHAR_MAX // e UCHAR_MAX de // Tipos inteiros podem sofrer cast para pontos-flutuantes e vice-versa. @@ -341,7 +342,7 @@ int main() { /////////////////////////////////////// // Um ponteiro é uma variável declarada para armazenar um endereço de memória. - // Seu declaração irá também dizer o tipo de dados para o qual ela aponta. Você + // Sua declaração irá também dizer o tipo de dados para o qual ela aponta. Você // Pode usar o endereço de memória de suas variáveis, então, brincar com eles. int x = 0; @@ -363,13 +364,13 @@ int main() { printf("%d\n", *px); // => Imprime 0, o valor de x // Você também pode mudar o valor que o ponteiro está apontando. - // Teremo que cercar a de-referência entre parenteses, pois + // Temos que cercar a de-referência entre parênteses, pois // ++ tem uma precedência maior que *. (*px)++; // Incrementa o valor que px está apontando por 1 printf("%d\n", *px); // => Imprime 1 printf("%d\n", x); // => Imprime 1 - // Arrays são um boa maneira de alocar um bloco contínuo de memória + // Arrays são uma boa maneira de alocar um bloco contínuo de memória int x_array[20]; // Declara um array de tamanho 20 (não pode-se mudar o tamanho int xx; for (xx = 0; xx < 20; xx++) { @@ -379,7 +380,7 @@ int main() { // Declara um ponteiro do tipo int e inicialize ele para apontar para x_array int* x_ptr = x_array; // x_ptr agora aponta para o primeiro elemento do array (o inteiro 20). - // Isto funciona porque arrays são apenas ponteiros para seu primeiros elementos. + // Isto funciona porque arrays são apenas ponteiros para seus primeiros elementos. // Por exemplo, quando um array é passado para uma função ou é atribuído a um // ponteiro, ele transforma-se (convertido implicitamente) em um ponteiro. // Exceções: quando o array é o argumento de um operador `&` (endereço-de): @@ -395,7 +396,7 @@ int main() { printf("%zu, %zu\n", sizeof arr, sizeof ptr); // provavelmente imprime "40, 4" ou "40, 8" // Ponteiros podem ser incrementados ou decrementados baseado no seu tipo - // (isto é chamado aritimética de ponteiros + // (isto é chamado aritmética de ponteiros printf("%d\n", *(x_ptr + 1)); // => Imprime 19 printf("%d\n", x_array[1]); // => Imprime 19 @@ -413,9 +414,9 @@ int main() { // "resultados imprevisíveis" - o programa é dito ter um "comportamento indefinido" printf("%d\n", *(my_ptr + 21)); // => Imprime quem-sabe-o-que? Talvez até quebre o programa. - // Quando termina-se de usar um bloco de memória alocado, você pode liberá-lo, + // Quando se termina de usar um bloco de memória alocado, você pode liberá-lo, // ou ninguém mais será capaz de usá-lo até o fim da execução - // (Isto cham-se "memory leak"): + // (Isto chama-se "memory leak"): free(my_ptr); // Strings são arrays de char, mas elas geralmente são representadas @@ -537,7 +538,7 @@ int area(retan r) return r.largura * r.altura; } -// Se você tiver structus grande, você pode passá-las "por ponteiro" +// Se você tiver structus grande, você pode passá-las "por ponteiro" // para evitar cópia de toda a struct: int area(const retan *r) { @@ -554,8 +555,8 @@ conhecidos. Ponteiros para funções são como qualquer outro ponteiro diretamente e passá-las para por toda parte. Entretanto, a sintaxe de definição por ser um pouco confusa. -Exemplo: use str_reverso através de um ponteiro -*/ +Exemplo: use str_reverso através de um ponteiro +*/ void str_reverso_através_ponteiro(char *str_entrada) { // Define uma variável de ponteiro para função, nomeada f. void (*f)(char *); //Assinatura deve ser exatamente igual à função alvo. @@ -575,7 +576,7 @@ typedef void (*minha_função_type)(char *); // Declarando o ponteiro: // ... -// minha_função_type f; +// minha_função_type f; //Caracteres especiais: '\a' // Alerta (sino) @@ -586,7 +587,7 @@ typedef void (*minha_função_type)(char *); '\r' // Retorno de carroça '\b' // Backspace '\0' // Caracter nulo. Geralmente colocado ao final de string em C. - // oi\n\0. \0 é usado por convenção para marcar o fim da string. + // oi\n\0. \0 é usado por convenção para marcar o fim da string. '\\' // Barra invertida '\?' // Interrogação '\'' // Aspas simples @@ -606,7 +607,7 @@ typedef void (*minha_função_type)(char *); "%p" // ponteiro "%x" // hexadecimal "%o" // octal -"%%" // imprime % +"%%" // imprime % /////////////////////////////////////// // Ordem de avaliação diff --git a/pt-br/pogo-pt.html.markdown b/pt-br/pogo-pt.html.markdown deleted file mode 100644 index 80dcfcd5..00000000 --- a/pt-br/pogo-pt.html.markdown +++ /dev/null @@ -1,203 +0,0 @@ ---- -language: pogoscript -contributors: - - ["Tim Macfarlane", "http://github.com/refractalize"] -translators: - - ["Cássio Böck", "https://github.com/cassiobsilva"] -filename: learnPogo-pt-br.pogo -lang: pt-br ---- - -Pogoscript é uma linguagem de programação que possui tipos primitivos concorrents -e que compila para linguagem Javascript padrão. - -``` javascript -// definindo uma variável -water temperature = 24 - -// reatribuindo o valor de uma variável após a sua definição -water temperature := 26 - -// funções permitem que seus parâmetros sejam colocados em qualquer lugar -temperature at (a) altitude = 32 - a / 100 - -// funções longas são apenas indentadas -temperature at (a) altitude := - if (a < 0) - water temperature - else - 32 - a / 100 - -// declarando uma função -current temperature = temperature at 3200 altitude - -// essa função cria um novo objeto com métodos -position (x, y) = { - x = x - y = y - - distance from position (p) = - dx = self.x - p.x - dy = self.y - p.y - Math.sqrt (dx * dx + dy * dy) -} - -// `self` é similiar ao `this` do Javascript, com exceção de que `self` não -// é redefinido em cada nova função - -// declaração de métodos -position (7, 2).distance from position (position (5, 1)) - -// assim como no Javascript, objetos também são hashes -position.'x' == position.x == position.('x') - -// arrays -positions = [ - position (1, 1) - position (1, 2) - position (1, 3) -] - -// indexando um array -positions.0.y - -n = 2 -positions.(n).y - -// strings -poem = 'Tail turned to red sunset on a juniper crown a lone magpie cawks. - Mad at Oryoki in the shrine-room -- Thistles blossomed late afternoon. - Put on my shirt and took it off in the sun walking the path to lunch. - A dandelion seed floats above the marsh grass with the mosquitos. - At 4 A.M. the two middleaged men sleeping together holding hands. - In the half-light of dawn a few birds warble under the Pleiades. - Sky reddens behind fir trees, larks twitter, sparrows cheep cheep cheep - cheep cheep.' - -// texto de Allen Ginsburg - -// interpolação -outlook = 'amazing!' -console.log "the weather tomorrow is going to be #(outlook)" - -// expressões regulares -r/(\d+)m/i -r/(\d+) degrees/mg - -// operadores -true @and true -false @or true -@not false -2 < 4 -2 >= 2 -2 > 1 - -// os operadores padrão do Javascript também são suportados - -// definindo seu próprio operador -(p1) plus (p2) = - position (p1.x + p2.x, p1.y + p2.y) - -// `plus` pode ser usado com um operador -position (1, 1) @plus position (0, 2) -// ou como uma função -(position (1, 1)) plus (position (0, 2)) - -// retorno explícito -(x) times (y) = return (x * y) - -// new -now = @new Date () - -// funções podem receber argumentos opcionais -spark (position, color: 'black', velocity: {x = 0, y = 0}) = { - color = color - position = position - velocity = velocity -} - -red = spark (position 1 1, color: 'red') -fast black = spark (position 1 1, velocity: {x = 10, y = 0}) - -// funções também podem ser utilizadas para realizar o "unsplat" de argumentos -log (messages, ...) = - console.log (messages, ...) - -// blocos são funções passadas para outras funções. -// Este bloco recebe dois parâmetros, `spark` e `c`, -// o corpo do bloco é o código indentado após a declaração da função - -render each @(spark) into canvas context @(c) - ctx.begin path () - ctx.stroke style = spark.color - ctx.arc ( - spark.position.x + canvas.width / 2 - spark.position.y - 3 - 0 - Math.PI * 2 - ) - ctx.stroke () - -// chamadas assíncronas - -// O Javascript, tanto no navegador quanto no servidor (através do Node.js) -// realiza um uso massivo de funções assíncronas de E/S (entrada/saída) com -// chamadas de retorno (callbacks). A E/S assíncrona é ótima para a performance e -// torna a utilização da concorrência simples, porém pode rapidamente se tornar -// algo complicado. -// O Pogoscript possui algumas coisas que tornam o uso de E/S assíncrono muito -// mais fácil - -// O Node.js inclui o móduolo `fs` para acessar o sistema de arquivos. -// Vamos listar o conteúdo de um diretório - -fs = require 'fs' -directory listing = fs.readdir! '.' - -// `fs.readdir()` é uma função assíncrona, então nos a chamamos usando o -// operador `!`. O operador `!` permite que você chame funções assíncronas -// com a mesma sintaxe e a mesma semântica do que as demais funções síncronas. -// O Pogoscript reescreve a função para que todo código inserido após o -// operador seja inserido em uma função de callback para o `fs.readdir()`. - -// obtendo erros ao utilizar funções assíncronas - -try - another directory listing = fs.readdir! 'a-missing-dir' -catch (ex) - console.log (ex) - -// na verdade, se você não usar o `try catch`, o erro será passado para o -// `try catch` mais externo do evento, assim como é feito em exceções síncronas - -// todo o controle de estrutura também funciona com chamadas assíncronas -// aqui um exemplo de `if else` -config = - if (fs.stat! 'config.json'.is file ()) - JSON.parse (fs.read file! 'config.json' 'utf-8') - else - { - color: 'red' - } - -// para executar duas chamadas assíncronas de forma concorrente, use o -// operador `?`. -// O operador `?` retorna um *future*, que pode ser executado para -// aguardar o resultado, novamente utilizando o operador `!` - -// nós não esperamos nenhuma dessas chamadas serem concluídas -a = fs.stat? 'a.txt' -b = fs.stat? 'b.txt' - -// agora nos aguardamos o término das chamadas e escrevemos os resultados -console.log "size of a.txt is #(a!.size)" -console.log "size of b.txt is #(b!.size)" - -// no Pogoscript, futures são semelhantes a Promises -``` -E encerramos por aqui. - -Baixe o [Node.js](http://nodejs.org/) e execute `npm install pogo`. - -Há bastante documentação em [http://pogoscript.org/](http://pogoscript.org/), incluindo um material para [consulta rápida](http://pogoscript.org/cheatsheet.html), um [guia](http://pogoscript.org/guide/), e como o [Pogoscript é traduzido para o Javascript](http://featurist.github.io/pogo-examples/). Entre em contato através do [grupo do Google](http://groups.google.com/group/pogoscript) se você possui dúvidas! From 76bf016f82133ecdb53e02975014d10a34fefce9 Mon Sep 17 00:00:00 2001 From: Victor Caldas Date: Fri, 30 Oct 2015 00:12:29 -0200 Subject: [PATCH 528/685] translating java to pt-br --- pt-br/java-pt.html.markdown | 213 ++++++++++++++++++++++++++++++++++++ 1 file changed, 213 insertions(+) diff --git a/pt-br/java-pt.html.markdown b/pt-br/java-pt.html.markdown index a884f273..3c9512aa 100644 --- a/pt-br/java-pt.html.markdown +++ b/pt-br/java-pt.html.markdown @@ -405,6 +405,219 @@ class Velocipede extends Bicicleta { } +// Interfaces +// Sintaxe de declaração de Interface +// Interface extends { +// // Constantes +// // Declarações de método +//} + +// Exemplo - Comida: +public interface Comestivel { + public void comer(); // Qualquer classe que implementa essa interface, deve +                        // Implementar este método. +} + +public interface Digestivel { + public void digerir(); +} + + +// Agora podemos criar uma classe que implementa ambas as interfaces. +public class Fruta implements Comestivel, Digestivel { + + @Override + public void comer() { + // ... + } + + @Override + public void digerir() { + // ... + } +} + +// Em Java, você pode estender somente uma classe, mas você pode implementar muitas +// Interfaces. Por exemplo: +public class ClasseExemplo extends ExemploClassePai implements InterfaceUm, + InterfaceDois { + + @Override + public void InterfaceUmMetodo() { + } + + @Override + public void InterfaceDoisMetodo() { + } + +} + +// Classes abstratas + +// Sintaxe de declaração de classe abstrata +// abstract extends { +// // Constantes e variáveis +// // Declarações de método +//} + +// Marcar uma classe como abstrata significa que ela contém métodos abstratos que devem +// ser definido em uma classe filha. Semelhante às interfaces, classes abstratas não podem +// ser instanciadas, ao invés disso devem ser extendidas e os métodos abstratos +// definidos. Diferente de interfaces, classes abstratas podem conter uma mistura de +// métodos concretos e abstratos. Métodos em uma interface não podem ter um corpo, +// a menos que o método seja estático, e as variáveis sejam finais, por padrão, ao contrário de um +// classe abstrata. Classes abstratas também PODEM ter o método "main". + +public abstract class Animal +{ + public abstract void fazerSom(); + + // Método pode ter um corpo + public void comer() + { + System.out.println("Eu sou um animal e estou comendo."); + //Nota: Nós podemos acessar variáveis privadas aqui. + idade = 30; + } + + // Não há necessidade de inicializar, no entanto, em uma interface +    // a variável é implicitamente final e, portanto, tem +    // de ser inicializado. + protected int idade; + + public void mostrarIdade() + { + System.out.println(idade); + } + + //Classes abstratas podem ter o método main. + public static void main(String[] args) + { + System.out.println("Eu sou abstrata"); + } +} + +class Cachorro extends Animal +{ + + // Nota: ainda precisamos substituir os métodos abstratos na +    // classe abstrata + @Override + public void fazerSom() + { + System.out.println("Bark"); + // idade = 30; ==> ERRO! idade é privada de Animal + } + + // NOTA: Você receberá um erro se usou a +    // anotação Override aqui, uma vez que java não permite +    // sobrescrita de métodos estáticos. +    // O que está acontecendo aqui é chamado de "esconder o método". +    // Vejá também este impressionante SO post: http://stackoverflow.com/questions/16313649/ + public static void main(String[] args) + { + Cachorro pluto = new Cachorro(); + pluto.fazerSom(); + pluto.comer(); + pluto.mostrarIdade(); + } +} + +// Classes Finais + +// Sintaxe de declaração de classe final +// final { +// // Constantes e variáveis +// // Declarações de método +//} + +// Classes finais são classes que não podem ser herdadas e são, portanto, um +// filha final. De certa forma, as classes finais são o oposto de classes abstratas +// Porque classes abstratas devem ser estendidas, mas as classes finais não pode ser +// estendidas. +public final class TigreDenteDeSabre extends Animal +{ + // Nota: Ainda precisamos substituir os métodos abstratos na +     // classe abstrata. + @Override + public void fazerSom(); + { + System.out.println("Roar"); + } +} + +// Métodos Finais +public abstract class Mamifero() +{ + // Sintaxe de Métodos Finais: + // final () + + // Métodos finais, como, classes finais não podem ser substituídas por uma classe filha, +    // e são, portanto, a implementação final do método. + public final boolean EImpulsivo() + { + return true; + } +} + + +// Tipo Enum +// +// Um tipo enum é um tipo de dado especial que permite a uma variável ser um conjunto de constantes predefinidas. A +// variável deve ser igual a um dos valores que foram previamente definidos para ela. +// Por serem constantes, os nomes dos campos de um tipo de enumeração estão em letras maiúsculas. +// Na linguagem de programação Java, você define um tipo de enumeração usando a palavra-chave enum. Por exemplo, você poderia +// especificar um tipo de enum dias-da-semana como: + +public enum Dia { + DOMINGO, SEGUNDA, TERÇA, QUARTA, + QUINTA, SEXTA, SABADO +} + +// Nós podemos usar nosso enum Dia assim: + +public class EnumTeste { + + // Variável Enum + Dia dia; + + public EnumTeste(Dia dia) { + this.dia = dia; + } + + public void digaComoE() { + switch (dia) { + case SEGUNDA: + System.out.println("Segundas são ruins."); + break; + + case SEXTA: + System.out.println("Sextas são melhores."); + break; + + case SABADO: + case DOMINGO: + System.out.println("Finais de semana são os melhores."); + break; + + default: + System.out.println("Dias no meio da semana são mais ou menos."); + break; + } + } + + public static void main(String[] args) { + EnumTeste primeiroDia = new EnumTeste(Dia.SEGUNDA); + primeiroDia.digaComoE(); // => Segundas-feiras são ruins. + EnumTeste terceiroDia = new EnumTeste(Dia.QUARTA); + terceiroDia.digaComoE(); // => Dias no meio da semana são mais ou menos. + } +} + +// Tipos Enum são muito mais poderosos do que nós mostramos acima. +// O corpo de um enum pode incluir métodos e outros campos. +// Você pode ver mais em https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html + ``` ## Leitura Recomendada From bc91d2ce920c8e68cdc882cb6af2c15e7d54352e Mon Sep 17 00:00:00 2001 From: "Elizabeth \"Lizzie\" Siegle" Date: Fri, 30 Oct 2015 01:20:12 -0400 Subject: [PATCH 529/685] Update make.html.markdown --- make.html.markdown | 2 -- 1 file changed, 2 deletions(-) diff --git a/make.html.markdown b/make.html.markdown index 563139d1..e8cfd2b5 100644 --- a/make.html.markdown +++ b/make.html.markdown @@ -234,10 +234,8 @@ bar = 'hello' endif ``` - ### More Resources + [gnu make documentation](https://www.gnu.org/software/make/manual/) + [software carpentry tutorial](http://swcarpentry.github.io/make-novice/) + learn C the hard way [ex2](http://c.learncodethehardway.org/book/ex2.html) [ex28](http://c.learncodethehardway.org/book/ex28.html) - From 3c43328a899f7996b0edb593092906057330aa98 Mon Sep 17 00:00:00 2001 From: Nasgul Date: Fri, 30 Oct 2015 14:52:23 +0200 Subject: [PATCH 530/685] Delete unused double quote. Delete unused double quote. --- ru-ru/clojure-ru.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ru-ru/clojure-ru.html.markdown b/ru-ru/clojure-ru.html.markdown index 2f508a00..451da312 100644 --- a/ru-ru/clojure-ru.html.markdown +++ b/ru-ru/clojure-ru.html.markdown @@ -144,7 +144,7 @@ Clojure, это представитель семейства Lisp-подобн ;;;;;;;;;;;;;;;;;;;;; ; Функция создается специальной формой fn. -; "Тело"" функции может состоять из нескольких форм, +; "Тело" функции может состоять из нескольких форм, ; но результатом вызова функции всегда будет результат вычисления ; последней из них. (fn [] "Hello World") ; => fn From ec601c168aa50368822411d7487e81027388db53 Mon Sep 17 00:00:00 2001 From: Jake Faris Date: Fri, 30 Oct 2015 10:17:15 -0400 Subject: [PATCH 531/685] Adds combined comparison operator to Ruby --- ruby.html.markdown | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ruby.html.markdown b/ruby.html.markdown index 998b4bf7..6114c14e 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -77,6 +77,11 @@ false.class #=> FalseClass 2 <= 2 #=> true 2 >= 2 #=> true +# Combined comparison operator +1 <=> 10 #=> -1 +10 <=> 1 #=> 1 +1 <=> 1 #=> 0 + # Logical operators true && false #=> false true || false #=> true From 33337d045d5af8155e9ef3418f6f766298977a15 Mon Sep 17 00:00:00 2001 From: Jake Faris Date: Fri, 30 Oct 2015 10:22:23 -0400 Subject: [PATCH 532/685] Adds bitwise operators (AND, OR, XOR) --- ruby.html.markdown | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ruby.html.markdown b/ruby.html.markdown index 998b4bf7..f13b77ac 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -41,7 +41,11 @@ You shouldn't either 35 / 5 #=> 7 2**5 #=> 32 5 % 3 #=> 2 -5 ^ 6 #=> 3 + +# Bitwise operators +3 & 5 #=> 1 +3 | 5 #=> 7 +3 ^ 5 #=> 6 # Arithmetic is just syntactic sugar # for calling a method on an object From 71ee28e132fbbade39568fb2332b10e81c07f68a Mon Sep 17 00:00:00 2001 From: Jacob Ward Date: Fri, 30 Oct 2015 08:32:32 -0600 Subject: [PATCH 533/685] easier to read? --- markdown.html.markdown | 45 ++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/markdown.html.markdown b/markdown.html.markdown index 2333110f..8b218473 100644 --- a/markdown.html.markdown +++ b/markdown.html.markdown @@ -2,45 +2,53 @@ language: markdown contributors: - ["Dan Turkel", "http://danturkel.com/"] + - ["Jacob Ward", "http://github.com/JacobCWard/"] filename: markdown.md --- + Markdown was created by John Gruber in 2004. It's meant to be an easy to read and write syntax which converts easily to HTML (and now many other formats as well). -Give me as much feedback as you want! / Feel free to fork and pull request! - - -```markdown - +element's contents. - +specific to a certain parser. - - +- [Headings](#headings) +- [Simple Text Styles](#simple-text-styles) + +## Headings + +You can create HTML elements `

` through `

` easily by prepending the +text you want to be in that element by a number of hashes (#). + +```markdown # This is an

## This is an

### This is an

#### This is an

##### This is an

###### This is an
+``` +Markdown also provides us with two alternative ways of indicating h1 and h2. - +```markdown This is an h1 ============= This is an h2 ------------- +``` +## Simple text styles - - +Text can be easily styled as italic or bold using markdown. +```markdown *This text is in italics.* _And so is this text._ @@ -50,10 +58,11 @@ __And so is this text.__ ***This text is in both.*** **_As is this!_** *__And this!__* +``` - - +In Github Flavored Markdown, which is used to render markdown files on +Github, we also have strikethrough: +```markdown ~~This text is rendered with strikethrough.~~ From 9a152c0490ba38e791ba1444d74dcf184d3c847e Mon Sep 17 00:00:00 2001 From: Jacob Ward Date: Fri, 30 Oct 2015 09:24:49 -0600 Subject: [PATCH 534/685] Revert "easier to read?" This reverts commit 71ee28e132fbbade39568fb2332b10e81c07f68a. --- markdown.html.markdown | 45 ++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/markdown.html.markdown b/markdown.html.markdown index 8b218473..2333110f 100644 --- a/markdown.html.markdown +++ b/markdown.html.markdown @@ -2,53 +2,45 @@ language: markdown contributors: - ["Dan Turkel", "http://danturkel.com/"] - - ["Jacob Ward", "http://github.com/JacobCWard/"] filename: markdown.md --- - Markdown was created by John Gruber in 2004. It's meant to be an easy to read and write syntax which converts easily to HTML (and now many other formats as well). -Markdown is a superset of HTML, so any HTML file is valid Markdown, that +Give me as much feedback as you want! / Feel free to fork and pull request! + + +```markdown + -Markdown also varies in implementation from one parser to a next. This + -- [Headings](#headings) -- [Simple Text Styles](#simple-text-styles) - -## Headings - -You can create HTML elements `

` through `

` easily by prepending the -text you want to be in that element by a number of hashes (#). - -```markdown + + # This is an

## This is an

### This is an

#### This is an

##### This is an

###### This is an
-``` -Markdown also provides us with two alternative ways of indicating h1 and h2. -```markdown + This is an h1 ============= This is an h2 ------------- -``` -## Simple text styles -Text can be easily styled as italic or bold using markdown. + + -```markdown *This text is in italics.* _And so is this text._ @@ -58,11 +50,10 @@ __And so is this text.__ ***This text is in both.*** **_As is this!_** *__And this!__* -``` -In Github Flavored Markdown, which is used to render markdown files on -Github, we also have strikethrough: -```markdown + + ~~This text is rendered with strikethrough.~~ From 5afca01bdfb7dab2e6086a63bb80444aae9831cb Mon Sep 17 00:00:00 2001 From: Liam Demafelix Date: Fri, 30 Oct 2015 23:26:49 +0800 Subject: [PATCH 535/685] [php/en] Line 159 - echo isn't a function, print() is Line 337 - unneeded semicolon (it's a pre-test loop) --- php.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/php.html.markdown b/php.html.markdown index 0504ced2..7b0cf61c 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -3,6 +3,7 @@ language: PHP contributors: - ["Malcolm Fell", "http://emarref.net/"] - ["Trismegiste", "https://github.com/Trismegiste"] + - [ Liam Demafelix , https://liamdemafelix.com/] filename: learnphp.php --- @@ -156,14 +157,13 @@ unset($array[3]); * Output */ -echo('Hello World!'); +echo 'Hello World!'; // Prints Hello World! to stdout. // Stdout is the web page if running in a browser. print('Hello World!'); // The same as echo -// echo and print are language constructs too, so you can drop the parentheses -echo 'Hello World!'; +// print is a language construct too, so you can drop the parentheses print 'Hello World!'; $paragraph = 'paragraph'; @@ -335,7 +335,7 @@ switch ($x) { $i = 0; while ($i < 5) { echo $i++; -}; // Prints "01234" +} // Prints "01234" echo "\n"; From 08b43e21f1a273d5ca471e0accdf46ba706a4cd5 Mon Sep 17 00:00:00 2001 From: Jacob Ward Date: Fri, 30 Oct 2015 09:32:51 -0600 Subject: [PATCH 536/685] Changed headers to headings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Relabeled the section called “headers” to “headings” because a header is a specific tag separate from the h1-h6 ‘heading’ tags. --- markdown.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown.html.markdown b/markdown.html.markdown index 2333110f..d5ed284b 100644 --- a/markdown.html.markdown +++ b/markdown.html.markdown @@ -21,7 +21,7 @@ element's contents. --> guide will attempt to clarify when features are universal or when they are specific to a certain parser. --> - + # This is an

From 55101d6ca7bd51b3b3c850ad51f24d7980a288d6 Mon Sep 17 00:00:00 2001 From: IvanEh Date: Fri, 30 Oct 2015 17:53:40 +0200 Subject: [PATCH 537/685] Add Ukrainian translation to javascript guide --- ua-ua/javascript-ua.html.markdown | 501 ++++++++++++++++++++++++++++++ 1 file changed, 501 insertions(+) create mode 100644 ua-ua/javascript-ua.html.markdown diff --git a/ua-ua/javascript-ua.html.markdown b/ua-ua/javascript-ua.html.markdown new file mode 100644 index 00000000..fedbf5ac --- /dev/null +++ b/ua-ua/javascript-ua.html.markdown @@ -0,0 +1,501 @@ +--- +language: javascript +contributors: + - ["Adam Brenecki", "http://adam.brenecki.id.au"] + - ["Ariel Krakowski", "http://www.learneroo.com"] +filename: javascript-ru.js +translators: + - ["Alexey Gonchar", "http://github.com/finico"] + - ["Andre Polykanine", "https://github.com/Oire"] +lang: ru-ru +--- + +JavaScript було створено в 1995 році Бренданом Айком, який працював у копаніх Netscape. +Він був задуманий як проста мова сценаріїв для веб-сайтів, який би доповнював Java +для більш складних веб-застосунків. Але тісна інтеграція з веб-сторінками і +вбудована підтримка браузерами призвела до того, що JavaScript став популярніший +за власне Java. + +Зараз JavaScript не обмежується тільки веб-браузеорм. Наприклад, Node.js, +програмна платформа, що дозволяє виконувати JavaScript код з використанням +рушія V8 від браузера Google Chrome, стає все більш і більш популярною. + +```js +// С-подібні коментарі. Однорядкові коментарі починаються з двох символів /(слеш) +/* а багаторядкові коментарі починаються з послідовності слеша та зірочки і + закінчуються символами зірочка-слеш */ + +Інструкції можуть закінчуватися крапкою з комою ; +doStuff(); + +// ... але не обов’язково, тому що крапка з комою автоматично вставляється на +// місці символу нового рядка, крім деяких випадків. +doStuff() + +// Ми завжди будемо використовувати крапку з комою в цьому посібнику, тому що ці +// винятки можуть призвести до неочікуваних результатів + +/////////////////////////////////// +// 1. Числа, Рядки і Оператори + +// В JavaScript числа зберігаються тільки в одному форматі (64-bit IEEE 754 double) +// Цей тип має 52-бітну мантису, якої достатньо для збереження чисел з +// точністю до 9✕10¹⁵. +3; // = 3 +1.5; // = 1.5 + +// Деякі прості арифметичні операції працють так, як ми очікуємо. +1 + 1; // = 2 +0.1 + 0.2; // = 0.30000000000000004 (а деякі - ні) +8 - 1; // = 7 +10 * 2; // = 20 +35 / 5; // = 7 + +// В тому числі ділення з остачою +5 / 2; // = 2.5 + +// В JavaScript є побітові операції; коли ви виконуєте таку операцію, +// число з плаваючою точкою переводиться в ціле зі знаком +// довжиною *до* 32 розрядів. +1 << 2; // = 4 + +// Пріоритет у виразах можна задати явно круглими дужками +(1 + 3) * 2; // = 8 + +// Є три спеціальні значення, які не є реальними числами: +Infinity; // "нескінченність", наприклад, як результат ділення на 0 +-Infinity; // "мінус нескінченність", як результат ділення від’ємного числа на 0 +NaN; // "не число", наприклад, ділення 0/0 + +// Логічні типи +true; +false; + +// Рядки створюються за допомогою подвійних та одинарних лапок +'абв'; +"Hello, world!"; + +// Для логічного заперечення використовується знак оклику. +!true; // = false +!false; // = true + +// Строга рівність === +1 === 1; // = true +2 === 1; // = false + +// Строга нерівність !== +1 !== 1; // = false +2 !== 1; // = true + +// Інші оператори порівняння +1 < 10; // = true +1 > 10; // = false +2 <= 2; // = true +2 >= 2; // = true + +// Рядки об’єднуються за допомогою оператор + +"hello, " + "world!"; // = "hello, world!" + +// І порівнюються за допомогою > і < +"a" < "b"; // = true + +// Перевірка на рівність з приведнням типів здійснюється оператором == +"5" == 5; // = true +null == undefined; // = true + +// ... але приведення не виконується при === +"5" === 5; // = false +null === undefined; // = false + +// ... приведення типів може призвести до дивних результатів +13 + !0; // 14 +"13" + !0; // '13true' + +// Можна отримати доступ до будь-якого символа рядка за допомгою charAt +"Это строка".charAt(0); // = 'Э' + +// ... або використати метод substring, щоб отримати більший кусок +"Hello, world".substring(0, 5); // = "Hello" + +// length - це не метод, а поле +"Hello".length; // = 5 + +// Типи null и undefined +null; // навмисна відсутність результату +undefined; // використовується для позначення відсутності присвоєного значення + +// false, null, undefined, NaN, 0 и "" — хиба; все інше - істина. +// Потрібно відмітити, що 0 — це зиба, а "0" — істина, не зважаючи на те що: +// 0 == "0". + +/////////////////////////////////// +// 2. Змінні, Масиви, Об’єкти + +// Змінні оголошуються за допомогою ключового слова var. JavaScript — мова з +// динамічною типізацією, тому не потрібно явно вказувати тип. Для присвоєння +// значення змінної використовується символ = +var someVar = 5; + +// якщо пропустити слово var, ви не отримаєте повідомлення про помилку, ... +someOtherVar = 10; + +// ... але ваша змінна буде створення в глобальному контексті, а не там, де +// ви її оголосили + +// Змінні, які оголошені без присвоєння, автоматично приймають значення undefined +var someThirdVar; // = undefined + +// У математичних операцій є скорочені форми: +someVar += 5; // як someVar = someVar + 5; +someVar *= 10; // тепер someVar = 100 + +// Інкремент і декремент +someVar++; // тепер someVar дорівнює 101 +someVar--; // а зараз 100 + +// Масиви — це нумеровані списку, які зберігають значення будь-якого типу. +var myArray = ["Hello", 45, true]; + +// Доступ до елементів можна отримати за допомогою синтаксиса з квадратними дужками +// Індексація починається з нуля +myArray[1]; // = 45 + +// Массивы можно изменять, как и их длину, +myArray.push("Мир"); +myArray.length; // = 4 + +// додавання і редагування елементів +myArray[3] = "Hello"; + +// Об’єкти в JavaScript сході на словники або асоціативні масиви в інших мовах +var myObj = {key1: "Hello", key2: "World"}; + +// Ключі - це рядки, але лапки не обов’язкі, якщо ключ задовольняє +// правилам формування назв змінних. Значення можуть бути будь-яких типів. +var myObj = {myKey: "myValue", "my other key": 4}; + +// Атрибути можна отримати використовуючи квадратні дужки +myObj["my other key"]; // = 4 + +// Або через точку, якщо ключ є правильним ідентифікатором +myObj.myKey; // = "myValue" + +// Об’єкти можна динамічно змінювати й додавати нові поля +myObj.myThirdKey = true; + +// Коли ви звертаєтесб до поля, яке не існує, ви отримуєте значення undefined +myObj.myFourthKey; // = undefined + +/////////////////////////////////// +// 3. Управляючі конструкції + +// Синтаксис для цього розділу майже такий самий, як у Java + +// Умовна конструкція +var count = 1; +if (count == 3) { + // виконується, якщо count дорівнює 3 +} else if (count == 4) { + // .. +} else { + // ... +} + +// ... цикл while. +while (true){ + // Нескінченний цикл! +} + +// Цикл do-while такий самий, як while, але завжди виконується принаймні один раз. +var input +do { + input = getInput(); +} while (!isValid(input)) + +// цикл for такий самий, кяк в C і Java: +// ініціалізація; умова; крок. +for (var i = 0; i < 5; i++) { + // виконається 5 разів +} + +// && — логічне І, || — логічне АБО +if (house.size == "big" && house.color == "blue") { + house.contains = "bear"; +} +if (color == "red" || color == "blue") { + // колір червоний або синій +} + +// && і || використовують скорочене обчислення +// тому їх можна використовувати для задання значень за замовчуванням. +var name = otherName || "default"; + +// Оператор switch виконує перевірку на рівність за допомогою === +// використовуйте break, щоб призупити виконання наступного case, +grade = 4; +switch (grade) { + case 5: + console.log("Відмінно"); + break; + case 4: + console.log("Добре"); + break; + case 3: + console.log("Можна краще"); + break; + default: + console.log("Погано!"); + break; +} + + +/////////////////////////////////// +// 4. Функції, область видимості і замикання + +// Функції в JavaScript оголошуються за допомогою ключового слова function. +function myFunction(thing) { + return thing.toUpperCase(); +} +myFunction("foo"); // = "FOO" + +// Зверність увагу, що значення яке буде повернено, повинно починатися на тому ж +// рядку, що і ключове слово return, інакше завжди буде повертатися значення undefined +// із-за автоматичної вставки крапки з комою +function myFunction() +{ + return // <- крапка з комою вставляється автоматично + { + thisIsAn: 'object literal' + } +} +myFunction(); // = undefined + +// В JavaScript функції - це об`єкти першого класу, тому вони можуть присвоюватися +// іншим змінним і передаватися іншим функціям, наприклад, щоб визначити обробник +// події. +function myFunction() { + // код буде виконано через 5 сек. +} +setTimeout(myFunction, 5000); +// setTimeout не є частиною мови, але реалізований в браузерах і Node.js + +// Функции не обязательно должны иметь имя при объявлении — вы можете написать +// анонимное определение функции непосредственно в аргументе другой функции. +// Функції не обов’язково мають мати ім’я при оголошенні — ви можете написати +// анонімну функцію прямо в якості аргумента іншої функції +setTimeout(function() { + // Цей код буде виконано через п’ять секунд +}, 5000); + +// В JavaScript реалізована концепція області видимості; функції мають свою +// область видимости, а інші блоки не мають +if (true) { + var i = 5; +} +i; // = 5, а не undefined, як це звичайно буває в інших мова + +// Така особливість призвела до шаблону "анонімних функцій, які викликають самих себе" +// що дозволяє уникнути проникнення змінних в глобальну область видимості +(function() { + var temporary = 5; + // об’єкт window зберігає глобальний контекст; таким чином ми можемо також додавати + // змінні до глобальної області + window.permanent = 10; +})(); +temporary; // повідомлення про помилку ReferenceError +permanent; // = 10 + +// Одной из самых мощных возможностей JavaScript являются замыкания. Если функция +// определена внутри другой функции, то внутренняя функция имеет доступ к +// переменным внешней функции даже после того, как контекст выполнения выйдет из +// внешней функции. +// Замикання - одна з найпотужніших інтрументів JavaScript. Якщо функція визначена +// всередині іншої функції, то внутрішня функція має доступ до змінних зовнішньої +// функції навіть після того, як код буде виконуватися поза контекстом зовнішньої функції +function sayHelloInFiveSeconds(name) { + var prompt = "Hello, " + name + "!"; + // Внутрішня функція зберігається в локальній області так, + // ніби функція була оголошена за допомогою ключового слова var + function inner() { + alert(prompt); + } + setTimeout(inner, 5000); + // setTimeout асинхронна, тому функція sayHelloInFiveSeconds зразу завершиться, + // після чого setTimeout викличе функцію inner. Але функція inner + // «замкнута» кругом sayHelloInFiveSeconds, вона все рівно має доступ до змінної prompt +} +sayHelloInFiveSeconds("Адам"); // Через 5 с відкриється вікно «Hello, Адам!» + +/////////////////////////////////// +// 5. Об’єкти: конструктори і прототипи + +// Об’єкти можуть містити функції +var myObj = { + myFunc: function() { + return "Hello, world!"; + } +}; +myObj.myFunc(); // = "Hello, world!" + +// Функції, що прикріплені до об’єктів мають доступ до поточного об’єкта за +// допомогою ключового слова this. +myObj = { + myString: "Hello, world!", + myFunc: function() { + return this.myString; + } +}; +myObj.myFunc(); // = "Hello, world!" + +// Значення this залежить від того, як функція викликається +// а не від того, де вона визначена. Таким чином наша функція не працює, якщо +// вона викликана не в контексті об’єкта +var myFunc = myObj.myFunc; +myFunc(); // = undefined + +// Функція може бути присвоєна іншому об’єкту. Тоді вона матиме доступ до +// цього об’єкта через this +var myOtherFunc = function() { +} +myObj.myOtherFunc = myOtherFunc; +myObj.myOtherFunc(); // = "HELLO, WORLD!" + +// Контекст виконання функції можна задати за допомогою сall або apply +var anotherFunc = function(s) { + return this.myString + s; +} +anotherFunc.call(myObj, " Hello!"); // = "Hello, world! Hello!" + +// Функцiя apply приймає в якості аргументу масив +anotherFunc.apply(myObj, [" Hello!"]); // = "Hello, world! Hello!" + +// apply можна використати, коли функція працює послідовністю аргументів, а +// ви хочете передати масив +Math.min(42, 6, 27); // = 6 +Math.min([42, 6, 27]); // = NaN (Ой-ой!) +Math.min.apply(Math, [42, 6, 27]); // = 6 + +// Але call і apply — тимчасові. Коли ми хочемо зв’язати функцію і об’єкт +// використовують bind +var boundFunc = anotherFunc.bind(myObj); +boundFunc(" Hello!"); // = "Hello world, Hello!" + +// Bind можна використати для задання аргументів +var product = function(a, b) { return a * b; } +var doubler = product.bind(this, 2); +doubler(8); // = 16 + +// Коли ви викликаєте функцію за допомогою ключового слова new, створюється новий об’єкт, +// доступний функції за допомогою this. Такі функції називають конструкторами. +var MyConstructor = function() { + this.myNumber = 5; +} +myNewObj = new MyConstructor(); // = {myNumber: 5} +myNewObj.myNumber; // = 5 + +// У кожного об’єкта є прототип. Коли ви звертаєтесь до поля, яке не існує в цьому +// об’єктів, інтерпретатор буде шукати поле в прототипі + +// Деякі реалізації мови дозволяють отримати доступ до прототипа об’єкта через +// "магічну" властивість __proto__. Це поле не є частиною стандарта, але існують +// стандартні способи використання прототипів, які ми побачимо пізніше +var myObj = { + myString: "Hello, world!" +}; +var myPrototype = { + meaningOfLife: 42, + myFunc: function() { + return this.myString.toLowerCase() + } +}; + +myObj.__proto__ = myPrototype; +myObj.meaningOfLife; // = 42 + +// Аналогічно для функцій +myObj.myFunc(); // = "Hello, world!" + +// Якщо інтерпретатор не знайде властивість в прототипі, то він продвжить пошук +// в прототипі прототипа і так далі +myPrototype.__proto__ = { + myBoolean: true +}; +myObj.myBoolean; // = true + +// Кожег об’єкт зберігає посилання на свій прототип. Це значить, що ми можемо змінити +// наш прототип, і наші зміни будуть всюди відображені. +myPrototype.meaningOfLife = 43; +myObj.meaningOfLife; // = 43 + +// Ми сказали, що властивість __proto__ нестандартне, і нема ніякого стандартного способу +// змінити прототип об’єкта, що вже існує. Але є два способи створити новий об’єкт зі заданим +// прототипом + +// Перший спосіб — це Object.create, який з’явився JavaScript недавно, +// а тому в деяких реалізаціях може бути не доступним. +var myObj = Object.create(myPrototype); +myObj.meaningOfLife; // = 43 + +// Другий спосіб: у конструкторів є властивість з іменем prototype. Це *не* +// прототип функції-конструктора, це прототип для нових об’єктів, які будуть створені +// цим конструктором і ключового слова new. +MyConstructor.prototype = { + myNumber: 5, + getMyNumber: function() { + return this.myNumber; + } +}; +var myNewObj2 = new MyConstructor(); +myNewObj2.getMyNumber(); // = 5 +myNewObj2.myNumber = 6 +myNewObj2.getMyNumber(); // = 6 + +// У вбудованих типів(рядок, число) теж є конструктори, які створють еквівалентні +// об’єкти-обгортки +var myNumber = 12; +var myNumberObj = new Number(12); +myNumber == myNumberObj; // = true + +// Але вони не ідентичні +typeof myNumber; // = 'number' +typeof myNumberObj; // = 'object' +myNumber === myNumberObj; // = false +if (0) { + // Этот код не выполнится, потому что 0 - это ложь. +} + +// Об’єкти-обгортки і вбудовані типи мають спільні прототипи, тому +// ви можете розширити функціонал рядків: +String.prototype.firstCharacter = function() { + return this.charAt(0); +} +"abc".firstCharacter(); // = "a" + +// Такий прийом часто використовуються в поліфілах, які реалізують нові можливості +// JavaScript в старій реалізації мови, так що вони можуть бути використані в старих +// середовищах + +// Наприклад, Object.create доступний не у всіх реалізація, но ми можемо +// використати функції за допомогою наступного поліфіла: +if (Object.create === undefined) { // не перезаписываем метод, если он существует + Object.create = function(proto) { + // Створюємо правильний конструктор з правильним прототипом + var Constructor = function(){}; + Constructor.prototype = proto; + + return new Constructor(); + } +} +``` + +## Що почитати + +[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript +[2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript +[3]: https://developer.mozilla.org/en-US/docs/Using_the_W3C_DOM_Level_1_Core +[4]: http://www.learneroo.com/modules/64/nodes/350 +[5]: http://bonsaiden.github.io/JavaScript-Garden/ +[6]: http://www.amazon.com/gp/product/0596805527/ +[7]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript +[8]: http://eloquentjavascript.net/ +[9]: http://jstherightway.org/ From a4842767094537dfee57698edc3bcc2b74f1ecee Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 30 Oct 2015 19:58:33 +0000 Subject: [PATCH 538/685] Adds documentation for revert command Also mentions graph flag for the log command --- git.html.markdown | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/git.html.markdown b/git.html.markdown index bedc9853..e7ca07d6 100644 --- a/git.html.markdown +++ b/git.html.markdown @@ -6,6 +6,7 @@ contributors: - ["Leo Rudberg" , "http://github.com/LOZORD"] - ["Betsy Lorton" , "http://github.com/schbetsy"] - ["Bruno Volcov", "http://github.com/volcov"] + - ["Andrew Taylor", "http://github.com/andrewjt71"] filename: LearnGit.txt --- @@ -333,6 +334,9 @@ $ git log --oneline # Show merge commits only $ git log --merges + +# Show all commits represented by an ASCII graph +$ git log --graph ``` ### merge @@ -499,6 +503,16 @@ $ git reset 31f2bb1 # after the specified commit). $ git reset --hard 31f2bb1 ``` +### revert + +Revert can be used to undo a commit. It should not be confused with reset which restores +the state of a project to a previous point. Revert will add a new commit which is the +inverse of the specified commit, thus reverting it. + +```bash +# Revert a specified commit +$ git revert +``` ### rm From 9530122a1c956a25adb71bfd9cc1c516ff67d2f3 Mon Sep 17 00:00:00 2001 From: Fernando Valverde Date: Fri, 30 Oct 2015 22:43:44 +0100 Subject: [PATCH 539/685] Include MARK style and two collection declarations Added MARK with separator and a couple of mutable explicit declarations of empty Array/Dictionary --- swift.html.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/swift.html.markdown b/swift.html.markdown index f451288d..1ca81bc2 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -25,6 +25,7 @@ import UIKit // Xcode supports landmarks to annotate your code and lists them in the jump bar // MARK: Section mark +// MARK: - Section mark with a separator line // TODO: Do something soon // FIXME: Fix this code @@ -128,6 +129,7 @@ shoppingList[1] = "bottle of water" let emptyArray = [String]() // let == immutable let emptyArray2 = Array() // same as above var emptyMutableArray = [String]() // var == mutable +var explicitEmptyMutableStringArray: [String] = [] // same as above // Dictionary @@ -139,6 +141,7 @@ occupations["Jayne"] = "Public Relations" let emptyDictionary = [String: Float]() // let == immutable let emptyDictionary2 = Dictionary() // same as above var emptyMutableDictionary = [String: Float]() // var == mutable +var explicitEmptyMutableDictionary: [String: Float] = [:] // same as above // From 0717fcfdc774a877020b9d194dc40924aa5dd528 Mon Sep 17 00:00:00 2001 From: Fernando Valverde Date: Fri, 30 Oct 2015 22:57:55 +0100 Subject: [PATCH 540/685] Added pragma mark information `#pragma mark` is very useful and widely recommended to "abuse" it for method/variable grouping since it improves readability. --- objective-c.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/objective-c.html.markdown b/objective-c.html.markdown index f130ea0c..36b4f3e9 100644 --- a/objective-c.html.markdown +++ b/objective-c.html.markdown @@ -20,6 +20,10 @@ It is a general-purpose, object-oriented programming language that adds Smalltal Multi-line comments look like this */ +// XCode supports pragma mark directive that improve jump bar readability +#pragma mark Navigation Functions // New tag on jump bar named 'Navigation Functions' +#pragma mark - Navigation Functions // Same tag, now with a separator + // Imports the Foundation headers with #import // Use <> to import global files (in general frameworks) // Use "" to import local files (from project) From ee835c28a942c85c5c32d24dde35239a8d07e7e2 Mon Sep 17 00:00:00 2001 From: Aybuke Ozdemir Date: Sat, 31 Oct 2015 00:49:23 +0200 Subject: [PATCH 541/685] the comments were translated into Turkish --- tr-tr/c-tr.html.markdown | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tr-tr/c-tr.html.markdown b/tr-tr/c-tr.html.markdown index 128901de..2d4240ed 100644 --- a/tr-tr/c-tr.html.markdown +++ b/tr-tr/c-tr.html.markdown @@ -91,9 +91,9 @@ int main() { // Örneğin, printf("%lu\n", sizeof(int)); // => 4 (bir çok makinede 4-byte words) - // If the argument of the `sizeof` operator an expression, then its argument - // is not evaluated (except VLAs (see below)). - // The value it yields in this case is a compile-time constant. + // Eger arguman düzenli ifae olan sizeof operatoru ise degerlendirilmez. + // VLAs hariç asagiya bakiniz). + // Bu durumda verimliligin degeri derleme-zamani sabitidir. int a = 1; // size_t bir objeyi temsil etmek için kullanılan 2 byte uzunluğundaki bir @@ -101,7 +101,7 @@ int main() { size_t size = sizeof(a++); // a++ is not evaluated printf("sizeof(a++) = %zu where a = %d\n", size, a); - // prints "sizeof(a++) = 4 where a = 1" (on a 32-bit architecture) + // yazdirilan "sizeof(a++) = 4 where a = 1" (32-bit mimaride) // Diziler somut bir boyut ile oluşturulmalıdır. char my_char_array[20]; // Bu dizi 1 * 20 = 20 byte alan kaplar @@ -119,19 +119,19 @@ int main() { my_array[1] = 2; printf("%d\n", my_array[1]); // => 2 - // In C99 (and as an optional feature in C11), variable-length arrays (VLAs) - // can be declared as well. The size of such an array need not be a compile - // time constant: - printf("Enter the array size: "); // ask the user for an array size + // C99'da (ve C11 istege bagli bir ozellik olarak), değidken-uzunluklu diziler (VLAs) bildirilebilirler. + // Böyle bir dizinin boyuunu derlenmesi gerekmez + // zaman sabiti: + printf("Enter the array size: "); // dizi boyutu kullaniciya soruluyor char buf[0x100]; fgets(buf, sizeof buf, stdin); - // strtoul parses a string to an unsigned integer + // strtoul isaretsiz integerlar icin string ayiricisidir. size_t size = strtoul(buf, NULL, 10); int var_length_array[size]; // declare the VLA printf("sizeof array = %zu\n", sizeof var_length_array); - // A possible outcome of this program may be: + // Bu programın olası bir sonucu olabilir: // > Enter the array size: 10 // > sizeof array = 40 @@ -151,8 +151,8 @@ int main() { printf("%d\n", a_string[16]); // => 0 // i.e., byte #17 is 0 (as are 18, 19, and 20) - // If we have characters between single quotes, that's a character literal. - // It's of type `int`, and *not* `char` (for historical reasons). + // Tek tirnak arasinda karakterlere sahipsek, bu karakterler degismezdir. + // Tip `int` ise, `char` *degildir* (tarihsel sebeplerle). int cha = 'a'; // fine char chb = 'a'; // fine too (implicit conversion from int to char) @@ -201,10 +201,10 @@ int main() { 0x01 << 1; // => 0x02 (bitwise left shift (by 1)) 0x02 >> 1; // => 0x01 (bitwise right shift (by 1)) - // Be careful when shifting signed integers - the following are undefined: - // - shifting into the sign bit of a signed integer (int a = 1 << 32) - // - left-shifting a negative number (int a = -1 << 2) - // - shifting by an offset which is >= the width of the type of the LHS: + // Isaretli sayilari kaydirirken dikkatli olun - tanimsizlar sunlardir: + // - isaretli sayinin isaret bitinde yapilan kaydirma (int a = 1 << 32) + // - negatif sayilarda sol kaydirma (int a = -1 << 2) + // - LHS tipinde >= ile olan ofset genisletmelerde yapilan kaydirma: // int a = 1 << 32; // UB if int is 32 bits wide /////////////////////////////////////// @@ -485,4 +485,4 @@ Readable code is better than clever code and fast code. For a good, sane coding Diğer taraftan google sizin için bir arkadaş olabilir. -[1] http://stackoverflow.com/questions/119123/why-isnt-sizeof-for-a-struct-equal-to-the-sum-of-sizeof-of-each-member \ No newline at end of file +[1] http://stackoverflow.com/questions/119123/why-isnt-sizeof-for-a-struct-equal-to-the-sum-of-sizeof-of-each-member From 77a16fc34b056843b0fda4c29547b8f575c72823 Mon Sep 17 00:00:00 2001 From: Francisco Marques Date: Fri, 30 Oct 2015 23:41:21 +0000 Subject: [PATCH 542/685] Fixed sentences that didn't make sense (at all) --- pt-br/json-pt.html.markdown | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pt-br/json-pt.html.markdown b/pt-br/json-pt.html.markdown index e4f10a61..d4eed0c1 100644 --- a/pt-br/json-pt.html.markdown +++ b/pt-br/json-pt.html.markdown @@ -3,6 +3,7 @@ language: json contributors: - ["Anna Harren", "https://github.com/iirelu"] - ["Marco Scannadinari", "https://github.com/marcoms"] + - ["Francisco Marques", "https://github.com/ToFran"] translators: - ["Miguel Araújo", "https://github.com/miguelarauj1o"] lang: pt-br @@ -12,10 +13,8 @@ filename: learnjson-pt.json Como JSON é um formato de intercâmbio de dados, este será, muito provavelmente, o "Learn X in Y minutes" mais simples existente. -JSON na sua forma mais pura não tem comentários em reais, mas a maioria dos analisadores -aceitarão comentários no estilo C (//, /\* \*/). Para os fins do presente, no entanto, -tudo o que é vai ser 100% JSON válido. Felizmente, isso meio que fala por si. - +JSON na sua forma mais pura não tem comentários, mas a maioria dos analisadores +aceitarão comentários no estilo C (//, /\* \*/). No entanto estes devem ser evitados para otimizar a compatibilidade. ```json { From 5de94e16901270de8d584b022d8e9557bba8adc1 Mon Sep 17 00:00:00 2001 From: Francisco Marques Date: Fri, 30 Oct 2015 23:45:00 +0000 Subject: [PATCH 543/685] Added more info. As I'm already editing this, added more detail (translated from the en version). --- pt-br/json-pt.html.markdown | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pt-br/json-pt.html.markdown b/pt-br/json-pt.html.markdown index d4eed0c1..f57cd383 100644 --- a/pt-br/json-pt.html.markdown +++ b/pt-br/json-pt.html.markdown @@ -16,6 +16,14 @@ Como JSON é um formato de intercâmbio de dados, este será, muito provavelment JSON na sua forma mais pura não tem comentários, mas a maioria dos analisadores aceitarão comentários no estilo C (//, /\* \*/). No entanto estes devem ser evitados para otimizar a compatibilidade. +Um valor JSON pode ser um numero, uma string, um array, um objeto, um booleano (true, false) ou null. + +Os browsers suportados são: Firefox 3.5+, Internet Explorer 8.0+, Chrome 1.0+, Opera 10.0+, e Safari 4.0+. + +A extensão dos ficheiros JSON é “.json” e o tipo de mídia de Internet (MIME) é “application/json”. + +Mais informação em: http://www.json.org/ + ```json { "chave": "valor", From 3b9de3c441d583242a7229ce534a446945b8085a Mon Sep 17 00:00:00 2001 From: Francisco Marques Date: Fri, 30 Oct 2015 23:47:10 +0000 Subject: [PATCH 544/685] Removed dot from the last line. There was a misplaced dot (".") in the last line of the example. --- pt-br/json-pt.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt-br/json-pt.html.markdown b/pt-br/json-pt.html.markdown index f57cd383..fd822c03 100644 --- a/pt-br/json-pt.html.markdown +++ b/pt-br/json-pt.html.markdown @@ -64,6 +64,6 @@ Mais informação em: http://www.json.org/ , "outro comentário": "que bom" }, - "que foi curto": "E, você está feito. Você já sabe tudo que JSON tem para oferecer.". + "que foi curto": "E, você está feito. Você já sabe tudo que JSON tem para oferecer." } ``` From c042b7c45e14fa1737a74673c1858c41dd8b9f4f Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Fri, 30 Oct 2015 20:15:06 -0400 Subject: [PATCH 545/685] [coldfusion/en] Adds information about CFScript and documentation --- coldfusion.html.markdown | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/coldfusion.html.markdown b/coldfusion.html.markdown index 70804a1e..d49ad254 100644 --- a/coldfusion.html.markdown +++ b/coldfusion.html.markdown @@ -3,13 +3,17 @@ language: coldfusion filename: learncoldfusion.cfm contributors: - ["Wayne Boka", "http://wboka.github.io"] + - ["Kevin Morris", "https://twitter.com/kevinmorris"] --- ColdFusion is a scripting language for web development. [Read more here.](http://www.adobe.com/products/coldfusion-family.html) -```html +### CFML +_**C**old**F**usion **M**arkup **L**anguage_ +ColdFusion started as a tag-based language. Almost all functionality is available using tags. +```html HTML tags have been provided for output readability " ---> @@ -314,8 +318,13 @@ ColdFusion is a scripting language for web development.

#getWorld()#

``` +### CFScript +_**C**old**F**usion **S**cript_ +In recent years, the ColdFusion language has added script syntax to mirror tag functionality. When using an up-to-date CF server, almost all functionality is available using scrypt syntax. + ## Further Reading The links provided here below are just to get an understanding of the topic, feel free to Google and find specific examples. 1. [Coldfusion Reference From Adobe](https://helpx.adobe.com/coldfusion/cfml-reference/topics.html) +2. [Open Source Documentation](http://cfdocs.org/) From 93d3ab4578cd7c6e27f4d2b9468179528d326a22 Mon Sep 17 00:00:00 2001 From: Liam Demafelix Date: Sat, 31 Oct 2015 08:26:09 +0800 Subject: [PATCH 546/685] [vb/en] Additional note for select statements --- visualbasic.html.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/visualbasic.html.markdown b/visualbasic.html.markdown index bdfdcc10..accdbf56 100644 --- a/visualbasic.html.markdown +++ b/visualbasic.html.markdown @@ -32,6 +32,9 @@ Module Module1 Console.WriteLine("50. About") Console.WriteLine("Please Choose A Number From The Above List") Dim selection As String = Console.ReadLine + ' The "Case" in the Select statement is optional. + ' For example, "Select selection" instead of "Select Case selection" + ' will also work. Select Case selection Case "1" 'HelloWorld Output Console.Clear() 'Clears the application and opens the private sub From a72017573d893b9c0b17e7342dbe39630ba4a5d0 Mon Sep 17 00:00:00 2001 From: bureken Date: Sat, 31 Oct 2015 03:33:13 +0300 Subject: [PATCH 547/685] Typo fix --- edn.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edn.html.markdown b/edn.html.markdown index 655c20f1..0a0dc9b5 100644 --- a/edn.html.markdown +++ b/edn.html.markdown @@ -16,7 +16,7 @@ will see how it is extended later on. ```Clojure ; Comments start with a semicolon. -; Anythng after the semicolon is ignored. +; Anything after the semicolon is ignored. ;;;;;;;;;;;;;;;;;;; ;;; Basic Types ;;; From b2b274df08f65a62f5f4c65701b043a69bd77964 Mon Sep 17 00:00:00 2001 From: bureken Date: Sat, 31 Oct 2015 04:00:03 +0300 Subject: [PATCH 548/685] Turkish typo fix --- tr-tr/brainfuck-tr.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tr-tr/brainfuck-tr.html.markdown b/tr-tr/brainfuck-tr.html.markdown index baca4217..bd842b17 100644 --- a/tr-tr/brainfuck-tr.html.markdown +++ b/tr-tr/brainfuck-tr.html.markdown @@ -19,7 +19,7 @@ gözardı edilir. Brainfuck 30,000 hücresi olan ve ilk değerleri sıfır olarak atanmış bir dizidir. İşaretçi ilk hücreyi işaret eder. -Sekik komut vardır: +Sekiz komut vardır: + : Geçerli hücrenin değerini bir artırır. - : Geçerli hücrenin değerini bir azaltır. > : Veri işaretçisini bir sonraki hücreye hareket ettirir(sağdaki hücreye). From d30215bfaf2420bd974eabbd561699ea664df259 Mon Sep 17 00:00:00 2001 From: Gordon Senesac Jr Date: Fri, 30 Oct 2015 20:21:30 -0500 Subject: [PATCH 549/685] Added a couple functions to the matlab doc. --- matlab.html.markdown | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/matlab.html.markdown b/matlab.html.markdown index ad42d9a9..9d78978e 100644 --- a/matlab.html.markdown +++ b/matlab.html.markdown @@ -123,6 +123,7 @@ x(2:end) % ans = 32 53 7 1 x = [4; 32; 53; 7; 1] % Column vector x = [1:10] % x = 1 2 3 4 5 6 7 8 9 10 +x = [1:2:10] % Increment by 2, i.e. x = 1 3 5 7 9 % Matrices A = [1 2 3; 4 5 6; 7 8 9] @@ -205,6 +206,8 @@ transpose(A) % Transpose the matrix, which is the same as: A one ctranspose(A) % Hermitian transpose the matrix % (the transpose, followed by taking complex conjugate of each element) +A' % Concise version of complex transpose +A.' % Concise version of transpose (without taking complex conjugate) @@ -254,6 +257,8 @@ axis equal % Set aspect ratio so data units are the same in every direction scatter(x, y); % Scatter-plot hist(x); % Histogram +stem(x); % Plot values as stems, useful for displaying discrete data +bar(x); % Plot bar graph z = sin(x); plot3(x,y,z); % 3D line plot @@ -400,7 +405,7 @@ exp(x) sqrt(x) log(x) log10(x) -abs(x) +abs(x) %If x is complex, returns magnitude min(x) max(x) ceil(x) @@ -411,6 +416,14 @@ rand % Uniformly distributed pseudorandom numbers randi % Uniformly distributed pseudorandom integers randn % Normally distributed pseudorandom numbers +%Complex math operations +abs(x) % Magnitude of complex variable x +phase(x) % Phase (or angle) of complex variable x +real(x) % Returns the real part of x (i.e returns a if x = a +jb) +imag(x) % Returns the imaginary part of x (i.e returns b if x = a+jb) +conj(x) % Returns the complex conjugate + + % Common constants pi NaN @@ -465,6 +478,9 @@ median % median value mean % mean value std % standard deviation perms(x) % list all permutations of elements of x +find(x) % Finds all non-zero elements of x and returns their indexes, can use comparison operators, + % i.e. find( x == 3 ) returns indexes of elements that are equal to 3 + % i.e. find( x >= 3 ) returns indexes of elements greater than or equal to 3 % Classes From 4508ee45d8924ee7b17ec1fa856f4e273c1ca5c1 Mon Sep 17 00:00:00 2001 From: Ben Pious Date: Fri, 30 Oct 2015 21:40:19 -0700 Subject: [PATCH 550/685] Adds description of how to define generic classes in Xcode 7.0 --- objective-c.html.markdown | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/objective-c.html.markdown b/objective-c.html.markdown index f130ea0c..05bb5c6a 100644 --- a/objective-c.html.markdown +++ b/objective-c.html.markdown @@ -599,6 +599,52 @@ int main (int argc, const char * argv[]) { @end +// Starting in Xcode 7.0, you can create Generic classes, +// allowing you to provide greater type safety and clarity +// without writing excessive boilerplate. +@interface Result<__covariant A> : NSObject + +- (void)handleSuccess:(void(^)(A))success + failure:(void(^)(NSError *))failure; + +@property (nonatomic) A object; + +@end + +// we can now declare instances of this class like +Result *result; +Result *result; + +// Each of these cases would be equivalent to rewriting Result's interface +// and substituting the appropriate type for A +@interface Result : NSObject +- (void)handleSuccess:(void(^)(NSArray *))success + failure:(void(^)(NSError *))failure; +@property (nonatomic) NSArray * object; +@end + +@interface Result : NSObject +- (void)handleSuccess:(void(^)(NSNumber *))success + failure:(void(^)(NSError *))failure; +@property (nonatomic) NSNumber * object; +@end + +// It should be obvious, however, that writing one +// Class to solve a problem is always preferable to writing two + +// Note that Clang will not accept generic types in @implementations, +// so your @implemnation of Result would have to look like this: + +@implementation Result + +- (void)handleSuccess:(void (^)(id))success + failure:(void (^)(NSError *))failure { + // Do something +} + +@end + + /////////////////////////////////////// // Protocols /////////////////////////////////////// From 59e85e2f37373145bcde8025da2bde93eb49ec28 Mon Sep 17 00:00:00 2001 From: Willie Zhu Date: Sat, 31 Oct 2015 00:40:37 -0400 Subject: [PATCH 551/685] Make whitespace more consistent --- fsharp.html.markdown | 74 ++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/fsharp.html.markdown b/fsharp.html.markdown index b5c47ed7..d63b9f1d 100644 --- a/fsharp.html.markdown +++ b/fsharp.html.markdown @@ -31,14 +31,14 @@ If you want to try out the code below, you can go to [tryfsharp.org](http://www. // The "let" keyword defines an (immutable) value let myInt = 5 let myFloat = 3.14 -let myString = "hello" //note that no types needed +let myString = "hello" // note that no types needed // ------ Lists ------ -let twoToFive = [2;3;4;5] // Square brackets create a list with +let twoToFive = [2; 3; 4; 5] // Square brackets create a list with // semicolon delimiters. let oneToFive = 1 :: twoToFive // :: creates list with new 1st element -// The result is [1;2;3;4;5] -let zeroToFive = [0;1] @ twoToFive // @ concats two lists +// The result is [1; 2; 3; 4; 5] +let zeroToFive = [0; 1] @ twoToFive // @ concats two lists // IMPORTANT: commas are never used as delimiters, only semicolons! @@ -53,7 +53,7 @@ add 2 3 // Now run the function. // to define a multiline function, just use indents. No semicolons needed. let evens list = - let isEven x = x%2 = 0 // Define "isEven" as a sub function + let isEven x = x % 2 = 0 // Define "isEven" as a sub function List.filter isEven list // List.filter is a library function // with two parameters: a boolean function // and a list to work on @@ -75,7 +75,7 @@ let sumOfSquaresTo100piped = // you can define lambdas (anonymous functions) using the "fun" keyword let sumOfSquaresTo100withFun = - [1..100] |> List.map (fun x -> x*x) |> List.sum + [1..100] |> List.map (fun x -> x * x) |> List.sum // In F# there is no "return" keyword. A function always // returns the value of the last expression used. @@ -109,7 +109,7 @@ optionPatternMatch invalidValue // The printf/printfn functions are similar to the // Console.Write/WriteLine functions in C#. printfn "Printing an int %i, a float %f, a bool %b" 1 2.0 true -printfn "A string %s, and something generic %A" "hello" [1;2;3;4] +printfn "A string %s, and something generic %A" "hello" [1; 2; 3; 4] // There are also sprintf/sprintfn functions for formatting data // into a string, similar to String.Format in C#. @@ -131,19 +131,19 @@ module FunctionExamples = // basic usage of a function let a = add 1 2 - printfn "1+2 = %i" a + printfn "1 + 2 = %i" a // partial application to "bake in" parameters let add42 = add 42 let b = add42 1 - printfn "42+1 = %i" b + printfn "42 + 1 = %i" b // composition to combine functions let add1 = add 1 let add2 = add 2 let add3 = add1 >> add2 let c = add3 7 - printfn "3+7 = %i" c + printfn "3 + 7 = %i" c // higher order functions [1..10] |> List.map add3 |> printfn "new list is %A" @@ -151,7 +151,7 @@ module FunctionExamples = // lists of functions, and more let add6 = [add1; add2; add3] |> List.reduce (>>) let d = add6 7 - printfn "1+2+3+7 = %i" d + printfn "1 + 2 + 3 + 7 = %i" d // ================================================ // Lists and collection @@ -168,12 +168,12 @@ module FunctionExamples = module ListExamples = // lists use square brackets - let list1 = ["a";"b"] + let list1 = ["a"; "b"] let list2 = "c" :: list1 // :: is prepending let list3 = list1 @ list2 // @ is concat // list comprehensions (aka generators) - let squares = [for i in 1..10 do yield i*i] + let squares = [for i in 1..10 do yield i * i] // prime number generator let rec sieve = function @@ -190,8 +190,8 @@ module ListExamples = | [first; second] -> printfn "list is %A and %A" first second | _ -> printfn "the list has more than two elements" - listMatcher [1;2;3;4] - listMatcher [1;2] + listMatcher [1; 2; 3; 4] + listMatcher [1; 2] listMatcher [1] listMatcher [] @@ -219,7 +219,7 @@ module ListExamples = module ArrayExamples = // arrays use square brackets with bar - let array1 = [| "a";"b" |] + let array1 = [| "a"; "b" |] let first = array1.[0] // indexed access using dot // pattern matching for arrays is same as for lists @@ -230,13 +230,13 @@ module ArrayExamples = | [| first; second |] -> printfn "array is %A and %A" first second | _ -> printfn "the array has more than two elements" - arrayMatcher [| 1;2;3;4 |] + arrayMatcher [| 1; 2; 3; 4 |] // Standard library functions just as for List [| 1..10 |] - |> Array.map (fun i -> i+3) - |> Array.filter (fun i -> i%2 = 0) + |> Array.map (fun i -> i + 3) + |> Array.filter (fun i -> i % 2 = 0) |> Array.iter (printfn "value is %i. ") @@ -255,7 +255,7 @@ module SequenceExamples = yield! [5..10] yield! seq { for i in 1..10 do - if i%2 = 0 then yield i }} + if i % 2 = 0 then yield i }} // test strange |> Seq.toList @@ -280,11 +280,11 @@ module DataTypeExamples = // Tuples are quick 'n easy anonymous types // -- Use a comma to create a tuple - let twoTuple = 1,2 - let threeTuple = "a",2,true + let twoTuple = 1, 2 + let threeTuple = "a", 2, true // Pattern match to unpack - let x,y = twoTuple //sets x=1 y=2 + let x, y = twoTuple // sets x = 1, y = 2 // ------------------------------------ // Record types have named fields @@ -297,7 +297,7 @@ module DataTypeExamples = let person1 = {First="John"; Last="Doe"} // Pattern match to unpack - let {First=first} = person1 //sets first="John" + let {First = first} = person1 // sets first="John" // ------------------------------------ // Union types (aka variants) have a set of choices @@ -331,7 +331,7 @@ module DataTypeExamples = | Worker of Person | Manager of Employee list - let jdoe = {First="John";Last="Doe"} + let jdoe = {First="John"; Last="Doe"} let worker = Worker jdoe // ------------------------------------ @@ -383,8 +383,8 @@ module DataTypeExamples = type Rank = Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten | Jack | Queen | King | Ace - let hand = [ Club,Ace; Heart,Three; Heart,Ace; - Spade,Jack; Diamond,Two; Diamond,Ace ] + let hand = [ Club, Ace; Heart, Three; Heart, Ace; + Spade, Jack; Diamond, Two; Diamond, Ace ] // sorting List.sort hand |> printfn "sorted hand is (low to high) %A" @@ -419,7 +419,7 @@ module ActivePatternExamples = | _ -> printfn "%c is something else" ch // print a list - ['a';'b';'1';' ';'-';'c'] |> List.iter printChar + ['a'; 'b'; '1'; ' '; '-'; 'c'] |> List.iter printChar // ----------------------------------- // FizzBuzz using active patterns @@ -479,7 +479,7 @@ module AlgorithmExamples = List.concat [smallerElements; [firstElem]; largerElements] // test - sort [1;5;23;18;9;1;3] |> printfn "Sorted = %A" + sort [1; 5; 23; 18; 9; 1; 3] |> printfn "Sorted = %A" // ================================================ // Asynchronous Code @@ -536,7 +536,7 @@ module NetCompatibilityExamples = // ------- work with existing library functions ------- - let (i1success,i1) = System.Int32.TryParse("123"); + let (i1success, i1) = System.Int32.TryParse("123"); if i1success then printfn "parsed as %i" i1 else printfn "parse failed" // ------- Implement interfaces on the fly! ------- @@ -570,12 +570,12 @@ module NetCompatibilityExamples = // abstract base class with virtual methods [] type Shape() = - //readonly properties + // readonly properties abstract member Width : int with get abstract member Height : int with get - //non-virtual method + // non-virtual method member this.BoundingArea = this.Height * this.Width - //virtual method with base implementation + // virtual method with base implementation abstract member Print : unit -> unit default this.Print () = printfn "I'm a shape" @@ -586,19 +586,19 @@ module NetCompatibilityExamples = override this.Height = y override this.Print () = printfn "I'm a Rectangle" - //test - let r = Rectangle(2,3) + // test + let r = Rectangle(2, 3) printfn "The width is %i" r.Width printfn "The area is %i" r.BoundingArea r.Print() // ------- extension methods ------- - //Just as in C#, F# can extend existing classes with extension methods. + // Just as in C#, F# can extend existing classes with extension methods. type System.String with member this.StartsWithA = this.StartsWith "A" - //test + // test let s = "Alice" printfn "'%s' starts with an 'A' = %A" s s.StartsWithA From 34c7c6acb22c934f879a353f3ba92b38b602f7fc Mon Sep 17 00:00:00 2001 From: Andy Date: Sat, 31 Oct 2015 16:57:22 +1030 Subject: [PATCH 552/685] Fixed typo at BigInteger assignment --- java.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java.html.markdown b/java.html.markdown index 1813f81c..901e2dad 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -128,7 +128,7 @@ public class LearnJava { // // BigInteger can be initialized using an array of bytes or a string. - BigInteger fooBigInteger = new BigDecimal(fooByteArray); + BigInteger fooBigInteger = new BigInteger(fooByteArray); // BigDecimal - Immutable, arbitrary-precision signed decimal number From 5bda926dcc79dea4e936cc752fd1ff00e29d71bb Mon Sep 17 00:00:00 2001 From: Elijah Karari Date: Sat, 31 Oct 2015 09:47:55 +0300 Subject: [PATCH 553/685] Minor correction calling li.index(2) with li as [1, 2, 3, 4, 5, 6] will return 1 not 3 --- python.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python.html.markdown b/python.html.markdown index 541bd36d..80cef828 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -238,7 +238,7 @@ li.remove(2) # Raises a ValueError as 2 is not in the list li.insert(1, 2) # li is now [1, 2, 3, 4, 5, 6] again # Get the index of the first item found -li.index(2) # => 3 +li.index(2) # => 1 li.index(7) # Raises a ValueError as 7 is not in the list # Check for existence in a list with "in" From ab1acb1bb265577ea4f189d203ac35726f02970a Mon Sep 17 00:00:00 2001 From: Elijah Karari Date: Sat, 31 Oct 2015 09:56:06 +0300 Subject: [PATCH 554/685] Updated tuple examples for clarity --- python.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python.html.markdown b/python.html.markdown index 541bd36d..b0add668 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -261,8 +261,9 @@ tup[:2] # => (1, 2) # You can unpack tuples (or lists) into variables a, b, c = (1, 2, 3) # a is now 1, b is now 2 and c is now 3 +d, e, f = 4, 5, 6 # you can leave out the parentheses # Tuples are created by default if you leave out the parentheses -d, e, f = 4, 5, 6 +g = 4, 5, 6 # => (4, 5, 6) # Now look how easy it is to swap two values e, d = d, e # d is now 5 and e is now 4 From f7af2da9dbb504377c2ff7c2f29a55b9f363a4c1 Mon Sep 17 00:00:00 2001 From: Andy Date: Sat, 31 Oct 2015 18:31:51 +1030 Subject: [PATCH 555/685] Added BigDecimal float constructor caveat --- java.html.markdown | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/java.html.markdown b/java.html.markdown index 1813f81c..d7d0199b 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -144,7 +144,12 @@ public class LearnJava { // or by initializing the unscaled value (BigInteger) and scale (int). BigDecimal fooBigDecimal = new BigDecimal(fooBigInteger, fooInt); - + + // Be wary of the constructor that takes a float or double as + // the inaccuracy of the float/double will be copied in BigDecimal. + // Prefer the String constructor when you need an exact value. + + BigDecimal tenCents = new BigDecimal("0.1"); // Strings From a38705757b95eb500d51e0dd0c5294b7aa76cada Mon Sep 17 00:00:00 2001 From: Abdul Alim Date: Sat, 31 Oct 2015 16:36:30 +0800 Subject: [PATCH 556/685] Added Bahasa Malaysia translation of the JavaScript file --- ms-my/javascript-my.html.markdown | 588 ++++++++++++++++++++++++++++++ 1 file changed, 588 insertions(+) create mode 100644 ms-my/javascript-my.html.markdown diff --git a/ms-my/javascript-my.html.markdown b/ms-my/javascript-my.html.markdown new file mode 100644 index 00000000..90e37133 --- /dev/null +++ b/ms-my/javascript-my.html.markdown @@ -0,0 +1,588 @@ +--- +language: javascript +contributors: + - ["Adam Brenecki", "http://adam.brenecki.id.au"] + - ["Ariel Krakowski", "http://www.learneroo.com"] +filename: javascript-ms.js +translators: + - ["abdalim", "https://github.com/abdalim"] +lang: ms-my +--- + +Javascript dicipta oleh Brendan Eich dari Netscape pada 1995. Pada awalnya, ia +dicipta sebagai bahasa skrip yang ringkas untuk laman web, melengkapi penggunaan +Java untuk aplikasi web yang lebih rumit, namun begitu, integrasi rapat pada +halaman web dan sokongan tersedia dalam pelayar web telah menyebabkan ia menjadi +lebih kerap digunakan berbanding Java pada bahagian hadapan laman web. + +Namun begitu, Javascript tidak terhad pada pelayar web; Node.js, sebuah projek +yang menyediakan 'runtime' berdiri sendiri untuk enjin V8 Google Chrome sedang +kian mendapat sambutan yang hangat. + +```js +// Komentar adalah seperti dalam C. Komentar sebaris bermula dengan dua sengkang +/* dan komentar banyak baris bermula dengan sengkang-bintang + dan berakhir dengan bintang-sengkang */ + +// Pernyataan boleh ditamatkan dengan ';' +doStuff(); + +// ... tetapi ia tidak wajib, kerana koma bertitik secara automatik akan +// dimasukkan dimana tempat yang ada baris baru, kecuali dalam kes - kes +// tertentu. +doStuff() + +// Disebabkan kes - kes itu boleh menyebabkan hasil yang tidak diduga, kami +// akan sentiasa menggunakan koma bertitik dalam panduan ini. + +/////////////////////////////////// +// 1. Nombor, String dan Operator + +// Javascript mempunyai satu jenis nombor (iaitu 64-bit IEEE 754 double). +// Double mempunyai 52-bit mantissa, iaitu ia cukup untuk menyimpan integer +// sehingga 9✕10¹⁵ secara tepatnya. +3; // = 3 +1.5; // = 1.5 + +// Sebahagian aritmetic asas berfungsi seperti yang anda jangkakan. +1 + 1; // = 2 +0.1 + 0.2; // = 0.30000000000000004 +8 - 1; // = 7 +10 * 2; // = 20 +35 / 5; // = 7 + +// Termasuk pembahagian tidak rata. +5 / 2; // = 2.5 + +// Dan pembahagian modulo. +10 % 2; // = 0 +30 % 4; // = 2 +18.5 % 7; // = 4.5 + +// Operasi bitwise juga boleh digunakan; bila anda melakukan operasi bitwise, +// float anda akan ditukarkan kepada int bertanda *sehingga* 32 bit. +1 << 2; // = 4 + +// Keutamaan ditekankan menggunakan kurungan. +(1 + 3) * 2; // = 8 + +// Terdapat tiga nilai nombor-tidak-nyata istimewa +Infinity; // hasil operasi seperti 1/0 +-Infinity; // hasil operasi seperti -1/0 +NaN; // hasil operasi seperti 0/0, bermaksud 'Bukan Sebuah Nombor' + +// Terdapat juga jenis boolean +true; +false; + +// Talian dicipta dengan ' atau ''. +'abc'; +"Hello, world"; + +// Penafian menggunakan simbol ! +!true; // = tidak benar +!false; // = benar + +// Sama ialah === +1 === 1; // = benar +2 === 1; // = tidak benar + +// Tidak sama ialah !== +1 !== 1; // = tidak benar +2 !== 1; // = benar + +// Lagi perbandingan +1 < 10; // = benar +1 > 10; // = tidak benar +2 <= 2; // = benar +2 >= 2; // = benar + +// Talian disambungkan dengan + +"Hello " + "world!"; // = "Hello world!" + +// dan dibandingkan dengan < dan > +"a" < "b"; // = benar + +// Paksaan jenis dilakukan untuk perbandingan menggunakan dua sama dengan... +"5" == 5; // = benar +null == undefined; // = benar + +// ...melainkan anda menggunakan === +"5" === 5; // = tidak benar +null === undefined; // = tidak benar + +// ...yang boleh menghasilkan keputusan yang pelik... +13 + !0; // 14 +"13" + !0; // '13true' + +// Anda boleh akses huruf dalam perkataan dengan `charAt` +"This is a string".charAt(0); // = 'T' + +// ...atau menggunakan `substring` untuk mendapatkan bahagian yang lebih besar. +"Hello world".substring(0, 5); // = "Hello" + +// `length` adalah ciri, maka jangan gunakan (). +"Hello".length; // = 5 + +// Selain itu, terdapat juga `null` dan `undefined`. +null; // digunakan untuk menandakan bukan-nilai yang disengajakan +undefined; // digunakan untuk menandakan nilai yang tidak wujud pada waktu ini (walaupun `undefined` adalah nilai juga) + +// false, null, undefined, NaN, 0 dan "" adalah tidak benar; semua selain itu adalah benar. +// Peringatan, 0 adalah tidak benar dan "0" adalah benar, walaupun 0 == "0". + +/////////////////////////////////// +// 2. Pembolehubah, Array dan Objek + +// Pembolehubah digunakan dengan kata kunci 'var'. Javascript ialah sebuah +// bahasa aturcara yang jenisnya dinamik, maka anda tidak perlu spesifikasikan +// jenis pembolehubah. Penetapan menggunakan satu '=' karakter. +var someVar = 5; + +// jika anda tinggalkan kata kunci var, anda tidak akan dapat ralat... +someOtherVar = 10; + +// ...tetapi pembolehubah anda akan dicipta di dalam skop global, bukan di +// dalam skop anda menciptanya. + +// Pembolehubah yang dideklarasikan tanpa ditetapkan sebarang nilai akan +// ditetapkan kepada undefined. +var someThirdVar; // = undefined + +// jika anda ingin mendeklarasikan beberapa pembolehubah, maka anda boleh +// menggunakan koma sebagai pembahagi +var someFourthVar = 2, someFifthVar = 4; + +// Terdapat cara mudah untuk melakukan operasi - operasi matematik pada +// pembolehubah: +someVar += 5; // bersamaan dengan someVar = someVar +5; someVar sama dengan 10 sekarang +someVar *= 10; // sekarang someVar bernilai 100 + +// dan cara lebih mudah untuk penambahan atau penolakan 1 +someVar++; // sekarang someVar ialah 101 +someVar--; // kembali kepada 100 + +// Array adalah senarai nilai yang tersusun, yang boleh terdiri daripada +// pembolehubah pelbagai jenis. +var myArray = ["Hello", 45, true]; + +// Setiap ahli array boleh diakses menggunakan syntax kurungan-petak. +// Indeks array bermula pada sifar. +myArray[1]; // = 45 + +// Array boleh diubah dan mempunyai panjang yang tidak tetap dan boleh ubah. +myArray.push("World"); +myArray.length; // = 4 + +// Tambah/Ubah di index yang spesifik +myArray[3] = "Hello"; + +// Objek javascript adalah sama dengan "dictionaries" atau "maps" dalam bahasa +// aturcara yang lain: koleksi pasangan kunci-nilai yang tidak mempunyai +// sebarang susunan. +var myObj = {key1: "Hello", key2: "World"}; + +// Kunci adalah string, tetapi 'quote' tidak diperlukan jika ia adalah pengecam +// javascript yang sah. Nilai boleh mempunyai sebarang jenis. +var myObj = {myKey: "myValue", "my other key": 4}; + +// Ciri - ciri objek boleh juga diakses menggunakan syntax subskrip (kurungan- +// petak), +myObj["my other key"]; // = 4 + +// ... atau menggunakan syntax titik, selagi kuncinya adalah pengecam yang sah. +myObj.myKey; // = "myValue" + +// Objek adalah boleh diubah; nilai boleh diubah dan kunci baru boleh ditambah. +myObj.myThirdKey = true; + +// Jika anda cuba untuk akses nilai yang belum ditetapkan, anda akan mendapat +// undefined. +myObj.myFourthKey; // = undefined + +/////////////////////////////////// +// 3. Logik dan Struktur Kawalan + +// Syntax untuk bahagian ini adalah hampir sama dengan Java. + +// Struktur `if` berfungsi seperti yang anda jangkakan. +var count = 1; +if (count == 3){ + // dinilai jika count ialah 3 +} else if (count == 4){ + // dinilai jika count ialah 4 +} else { + // dinilai jika count bukan 3 atau 4 +} + +// Sama juga dengan `while`. +while (true){ + // Sebuah ulangan yang tidak terhingga! + // An infinite loop! +} + +// Ulangan do-while adalah sama dengan ulangan while, kecuali ia akan diulang +// sekurang-kurangnya sekali. +var input; +do { + input = getInput(); +} while (!isValid(input)) + +// Ulangan `for` adalah sama dengan C dan Java: +// Persiapan; kondisi untuk bersambung; pengulangan. +for (var i = 0; i < 5; i++){ + // akan berulang selama 5 kali +} + +// Pernyataan ulangan For/In akan mengulang setiap ciri seluruh jaringan +// 'prototype' +var description = ""; +var person = {fname:"Paul", lname:"Ken", age:18}; +for (var x in person){ + description += person[x] + " "; +} + +// Jika anda cuma mahu mengambil kira ciri - ciri yang ditambah pada objek it +// sendiri dan bukan 'prototype'nya, sila gunakan semakan hasOwnProperty() +var description = ""; +var person = {fname:"Paul", lname:"Ken", age:18}; +for (var x in person){ + if (person.hasOwnProperty(x)){ + description += person[x] + " "; + } +} + +// for/in tidak sepatutnya digunakan untuk mengulang sebuah Array di mana +// indeks susunan adalah penting. +// Tiada sebarang jaminan bahawa for/in akan mengembalikan indeks dalam +// mana - mana susunan + +// && adalah logikal dan, || adalah logikal atau +if (house.size == "big" && house.colour == "blue"){ + house.contains = "bear"; +} +if (colour == "red" || colour == "blue"){ + // warna adalah sama ada 'red' atau 'blue' +} + +// && dan || adalah "lintar pintas", di mana ia berguna untuk menetapkan +// nilai asal. +var name = otherName || "default"; + + +// Pernyataan `switch` menyemak persamaan menggunakan `===`. +// gunakan pernyataan `break` selepas setiap kes +// atau tidak, kes - kes selepas kes yang betul akan dijalankan juga. +grade = 'B'; +switch (grade) { + case 'A': + console.log("Great job"); + break; + case 'B': + console.log("OK job"); + break; + case 'C': + console.log("You can do better"); + break; + default: + console.log("Oy vey"); + break; +} + + +/////////////////////////////////// +// 4. Functions, Skop dan Closures + +// Function javascript dideklarasikan dengan kata kunci `function`. +function myFunction(thing){ + return thing.toUpperCase(); +} +myFunction("foo"); // = "FOO" + +// Perhatikan yang nilai yang dikembalikan mesti bermula pada baris yang sama +// dengan kata kunci `return`, jika tidak, anda akan sentiasa mengembalikan +// `undefined` disebabkan kemasukan 'semicolon' secara automatik. Sila berjaga - +// jaga dengan hal ini apabila menggunakan Allman style. +function myFunction(){ + return // <- semicolon dimasukkan secara automatik di sini + {thisIsAn: 'object literal'} +} +myFunction(); // = undefined + +// Function javascript adalah objek kelas pertama, maka ia boleh diberikan +// nama pembolehubah yang lain dan diberikan kepada function yang lain sebagai +// input - sebagai contoh, apabila membekalkan pengendali event: +function myFunction(){ + // kod ini akan dijalankan selepas 5 saat +} +setTimeout(myFunction, 5000); +// Nota: setTimeout bukan sebahagian daripada bahasa JS, tetapi ia disediakan +// oleh pelayar web dan Node.js. + +// Satu lagi function yang disediakan oleh pelayar web adalah setInterval +function myFunction(){ + // kod ini akan dijalankan setiap 5 saat +} +setInterval(myFunction, 5000); + +// Objek function tidak perlu dideklarasikan dengan nama - anda boleh menulis +// function yang tidak bernama didalam input sebuah function lain. +setTimeout(function(){ + // kod ini akan dijalankan dalam 5 saat +}, 5000); + +// Javascript mempunyai skop function; function mempunyai skop mereka +// tersendiri tetapi blok tidak. +if (true){ + var i = 5; +} +i; // = 5 - bukan undefined seperti yang anda jangkakan di dalam bahasa blok-skop + +// Ini telah menyebabkan corak biasa iaitu "immediately-executing anonymous +// functions", yang mengelakkan pembolehubah sementara daripada bocor ke +// skop global. +(function(){ + var temporary = 5; + // Kita boleh akses skop global dengan menetapkan nilai ke "objek global", + // iaitu dalam pelayar web selalunya adalah `window`. Objek global mungkin + // mempunyai nama yang berlainan dalam alam bukan pelayar web seperti Node.js. + window.permanent = 10; +})(); +temporary; // akan menghasilkan ralat ReferenceError +permanent; // = 10 + +// Salah satu ciri terhebat Javascript ialah closure. Jika sebuah function +// didefinisikan di dalam sebuah function lain, function yang di dalam akan +// mempunyai akses kepada semua pembolehubah function yang di luar, mahupun +// selepas function yang di luar tersebut selesai. +function sayHelloInFiveSeconds(name){ + var prompt = "Hello, " + name + "!"; + // Function dalam diletakkan di dalam skop lokal secara asal, seperti + // ia dideklarasikan dengan `var`. + function inner(){ + alert(prompt); + } + setTimeout(inner, 5000); + // setTimeout adalah tak segerak atau asinkroni, maka function sayHelloInFiveSeconds akan selesai serta merta, dan setTimeout akan memanggil + // inner selepas itu. Walaubagaimanapun, disebabkan inner terletak didalam + // sayHelloInFiveSeconds, inner tetap mempunyai akses kepada pembolehubah + // `prompt` apabila ia dipanggil. +} +sayHelloInFiveSeconds("Adam"); // akan membuka sebuah popup dengan "Hello, Adam!" selepas 5s + +/////////////////////////////////// +// 5. Lagi tentang Objek, Constructor dan Prototype + +// Objek boleh mengandungi function. +var myObj = { + myFunc: function(){ + return "Hello world!"; + } +}; +myObj.myFunc(); // = "Hello world!" + +// Apabila function sesebuah object dipanggil, ia boleh mengakses objek asalnya +// dengan menggunakan kata kunci `this`. +myObj = { + myString: "Hello world!", + myFunc: function(){ + return this.myString; + } +}; +myObj.myFunc(); // = "Hello world!" + +// Nilai sebenar yang ditetapkan kepada this akan ditentukan oleh bagaimana +// sesebuah function itu dipanggil, bukan dimana ia didefinisikan. Oleh it, +// sesebuah function tidak akan berfungsi jika ia dipanggil bukan pada konteks +// objeknya. +var myFunc = myObj.myFunc; +myFunc(); // = undefined + +// Sebaliknya, sebuah function boleh ditetapkan kepada objek dan mendapat akses +// kepada objek itu melalui `this`, walaupun ia tidak ditetapkan semasa ia +// didefinisikan. +var myOtherFunc = function(){ + return this.myString.toUpperCase(); +} +myObj.myOtherFunc = myOtherFunc; +myObj.myOtherFunc(); // = "HELLO WORLD!" + +// Kita juga boleh menentukan konteks untuk sebuah function dijalankan apabila +// ia dipanggil menggunakan `call` atau `apply`. + +var anotherFunc = function(s){ + return this.myString + s; +} +anotherFunc.call(myObj, " And Hello Moon!"); // = "Hello World! And Hello Moon!" + +// Function `apply` adalah hampir sama, tetapi ia mengambil sebuah array +// sebagai senarai input. + +anotherFunc.apply(myObj, [" And Hello Sun!"]); // = "Hello World! And Hello Sun!" + +// Ini sangat berguna apabila menggunakan sebuah function yang menerima senarai +// input dan anda mahu menggunakan sebuah array sebagai input. + +Math.min(42, 6, 27); // = 6 +Math.min([42, 6, 27]); // = NaN (uh-oh!) +Math.min.apply(Math, [42, 6, 27]); // = 6 + +// Tetapi, `call` dan `apply` adalah hanya sementara, sebagaimana hidup ini. +// Apabila kita mahu ia kekal, kita boleh menggunakan `bind`. + +var boundFunc = anotherFunc.bind(myObj); +boundFunc(" And Hello Saturn!"); // = "Hello World! And Hello Saturn!" + +// `bind` boleh juga digunakan untuk menggunakan sebuah function tidak +// sepenuhnya (curry). + +var product = function(a, b){ return a * b; } +var doubler = product.bind(this, 2); +doubler(8); // = 16 + +// Apabila anda memanggil sebuah function dengan kata kunci `new`, sebuah +// objek baru akan dicipta dan dijadikan tersedia kepada function itu melalui +// kata kunci `this`. Function yang direka bentuk untuk dipanggil sebegitu rupa +// dikenali sebagai constructors. + +var MyConstructor = function(){ + this.myNumber = 5; +} +myNewObj = new MyConstructor(); // = {myNumber: 5} +myNewObj.myNumber; // = 5 + +// Setiap objek JavaScript mempunyai `prototype`. Apabila anda akses sesuatu +// ciri sebuah objek yang tidak wujud dalam objek sebenar itu, interpreter akan +// mencari ciri itu didalam `prototype`nya. + +// Sebahagian implementasi JS membenarkan anda untuk akses prototype sebuah +// objek pada ciri istimewa `__proto__`. Walaupun ini membantu dalam menerangkan +// mengenai prototypes, ia bukan sebahagian dari piawai; kita akan melihat +// cara - cara piawai untuk menggunakan prototypes nanti. +var myObj = { + myString: "Hello world!" +}; +var myPrototype = { + meaningOfLife: 42, + myFunc: function(){ + return this.myString.toLowerCase() + } +}; + +myObj.__proto__ = myPrototype; +myObj.meaningOfLife; // = 42 + +// Ini berfungsi untuk function juga. +myObj.myFunc(); // = "hello world!" + +// Sudah pasti, jika ciri anda bukan pada prototype anda, prototype kepada +// prototype anda akan disemak, dan seterusnya. +myPrototype.__proto__ = { + myBoolean: true +}; +myObj.myBoolean; // = true + +// Tiada penyalinan terlibat disini; setiap objek menyimpan rujukan kepada +// prototypenya sendiri. Ini bermaksud, kita boleh mengubah prototypenya dan +// pengubahsuaian itu akan dilihat dan berkesan dimana sahaja. +myPrototype.meaningOfLife = 43; +myObj.meaningOfLife; // = 43 + +// Kami menyatakan yang `__proto__` adalah bukan piawai, dan tiada cara rasmi +// untuk mengubah prototype sesebuah objek. Walaubagaimanapun, terdapat dua +// cara untuk mencipta objek baru dengan sesebuah prototype. + +// Yang pertama ialah Object.create, yang merupakan tambahan terbaru pada JS, +// dan oleh itu tiada dalam semua implementasi buat masa ini. +var myObj = Object.create(myPrototype); +myObj.meaningOfLife; // = 43 + +// Cara kedua, yang boleh digunakan dimana sahaja, adalah berkaitan dengan +// constructor. Constructors mempunyai sebuah ciri yang dipanggil prototype. +// Ini *bukan* prototype constructor terbabit; tetapi, ia adalah prototype yang +// diberikan kepada objek baru apabila ia dicipta menggunakan constructor dan +// kata kunci new. +MyConstructor.prototype = { + myNumber: 5, + getMyNumber: function(){ + return this.myNumber; + } +}; +var myNewObj2 = new MyConstructor(); +myNewObj2.getMyNumber(); // = 5 +myNewObj2.myNumber = 6 +myNewObj2.getMyNumber(); // = 6 + +// Jenis yang terbina sedia seperti string dan nombor juga mempunyai constructor +// yang mencipta objek pembalut yang serupa. +var myNumber = 12; +var myNumberObj = new Number(12); +myNumber == myNumberObj; // = true + +// Kecuali, mereka sebenarnya tak sama sepenuhnya. +typeof myNumber; // = 'number' +typeof myNumberObj; // = 'object' +myNumber === myNumberObj; // = false +if (0){ + // Kod ini tidak akan dilaksanakan, kerana 0 adalah tidak benar. +} + +// Walaubagaimanapun, pembalut objek dan jenis terbina yang biasa berkongsi +// prototype, maka sebagai contoh, anda sebenarnya boleh menambah fungsi +// kepada string. +String.prototype.firstCharacter = function(){ + return this.charAt(0); +} +"abc".firstCharacter(); // = "a" + +// Fakta ini selalu digunakan dalam "polyfilling", iaitu melaksanakan fungsi +// baru JavaScript didalam subset JavaScript yang lama, supaya ia boleh +// digunakan di dalam persekitaran yang lama seperti pelayar web yang lama. + +// Sebagai contoh, kami menyatakan yang Object.create belum lagi tersedia +// di semua implementasi, tetapi kita masih boleh menggunakannya dengan polyfill: +if (Object.create === undefined){ // jangan ganti jika ia sudah wujud + Object.create = function(proto){ + // buat satu constructor sementara dengan prototype yang betul + var Constructor = function(){}; + Constructor.prototype = proto; + // kemudian gunakannya untuk mencipta objek baru yang diberikan + // prototype yang betul + return new Constructor(); + } +} +``` +## Bacaan Lanjut + +[Mozilla Developer Network][1] menyediakan dokumentasi yang sangat baik untuk +JavaScript kerana ia digunakan di dalam pelayar - pelayar web. Tambahan pula, +ia adalah sebuah wiki, maka, sambil anda belajar lebih banyak lagi, anda boleh +membantu orang lain dengan berkongsi pengetahuan anda. + +[A re-introduction to JavaScript][2] oleh MDN meliputi semua konsep yang +diterangkan di sini dengan lebih terperinci. Panduan ini menerangkan bahasa +aturcara JavaScript dengan agak mudah; jika anda mahu belajar lebih lanjut +tentang menggunakan JavaScript didalam laman web, mulakan dengan mempelajari +tentang [Document Object Model][3]. + +[Learn Javascript by Example and with Challenges][4] adalah variasi panduan ini +dengan cabaran yang tersedia pakai. + +[JavaScript Garden][5] pula adalah panduan yang lebih terperinci mengenai +semua bahagian bahasa aturcara ini yang bertentangan dengan naluri atau +kebiasaan. + +[JavaScript: The Definitive Guide][6] adalah panduan klasik dan buku rujukan. + +Selain daripada penyumbang terus kepada artikel ini, sebahagian kandungannya +adalah adaptasi daripada tutorial Python Louie Dinh di dalam laman web ini, +dan [JS Tutorial][7] di Mozilla Developer Network. + + +[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript +[2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript +[3]: https://developer.mozilla.org/en-US/docs/Using_the_W3C_DOM_Level_1_Core +[4]: http://www.learneroo.com/modules/64/nodes/350 +[5]: http://bonsaiden.github.io/JavaScript-Garden/ +[6]: http://www.amazon.com/gp/product/0596805527/ +[7]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript From 4593c65543eec73688acf999c4bab002116909b0 Mon Sep 17 00:00:00 2001 From: Andy Date: Sat, 31 Oct 2015 19:39:26 +1030 Subject: [PATCH 557/685] Improved int division comment and code --- java.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java.html.markdown b/java.html.markdown index 1813f81c..966aee15 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -207,8 +207,8 @@ public class LearnJava { System.out.println("1+2 = " + (i1 + i2)); // => 3 System.out.println("2-1 = " + (i2 - i1)); // => 1 System.out.println("2*1 = " + (i2 * i1)); // => 2 - System.out.println("1/2 = " + (i1 / i2)); // => 0 (0.5 truncated down) - System.out.println("1/2 = " + (i1 / (i2*1.0))); // => 0.5 + System.out.println("1/2 = " + (i1 / i2)); // => 0 (int/int returns an int) + System.out.println("1/2 = " + (i1 / (double)i2)); // => 0.5 // Modulo System.out.println("11%3 = "+(11 % 3)); // => 2 From 231b60b7c0c21e2f76a3dfc0939abe1b7efbfad3 Mon Sep 17 00:00:00 2001 From: Andy Date: Sat, 31 Oct 2015 20:05:05 +1030 Subject: [PATCH 558/685] Added missing new in HashSet instantiation --- java.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java.html.markdown b/java.html.markdown index 966aee15..2836f601 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -416,7 +416,7 @@ public class LearnJava { // easier way, by using something that is called Double Brace // Initialization. - private static final Set COUNTRIES = HashSet() {{ + private static final Set COUNTRIES = new HashSet() {{ add("DENMARK"); add("SWEDEN"); add("FINLAND"); From b5cb14703ac99e70ecd6c1ec2abd9a2b5dbde54d Mon Sep 17 00:00:00 2001 From: Niko Weh Date: Sat, 31 Oct 2015 19:44:04 +1000 Subject: [PATCH 559/685] Haskell: Fix !! operator - Use a finite list, as infinite lists are not introduced yet - Use a list starting from 1 instead of 0, to make it obvious that the element returned comes from the list (and is not the second argument to !!). --- haskell.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haskell.html.markdown b/haskell.html.markdown index 08611e63..936744a0 100644 --- a/haskell.html.markdown +++ b/haskell.html.markdown @@ -81,7 +81,7 @@ not False -- True [5,4..1] -- [5, 4, 3, 2, 1] -- indexing into a list -[0..] !! 5 -- 5 +[1..10] !! 3 -- 4 -- You can also have infinite lists in Haskell! [1..] -- a list of all the natural numbers From deb62f41467fc94513b9adbef3a2cbb1e03cb220 Mon Sep 17 00:00:00 2001 From: Niko Weh Date: Sat, 31 Oct 2015 20:20:01 +1000 Subject: [PATCH 560/685] [haskell/de] Synchronized with english version Added changes from a7b8858 to HEAD (b5cb14703) to the german version, where appropiate. --- de-de/haskell-de.html.markdown | 63 +++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/de-de/haskell-de.html.markdown b/de-de/haskell-de.html.markdown index 2c548961..41b80d95 100644 --- a/de-de/haskell-de.html.markdown +++ b/de-de/haskell-de.html.markdown @@ -5,6 +5,7 @@ contributors: - ["Adit Bhargava", "http://adit.io"] translators: - ["Henrik Jürges", "https://github.com/santifa"] + - ["Nikolai Weh", "http://weh.hamburg"] filename: haskell-de.hs --- @@ -64,6 +65,7 @@ not False -- True "Hello " ++ "world!" -- "Hello world!" -- Ein String ist eine Liste von Zeichen. +['H', 'a', 'l', 'l', 'o', '!'] -- "Hallo!" "Das ist eine String" !! 0 -- 'D' @@ -76,6 +78,18 @@ not False -- True [1, 2, 3, 4, 5] [1..5] +-- Die zweite Variante nennt sich die "range"-Syntax. +-- Ranges sind recht flexibel: +['A'..'F'] -- "ABCDEF" + +-- Es ist möglich eine Schrittweite anzugeben: +[0,2..10] -- [0,2,4,6,8,10] +[5..1] -- [], da Haskell standardmässig inkrementiert. +[5,4..1] -- [5,4,3,2,1] + +-- Der "!!"-Operator extrahiert das Element an einem bestimmten Index: +[1..10] !! 3 -- 4 + -- Haskell unterstuetzt unendliche Listen! [1..] -- Die Liste aller natuerlichen Zahlen @@ -95,9 +109,6 @@ not False -- True -- Ein Element als Head hinzufuegen 0:[1..5] -- [0, 1, 2, 3, 4, 5] --- Gibt den 5. Index zurueck -[0..] !! 5 -- 5 - -- Weitere Listenoperationen head [1..5] -- 1 tail [1..5] -- [2, 3, 4, 5] @@ -114,7 +125,8 @@ last [1..5] -- 5 -- Ein Tupel: ("haskell", 1) --- Auf Elemente eines Tupels zugreifen: +-- Ein Paar (Pair) ist ein Tupel mit 2 Elementen, auf die man wie folgt +-- zugreifen kann: fst ("haskell", 1) -- "haskell" snd ("haskell", 1) -- 1 @@ -142,7 +154,7 @@ add 1 2 -- 3 -- Guards sind eine einfache Möglichkeit fuer Fallunterscheidungen. fib x - | x < 2 = x + | x < 2 = 1 | otherwise = fib (x - 1) + fib (x - 2) -- Pattern Matching funktioniert ähnlich. @@ -190,23 +202,28 @@ foo 5 -- 15 -- Funktionskomposition -- Die (.) Funktion verkettet Funktionen. -- Zum Beispiel, die Funktion Foo nimmt ein Argument addiert 10 dazu und --- multipliziert dieses Ergebnis mit 5. -foo = (*5) . (+10) +-- multipliziert dieses Ergebnis mit 4. +foo = (*4) . (+10) --- (5 + 10) * 5 = 75 -foo 5 -- 75 +-- (5 + 10) * 4 = 60 +foo 5 -- 60 --- Haskell hat eine Funktion `$`. Diese ändert den Vorrang, --- so dass alles links von ihr zuerst berechnet wird und --- und dann an die rechte Seite weitergegeben wird. --- Mit `.` und `$` kann man sich viele Klammern ersparen. +-- Haskell hat einen Operator `$`, welcher Funktionsapplikation durchfuehrt. +-- Im Gegenzug zu der Standard-Funktionsapplikation, welche linksassoziativ ist +-- und die höchstmögliche Priorität von "10" hat, ist der `$`-Operator +-- rechtsassoziativ und hat die Priorität 0. Dieses hat (idr.) den Effekt, +-- dass der `komplette` Ausdruck auf der rechten Seite als Parameter für die +-- Funktion auf der linken Seite verwendet wird. +-- Mit `.` und `$` kann man sich so viele Klammern ersparen. --- Vorher -(even (fib 7)) -- true +(even (fib 7)) -- false --- Danach -even . fib $ 7 -- true +-- Äquivalent: +even $ fib 7 -- false + +-- Funktionskomposition: +even . fib $ 7 -- false ---------------------------------------------------- -- 5. Typensystem @@ -233,19 +250,19 @@ double :: Integer -> Integer double x = x * 2 ---------------------------------------------------- --- 6. If-Anweisung und Kontrollstrukturen +-- 6. If-Ausdrücke und Kontrollstrukturen ---------------------------------------------------- --- If-Anweisung: +-- If-Ausdruck: haskell = if 1 == 1 then "awesome" else "awful" -- haskell = "awesome" --- If-Anweisungen können auch ueber mehrere Zeilen verteilt sein. --- Das Einruecken ist dabei äußerst wichtig. +-- If-Ausdrücke können auch über mehrere Zeilen verteilt sein. +-- Die Einrückung ist dabei wichtig. haskell = if 1 == 1 then "awesome" else "awful" --- Case-Anweisung: Zum Beispiel "commandline" Argumente parsen. +-- Case-Ausdruck: Am Beispiel vom Parsen von "commandline"-Argumenten. case args of "help" -> printHelp "start" -> startProgram @@ -276,7 +293,7 @@ foldl (\x y -> 2*x + y) 4 [1,2,3] -- 43 foldr (\x y -> 2*x + y) 4 [1,2,3] -- 16 -- die Abarbeitung sieht so aus: -(2 * 3 + (2 * 2 + (2 * 1 + 4))) +(2 * 1 + (2 * 2 + (2 * 3 + 4))) ---------------------------------------------------- -- 7. Datentypen From 093c3e656242e84682da7910e8d56db62c08ca10 Mon Sep 17 00:00:00 2001 From: Andy Date: Sat, 31 Oct 2015 20:52:07 +1030 Subject: [PATCH 561/685] Formatted enum comments --- java.html.markdown | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/java.html.markdown b/java.html.markdown index e1efc375..84978ecc 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -706,10 +706,12 @@ public abstract class Mammal() // Enum Type // -// An enum type is a special data type that enables for a variable to be a set of predefined constants. The // variable must be equal to one of the values that have been predefined for it. -// Because they are constants, the names of an enum type's fields are in uppercase letters. -// In the Java programming language, you define an enum type by using the enum keyword. For example, you would -// specify a days-of-the-week enum type as: +// An enum type is a special data type that enables for a variable to be a set +// of predefined constants. The variable must be equal to one of the values that +// have been predefined for it. Because they are constants, the names of an enum +// type's fields are in uppercase letters. In the Java programming language, you +// define an enum type by using the enum keyword. For example, you would specify +// a days-of-the-week enum type as: public enum Day { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, From 4545257ce36075b7dfeb12244fd38c1614895ae6 Mon Sep 17 00:00:00 2001 From: Elie Moreau Date: Sat, 31 Oct 2015 21:23:35 +1100 Subject: [PATCH 562/685] Closed a comment that was not properly closed --- css.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css.html.markdown b/css.html.markdown index d8f30ca3..e824914c 100644 --- a/css.html.markdown +++ b/css.html.markdown @@ -29,7 +29,7 @@ The main focus of this article is on the syntax and some general tips. #################### */ /* the selector is used to target an element on a page. -selector { property: value; /* more properties...*/ } +selector { property: value; /* more properties...*/ } */ /* Here is an example element: From fb5365ec8fcc898cba845b2194ab51fec57e84bb Mon Sep 17 00:00:00 2001 From: Adam Bard Date: Sat, 31 Oct 2015 18:26:19 +0800 Subject: [PATCH 563/685] Revert "Closed a comment that was not properly closed" --- css.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css.html.markdown b/css.html.markdown index e824914c..d8f30ca3 100644 --- a/css.html.markdown +++ b/css.html.markdown @@ -29,7 +29,7 @@ The main focus of this article is on the syntax and some general tips. #################### */ /* the selector is used to target an element on a page. -selector { property: value; /* more properties...*/ } */ +selector { property: value; /* more properties...*/ } /* Here is an example element: From 0156044d6f4f0630e1f82989b905a9f2a625e1a7 Mon Sep 17 00:00:00 2001 From: Kristy Vuong Date: Sat, 31 Oct 2015 21:29:46 +1100 Subject: [PATCH 564/685] Added fullstops at the end of most lines --- markdown.html.markdown | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/markdown.html.markdown b/markdown.html.markdown index 2333110f..b3284e71 100644 --- a/markdown.html.markdown +++ b/markdown.html.markdown @@ -11,7 +11,7 @@ Give me as much feedback as you want! / Feel free to fork and pull request! ```markdown - +text you want to be in that element by a number of hashes (#). --> # This is an

## This is an

### This is an

@@ -31,7 +31,7 @@ text you want to be in that element by a number of hashes (#) --> ##### This is an

###### This is an
- + This is an h1 ============= @@ -39,7 +39,7 @@ This is an h2 ------------- - + *This text is in italics.* _And so is this text._ @@ -85,7 +85,7 @@ There's a
above me! > How neat is that? - + * Item * Item @@ -103,21 +103,21 @@ or - Item - One last item - + 1. Item one 2. Item two 3. Item three +render the numbers in order, but this may not be a good idea. --> 1. Item one 1. Item two 1. Item three - + 1. Item one 2. Item two @@ -136,13 +136,13 @@ This checkbox below will be a checked HTML checkbox. +a line with four spaces or a tab. --> This is code So is this +inside your code. --> my_array.each do |item| puts item @@ -152,7 +152,7 @@ inside your code --> John didn't even know what the `go_to()` function did! - + \`\`\`ruby def foobar @@ -174,11 +174,11 @@ with or without spaces. --> +the text to display in hard brackets [] followed by the url in parentheses (). --> [Click me!](http://test.com/) - + [Click me!](http://test.com/ "Link to Test.com") @@ -186,7 +186,7 @@ the text to display in hard brackets [] followed by the url in parentheses () -- [Go to music](/music/). - + [Click this link][link1] for more info about it! [Also check out this link][foobar] if you want to. @@ -198,7 +198,7 @@ the text to display in hard brackets [] followed by the url in parentheses () -- entirely. The references can be anywhere in your document and the reference IDs can be anything so long as they are unique. --> - + [This][] is a link. @@ -211,7 +211,7 @@ can be anything so long as they are unique. --> ![This is the alt-attribute for my image](http://imgur.com/myimage.jpg "An optional title") - + ![This is the alt-attribute.][myimage] @@ -233,7 +233,7 @@ I want to type *this text surrounded by asterisks* but I don't want it to be in italics, so I do this: \*this text surrounded by asterisks\*. - + Your computer crashed? Try sending a Ctrl+Alt+Del From fd16cf95ae0a96424f1cd78ffb3ac99138eda4ff Mon Sep 17 00:00:00 2001 From: Niko Weh Date: Sat, 31 Oct 2015 20:57:30 +1000 Subject: [PATCH 565/685] [haskell/de] [yaml/de] Fix umlauts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced ae/oe/ue with ä/ö/ü where appropriate. I did a "grep" in the de-de directory, i've only found problems in haskell and yaml files. --- de-de/haskell-de.html.markdown | 40 +++++++++++++++++----------------- de-de/yaml-de.html.markdown | 4 ++-- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/de-de/haskell-de.html.markdown b/de-de/haskell-de.html.markdown index 41b80d95..d1a0008e 100644 --- a/de-de/haskell-de.html.markdown +++ b/de-de/haskell-de.html.markdown @@ -59,7 +59,7 @@ not False -- True -- Strings und Zeichen "Das ist ein String." 'a' -- Zeichen -'Einfache Anfuehrungszeichen gehen nicht.' -- error! +'Einfache Anführungszeichen gehen nicht.' -- error! -- Strings können konkateniert werden. "Hello " ++ "world!" -- "Hello world!" @@ -90,11 +90,11 @@ not False -- True -- Der "!!"-Operator extrahiert das Element an einem bestimmten Index: [1..10] !! 3 -- 4 --- Haskell unterstuetzt unendliche Listen! -[1..] -- Die Liste aller natuerlichen Zahlen +-- Haskell unterstützt unendliche Listen! +[1..] -- Die Liste aller natürlichen Zahlen -- Unendliche Listen funktionieren in Haskell, da es "lazy evaluation" --- unterstuetzt. Haskell evaluiert erst etwas, wenn es benötigt wird. +-- unterstützt. Haskell evaluiert erst etwas, wenn es benötigt wird. -- Somit kannst du nach dem 1000. Element fragen und Haskell gibt es dir: [1..] !! 999 -- 1000 @@ -106,7 +106,7 @@ not False -- True -- Zwei Listen konkatenieren [1..5] ++ [6..10] --- Ein Element als Head hinzufuegen +-- Ein Element als Head hinzufügen 0:[1..5] -- [0, 1, 2, 3, 4, 5] -- Weitere Listenoperationen @@ -152,7 +152,7 @@ add 1 2 -- 3 (//) a b = a `div` b 35 // 4 -- 8 --- Guards sind eine einfache Möglichkeit fuer Fallunterscheidungen. +-- Guards sind eine einfache Möglichkeit für Fallunterscheidungen. fib x | x < 2 = 1 | otherwise = fib (x - 1) + fib (x - 2) @@ -186,7 +186,7 @@ foldl1 (\acc x -> acc + x) [1..5] -- 15 -- 4. Mehr Funktionen ---------------------------------------------------- --- currying: Wenn man nicht alle Argumente an eine Funktion uebergibt, +-- currying: Wenn man nicht alle Argumente an eine Funktion übergibt, -- so wird sie eine neue Funktion gebildet ("curried"). -- Es findet eine partielle Applikation statt und die neue Funktion -- nimmt die fehlenden Argumente auf. @@ -209,7 +209,7 @@ foo = (*4) . (+10) foo 5 -- 60 --- Haskell hat einen Operator `$`, welcher Funktionsapplikation durchfuehrt. +-- Haskell hat einen Operator `$`, welcher Funktionsapplikation durchführt. -- Im Gegenzug zu der Standard-Funktionsapplikation, welche linksassoziativ ist -- und die höchstmögliche Priorität von "10" hat, ist der `$`-Operator -- rechtsassoziativ und hat die Priorität 0. Dieses hat (idr.) den Effekt, @@ -238,14 +238,14 @@ even . fib $ 7 -- false True :: Bool -- Funktionen haben genauso Typen. --- `not` ist Funktion die ein Bool annimmt und ein Bool zurueckgibt: +-- `not` ist Funktion die ein Bool annimmt und ein Bool zurückgibt: -- not :: Bool -> Bool -- Eine Funktion die zwei Integer Argumente annimmt: -- add :: Integer -> Integer -> Integer -- Es ist guter Stil zu jeder Funktionsdefinition eine --- Typdefinition darueber zu schreiben: +-- Typdefinition darüber zu schreiben: double :: Integer -> Integer double x = x * 2 @@ -317,7 +317,7 @@ data Maybe a = Nothing | Just a -- Diese sind alle vom Typ Maybe: Just "hello" -- vom Typ `Maybe String` Just 1 -- vom Typ `Maybe Int` -Nothing -- vom Typ `Maybe a` fuer jedes `a` +Nothing -- vom Typ `Maybe a` für jedes `a` ---------------------------------------------------- -- 8. Haskell IO @@ -326,8 +326,8 @@ Nothing -- vom Typ `Maybe a` fuer jedes `a` -- IO kann nicht völlig erklärt werden ohne Monaden zu erklären, -- aber man kann die grundlegenden Dinge erklären. --- Wenn eine Haskell Programm ausgefuehrt wird, so wird `main` aufgerufen. --- Diese muss etwas vom Typ `IO ()` zurueckgeben. Zum Beispiel: +-- Wenn eine Haskell Programm ausgeführt wird, so wird `main` aufgerufen. +-- Diese muss etwas vom Typ `IO ()` zurückgeben. Zum Beispiel: main :: IO () main = putStrLn $ "Hello, sky! " ++ (say Blue) @@ -355,10 +355,10 @@ sayHello = do -- an die Variable "name" gebunden putStrLn $ "Hello, " ++ name --- Uebung: Schreibe deine eigene Version von `interact`, +-- Übung: Schreibe deine eigene Version von `interact`, -- die nur eine Zeile einliest. --- `sayHello` wird niemals ausgefuehrt, nur `main` wird ausgefuehrt. +-- `sayHello` wird niemals ausgeführt, nur `main` wird ausgeführt. -- Um `sayHello` laufen zulassen kommentiere die Definition von `main` -- aus und ersetze sie mit: -- main = sayHello @@ -376,7 +376,7 @@ action = do input1 <- getLine input2 <- getLine -- Der Typ von `do` ergibt sich aus der letzten Zeile. - -- `return` ist eine Funktion und keine Schluesselwort + -- `return` ist eine Funktion und keine Schlüsselwort return (input1 ++ "\n" ++ input2) -- return :: String -> IO String -- Nun können wir `action` wie `getLine` benutzen: @@ -387,7 +387,7 @@ main'' = do putStrLn result putStrLn "This was all, folks!" --- Der Typ `IO` ist ein Beispiel fuer eine Monade. +-- Der Typ `IO` ist ein Beispiel für eine Monade. -- Haskell benutzt Monaden Seiteneffekte zu kapseln und somit -- eine rein funktional Sprache zu sein. -- Jede Funktion die mit der Außenwelt interagiert (z.B. IO) @@ -404,7 +404,7 @@ main'' = do -- Starte die REPL mit dem Befehl `ghci` -- Nun kann man Haskell Code eingeben. --- Alle neuen Werte muessen mit `let` gebunden werden: +-- Alle neuen Werte müssen mit `let` gebunden werden: let foo = 5 @@ -413,7 +413,7 @@ let foo = 5 >:t foo foo :: Integer --- Auch jede `IO ()` Funktion kann ausgefuehrt werden. +-- Auch jede `IO ()` Funktion kann ausgeführt werden. > sayHello What is your name? @@ -437,6 +437,6 @@ qsort (p:xs) = qsort lesser ++ [p] ++ qsort greater Haskell ist sehr einfach zu installieren. Hohl es dir von [hier](http://www.haskell.org/platform/). -Eine sehr viele langsamere Einfuehrung findest du unter: +Eine sehr viele langsamere Einführung findest du unter: [Learn you a Haskell](http://learnyouahaskell.com/) oder [Real World Haskell](http://book.realworldhaskell.org/). diff --git a/de-de/yaml-de.html.markdown b/de-de/yaml-de.html.markdown index 19ea9e87..a46c30f6 100644 --- a/de-de/yaml-de.html.markdown +++ b/de-de/yaml-de.html.markdown @@ -30,7 +30,7 @@ null_Wert: null Schlüssel mit Leerzeichen: value # Strings müssen nicht immer mit Anführungszeichen umgeben sein, können aber: jedoch: "Ein String in Anführungzeichen" -"Ein Schlüssel in Anführungszeichen": "Nützlich, wenn du einen Doppelpunkt im Schluessel haben willst." +"Ein Schlüssel in Anführungszeichen": "Nützlich, wenn du einen Doppelpunkt im Schlüssel haben willst." # Mehrzeilige Strings schreibst du am besten als 'literal block' (| gefolgt vom Text) # oder ein 'folded block' (> gefolgt vom text). @@ -64,7 +64,7 @@ eine_verschachtelte_map: hallo: hallo # Schlüssel müssen nicht immer String sein. -0.25: ein Float-Wert als Schluessel +0.25: ein Float-Wert als Schlüssel # Schlüssel können auch mehrzeilig sein, ? symbolisiert den Anfang des Schlüssels ? | From c23fa3613874bc22b65e5506c374c8f8bf2691d8 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 31 Oct 2015 19:34:51 +0800 Subject: [PATCH 566/685] Revert "[php/en]" This reverts commit 5afca01bdfb7dab2e6086a63bb80444aae9831cb. --- php.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/php.html.markdown b/php.html.markdown index 7b0cf61c..0504ced2 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -3,7 +3,6 @@ language: PHP contributors: - ["Malcolm Fell", "http://emarref.net/"] - ["Trismegiste", "https://github.com/Trismegiste"] - - [ Liam Demafelix , https://liamdemafelix.com/] filename: learnphp.php --- @@ -157,13 +156,14 @@ unset($array[3]); * Output */ -echo 'Hello World!'; +echo('Hello World!'); // Prints Hello World! to stdout. // Stdout is the web page if running in a browser. print('Hello World!'); // The same as echo -// print is a language construct too, so you can drop the parentheses +// echo and print are language constructs too, so you can drop the parentheses +echo 'Hello World!'; print 'Hello World!'; $paragraph = 'paragraph'; @@ -335,7 +335,7 @@ switch ($x) { $i = 0; while ($i < 5) { echo $i++; -} // Prints "01234" +}; // Prints "01234" echo "\n"; From c990b720e4416fd5c516af906ba548d0b2b12f0f Mon Sep 17 00:00:00 2001 From: Reinoud Kruithof Date: Sat, 31 Oct 2015 12:37:39 +0100 Subject: [PATCH 567/685] Added Dutch translation of AMD. --- nl-nl/amd-nl.html.markdown | 235 +++++++++++++++++++++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 nl-nl/amd-nl.html.markdown diff --git a/nl-nl/amd-nl.html.markdown b/nl-nl/amd-nl.html.markdown new file mode 100644 index 00000000..d5e0022a --- /dev/null +++ b/nl-nl/amd-nl.html.markdown @@ -0,0 +1,235 @@ +--- +category: tool +tool: amd +contributors: + - ["Frederik Ring", "https://github.com/m90"] +translators: + - ["Reinoud Kruithof", "https://github.com/reinoudk"] +filename: learnamd-nl.js +lang: nl-nl +--- + +## Aan de slag met AMD + +De **Asynchronous Module Definition** API specificeert een mechanisme om JavaScript + modules the definiren zodat de module en dependencies (afhankelijkheden) asynchroon + geladen kunnen worden. Dit is vooral erg geschikt voor de browseromgeving, waar het + synchroon laden van modules zorgt voor problemen qua prestatie, gebruiksvriendelijkheid, + debugging en cross-domain toegangsproblemen. + +### Basis concept +```javascript +// De basis AMD API bestaat uit niks meer dan twee methodes: `define` en `require` +// and gaat vooral over de definitie en gebruik van modules: +// `define(id?, dependencies?, factory)` definieert een module +// `require(dependencies, callback)` importeert een set van dependencies en +// gebruikt ze in de gegeven callback + +// Laten we starten met het gebruiken van define om een nieuwe module (met naam) +// te creeren, welke geen dependencies heeft. Dit doen we door een naam +// en een zogeheten factory functie door te geven aan define: +define('awesomeAMD', function(){ + var isAMDAwesome = function(){ + return true; + }; + // De return waarde van een module's factory functie is + // wat andere modules of require calls ontvangen wanneer + // ze onze `awesomeAMD` module requiren. + // De gexporteerde waarde kan van alles zijn: (constructor) functies, + // objecten, primitives, zelfs undefined (hoewel dat niet veel nut heeft). + return isAMDAwesome; +}); + + +// We gaan nu een andere module defineren die afhankelijk is van onze +// `awesomeAMD` module. Merk hierbij op dat er nu een extra functieargument +// is die de dependencies van onze module defineert: +define('schreewlelijk', ['awesomeAMD'], function(awesomeAMD){ + // dependencies worden naar de factory's functieargumenten + // gestuurd in de volgorde waarin ze gespecificeert zijn + var vertelIedereen = function(){ + if (awesomeAMD()){ + alert('Dit is zOoOo cool!'); + } else { + alert('Vrij saai, niet?'); + } + }; + return vertelIedereen; +}); + +// Nu we weten hoe we define moeten gebruiken, kunnen we require gebruiken +// om ons programma mee te starten. De vorm van `require` is +// `(arrayVanDependencies, callback)`. +require(['schreeuwlelijk'], function(schreewlelijk){ + schreeuwlelijk(); +}); + +// Om deze tutorial code uit te laten voeren, gaan we hier een vrij basic +// (niet-asynchrone) versie van AMD implementeren: +function define(naam, deps, factory){ + // merk op hoe modules zonder dependencies worden afgehandeld + define[naam] = require(factory ? deps : [], factory || deps); +} + +function require(deps, callback){ + var args = []; + // we halen eerst alle dependecies op die nodig zijn + // om require aan te roepen + for (var i = 0; i < deps.length; i++){ + args[i] = define[deps[i]]; + } + // voldoe aan alle dependencies van de callback + return callback.apply(null, args); +} +// je kan deze code hier in actie zien (Engels): http://jsfiddle.net/qap949pd/ +``` + +### require.js in de echte wereld + +In contrast met het voorbeeld uit de introductie, implementeert `require.js` + (de meest populaire AMD library) de **A** in **AMD**. Dit maakt het mogelijk + om je modules en hun dependencies asynchroon in the laden via XHR: + +```javascript +/* file: app/main.js */ +require(['modules/someClass'], function(SomeClass){ + // de callback word uitgesteld tot de dependency geladen is + var things = new SomeClass(); +}); +console.log('Dus, hier wachten we!'); // dit wordt als eerste uitgevoerd +``` + +De afspraak is dat je over het algemeen n module in n bestand opslaat. +`require.js` kan module-namen achterhalen gebaseerd op de bestandslocatie, +dus je hoeft je module geen naam te geven. Je kan simpelweg aan ze referen + door hun locatie te gebruiken. +In het voorbeeld nemen we aan dat `someClass` aanwezig is in de `modules` map, + relatief ten opzichte van de `baseUrl` uit je configuratie. + +* app/ + * main.js + * modules/ + * someClass.js + * someHelpers.js + * ... + * daos/ + * things.js + * ... + +Dit betekent dat we `someClass` kunnen defineren zonder een module-id te specificeren: + +```javascript +/* file: app/modules/someClass.js */ +define(['daos/things', 'modules/someHelpers'], function(thingsDao, helpers){ + // definitie van de module gebeurt, natuurlijk, ook asynchroon + function SomeClass(){ + this.method = function(){/**/}; + // ... + } + return SomeClass; +}); +``` +Gebruik `requirejs.config(configObj)` om het gedrag van de standaard mapping + aan te passen in je `main.js`: + +```javascript +/* file: main.js */ +requirejs.config({ + baseUrl : 'app', + paths : { + // je kan ook modules uit andere locatie inladen + jquery : '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min', + coolLibUitBower : '../bower_components/cool-lib/coollib' + } +}); +require(['jquery', 'coolLibUitBower', 'modules/someHelpers'], function($, coolLib, helpers){ + // een `main` bestand moet require minstens eenmaal aanroepen, + // anders zal er geen code uitgevoerd worden + coolLib.doFancyDingenMet(helpers.transform($('#foo'))); +}); +``` +Op `require.js` gebaseerde apps hebben vaak een enkel beginpunt (`main.js`) + welke toegevoegd wordt aan de `require.js` script tag als een data-attribuut. +Deze zal automisch geladen en uitgevoerd worden als de pagina laadt: + +```html + + + + Honder script tags? Nooi meer! + + + + + +``` + +### Een heel project optimaliseren met r.js + +Veel mensen geven er de voorkeur aan om AMD te gebruiken tijdens de + ontwikkelfase om code op een gezonde manier te organiseren maar + willen nog steeds een enkel scriptbestand gebruiken in productie in + plaats van honderderen XHR verzoeken uit te voeren als de pagina laadt. + +`require.js` wordt geleverd met een script genaamd `r.js` (die je waarschijnlijk +uitvoert in node.js, hoewel Rhino ook ondersteund wordt) welke de +dependency book van je project analyseert en een enkel bestand bouwt met daarin +al je module (juist genaamd), geminificeerd en klaar voor productie. + +Instaleren met `npm`: +```shell +$ npm install requirejs -g +``` + +Nu kun je het een configuratiebestand voeden: +```shell +$ r.js -o app.build.js +``` + +Voor ons bovenstaande voorbeeld zou de configuratie er zo uit kunnen zien: +```javascript +/* file : app.build.js */ +({ + name : 'main', // naam van het beginpunt + out : 'main-built.js', // naam van het bestand waar de output naar geschreven wordt + baseUrl : 'app', + paths : { + // `empty:` verteld r.js dat dee nog steeds geladen moet worden van de CDN, + // gebruik makend van de locatie gespecificeert in `main.js` + jquery : 'empty:', + coolLibUitBower : '../bower_components/cool-lib/coollib' + } +}) +``` +Verwissel simpelweg `data-main` om het gebouwde bestand te gebruiken in productie: +```html + +``` + +Een erg gedetaileerd [overzicht van bouwopties](https://github.com/jrburke/r.js/blob/master/build/example.build.js) is +beschikbar in de GitHub repo (Engels). + +Hieronder vind je nog meer informatie over AMD (Engels). + +### Onderwerpen die niet aan bod zijn gekomen +* [Loader plugins / transforms](http://requirejs.org/docs/plugins.html) +* [CommonJS style loading and exporting](http://requirejs.org/docs/commonjs.html) +* [Advanced configuration](http://requirejs.org/docs/api.html#config) +* [Shim configuration (loading non-AMD modules)](http://requirejs.org/docs/api.html#config-shim) +* [CSS loading and optimizing with require.js](http://requirejs.org/docs/optimization.html#onecss) +* [Using almond.js for builds](https://github.com/jrburke/almond) + +### Verder lezen: + +* [Official Spec](https://github.com/amdjs/amdjs-api/wiki/AMD) +* [Why AMD?](http://requirejs.org/docs/whyamd.html) +* [Universal Module Definition](https://github.com/umdjs/umd) + +### Implementaties: + +* [require.js](http://requirejs.org) +* [dojo toolkit](http://dojotoolkit.org/documentation/tutorials/1.9/modules/) +* [cujo.js](http://cujojs.com/) +* [curl.js](https://github.com/cujojs/curl) +* [lsjs](https://github.com/zazl/lsjs) +* [mmd](https://github.com/alexlawrence/mmd) From 1bd371bcda266c594ab4a4be9868db32a157c296 Mon Sep 17 00:00:00 2001 From: Tom Anderson Date: Sat, 31 Oct 2015 22:43:43 +1030 Subject: [PATCH 568/685] Add section heading info Give information about using comments for code sections --- matlab.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/matlab.html.markdown b/matlab.html.markdown index 9d78978e..25f762bb 100644 --- a/matlab.html.markdown +++ b/matlab.html.markdown @@ -15,6 +15,7 @@ If you have any feedback please feel free to reach me at [osvaldo.t.mendoza@gmail.com](mailto:osvaldo.t.mendoza@gmail.com). ```matlab +%% Code sections start with two percent signs. Section titles go on the same line. % Comments start with a percent sign. %{ From bda1e01ae0260e5ebbc7f93972b57bbad39c2ab4 Mon Sep 17 00:00:00 2001 From: IvanEh Date: Sat, 31 Oct 2015 14:46:06 +0200 Subject: [PATCH 569/685] Add Ukrainian translation for JSON --- ua-ua/json-ua.html.markdown | 67 +++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 ua-ua/json-ua.html.markdown diff --git a/ua-ua/json-ua.html.markdown b/ua-ua/json-ua.html.markdown new file mode 100644 index 00000000..6281ea56 --- /dev/null +++ b/ua-ua/json-ua.html.markdown @@ -0,0 +1,67 @@ +--- +language: json +filename: learnjson-ru.json +contributors: + - ["Anna Harren", "https://github.com/iirelu"] + - ["Marco Scannadinari", "https://github.com/marcoms"] +translators: + - ["Ehreshi Ivan", "https://github.com/IvanEh"] +lang: ua-ua +--- + +JSON - це надзвичайно простий формат обміну даними. Це мабуть буде найлегшим курсом +"Learn X in Y Minutes". + +В загальному випадку в JSON немає коментарів, але більшість парсерів дозволяють +використовувати коментарі в С-стилі(//, /\* \*/). Можна залишити кому після останнього +поля, але все-таки краще такого уникати для кращої сумісності + +```json +{ + "ключ": "значеннь", + + "ключі": "завжди мають бути обгорнуті в подвійні лапки", + "числа": 0, + "рядки": "Пρивет, світ. Допускаються всі unicode-символи разом з \"екрануванням\".", + "логічний тип": true, + "нічого": null, + + "велике число": 1.2e+100, + + "об’єкти": { + "коментар": "Більшість ваших структур будуть складатися з об’єктів", + + "масив": [0, 1, 2, 3, "масиви можуть містити будь-які типи", 5], + + "інший об’єкт": { + "коментра": "Об’єкти можуть містити інші об’єкти. Це дуже корисно." + } + }, + + "безглуздя": [ + { + "джерело калія": ["банани"] + }, + [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, "нео"], + [0, 0, 0, 1] + ] + ], + + "альтернативнтй стиль": { + "коментар": "Гляньте!" + , "позиція коми": "неважлива, поки вона знаходиться до наступного поля" + , "інший коментар": "класно" + }, + + "Це було не довго": "І ви справилист. Тепер ви знаєте все про JSON." +} + +Одиничний масив значень теж є правильним JSON + +[1, 2, 3, "text", true] + + +``` From bc087b50370a3c32c35ef026047c2fa9db9944d8 Mon Sep 17 00:00:00 2001 From: Pavel Kazlou Date: Sat, 31 Oct 2015 16:39:47 +0300 Subject: [PATCH 570/685] usage of named parameters --- scala.html.markdown | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scala.html.markdown b/scala.html.markdown index 192e03d7..bc8cd422 100644 --- a/scala.html.markdown +++ b/scala.html.markdown @@ -169,6 +169,12 @@ def sumOfSquaresShort(x: Int, y: Int): Int = x * x + y * y // Syntax for calling functions is familiar: sumOfSquares(3, 4) // => 25 +// You can use parameters names to specify them in different order +def subtract(x: Int, y: Int): Int = x - y + +subtract(10, 3) // => 7 +subtract(y=10, x=3) // => -7 + // In most cases (with recursive functions the most notable exception), function // return type can be omitted, and the same type inference we saw with variables // will work with function return values: From 0049a475edba88f6537b2490ca9506df23b46368 Mon Sep 17 00:00:00 2001 From: Aayush Ranaut Date: Sat, 31 Oct 2015 22:20:51 +0530 Subject: [PATCH 571/685] Removed confusing comments --- python.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python.html.markdown b/python.html.markdown index 5572e38e..abc461a2 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -404,7 +404,7 @@ add(y=6, x=5) # Keyword arguments can arrive in any order. # You can define functions that take a variable number of -# positional args, which will be interpreted as a tuple if you do not use the * +# positional args, which will be interpreted as a tuple def varargs(*args): return args @@ -412,7 +412,7 @@ varargs(1, 2, 3) # => (1, 2, 3) # You can define functions that take a variable number of -# keyword args, as well, which will be interpreted as a dict if you do not use ** +# keyword args, as well, which will be interpreted as a dict def keyword_args(**kwargs): return kwargs From 3cabc7cc9ac2db44e9ee7bbbfb9538e1bf968a41 Mon Sep 17 00:00:00 2001 From: IvanEh Date: Sat, 31 Oct 2015 19:33:20 +0200 Subject: [PATCH 572/685] Add Ukrainian translation for bash --- ua-ua/bash-ua.html.markdown | 296 ++++++++++++++++++++++++++++++++++++ 1 file changed, 296 insertions(+) create mode 100644 ua-ua/bash-ua.html.markdown diff --git a/ua-ua/bash-ua.html.markdown b/ua-ua/bash-ua.html.markdown new file mode 100644 index 00000000..2c930ad1 --- /dev/null +++ b/ua-ua/bash-ua.html.markdown @@ -0,0 +1,296 @@ +--- +category: tool +tool: bash +contributors: + - ["Max Yankov", "https://github.com/golergka"] + - ["Darren Lin", "https://github.com/CogBear"] + - ["Alexandre Medeiros", "http://alemedeiros.sdf.org"] + - ["Denis Arh", "https://github.com/darh"] + - ["akirahirose", "https://twitter.com/akirahirose"] + - ["Anton Strömkvist", "http://lutic.org/"] + - ["Rahil Momin", "https://github.com/iamrahil"] + - ["Gregrory Kielian", "https://github.com/gskielian"] + - ["Etan Reisner", "https://github.com/deryni"] +translators: + - ["Ehreshi Ivan", "https://github.com/IvanEh"] +lang: ua-ua +--- + +Bash - командна оболонка unix (unix shell), що також розповсюджувалась як оболонка для +операційної системи GNU і зараз використовується як командна оболонка за замовчуванням +для Linux i Max OS X. +Почти все нижеприведенные примеры могут быть частью shell-скриптов или исполнены напрямую в shell. +Майже всі приклади, що наведені нижче можуть бути частиною shell-скриптів або +виконані в оболонці + +[Більш детально тут.](http://www.gnu.org/software/bash/manual/bashref.html) + +```bash +#!/bin/bash +# Перший рядок скрипта - це shebang, який вказує системі, як потрібно виконувати +# скрипт. Як ви вже зрозуміли, коментарі починаються з #. Shebang - тоже коментар + +# Простий приклад hello world: +echo Hello world! + +# Окремі команди починаються з нового рядка або розділяються крапкою з комкою: +echo 'Перший рядок'; echo 'Другий рядок' + +# Оголошення змінної +VARIABLE="Просто рядок" + +# Але не так! +VARIABLE = "Просто рядок" +# Bash вирішить, що VARIABLE - це команда, яку він може виконати, +# і видасть помилку, тому що не зможе знайти її + +# І так також не можна писати: +VARIABLE= 'Просто рядок' +# Bash сприйме рядок 'Просто рядок' як команду. Але такої команди не має, тому +# видасть помилку. +# (тут 'VARIABLE=' інтерпретується як присвоєння тільки в контексті +# виконання команди 'Просто рядок') + +# Використання змінних: +echo $VARIABLE +echo "$VARIABLE" +echo '$VARIABLE' +# Коли ви використовуєте змінну - присвоюєте значення, експортуєте і т.д. - +# пишіть її імя без $. А для отримання значення змінної використовуйте $. +# Одинарні лапки ' не розкривають значення змінних + +# Підстановка рядків в змінні +echo ${VARIABLE/Просто/A} +# Цей вираз замінить перше входження підрядка "Просто" на "А" + +# Отримання підрядка із рядка +LENGTH=7 +echo ${VARIABLE:0:LENGTH} +# Цей вираз поверне тільки перші 7 символів змінної VARIABLE + +# Значення за замовчуванням +echo ${FOO:-"DefaultValueIfFOOIsMissingOrEmpty"} +# Це спрацює при відсутності значення (FOO=) і при пустому рядку (FOO="") +# Нуль (FOO=0) поверне 0. +# Зауважте, що у всіх випадках значення самої змінної FOO не зміниться + +# Вбудовані змінні: +# В bash є корисні вбудовані змінні, наприклад +echo "Значення, яке було повернуте в останній раз: $?" +echo "PID скрипта: $$" +echo "Кількість аргументів: $#" +echo "Аргументи скрипта: $@" +echo "Аргументи скрипта, розподілені по різним змінним: $1 $2..." + +# Зчитування змінних з пристроїв введення +echo "Як вас звати?" +read NAME # Зверніть увагу, що вам не потрібно оголошувати нову змінну +echo Привіт, $NAME! + +# В bash є звичайна умовна конструкція if: +# наберіть 'man test', щоб переглянути детальну інформацію про формати умов +if [ $NAME -ne $USER ] +then + echo "Ім’я користувача не збігається з введеним" +else + echo "Ім’я збігаєтьяс з іменем користувача" +fi + +# Зауважте! якщо $Name пуста, bash інтерпретує код вище як: +if [ -ne $USER ] +# що є неправильним синтаксисом +# тому безпечний спосіб використання потенційно пустих змінних має вигляд: +if [ "$Name" -ne $USER ] ... +# коли $Name пуста, інтерпретується наступним чином: +if [ "" -ne $USER ] ... +# що працює як і очікувалося + +# Умовне виконання (conditional execution) +echo "Виконується завжди" || echo "Виконається, якщо перша команда завершиться з помилкою" +echo "Виконується завжди" && echo "Виконається, якщо перша команда завершиться успішно" + +# Щоб використати && і || у конструкції if, потрібно декілька пар дужок: +if [ $NAME == "Steve" ] && [ $AGE -eq 15 ] +then + echo "Виконається, якщо $NAME="Steve" i AGE=15." +fi + +if [ $NAME == "Daniya" ] || [ $NAME == "Zach" ] +then + echo "Виконається, якщо NAME="Steve" або NAME="Zach"." +fi + +# Вирази позначаються наступним форматом: +echo $(( 10 + 5 )) + +# На відмінно від інших мов програмування, Bash - це командна оболонка, а +# отже, працює в контексті поточної директорії +ls + +# Ця команда може використовуватися з опціями +ls -l # Показати кожен файл і директорію на окремому рядку + +# Результат попередньої команди можна перенаправити на вхід наступної. +# Команда grep фільтрує вхід по шаблону. +# Таким чином ми можемо переглянути тільки *.txt файли в поточній директорії: +ls -l | grep "\.txt" + +# Ви можете перенаправ вхід і вихід команди (stdin, stdout, stderr). +# Наступна команда означає: читати із stdin, поки не зустрінеться ^EOF$, і +# перезаписати hello.py наступними рядками (до рядка "EOF"): +cat > hello.py << EOF +#!/usr/bin/env python +from __future__ import print_function +import sys +print("#stdout", file=sys.stdout) +print("#stderr", file=sys.stderr) +for line in sys.stdin: + print(line, file=sys.stdout) +EOF + +# Запуск hello.py з різними варіантами перенаправлення stdin, +# stdout, stderr (стандартні потоки введення, виведення і помилок): +python hello.py < "input.in" +python hello.py > "output.out" +python hello.py 2> "error.err" +python hello.py > "output-and-error.log" 2>&1 +python hello.py > /dev/null 2>&1 +# Поток помилок перезапише фпйл, якщо цей файл існує +# тому, якщо ви хочете дописувати до файлу, використовуйте ">>": +python hello.py >> "output.out" 2>> "error.err" + +# Перезаписати output.txt, дописати error.err і порахувати кількість рядків: +info bash 'Basic Shell Features' 'Redirections' > output.out 2>> error.err +wc -l output.out error.err + +# Запустити команду і вивести її файловий дескриптор (див.: man fd; наприклад /dev/fd/123) +echo <(echo "#helloworld") + +# Перезаписати output.txt рядком "#helloworld": +cat > output.out <(echo "#helloworld") +echo "#helloworld" > output.out +echo "#helloworld" | cat > output.out +echo "#helloworld" | tee output.out >/dev/null + +# Подчистить временные файлы с подробным выводом ('-i' - интерактивый режим) +# Очистити тимчасові файли з детальним виводом (додайте '-i' +# для інтерактивного режиму) +rm -v output.out error.err output-and-error.log + +# Команди можуть бути підставлені в інші команди використовуючи $(): +# наступна команда виводить кількість файлів і директорій в поточній директорії +echo "Тут $(ls | wc -l) елементів." + +# Те саме можна зробити використовуючи зворотні лапки +# Але вони не можуть бути вкладеними, тому перший варіант бажаніший +echo "Тут `ls | wc -l` елементів." + +# В Bash є структура case, яка схожа на switch в Java и C++: +case "$VARIABLE" in + # перерахуйте шаблони, які будуть використовуватися в якості умов + 0) echo "Тут нуль.";; + 1) echo "Тут один.";; + *) echo "Не пусте значення.";; +esac + +# Цикл for перебирає елементи передані в аргумент: +# Значення $VARIABLE буде напечатано тричі. +for VARIABLE in {1..3} +do + echo "$VARIABLE" +done + +# Aбо можна використати звичний синтаксис for: +for ((a=1; a <= 3; a++)) +do + echo $a +done + +# Цикл for можно використати, щоб виконувати дії над файлами. +# Цей код запустить команду 'cat' для файлів file1 и file2 +for VARIABLE in file1 file2 +do + cat "$VARIABLE" +done + +# ... або дії над виводом команд +# Запустимо cat для виведення із ls. +for OUTPUT in $(ls) +do + cat "$OUTPUT" +done + +# Цикл while: +while [ true ] +do + echo "Тіло циклу..." + break +done + +# Ви також можете оголосити функцію +# Оголошення: +function foo () +{ + echo "Аргументи функції доступні так само, як і аргументи скрипта: $@" + echo "$1 $2..." + echo "Це функція" + return 0 +} + +# Або просто +bar () +{ + echo "Інший спосіб оголошення функцій!" + return 0 +} + +# Виклик функцій +foo "Мое имя" $NAME + +# Є багато корисних команд: +# вивести останні 10 рядків файла file.txt +tail -n 10 file.txt +# вивести перші 10 рядків файла file.txt +head -n 10 file.txt +# відсортувати рядки file.txt +sort file.txt +# відібрати або пропустити рядки, що дублюються (з опцією -d відбирає) +uniq -d file.txt +# вивести тільки першу колонку перед символом ',' +cut -d ',' -f 1 file.txt +# замінити кожне 'okay' на 'great' у файлі file.txt (підтримується regex) +sed -i 's/okay/great/g' file.txt +# вивести в stdout все рядки з file.txt, що задовольняють шаблону regex; +# цей приклад виводить рядки, що починаються на foo і закінчуються на bar: +grep "^foo.*bar$" file.txt +# використайте опцію -c, щоб вивести кількість входжень +grep -c "^foo.*bar$" file.txt +# чтобы искать по строке, а не шаблону regex, используйте fgrep (или grep -F) +# щоб здійснити пошук по рядку, а не по шаблону regex, використовуйте fgrea (або grep -F) +fgrep "^foo.*bar$" file.txt + +# Читайте вбудовану документацію Bash командою 'help': +help +help help +help for +help return +help source +help . + +# Читайте Bash man-документацію +apropos bash +man 1 bash +man bash + +# Читайте документацію info (? для допомоги) +apropos info | grep '^info.*(' +man info +info info +info 5 info + +# Читайте bash info документацію: +info bash +info bash 'Bash Features' +info bash 6 +info --apropos bash +``` From 903874addc7715172e465efd5f57b526b81ec3a5 Mon Sep 17 00:00:00 2001 From: IvanEh Date: Sat, 31 Oct 2015 19:43:23 +0200 Subject: [PATCH 573/685] Add missing important code to bash-ru.html.markdown from the english version --- ru-ru/.directory | 4 ++++ ru-ru/bash-ru.html.markdown | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 ru-ru/.directory diff --git a/ru-ru/.directory b/ru-ru/.directory new file mode 100644 index 00000000..4d20336b --- /dev/null +++ b/ru-ru/.directory @@ -0,0 +1,4 @@ +[Dolphin] +SortRole=size +Timestamp=2015,10,31,18,6,13 +Version=3 diff --git a/ru-ru/bash-ru.html.markdown b/ru-ru/bash-ru.html.markdown index 21377b6c..5e99afc2 100644 --- a/ru-ru/bash-ru.html.markdown +++ b/ru-ru/bash-ru.html.markdown @@ -95,6 +95,15 @@ else echo "Имя совпадает с именем пользователя" fi +# Примечание: если $Name пустой, bash интерпретирует код как: +if [ -ne $USER ] +# а это ошибочная команда +# поэтому такие переменные нужно использовать так: +if [ "$Name" -ne $USER ] ... +# когда $Name пустой, bash видит код как: +if [ "" -ne $USER ] ... +# что работает правильно + # Также есть условное исполнение echo "Исполнится всегда" || echo "Исполнится, если первая команда завершится ошибкой" echo "Исполнится всегда" && echo "Исполнится, если первая команда выполнится удачно" From 04694a00e54272799e50ef8570ddef70a1fd5779 Mon Sep 17 00:00:00 2001 From: Victor Caldas Date: Sat, 31 Oct 2015 16:31:22 -0200 Subject: [PATCH 574/685] fixing javascript translate --- pt-br/javascript-pt.html.markdown | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pt-br/javascript-pt.html.markdown b/pt-br/javascript-pt.html.markdown index 406042fa..6424214e 100644 --- a/pt-br/javascript-pt.html.markdown +++ b/pt-br/javascript-pt.html.markdown @@ -436,7 +436,6 @@ var myPrototype = { myObj.__proto__ = myPrototype; myObj.meaningOfLife; // = 42 -// This works for functions, too. // Isto funciona para funções, também. myObj.myFunc(); // = "olá mundo!" @@ -506,7 +505,7 @@ String.prototype.firstCharacter = function(){ // Havíamos mencionado que `Object.create` não estava ainda disponível em // todos as implementações, mas nós podemos usá-lo com esse polyfill: -if (Object.create === undefined){ // don't overwrite it if it exists +if (Object.create === undefined){ // Não o sobrescreve se já existir Object.create = function(proto){ // faz um construtor temporário com o prototype certo var Constructor = function(){}; From 8670035d19f1b0002344f0e17d2e09ce19223e7f Mon Sep 17 00:00:00 2001 From: Rudy Affandi Date: Sat, 31 Oct 2015 11:31:30 -0700 Subject: [PATCH 575/685] Add a note regarding string value of "1" Because some YAML parser will always assume that 1 is boolean for true. --- yaml.html.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yaml.html.markdown b/yaml.html.markdown index 6e3e2c94..1d12fad7 100644 --- a/yaml.html.markdown +++ b/yaml.html.markdown @@ -24,6 +24,8 @@ YAML doesn't allow literal tab characters at all. key: value another_key: Another value goes here. a_number_value: 100 +# If you want to use number 1 as a value, you have to enclose it in quotes, +# otherwise, YAML parser will assume that it is a boolean value of true. scientific_notation: 1e+12 boolean: true null_value: null From 38506983bb1d589734268b62bb87b4bad4601733 Mon Sep 17 00:00:00 2001 From: Willie Zhu Date: Sat, 31 Oct 2015 15:27:44 -0400 Subject: [PATCH 576/685] [edn/en] Fix grammar --- edn.html.markdown | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/edn.html.markdown b/edn.html.markdown index 0a0dc9b5..d0bdddfc 100644 --- a/edn.html.markdown +++ b/edn.html.markdown @@ -5,13 +5,13 @@ contributors: - ["Jason Yeo", "https://github.com/jsyeo"] --- -Extensible Data Notation or EDN for short is a format for serializing data. +Extensible Data Notation (EDN) is a format for serializing data. -The notation is used internally by Clojure to represent programs and it also +The notation is used internally by Clojure to represent programs. It is also used as a data transfer format like JSON. Though it is more commonly used in -Clojure land, there are implementations of EDN for many other languages. +Clojure, there are implementations of EDN for many other languages. -The main benefit of EDN over JSON and YAML is that it is extensible, which we +The main benefit of EDN over JSON and YAML is that it is extensible. We will see how it is extended later on. ```Clojure @@ -59,7 +59,7 @@ false ; Vectors allow random access [:gelato 1 2 -2] -; Maps are associative data structures that associates the key with its value +; Maps are associative data structures that associate the key with its value {:eggs 2 :lemon-juice 3.5 :butter 1} @@ -68,7 +68,7 @@ false {[1 2 3 4] "tell the people what she wore", [5 6 7 8] "the more you see the more you hate"} -; You may use commas for readability. They are treated as whitespaces. +; You may use commas for readability. They are treated as whitespace. ; Sets are collections that contain unique elements. #{:a :b 88 "huat"} @@ -82,11 +82,11 @@ false #MyYelpClone/MenuItem {:name "eggs-benedict" :rating 10} ; Let me explain this with a clojure example. Suppose I want to transform that -; piece of edn into a MenuItem record. +; piece of EDN into a MenuItem record. (defrecord MenuItem [name rating]) -; To transform edn to clojure values, I will need to use the built in EDN +; To transform EDN to clojure values, I will need to use the built in EDN ; reader, edn/read-string (edn/read-string "{:eggs 2 :butter 1 :flour 5}") From f5b8d838006d4d461389d35568786bbe7dd4d48c Mon Sep 17 00:00:00 2001 From: ComSecNinja Date: Sat, 31 Oct 2015 22:10:04 +0200 Subject: [PATCH 577/685] Translate Go-tutorial to Finnish --- fi-fi/go-fi.html.markdown | 428 ++++++++++++++++++++++++++++++++++++ fi-fi/go.html.markdown | 440 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 868 insertions(+) create mode 100644 fi-fi/go-fi.html.markdown create mode 100644 fi-fi/go.html.markdown diff --git a/fi-fi/go-fi.html.markdown b/fi-fi/go-fi.html.markdown new file mode 100644 index 00000000..dc684227 --- /dev/null +++ b/fi-fi/go-fi.html.markdown @@ -0,0 +1,428 @@ +--- +name: Go +category: language +language: Go +filename: learngo.go +contributors: + - ["Sonia Keys", "https://github.com/soniakeys"] + - ["Christopher Bess", "https://github.com/cbess"] + - ["Jesse Johnson", "https://github.com/holocronweaver"] + - ["Quint Guvernator", "https://github.com/qguv"] + - ["Jose Donizetti", "https://github.com/josedonizetti"] + - ["Alexej Friesen", "https://github.com/heyalexej"] + - ["Clayton Walker", "https://github.com/cwalk"] +--- + +Go was created out of the need to get work done. It's not the latest trend +in computer science, but it is the newest fastest way to solve real-world +problems. + +It has familiar concepts of imperative languages with static typing. +It's fast to compile and fast to execute, it adds easy-to-understand +concurrency to leverage today's multi-core CPUs, and has features to +help with large-scale programming. + +Go comes with a great standard library and an enthusiastic community. + +```go +// Single line comment +/* Multi- + line comment */ + +// A package clause starts every source file. +// Main is a special name declaring an executable rather than a library. +package main + +// Import declaration declares library packages referenced in this file. +import ( + "fmt" // A package in the Go standard library. + "io/ioutil" // Implements some I/O utility functions. + m "math" // Math library with local alias m. + "net/http" // Yes, a web server! + "strconv" // String conversions. +) + +// A function definition. Main is special. It is the entry point for the +// executable program. Love it or hate it, Go uses brace brackets. +func main() { + // Println outputs a line to stdout. + // Qualify it with the package name, fmt. + fmt.Println("Hello world!") + + // Call another function within this package. + beyondHello() +} + +// Functions have parameters in parentheses. +// If there are no parameters, empty parentheses are still required. +func beyondHello() { + var x int // Variable declaration. Variables must be declared before use. + x = 3 // Variable assignment. + // "Short" declarations use := to infer the type, declare, and assign. + y := 4 + sum, prod := learnMultiple(x, y) // Function returns two values. + fmt.Println("sum:", sum, "prod:", prod) // Simple output. + learnTypes() // < y minutes, learn more! +} + +/* <- multiline comment +Functions can have parameters and (multiple!) return values. +Here `x`, `y` are the arguments and `sum`, `prod` is the signature (what's returned). +Note that `x` and `sum` receive the type `int`. +*/ +func learnMultiple(x, y int) (sum, prod int) { + return x + y, x * y // Return two values. +} + +// Some built-in types and literals. +func learnTypes() { + // Short declaration usually gives you what you want. + str := "Learn Go!" // string type. + + s2 := `A "raw" string literal +can include line breaks.` // Same string type. + + // Non-ASCII literal. Go source is UTF-8. + g := 'Σ' // rune type, an alias for int32, holds a unicode code point. + + f := 3.14195 // float64, an IEEE-754 64-bit floating point number. + c := 3 + 4i // complex128, represented internally with two float64's. + + // var syntax with initializers. + var u uint = 7 // Unsigned, but implementation dependent size as with int. + var pi float32 = 22. / 7 + + // Conversion syntax with a short declaration. + n := byte('\n') // byte is an alias for uint8. + + // Arrays have size fixed at compile time. + var a4 [4]int // An array of 4 ints, initialized to all 0. + a3 := [...]int{3, 1, 5} // An array initialized with a fixed size of three + // elements, with values 3, 1, and 5. + + // Slices have dynamic size. Arrays and slices each have advantages + // but use cases for slices are much more common. + s3 := []int{4, 5, 9} // Compare to a3. No ellipsis here. + s4 := make([]int, 4) // Allocates slice of 4 ints, initialized to all 0. + var d2 [][]float64 // Declaration only, nothing allocated here. + bs := []byte("a slice") // Type conversion syntax. + + // Because they are dynamic, slices can be appended to on-demand. + // To append elements to a slice, the built-in append() function is used. + // First argument is a slice to which we are appending. Commonly, + // the array variable is updated in place, as in example below. + s := []int{1, 2, 3} // Result is a slice of length 3. + s = append(s, 4, 5, 6) // Added 3 elements. Slice now has length of 6. + fmt.Println(s) // Updated slice is now [1 2 3 4 5 6] + + // To append another slice, instead of list of atomic elements we can + // pass a reference to a slice or a slice literal like this, with a + // trailing ellipsis, meaning take a slice and unpack its elements, + // appending them to slice s. + s = append(s, []int{7, 8, 9}...) // Second argument is a slice literal. + fmt.Println(s) // Updated slice is now [1 2 3 4 5 6 7 8 9] + + p, q := learnMemory() // Declares p, q to be type pointer to int. + fmt.Println(*p, *q) // * follows a pointer. This prints two ints. + + // Maps are a dynamically growable associative array type, like the + // hash or dictionary types of some other languages. + m := map[string]int{"three": 3, "four": 4} + m["one"] = 1 + + // Unused variables are an error in Go. + // The underscore lets you "use" a variable but discard its value. + _, _, _, _, _, _, _, _, _, _ = str, s2, g, f, u, pi, n, a3, s4, bs + // Output of course counts as using a variable. + fmt.Println(s, c, a4, s3, d2, m) + + learnFlowControl() // Back in the flow. +} + +// It is possible, unlike in many other languages for functions in go +// to have named return values. +// Assigning a name to the type being returned in the function declaration line +// allows us to easily return from multiple points in a function as well as to +// only use the return keyword, without anything further. +func learnNamedReturns(x, y int) (z int) { + z = x * y + return // z is implicit here, because we named it earlier. +} + +// Go is fully garbage collected. It has pointers but no pointer arithmetic. +// You can make a mistake with a nil pointer, but not by incrementing a pointer. +func learnMemory() (p, q *int) { + // Named return values p and q have type pointer to int. + p = new(int) // Built-in function new allocates memory. + // The allocated int is initialized to 0, p is no longer nil. + s := make([]int, 20) // Allocate 20 ints as a single block of memory. + s[3] = 7 // Assign one of them. + r := -2 // Declare another local variable. + return &s[3], &r // & takes the address of an object. +} + +func expensiveComputation() float64 { + return m.Exp(10) +} + +func learnFlowControl() { + // If statements require brace brackets, and do not require parentheses. + if true { + fmt.Println("told ya") + } + // Formatting is standardized by the command line command "go fmt." + if false { + // Pout. + } else { + // Gloat. + } + // Use switch in preference to chained if statements. + x := 42.0 + switch x { + case 0: + case 1: + case 42: + // Cases don't "fall through". + /* + There is a `fallthrough` keyword however, see: + https://github.com/golang/go/wiki/Switch#fall-through + */ + case 43: + // Unreached. + default: + // Default case is optional. + } + // Like if, for doesn't use parens either. + // Variables declared in for and if are local to their scope. + for x := 0; x < 3; x++ { // ++ is a statement. + fmt.Println("iteration", x) + } + // x == 42 here. + + // For is the only loop statement in Go, but it has alternate forms. + for { // Infinite loop. + break // Just kidding. + continue // Unreached. + } + + // You can use range to iterate over an array, a slice, a string, a map, or a channel. + // range returns one (channel) or two values (array, slice, string and map). + for key, value := range map[string]int{"one": 1, "two": 2, "three": 3} { + // for each pair in the map, print key and value + fmt.Printf("key=%s, value=%d\n", key, value) + } + + // As with for, := in an if statement means to declare and assign + // y first, then test y > x. + if y := expensiveComputation(); y > x { + x = y + } + // Function literals are closures. + xBig := func() bool { + return x > 10000 // References x declared above switch statement. + } + fmt.Println("xBig:", xBig()) // true (we last assigned e^10 to x). + x = 1.3e3 // This makes x == 1300 + fmt.Println("xBig:", xBig()) // false now. + + // What's more is function literals may be defined and called inline, + // acting as an argument to function, as long as: + // a) function literal is called immediately (), + // b) result type matches expected type of argument. + fmt.Println("Add + double two numbers: ", + func(a, b int) int { + return (a + b) * 2 + }(10, 2)) // Called with args 10 and 2 + // => Add + double two numbers: 24 + + // When you need it, you'll love it. + goto love +love: + + learnFunctionFactory() // func returning func is fun(3)(3) + learnDefer() // A quick detour to an important keyword. + learnInterfaces() // Good stuff coming up! +} + +func learnFunctionFactory() { + // Next two are equivalent, with second being more practical + fmt.Println(sentenceFactory("summer")("A beautiful", "day!")) + + d := sentenceFactory("summer") + fmt.Println(d("A beautiful", "day!")) + fmt.Println(d("A lazy", "afternoon!")) +} + +// Decorators are common in other languages. Same can be done in Go +// with function literals that accept arguments. +func sentenceFactory(mystring string) func(before, after string) string { + return func(before, after string) string { + return fmt.Sprintf("%s %s %s", before, mystring, after) // new string + } +} + +func learnDefer() (ok bool) { + // Deferred statements are executed just before the function returns. + defer fmt.Println("deferred statements execute in reverse (LIFO) order.") + defer fmt.Println("\nThis line is being printed first because") + // Defer is commonly used to close a file, so the function closing the + // file stays close to the function opening the file. + return true +} + +// Define Stringer as an interface type with one method, String. +type Stringer interface { + String() string +} + +// Define pair as a struct with two fields, ints named x and y. +type pair struct { + x, y int +} + +// Define a method on type pair. Pair now implements Stringer. +func (p pair) String() string { // p is called the "receiver" + // Sprintf is another public function in package fmt. + // Dot syntax references fields of p. + return fmt.Sprintf("(%d, %d)", p.x, p.y) +} + +func learnInterfaces() { + // Brace syntax is a "struct literal". It evaluates to an initialized + // struct. The := syntax declares and initializes p to this struct. + p := pair{3, 4} + fmt.Println(p.String()) // Call String method of p, of type pair. + var i Stringer // Declare i of interface type Stringer. + i = p // Valid because pair implements Stringer + // Call String method of i, of type Stringer. Output same as above. + fmt.Println(i.String()) + + // Functions in the fmt package call the String method to ask an object + // for a printable representation of itself. + fmt.Println(p) // Output same as above. Println calls String method. + fmt.Println(i) // Output same as above. + + learnVariadicParams("great", "learning", "here!") +} + +// Functions can have variadic parameters. +func learnVariadicParams(myStrings ...interface{}) { + // Iterate each value of the variadic. + // The underbar here is ignoring the index argument of the array. + for _, param := range myStrings { + fmt.Println("param:", param) + } + + // Pass variadic value as a variadic parameter. + fmt.Println("params:", fmt.Sprintln(myStrings...)) + + learnErrorHandling() +} + +func learnErrorHandling() { + // ", ok" idiom used to tell if something worked or not. + m := map[int]string{3: "three", 4: "four"} + if x, ok := m[1]; !ok { // ok will be false because 1 is not in the map. + fmt.Println("no one there") + } else { + fmt.Print(x) // x would be the value, if it were in the map. + } + // An error value communicates not just "ok" but more about the problem. + if _, err := strconv.Atoi("non-int"); err != nil { // _ discards value + // prints 'strconv.ParseInt: parsing "non-int": invalid syntax' + fmt.Println(err) + } + // We'll revisit interfaces a little later. Meanwhile, + learnConcurrency() +} + +// c is a channel, a concurrency-safe communication object. +func inc(i int, c chan int) { + c <- i + 1 // <- is the "send" operator when a channel appears on the left. +} + +// We'll use inc to increment some numbers concurrently. +func learnConcurrency() { + // Same make function used earlier to make a slice. Make allocates and + // initializes slices, maps, and channels. + c := make(chan int) + // Start three concurrent goroutines. Numbers will be incremented + // concurrently, perhaps in parallel if the machine is capable and + // properly configured. All three send to the same channel. + go inc(0, c) // go is a statement that starts a new goroutine. + go inc(10, c) + go inc(-805, c) + // Read three results from the channel and print them out. + // There is no telling in what order the results will arrive! + fmt.Println(<-c, <-c, <-c) // channel on right, <- is "receive" operator. + + cs := make(chan string) // Another channel, this one handles strings. + ccs := make(chan chan string) // A channel of string channels. + go func() { c <- 84 }() // Start a new goroutine just to send a value. + go func() { cs <- "wordy" }() // Again, for cs this time. + // Select has syntax like a switch statement but each case involves + // a channel operation. It selects a case at random out of the cases + // that are ready to communicate. + select { + case i := <-c: // The value received can be assigned to a variable, + fmt.Printf("it's a %T", i) + case <-cs: // or the value received can be discarded. + fmt.Println("it's a string") + case <-ccs: // Empty channel, not ready for communication. + fmt.Println("didn't happen.") + } + // At this point a value was taken from either c or cs. One of the two + // goroutines started above has completed, the other will remain blocked. + + learnWebProgramming() // Go does it. You want to do it too. +} + +// A single function from package http starts a web server. +func learnWebProgramming() { + + // First parameter of ListenAndServe is TCP address to listen to. + // Second parameter is an interface, specifically http.Handler. + go func() { + err := http.ListenAndServe(":8080", pair{}) + fmt.Println(err) // don't ignore errors + }() + + requestServer() +} + +// Make pair an http.Handler by implementing its only method, ServeHTTP. +func (p pair) ServeHTTP(w http.ResponseWriter, r *http.Request) { + // Serve data with a method of http.ResponseWriter. + w.Write([]byte("You learned Go in Y minutes!")) +} + +func requestServer() { + resp, err := http.Get("http://localhost:8080") + fmt.Println(err) + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + fmt.Printf("\nWebserver said: `%s`", string(body)) +} +``` + +## Further Reading + +The root of all things Go is the [official Go web site](http://golang.org/). +There you can follow the tutorial, play interactively, and read lots. +Aside from a tour, [the docs](https://golang.org/doc/) contain information on +how to write clean and effective Go code, package and command docs, and release history. + +The language definition itself is highly recommended. It's easy to read +and amazingly short (as language definitions go these days.) + +You can play around with the code on [Go playground](https://play.golang.org/p/tnWMjr16Mm). Try to change it and run it from your browser! Note that you can use [https://play.golang.org](https://play.golang.org) as a [REPL](https://en.wikipedia.org/wiki/Read-eval-print_loop) to test things and code in your browser, without even installing Go. + +On the reading list for students of Go is the [source code to the standard +library](http://golang.org/src/pkg/). Comprehensively documented, it +demonstrates the best of readable and understandable Go, Go style, and Go +idioms. Or you can click on a function name in [the +documentation](http://golang.org/pkg/) and the source code comes up! + +Another great resource to learn Go is [Go by example](https://gobyexample.com/). + +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/fi-fi/go.html.markdown b/fi-fi/go.html.markdown new file mode 100644 index 00000000..714d4e06 --- /dev/null +++ b/fi-fi/go.html.markdown @@ -0,0 +1,440 @@ +--- +name: Go +category: language +language: Go +filename: learngo.go +contributors: + - ["Sonia Keys", "https://github.com/soniakeys"] + - ["Christopher Bess", "https://github.com/cbess"] + - ["Jesse Johnson", "https://github.com/holocronweaver"] + - ["Quint Guvernator", "https://github.com/qguv"] + - ["Jose Donizetti", "https://github.com/josedonizetti"] + - ["Alexej Friesen", "https://github.com/heyalexej"] + - ["Clayton Walker", "https://github.com/cwalk"] +translators: + - ["Timo Virkkunen", "https://github.com/ComSecNinja"] +--- + +Go luotiin työn tekemistä varten. Se ei ole tietojenkäsittelyn uusin trendi, +mutta se on uusin nopein tapa ratkaista oikean maailman ongelmia. + +Sillä on staattisesti tyypitetyistä imperatiivisista kielistä tuttuja +konsepteja. Se kääntyy ja suorittuu nopeasti, lisää helposti käsitettävän +samanaikaisten komentojen suorittamisen nykyaikaisten moniytimisten +prosessoreiden hyödyntämiseksi ja antaa käyttäjälle ominaisuuksia suurten +projektien käsittelemiseksi. + +Go tuo mukanaan loistavan oletuskirjaston sekä innokkaan yhteisön. + +```go +// Yhden rivin kommentti +/* Useamman + rivin kommentti */ + +// Package -lausekkeella aloitetaan jokainen lähdekooditiedosto. +// Main on erityinen nimi joka ilmoittaa +// suoritettavan tiedoston kirjaston sijasta. +package main + +// Import -lauseke ilmoittaa tässä tiedostossa käytetyt kirjastot. +import ( + "fmt" // Paketti Go:n oletuskirjastosta. + "io/ioutil" // Implementoi hyödyllisiä I/O -funktioita. + m "math" // Matematiikkakirjasto jolla on paikallinen nimi m. + "net/http" // Kyllä, web-palvelin! + "strconv" // Kirjainjonojen muuntajia. +) + +// Funktion määrittelijä. Main on erityinen: se on ohjelman suorittamisen +// aloittamisen alkupiste. Rakasta tai vihaa sitä, Go käyttää aaltosulkeita. +func main() { + // Println tulostaa rivin stdoutiin. + // Se tulee paketin fmt mukana, joten paketin nimi on mainittava. + fmt.Println("Hei maailma!") + + // Kutsu toista funktiota tämän paketin sisällä. + beyondHello() +} + +// Funktioilla voi olla parametrejä sulkeissa. +// Vaikkei parametrejä olisikaan, sulkeet ovat silti pakolliset. +func beyondHello() { + var x int // Muuttujan ilmoittaminen: ne täytyy ilmoittaa ennen käyttöä. + x = 3 // Arvon antaminen muuttujalle. + // "Lyhyet" ilmoitukset käyttävät := joka päättelee tyypin, ilmoittaa + // sekä antaa arvon muuttujalle. + y := 4 + sum, prod := learnMultiple(x, y) // Funktio palauttaa kaksi arvoa. + fmt.Println("summa:", sum, "tulo:", prod) // Yksinkertainen tuloste. + learnTypes() // < y minuuttia, opi lisää! +} + +/* <- usean rivin kommentti +Funktioilla voi olla parametrejä ja (useita!) palautusarvoja. +Tässä `x`, `y` ovat argumenttejä ja `sum`, `prod` ovat ne, mitä palautetaan. +Huomaa että `x` ja `sum` saavat tyyin `int`. +*/ +func learnMultiple(x, y int) (sum, prod int) { + return x + y, x * y // Palauta kaksi arvoa. +} + +// Sisäänrakennettuja tyyppejä ja todellisarvoja. +func learnTypes() { + // Lyhyt ilmoitus antaa yleensä haluamasi. + str := "Opi Go!" // merkkijonotyyppi. + + s2 := `"raaka" todellisarvoinen merrkijono +voi sisältää rivinvaihtoja.` // Sama merkkijonotyyppi. + + // Ei-ASCII todellisarvo. Go-lähdekoodi on UTF-8. + g := 'Σ' // riimutyyppi, lempinimi int32:lle, sisältää unicode-koodipisteen. + + f := 3.14195 //float64, IEEE-754 64-bittinen liukuluku. + c := 3 + 4i // complex128, sisäisesti ilmaistu kahdella float64:lla. + + // var -syntaksi alkuarvoilla. + var u uint = 7 // Etumerkitön, toteutus riippuvainen koosta kuten int. + var pi float32 = 22. / 7 + + // Muuntosyntaksi lyhyellä ilmoituksella. + n := byte('\n') // byte on leminimi uint8:lle. + + // Listoilla on kiinteä koko kääntöhetkellä. + var a4 [4]int // 4 int:in lista, alkiot ovat alustettu nolliksi. + a3 := [...]int{3, 1, 5} // Listan alustaja jonka kiinteäksi kooksi tulee 3 + // alkiota, jotka saavat arvot 3, 1, ja 5. + + // Siivuilla on muuttuva koko. Sekä listoilla että siivuilla on puolensa, + // mutta siivut ovat yleisempiä käyttötapojensa vuoksi. + s3 := []int{4, 5, 9} // Vertaa a3: ei sananheittoa (...). + s4 := make([]int, 4) // Varaa 4 int:n siivun, alkiot alustettu nolliksi. + var d2 [][]float64 // Vain ilmoitus, muistia ei varata. + bs := []byte("a slice") // Tyypinmuuntosyntaksi. + + // Koska siivut ovat dynaamisia, niitä voidaan yhdistellä sellaisinaan. + // Lisätäksesi alkioita siivuun, käytä sisäänrakennettua append()-funktiota. + // Ensimmäinen argumentti on siivu, johon alkoita lisätään. + s := []int{1, 2, 3} // Tuloksena on kolmen alkion pituinen lista. + s = append(s, 4, 5, 6) // Lisätty kolme alkiota. Siivun pituudeksi tulee 6. + fmt.Println(s) // Päivitetty siivu on nyt [1 2 3 4 5 6] + + // Lisätäksesi siivun toiseen voit antaa append-funktiolle referenssin + // siivuun tai todellisarvoiseen siivuun lisäämällä sanaheiton argumentin + // perään. Tämä tapa purkaa siivun alkiot ja lisää ne siivuun s. + s = append(s, []int{7, 8, 9}...) // 2. argumentti on todellisarvoinen siivu. + fmt.Println(s) // Päivitetty siivu on nyt [1 2 3 4 5 6 7 8 9] + + p, q := learnMemory() // Ilmoittaa p ja q olevan tyyppiä osoittaja int:iin. + fmt.Println(*p, *q) // * seuraa osoittajaa. Tämä tulostaa kaksi int:ä. + + // Kartat ovat dynaamisesti kasvavia assosiatiivisia listoja, kuten hash tai + // dictionary toisissa kielissä. + m := map[string]int{"three": 3, "four": 4} + m["one"] = 1 + + // Käyttämättömät muuttujat ovat virheitä Go:ssa. + // Alaviiva antaa sinun "käyttää" muuttujan mutta hylätä sen arvon. + _, _, _, _, _, _, _, _, _, _ = str, s2, g, f, u, pi, n, a3, s4, bs + // Tulostaminen tietysti lasketaan muuttujan käyttämiseksi. + fmt.Println(s, c, a4, s3, d2, m) + + learnFlowControl() // Takaisin flowiin. +} + +// Go:ssa on useista muista kielistä poiketen mahdollista käyttää nimettyjä +// palautusarvoja. +// Nimen antaminen palautettavan arvon tyypille funktion ilmoitusrivillä +// mahdollistaa helpon palaamisen useasta eri funktion suorituskohdasta sekä +// pelkän return-lausekkeen käytön ilman muita mainintoja. +func learnNamedReturns(x, y int) (z int) { + z = x * y + return // z on epäsuorasti tässä, koska nimesimme sen aiemmin. +} + +// Go kerää kaikki roskansa. Siinä on osoittajia mutta ei niiden laskentoa. +// Voit tehdä virheen mitättömällä osoittajalla, mutta et +// kasvattamalla osoittajaa. +func learnMemory() (p, q *int) { + // Nimetyillä palautusarvoilla p ja q on tyyppi osoittaja int:iin. + p = new(int) // Sisäänrakennettu funktio new varaa muistia. + // Varattu int on alustettu nollaksi, p ei ole enää mitätön. + s := make([]int, 20) // Varaa 20 int:ä yhteen kohtaan muistissa. + s[3] = 7 // Anna yhdelle niistä arvo. + r := -2 // Ilmoita toinen paikallinen muuttuja. + return &s[3], &r // & ottaa asian osoitteen muistissa. +} + +func expensiveComputation() float64 { + return m.Exp(10) +} + +func learnFlowControl() { + // If -lausekkeet vaativat aaltosulkeet mutta ei tavallisia sulkeita. + if true { + fmt.Println("mitä mä sanoin") + } + // Muotoilu on standardoitu käyttämällä komentorivin komentoa "go fmt". + if false { + // Nyrpistys. + } else { + // Nautinto. + } + // Käytä switch -lauseketta ketjutettujen if -lausekkeiden sijasta. + x := 42.0 + switch x { + case 0: + case 1: + case 42: + // Tapaukset eivät "tipu läpi". + /* + Kuitenkin meillä on erikseen `fallthrough` -avainsana. Katso: + https://github.com/golang/go/wiki/Switch#fall-through + */ + case 43: + // Saavuttamaton. + default: + // Oletustapaus (default) on valinnainen. + } + // Kuten if, for -lauseke ei myöskään käytä tavallisia sulkeita. + // for- ja if- lausekkeissa ilmoitetut muuttujat ovat paikallisia niiden + // piireissä. + for x := 0; x < 3; x++ { // ++ on lauseke. Sama kuin "x = x + 1". + fmt.Println("iteraatio", x) + } + // x == 42 tässä. + + // For on kielen ainoa silmukkalauseke mutta sillä on vaihtoehtosia muotoja. + for { // Päättymätön silmukka. + break // Kunhan vitsailin. + continue // Saavuttamaton. + } + + // Voit käyttää range -lauseketta iteroidaksesi listojen, siivujen, merkki- + // jonojen, karttojen tai kanavien läpi. range palauttaa yhden (kanava) tai + // kaksi arvoa (lista, siivu, merkkijono ja kartta). + for key, value := range map[string]int{"yksi": 1, "kaksi": 2, "kolme": 3} { + // jokaista kartan paria kohden, tulosta avain ja arvo + fmt.Printf("avain=%s, arvo=%d\n", key, value) + } + + // Kuten for -lausekkeessa := if -lausekkeessa tarkoittaa ilmoittamista ja + // arvon asettamista. + // Aseta ensin y, sitten testaa onko y > x. + if y := expensiveComputation(); y > x { + x = y + } + // Todellisarvoiset funktiot ovat sulkeumia. + xBig := func() bool { + return x > 10000 // Viittaa ylempänä ilmoitettuun x:ään. + } + fmt.Println("xBig:", xBig()) // tosi (viimeisin arvo on e^10). + x = 1.3e3 // Tämä tekee x == 1300 + fmt.Println("xBig:", xBig()) // epätosi nyt. + + // Lisäksi todellisarvoiset funktiot voidaan samalla sekä ilmoittaa että + // kutsua, jolloin niitä voidaan käyttää funtioiden argumentteina kunhan: + // a) todellisarvoinen funktio kutsutaan välittömästi (), + // b) palautettu tyyppi vastaa odotettua argumentin tyyppiä. + fmt.Println("Lisää ja tuplaa kaksi numeroa: ", + func(a, b int) int { + return (a + b) * 2 + }(10, 2)) // Kutsuttu argumenteilla 10 ja 2 + // => Lisää ja tuplaa kaksi numeroa: 24 + + // Kun tarvitset sitä, rakastat sitä. + goto love +love: + + learnFunctionFactory() // Funktioita palauttavat funktiot + learnDefer() // Nopea kiertoreitti tärkeään avainsanaan. + learnInterfaces() // Hyvää kamaa tulossa! +} + +func learnFunctionFactory() { + // Seuraavat kaksi ovat vastaavia, mutta toinen on käytännöllisempi + fmt.Println(sentenceFactory("kesä")("Kaunis", "päivä!")) + + d := sentenceFactory("kesä") + fmt.Println(d("Kaunis", "päivä!")) + fmt.Println(d("Laiska", "iltapäivä!")) +} + +// Somisteet ovat yleisiä toisissa kielissä. Sama saavutetaan Go:ssa käyttämällä +// todellisarvoisia funktioita jotka ottavat vastaan argumentteja. +func sentenceFactory(mystring string) func(before, after string) string { + return func(before, after string) string { + return fmt.Sprintf("%s %s %s", before, mystring, after) // uusi jono + } +} + +func learnDefer() (ok bool) { + // Lykätyt lausekkeet suoritetaan juuri ennen funktiosta palaamista. + defer fmt.Println("lykätyt lausekkeet suorittuvat") + defer fmt.Println("käänteisessä järjestyksessä (LIFO).") + defer fmt.Println("\nTämä rivi tulostuu ensin, koska") + // Defer -lauseketta käytetään yleisesti tiedoston sulkemiseksi, jotta + // tiedoston sulkeva funktio pysyy lähellä sen avannutta funktiota. + return true +} + +// Määrittele Stringer rajapintatyypiksi jolla on +// yksi jäsenfunktio eli metodi, String. +type Stringer interface { + String() string +} + +// Määrittele pair rakenteeksi jossa on kaksi kenttää, x ja y tyyppiä int. +type pair struct { + x, y int +} + +// Määrittele jäsenfunktio pair:lle. Pair tyydyttää nyt Stringer -rajapinnan. +func (p pair) String() string { // p:tä kutsutaan nimellä "receiver" + // Sprintf on toinen julkinen funktio paketissa fmt. + // Pistesyntaksilla viitataan P:n kenttiin. + return fmt.Sprintf("(%d, %d)", p.x, p.y) +} + +func learnInterfaces() { + // Aaltosuljesyntaksi on "todellisarvoinen rakenne". Se todentuu alustetuksi + // rakenteeksi. := -syntaksi ilmoittaa ja alustaa p:n täksi rakenteeksi. + p := pair{3, 4} + fmt.Println(p.String()) // Kutsu p:n (tyyppiä pair) jäsenfunktiota String. + var i Stringer // Ilmoita i Stringer-rajapintatyypiksi. + i = p // Pätevä koska pair tyydyttää rajapinnan Stringer. + // Kutsu i:n (Stringer) jäsenfunktiota String. Tuloste on sama kuin yllä. + fmt.Println(i.String()) + + // Funktiot fmt-paketissa kutsuvat argumenttien String-jäsenfunktiota + // selvittääkseen onko niistä saatavilla tulostettavaa vastinetta. + fmt.Println(p) // Tuloste on sama kuin yllä. Println kutsuu String-metodia. + fmt.Println(i) // Tuloste on sama kuin yllä. + + learnVariadicParams("loistavaa", "oppimista", "täällä!") +} + +// Funktioilla voi olla muuttuva eli variteettinen +// määrä argumentteja eli parametrejä. +func learnVariadicParams(myStrings ...interface{}) { + // Iteroi jokaisen argumentin läpi. + // Tässä alaviivalla sivuutetaan argumenttilistan kunkin kohdan indeksi. + for _, param := range myStrings { + fmt.Println("param:", param) + } + + // Luovuta variteettinen arvo variteettisena parametrinä. + fmt.Println("params:", fmt.Sprintln(myStrings...)) + + learnErrorHandling() +} + +func learnErrorHandling() { + // "; ok" -muotoa käytetään selvittääksemme toimiko jokin vai ei. + m := map[int]string{3: "kolme", 4: "neljä"} + if x, ok := m[1]; !ok { // ok on epätosi koska 1 ei ole kartassa. + fmt.Println("ei ketään täällä") + } else { + fmt.Print(x) // x olisi arvo jos se olisi kartassa. + } + // Virhearvo voi kertoa muutakin ongelmasta. + if _, err := strconv.Atoi("ei-luku"); err != nil { // _ sivuuttaa arvon + // tulostaa strconv.ParseInt: parsing "ei-luku": invalid syntax + fmt.Println(err) + } + // Palaamme rajapintoihin hieman myöhemmin. Sillä välin, + learnConcurrency() +} + +// c on kanava, samanaikaisturvallinen viestintäolio. +func inc(i int, c chan int) { + c <- i + 1 // <- on "lähetysoperaattori" kun kanava on siitä vasemmalla. +} + +// Käytämme inc -funktiota samanaikaiseen lukujen lisäämiseen. +func learnConcurrency() { + // Sama make -funktio jota käytimme aikaisemmin siivun luomiseksi. Make + // varaa muistin ja alustaa siivut, kartat ja kanavat. + c := make(chan int) + // Aloita kolme samanaikaista gorutiinia (goroutine). Luvut kasvavat + // samanaikaisesti ja ehkäpä rinnakkain jos laite on kykenevä ja oikein + // määritelty. Kaikki kolme lähettävät samalle kanavalle. + go inc(0, c) // go -lauseke aloittaa uuden gorutiinin. + go inc(10, c) + go inc(-805, c) + // Lue kolme palautusarvoa kanavalta ja tulosta ne. + // Niiden saapumisjärjestystä ei voida taata! + // <- on "vastaanotto-operaattori" jos kanava on oikealla + fmt.Println(<-c, <-c, <-c) + + cs := make(chan string) // Toinen kanava joka käsittelee merkkijonoja. + ccs := make(chan chan string) // Kanava joka käsittelee merkkijonokanavia. + go func() { c <- 84 }() // Aloita uusi gorutiini arvon lähettämiseksi. + go func() { cs <- "sanaa" }() // Uudestaan, mutta cs -kanava tällä kertaa. + // Select -lausekkeella on syntaksi kuten switch -lausekkeella mutta + // jokainen tapaus sisältää kanavaoperaation. Se valitsee satunnaisen + // tapauksen niistä kanavista, jotka ovat kommunikaatiovalmiita + select { + case i := <-c: // Vastaanotettu arvo voidaan antaa muuttujalle + fmt.Printf("se on %T", i) + case <-cs: // tai vastaanotettu arvo voidaan sivuuttaa. + fmt.Println("se on merkkijono") + case <-ccs: // Tyhjä kanava; ei valmis kommunikaatioon. + fmt.Println("ei tapahtunut.") + } + // Tässä vaiheessa arvo oli otettu joko c:ltä tai cs:ltä. Yksi kahdesta + // ylempänä aloitetusta gorutiinista on valmistunut, toinen pysyy tukossa. + + learnWebProgramming() // Go tekee sitä. Sinäkin haluat tehdä sitä. +} + +// Yksittäinen funktio http -paketista aloittaa web-palvelimen. +func learnWebProgramming() { + + // ListenAndServe:n ensimmäinen parametri on TCP-osoite, jota kuunnellaan. + // Toinen parametri on rajapinta, http.Handler. + go func() { + err := http.ListenAndServe(":8080", pair{}) + fmt.Println(err) // älä sivuuta virheitä. + }() + + requestServer() +} + +// Tee pair:sta http.Handler implementoimalla sen ainoa metodi, ServeHTTP. +func (p pair) ServeHTTP(w http.ResponseWriter, r *http.Request) { + // Tarjoa dataa metodilla http.ResponseWriter. + w.Write([]byte("Opit Go:n Y minuutissa!")) +} + +func requestServer() { + resp, err := http.Get("http://localhost:8080") + fmt.Println(err) + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + fmt.Printf("\nWeb-palvelin sanoo: `%s`", string(body)) +} +``` + +## Lisää luettavaa + +Go-tietämyksen alku ja juuri on sen [virallinen verkkosivu]()(http://golang.org/). +Siellä voit seurata oppitunteja, askarrella vuorovaikutteisesti sekä lukea paljon. +Kierroksen lisäksi [dokumentaatio](https://golang.org/doc/) pitää sisällään tietoa +siistin Go-koodin kirjoittamisesta, pakettien ja komentojen käytöstä sekä julkaisuhistoriasta. + +Kielen määritelmä itsessään on suuresti suositeltavissa. Se on helppolukuinen ja +yllättävän lyhyt (niissä määrin kuin kielimääritelmät nykypäivänä ovat.) + +Voit askarrella parissa kanssa [Go playgroundissa](https://play.golang.org/p/tnWMjr16Mm). +Muuttele sitä ja aja se selaimestasi! Huomaa, että voit käyttää [https://play.golang.org](https://play.golang.org) +[REPL:na](https://en.wikipedia.org/wiki/Read-eval-print_loop) testataksesi ja koodataksesi selaimessasi, ilman Go:n asentamista. + +Go:n opiskelijoiden lukulistalla on [oletuskirjaston lähdekoodi](http://golang.org/src/pkg/). +Kattavasti dokumentoituna se antaa parhaan kuvan helppolukuisesta ja ymmärrettävästä Go-koodista, +-tyylistä ja -tavoista. Voit klikata funktion nimeä [doukumentaatiossa](http://golang.org/pkg/) ja +lähdekoodi tulee esille! + +Toinen loistava paikka oppia on [Go by example](https://gobyexample.com/). + +Go Mobile lisää tuen mobiilialustoille (Android ja iOS). Voit kirjoittaa pelkällä Go:lla natiiveja applikaatioita tai tehdä kirjaston joka sisältää sidoksia +Go-paketista, jotka puolestaan voidaan kutsua Javasta (Android) ja Objective-C:stä (iOS). Katso [lisätietoja](https://github.com/golang/go/wiki/Mobile). From 0234e6eee1ed26f2135c271a198a4b0517d5bb2e Mon Sep 17 00:00:00 2001 From: ComSecNinja Date: Sat, 31 Oct 2015 22:16:50 +0200 Subject: [PATCH 578/685] Changes to follow style guide --- fi-fi/go-fi.html.markdown | 480 +++++++++++++++++++------------------- fi-fi/go.html.markdown | 440 ---------------------------------- 2 files changed, 246 insertions(+), 674 deletions(-) delete mode 100644 fi-fi/go.html.markdown diff --git a/fi-fi/go-fi.html.markdown b/fi-fi/go-fi.html.markdown index dc684227..8a0ca245 100644 --- a/fi-fi/go-fi.html.markdown +++ b/fi-fi/go-fi.html.markdown @@ -2,7 +2,7 @@ name: Go category: language language: Go -filename: learngo.go +filename: learngo-fi.go contributors: - ["Sonia Keys", "https://github.com/soniakeys"] - ["Christopher Bess", "https://github.com/cbess"] @@ -11,154 +11,157 @@ contributors: - ["Jose Donizetti", "https://github.com/josedonizetti"] - ["Alexej Friesen", "https://github.com/heyalexej"] - ["Clayton Walker", "https://github.com/cwalk"] +translators: + - ["Timo Virkkunen", "https://github.com/ComSecNinja"] --- -Go was created out of the need to get work done. It's not the latest trend -in computer science, but it is the newest fastest way to solve real-world -problems. +Go luotiin työn tekemistä varten. Se ei ole tietojenkäsittelyn uusin trendi, +mutta se on uusin nopein tapa ratkaista oikean maailman ongelmia. -It has familiar concepts of imperative languages with static typing. -It's fast to compile and fast to execute, it adds easy-to-understand -concurrency to leverage today's multi-core CPUs, and has features to -help with large-scale programming. +Sillä on staattisesti tyypitetyistä imperatiivisista kielistä tuttuja +konsepteja. Se kääntyy ja suorittuu nopeasti, lisää helposti käsitettävän +samanaikaisten komentojen suorittamisen nykyaikaisten moniytimisten +prosessoreiden hyödyntämiseksi ja antaa käyttäjälle ominaisuuksia suurten +projektien käsittelemiseksi. -Go comes with a great standard library and an enthusiastic community. +Go tuo mukanaan loistavan oletuskirjaston sekä innokkaan yhteisön. ```go -// Single line comment -/* Multi- - line comment */ +// Yhden rivin kommentti +/* Useamman + rivin kommentti */ -// A package clause starts every source file. -// Main is a special name declaring an executable rather than a library. +// Package -lausekkeella aloitetaan jokainen lähdekooditiedosto. +// Main on erityinen nimi joka ilmoittaa +// suoritettavan tiedoston kirjaston sijasta. package main -// Import declaration declares library packages referenced in this file. +// Import -lauseke ilmoittaa tässä tiedostossa käytetyt kirjastot. import ( - "fmt" // A package in the Go standard library. - "io/ioutil" // Implements some I/O utility functions. - m "math" // Math library with local alias m. - "net/http" // Yes, a web server! - "strconv" // String conversions. + "fmt" // Paketti Go:n oletuskirjastosta. + "io/ioutil" // Implementoi hyödyllisiä I/O -funktioita. + m "math" // Matematiikkakirjasto jolla on paikallinen nimi m. + "net/http" // Kyllä, web-palvelin! + "strconv" // Kirjainjonojen muuntajia. ) -// A function definition. Main is special. It is the entry point for the -// executable program. Love it or hate it, Go uses brace brackets. +// Funktion määrittelijä. Main on erityinen: se on ohjelman suorittamisen +// aloittamisen alkupiste. Rakasta tai vihaa sitä, Go käyttää aaltosulkeita. func main() { - // Println outputs a line to stdout. - // Qualify it with the package name, fmt. - fmt.Println("Hello world!") + // Println tulostaa rivin stdoutiin. + // Se tulee paketin fmt mukana, joten paketin nimi on mainittava. + fmt.Println("Hei maailma!") - // Call another function within this package. + // Kutsu toista funktiota tämän paketin sisällä. beyondHello() } -// Functions have parameters in parentheses. -// If there are no parameters, empty parentheses are still required. +// Funktioilla voi olla parametrejä sulkeissa. +// Vaikkei parametrejä olisikaan, sulkeet ovat silti pakolliset. func beyondHello() { - var x int // Variable declaration. Variables must be declared before use. - x = 3 // Variable assignment. - // "Short" declarations use := to infer the type, declare, and assign. + var x int // Muuttujan ilmoittaminen: ne täytyy ilmoittaa ennen käyttöä. + x = 3 // Arvon antaminen muuttujalle. + // "Lyhyet" ilmoitukset käyttävät := joka päättelee tyypin, ilmoittaa + // sekä antaa arvon muuttujalle. y := 4 - sum, prod := learnMultiple(x, y) // Function returns two values. - fmt.Println("sum:", sum, "prod:", prod) // Simple output. - learnTypes() // < y minutes, learn more! + sum, prod := learnMultiple(x, y) // Funktio palauttaa kaksi arvoa. + fmt.Println("summa:", sum, "tulo:", prod) // Yksinkertainen tuloste. + learnTypes() // < y minuuttia, opi lisää! } -/* <- multiline comment -Functions can have parameters and (multiple!) return values. -Here `x`, `y` are the arguments and `sum`, `prod` is the signature (what's returned). -Note that `x` and `sum` receive the type `int`. +/* <- usean rivin kommentti +Funktioilla voi olla parametrejä ja (useita!) palautusarvoja. +Tässä `x`, `y` ovat argumenttejä ja `sum`, `prod` ovat ne, mitä palautetaan. +Huomaa että `x` ja `sum` saavat tyyin `int`. */ func learnMultiple(x, y int) (sum, prod int) { - return x + y, x * y // Return two values. + return x + y, x * y // Palauta kaksi arvoa. } -// Some built-in types and literals. +// Sisäänrakennettuja tyyppejä ja todellisarvoja. func learnTypes() { - // Short declaration usually gives you what you want. - str := "Learn Go!" // string type. + // Lyhyt ilmoitus antaa yleensä haluamasi. + str := "Opi Go!" // merkkijonotyyppi. - s2 := `A "raw" string literal -can include line breaks.` // Same string type. + s2 := `"raaka" todellisarvoinen merrkijono +voi sisältää rivinvaihtoja.` // Sama merkkijonotyyppi. - // Non-ASCII literal. Go source is UTF-8. - g := 'Σ' // rune type, an alias for int32, holds a unicode code point. + // Ei-ASCII todellisarvo. Go-lähdekoodi on UTF-8. + g := 'Σ' // riimutyyppi, lempinimi int32:lle, sisältää unicode-koodipisteen. - f := 3.14195 // float64, an IEEE-754 64-bit floating point number. - c := 3 + 4i // complex128, represented internally with two float64's. + f := 3.14195 //float64, IEEE-754 64-bittinen liukuluku. + c := 3 + 4i // complex128, sisäisesti ilmaistu kahdella float64:lla. - // var syntax with initializers. - var u uint = 7 // Unsigned, but implementation dependent size as with int. + // var -syntaksi alkuarvoilla. + var u uint = 7 // Etumerkitön, toteutus riippuvainen koosta kuten int. var pi float32 = 22. / 7 - // Conversion syntax with a short declaration. - n := byte('\n') // byte is an alias for uint8. + // Muuntosyntaksi lyhyellä ilmoituksella. + n := byte('\n') // byte on leminimi uint8:lle. - // Arrays have size fixed at compile time. - var a4 [4]int // An array of 4 ints, initialized to all 0. - a3 := [...]int{3, 1, 5} // An array initialized with a fixed size of three - // elements, with values 3, 1, and 5. + // Listoilla on kiinteä koko kääntöhetkellä. + var a4 [4]int // 4 int:in lista, alkiot ovat alustettu nolliksi. + a3 := [...]int{3, 1, 5} // Listan alustaja jonka kiinteäksi kooksi tulee 3 + // alkiota, jotka saavat arvot 3, 1, ja 5. - // Slices have dynamic size. Arrays and slices each have advantages - // but use cases for slices are much more common. - s3 := []int{4, 5, 9} // Compare to a3. No ellipsis here. - s4 := make([]int, 4) // Allocates slice of 4 ints, initialized to all 0. - var d2 [][]float64 // Declaration only, nothing allocated here. - bs := []byte("a slice") // Type conversion syntax. + // Siivuilla on muuttuva koko. Sekä listoilla että siivuilla on puolensa, + // mutta siivut ovat yleisempiä käyttötapojensa vuoksi. + s3 := []int{4, 5, 9} // Vertaa a3: ei sananheittoa (...). + s4 := make([]int, 4) // Varaa 4 int:n siivun, alkiot alustettu nolliksi. + var d2 [][]float64 // Vain ilmoitus, muistia ei varata. + bs := []byte("a slice") // Tyypinmuuntosyntaksi. - // Because they are dynamic, slices can be appended to on-demand. - // To append elements to a slice, the built-in append() function is used. - // First argument is a slice to which we are appending. Commonly, - // the array variable is updated in place, as in example below. - s := []int{1, 2, 3} // Result is a slice of length 3. - s = append(s, 4, 5, 6) // Added 3 elements. Slice now has length of 6. - fmt.Println(s) // Updated slice is now [1 2 3 4 5 6] + // Koska siivut ovat dynaamisia, niitä voidaan yhdistellä sellaisinaan. + // Lisätäksesi alkioita siivuun, käytä sisäänrakennettua append()-funktiota. + // Ensimmäinen argumentti on siivu, johon alkoita lisätään. + s := []int{1, 2, 3} // Tuloksena on kolmen alkion pituinen lista. + s = append(s, 4, 5, 6) // Lisätty kolme alkiota. Siivun pituudeksi tulee 6. + fmt.Println(s) // Päivitetty siivu on nyt [1 2 3 4 5 6] - // To append another slice, instead of list of atomic elements we can - // pass a reference to a slice or a slice literal like this, with a - // trailing ellipsis, meaning take a slice and unpack its elements, - // appending them to slice s. - s = append(s, []int{7, 8, 9}...) // Second argument is a slice literal. - fmt.Println(s) // Updated slice is now [1 2 3 4 5 6 7 8 9] + // Lisätäksesi siivun toiseen voit antaa append-funktiolle referenssin + // siivuun tai todellisarvoiseen siivuun lisäämällä sanaheiton argumentin + // perään. Tämä tapa purkaa siivun alkiot ja lisää ne siivuun s. + s = append(s, []int{7, 8, 9}...) // 2. argumentti on todellisarvoinen siivu. + fmt.Println(s) // Päivitetty siivu on nyt [1 2 3 4 5 6 7 8 9] - p, q := learnMemory() // Declares p, q to be type pointer to int. - fmt.Println(*p, *q) // * follows a pointer. This prints two ints. + p, q := learnMemory() // Ilmoittaa p ja q olevan tyyppiä osoittaja int:iin. + fmt.Println(*p, *q) // * seuraa osoittajaa. Tämä tulostaa kaksi int:ä. - // Maps are a dynamically growable associative array type, like the - // hash or dictionary types of some other languages. + // Kartat ovat dynaamisesti kasvavia assosiatiivisia listoja, kuten hash tai + // dictionary toisissa kielissä. m := map[string]int{"three": 3, "four": 4} m["one"] = 1 - // Unused variables are an error in Go. - // The underscore lets you "use" a variable but discard its value. + // Käyttämättömät muuttujat ovat virheitä Go:ssa. + // Alaviiva antaa sinun "käyttää" muuttujan mutta hylätä sen arvon. _, _, _, _, _, _, _, _, _, _ = str, s2, g, f, u, pi, n, a3, s4, bs - // Output of course counts as using a variable. + // Tulostaminen tietysti lasketaan muuttujan käyttämiseksi. fmt.Println(s, c, a4, s3, d2, m) - learnFlowControl() // Back in the flow. + learnFlowControl() // Takaisin flowiin. } -// It is possible, unlike in many other languages for functions in go -// to have named return values. -// Assigning a name to the type being returned in the function declaration line -// allows us to easily return from multiple points in a function as well as to -// only use the return keyword, without anything further. +// Go:ssa on useista muista kielistä poiketen mahdollista käyttää nimettyjä +// palautusarvoja. +// Nimen antaminen palautettavan arvon tyypille funktion ilmoitusrivillä +// mahdollistaa helpon palaamisen useasta eri funktion suorituskohdasta sekä +// pelkän return-lausekkeen käytön ilman muita mainintoja. func learnNamedReturns(x, y int) (z int) { z = x * y - return // z is implicit here, because we named it earlier. + return // z on epäsuorasti tässä, koska nimesimme sen aiemmin. } -// Go is fully garbage collected. It has pointers but no pointer arithmetic. -// You can make a mistake with a nil pointer, but not by incrementing a pointer. +// Go kerää kaikki roskansa. Siinä on osoittajia mutta ei niiden laskentoa. +// Voit tehdä virheen mitättömällä osoittajalla, mutta et +// kasvattamalla osoittajaa. func learnMemory() (p, q *int) { - // Named return values p and q have type pointer to int. - p = new(int) // Built-in function new allocates memory. - // The allocated int is initialized to 0, p is no longer nil. - s := make([]int, 20) // Allocate 20 ints as a single block of memory. - s[3] = 7 // Assign one of them. - r := -2 // Declare another local variable. - return &s[3], &r // & takes the address of an object. + // Nimetyillä palautusarvoilla p ja q on tyyppi osoittaja int:iin. + p = new(int) // Sisäänrakennettu funktio new varaa muistia. + // Varattu int on alustettu nollaksi, p ei ole enää mitätön. + s := make([]int, 20) // Varaa 20 int:ä yhteen kohtaan muistissa. + s[3] = 7 // Anna yhdelle niistä arvo. + r := -2 // Ilmoita toinen paikallinen muuttuja. + return &s[3], &r // & ottaa asian osoitteen muistissa. } func expensiveComputation() float64 { @@ -166,234 +169,241 @@ func expensiveComputation() float64 { } func learnFlowControl() { - // If statements require brace brackets, and do not require parentheses. + // If -lausekkeet vaativat aaltosulkeet mutta ei tavallisia sulkeita. if true { - fmt.Println("told ya") + fmt.Println("mitä mä sanoin") } - // Formatting is standardized by the command line command "go fmt." + // Muotoilu on standardoitu käyttämällä komentorivin komentoa "go fmt". if false { - // Pout. + // Nyrpistys. } else { - // Gloat. + // Nautinto. } - // Use switch in preference to chained if statements. + // Käytä switch -lauseketta ketjutettujen if -lausekkeiden sijasta. x := 42.0 switch x { case 0: case 1: case 42: - // Cases don't "fall through". + // Tapaukset eivät "tipu läpi". /* - There is a `fallthrough` keyword however, see: + Kuitenkin meillä on erikseen `fallthrough` -avainsana. Katso: https://github.com/golang/go/wiki/Switch#fall-through */ case 43: - // Unreached. + // Saavuttamaton. default: - // Default case is optional. + // Oletustapaus (default) on valinnainen. } - // Like if, for doesn't use parens either. - // Variables declared in for and if are local to their scope. - for x := 0; x < 3; x++ { // ++ is a statement. - fmt.Println("iteration", x) + // Kuten if, for -lauseke ei myöskään käytä tavallisia sulkeita. + // for- ja if- lausekkeissa ilmoitetut muuttujat ovat paikallisia niiden + // piireissä. + for x := 0; x < 3; x++ { // ++ on lauseke. Sama kuin "x = x + 1". + fmt.Println("iteraatio", x) } - // x == 42 here. + // x == 42 tässä. - // For is the only loop statement in Go, but it has alternate forms. - for { // Infinite loop. - break // Just kidding. - continue // Unreached. + // For on kielen ainoa silmukkalauseke mutta sillä on vaihtoehtosia muotoja. + for { // Päättymätön silmukka. + break // Kunhan vitsailin. + continue // Saavuttamaton. } - // You can use range to iterate over an array, a slice, a string, a map, or a channel. - // range returns one (channel) or two values (array, slice, string and map). - for key, value := range map[string]int{"one": 1, "two": 2, "three": 3} { - // for each pair in the map, print key and value - fmt.Printf("key=%s, value=%d\n", key, value) + // Voit käyttää range -lauseketta iteroidaksesi listojen, siivujen, merkki- + // jonojen, karttojen tai kanavien läpi. range palauttaa yhden (kanava) tai + // kaksi arvoa (lista, siivu, merkkijono ja kartta). + for key, value := range map[string]int{"yksi": 1, "kaksi": 2, "kolme": 3} { + // jokaista kartan paria kohden, tulosta avain ja arvo + fmt.Printf("avain=%s, arvo=%d\n", key, value) } - // As with for, := in an if statement means to declare and assign - // y first, then test y > x. + // Kuten for -lausekkeessa := if -lausekkeessa tarkoittaa ilmoittamista ja + // arvon asettamista. + // Aseta ensin y, sitten testaa onko y > x. if y := expensiveComputation(); y > x { x = y } - // Function literals are closures. + // Todellisarvoiset funktiot ovat sulkeumia. xBig := func() bool { - return x > 10000 // References x declared above switch statement. + return x > 10000 // Viittaa ylempänä ilmoitettuun x:ään. } - fmt.Println("xBig:", xBig()) // true (we last assigned e^10 to x). - x = 1.3e3 // This makes x == 1300 - fmt.Println("xBig:", xBig()) // false now. + fmt.Println("xBig:", xBig()) // tosi (viimeisin arvo on e^10). + x = 1.3e3 // Tämä tekee x == 1300 + fmt.Println("xBig:", xBig()) // epätosi nyt. - // What's more is function literals may be defined and called inline, - // acting as an argument to function, as long as: - // a) function literal is called immediately (), - // b) result type matches expected type of argument. - fmt.Println("Add + double two numbers: ", + // Lisäksi todellisarvoiset funktiot voidaan samalla sekä ilmoittaa että + // kutsua, jolloin niitä voidaan käyttää funtioiden argumentteina kunhan: + // a) todellisarvoinen funktio kutsutaan välittömästi (), + // b) palautettu tyyppi vastaa odotettua argumentin tyyppiä. + fmt.Println("Lisää ja tuplaa kaksi numeroa: ", func(a, b int) int { return (a + b) * 2 - }(10, 2)) // Called with args 10 and 2 - // => Add + double two numbers: 24 + }(10, 2)) // Kutsuttu argumenteilla 10 ja 2 + // => Lisää ja tuplaa kaksi numeroa: 24 - // When you need it, you'll love it. + // Kun tarvitset sitä, rakastat sitä. goto love love: - learnFunctionFactory() // func returning func is fun(3)(3) - learnDefer() // A quick detour to an important keyword. - learnInterfaces() // Good stuff coming up! + learnFunctionFactory() // Funktioita palauttavat funktiot + learnDefer() // Nopea kiertoreitti tärkeään avainsanaan. + learnInterfaces() // Hyvää kamaa tulossa! } func learnFunctionFactory() { - // Next two are equivalent, with second being more practical - fmt.Println(sentenceFactory("summer")("A beautiful", "day!")) + // Seuraavat kaksi ovat vastaavia, mutta toinen on käytännöllisempi + fmt.Println(sentenceFactory("kesä")("Kaunis", "päivä!")) - d := sentenceFactory("summer") - fmt.Println(d("A beautiful", "day!")) - fmt.Println(d("A lazy", "afternoon!")) + d := sentenceFactory("kesä") + fmt.Println(d("Kaunis", "päivä!")) + fmt.Println(d("Laiska", "iltapäivä!")) } -// Decorators are common in other languages. Same can be done in Go -// with function literals that accept arguments. +// Somisteet ovat yleisiä toisissa kielissä. Sama saavutetaan Go:ssa käyttämällä +// todellisarvoisia funktioita jotka ottavat vastaan argumentteja. func sentenceFactory(mystring string) func(before, after string) string { return func(before, after string) string { - return fmt.Sprintf("%s %s %s", before, mystring, after) // new string + return fmt.Sprintf("%s %s %s", before, mystring, after) // uusi jono } } func learnDefer() (ok bool) { - // Deferred statements are executed just before the function returns. - defer fmt.Println("deferred statements execute in reverse (LIFO) order.") - defer fmt.Println("\nThis line is being printed first because") - // Defer is commonly used to close a file, so the function closing the - // file stays close to the function opening the file. + // Lykätyt lausekkeet suoritetaan juuri ennen funktiosta palaamista. + defer fmt.Println("lykätyt lausekkeet suorittuvat") + defer fmt.Println("käänteisessä järjestyksessä (LIFO).") + defer fmt.Println("\nTämä rivi tulostuu ensin, koska") + // Defer -lauseketta käytetään yleisesti tiedoston sulkemiseksi, jotta + // tiedoston sulkeva funktio pysyy lähellä sen avannutta funktiota. return true } -// Define Stringer as an interface type with one method, String. +// Määrittele Stringer rajapintatyypiksi jolla on +// yksi jäsenfunktio eli metodi, String. type Stringer interface { String() string } -// Define pair as a struct with two fields, ints named x and y. +// Määrittele pair rakenteeksi jossa on kaksi kenttää, x ja y tyyppiä int. type pair struct { x, y int } -// Define a method on type pair. Pair now implements Stringer. -func (p pair) String() string { // p is called the "receiver" - // Sprintf is another public function in package fmt. - // Dot syntax references fields of p. +// Määrittele jäsenfunktio pair:lle. Pair tyydyttää nyt Stringer -rajapinnan. +func (p pair) String() string { // p:tä kutsutaan nimellä "receiver" + // Sprintf on toinen julkinen funktio paketissa fmt. + // Pistesyntaksilla viitataan P:n kenttiin. return fmt.Sprintf("(%d, %d)", p.x, p.y) } func learnInterfaces() { - // Brace syntax is a "struct literal". It evaluates to an initialized - // struct. The := syntax declares and initializes p to this struct. + // Aaltosuljesyntaksi on "todellisarvoinen rakenne". Se todentuu alustetuksi + // rakenteeksi. := -syntaksi ilmoittaa ja alustaa p:n täksi rakenteeksi. p := pair{3, 4} - fmt.Println(p.String()) // Call String method of p, of type pair. - var i Stringer // Declare i of interface type Stringer. - i = p // Valid because pair implements Stringer - // Call String method of i, of type Stringer. Output same as above. + fmt.Println(p.String()) // Kutsu p:n (tyyppiä pair) jäsenfunktiota String. + var i Stringer // Ilmoita i Stringer-rajapintatyypiksi. + i = p // Pätevä koska pair tyydyttää rajapinnan Stringer. + // Kutsu i:n (Stringer) jäsenfunktiota String. Tuloste on sama kuin yllä. fmt.Println(i.String()) - // Functions in the fmt package call the String method to ask an object - // for a printable representation of itself. - fmt.Println(p) // Output same as above. Println calls String method. - fmt.Println(i) // Output same as above. + // Funktiot fmt-paketissa kutsuvat argumenttien String-jäsenfunktiota + // selvittääkseen onko niistä saatavilla tulostettavaa vastinetta. + fmt.Println(p) // Tuloste on sama kuin yllä. Println kutsuu String-metodia. + fmt.Println(i) // Tuloste on sama kuin yllä. - learnVariadicParams("great", "learning", "here!") + learnVariadicParams("loistavaa", "oppimista", "täällä!") } -// Functions can have variadic parameters. +// Funktioilla voi olla muuttuva eli variteettinen +// määrä argumentteja eli parametrejä. func learnVariadicParams(myStrings ...interface{}) { - // Iterate each value of the variadic. - // The underbar here is ignoring the index argument of the array. + // Iteroi jokaisen argumentin läpi. + // Tässä alaviivalla sivuutetaan argumenttilistan kunkin kohdan indeksi. for _, param := range myStrings { fmt.Println("param:", param) } - // Pass variadic value as a variadic parameter. + // Luovuta variteettinen arvo variteettisena parametrinä. fmt.Println("params:", fmt.Sprintln(myStrings...)) learnErrorHandling() } func learnErrorHandling() { - // ", ok" idiom used to tell if something worked or not. - m := map[int]string{3: "three", 4: "four"} - if x, ok := m[1]; !ok { // ok will be false because 1 is not in the map. - fmt.Println("no one there") + // "; ok" -muotoa käytetään selvittääksemme toimiko jokin vai ei. + m := map[int]string{3: "kolme", 4: "neljä"} + if x, ok := m[1]; !ok { // ok on epätosi koska 1 ei ole kartassa. + fmt.Println("ei ketään täällä") } else { - fmt.Print(x) // x would be the value, if it were in the map. + fmt.Print(x) // x olisi arvo jos se olisi kartassa. } - // An error value communicates not just "ok" but more about the problem. - if _, err := strconv.Atoi("non-int"); err != nil { // _ discards value - // prints 'strconv.ParseInt: parsing "non-int": invalid syntax' + // Virhearvo voi kertoa muutakin ongelmasta. + if _, err := strconv.Atoi("ei-luku"); err != nil { // _ sivuuttaa arvon + // tulostaa strconv.ParseInt: parsing "ei-luku": invalid syntax fmt.Println(err) } - // We'll revisit interfaces a little later. Meanwhile, + // Palaamme rajapintoihin hieman myöhemmin. Sillä välin, learnConcurrency() } -// c is a channel, a concurrency-safe communication object. +// c on kanava, samanaikaisturvallinen viestintäolio. func inc(i int, c chan int) { - c <- i + 1 // <- is the "send" operator when a channel appears on the left. + c <- i + 1 // <- on "lähetysoperaattori" kun kanava on siitä vasemmalla. } -// We'll use inc to increment some numbers concurrently. +// Käytämme inc -funktiota samanaikaiseen lukujen lisäämiseen. func learnConcurrency() { - // Same make function used earlier to make a slice. Make allocates and - // initializes slices, maps, and channels. + // Sama make -funktio jota käytimme aikaisemmin siivun luomiseksi. Make + // varaa muistin ja alustaa siivut, kartat ja kanavat. c := make(chan int) - // Start three concurrent goroutines. Numbers will be incremented - // concurrently, perhaps in parallel if the machine is capable and - // properly configured. All three send to the same channel. - go inc(0, c) // go is a statement that starts a new goroutine. + // Aloita kolme samanaikaista gorutiinia (goroutine). Luvut kasvavat + // samanaikaisesti ja ehkäpä rinnakkain jos laite on kykenevä ja oikein + // määritelty. Kaikki kolme lähettävät samalle kanavalle. + go inc(0, c) // go -lauseke aloittaa uuden gorutiinin. go inc(10, c) go inc(-805, c) - // Read three results from the channel and print them out. - // There is no telling in what order the results will arrive! - fmt.Println(<-c, <-c, <-c) // channel on right, <- is "receive" operator. + // Lue kolme palautusarvoa kanavalta ja tulosta ne. + // Niiden saapumisjärjestystä ei voida taata! + // <- on "vastaanotto-operaattori" jos kanava on oikealla + fmt.Println(<-c, <-c, <-c) - cs := make(chan string) // Another channel, this one handles strings. - ccs := make(chan chan string) // A channel of string channels. - go func() { c <- 84 }() // Start a new goroutine just to send a value. - go func() { cs <- "wordy" }() // Again, for cs this time. - // Select has syntax like a switch statement but each case involves - // a channel operation. It selects a case at random out of the cases - // that are ready to communicate. + cs := make(chan string) // Toinen kanava joka käsittelee merkkijonoja. + ccs := make(chan chan string) // Kanava joka käsittelee merkkijonokanavia. + go func() { c <- 84 }() // Aloita uusi gorutiini arvon lähettämiseksi. + go func() { cs <- "sanaa" }() // Uudestaan, mutta cs -kanava tällä kertaa. + // Select -lausekkeella on syntaksi kuten switch -lausekkeella mutta + // jokainen tapaus sisältää kanavaoperaation. Se valitsee satunnaisen + // tapauksen niistä kanavista, jotka ovat kommunikaatiovalmiita select { - case i := <-c: // The value received can be assigned to a variable, - fmt.Printf("it's a %T", i) - case <-cs: // or the value received can be discarded. - fmt.Println("it's a string") - case <-ccs: // Empty channel, not ready for communication. - fmt.Println("didn't happen.") + case i := <-c: // Vastaanotettu arvo voidaan antaa muuttujalle + fmt.Printf("se on %T", i) + case <-cs: // tai vastaanotettu arvo voidaan sivuuttaa. + fmt.Println("se on merkkijono") + case <-ccs: // Tyhjä kanava; ei valmis kommunikaatioon. + fmt.Println("ei tapahtunut.") } - // At this point a value was taken from either c or cs. One of the two - // goroutines started above has completed, the other will remain blocked. + // Tässä vaiheessa arvo oli otettu joko c:ltä tai cs:ltä. Yksi kahdesta + // ylempänä aloitetusta gorutiinista on valmistunut, toinen pysyy tukossa. - learnWebProgramming() // Go does it. You want to do it too. + learnWebProgramming() // Go tekee sitä. Sinäkin haluat tehdä sitä. } -// A single function from package http starts a web server. +// Yksittäinen funktio http -paketista aloittaa web-palvelimen. func learnWebProgramming() { - // First parameter of ListenAndServe is TCP address to listen to. - // Second parameter is an interface, specifically http.Handler. + // ListenAndServe:n ensimmäinen parametri on TCP-osoite, jota kuunnellaan. + // Toinen parametri on rajapinta, http.Handler. go func() { err := http.ListenAndServe(":8080", pair{}) - fmt.Println(err) // don't ignore errors + fmt.Println(err) // älä sivuuta virheitä. }() requestServer() } -// Make pair an http.Handler by implementing its only method, ServeHTTP. +// Tee pair:sta http.Handler implementoimalla sen ainoa metodi, ServeHTTP. func (p pair) ServeHTTP(w http.ResponseWriter, r *http.Request) { - // Serve data with a method of http.ResponseWriter. - w.Write([]byte("You learned Go in Y minutes!")) + // Tarjoa dataa metodilla http.ResponseWriter. + w.Write([]byte("Opit Go:n Y minuutissa!")) } func requestServer() { @@ -401,28 +411,30 @@ func requestServer() { fmt.Println(err) defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) - fmt.Printf("\nWebserver said: `%s`", string(body)) + fmt.Printf("\nWeb-palvelin sanoo: `%s`", string(body)) } ``` -## Further Reading +## Lisää luettavaa -The root of all things Go is the [official Go web site](http://golang.org/). -There you can follow the tutorial, play interactively, and read lots. -Aside from a tour, [the docs](https://golang.org/doc/) contain information on -how to write clean and effective Go code, package and command docs, and release history. +Go-tietämyksen alku ja juuri on sen [virallinen verkkosivu]()(http://golang.org/). +Siellä voit seurata oppitunteja, askarrella vuorovaikutteisesti sekä lukea paljon. +Kierroksen lisäksi [dokumentaatio](https://golang.org/doc/) pitää sisällään tietoa +siistin Go-koodin kirjoittamisesta, pakettien ja komentojen käytöstä sekä julkaisuhistoriasta. -The language definition itself is highly recommended. It's easy to read -and amazingly short (as language definitions go these days.) +Kielen määritelmä itsessään on suuresti suositeltavissa. Se on helppolukuinen ja +yllättävän lyhyt (niissä määrin kuin kielimääritelmät nykypäivänä ovat.) -You can play around with the code on [Go playground](https://play.golang.org/p/tnWMjr16Mm). Try to change it and run it from your browser! Note that you can use [https://play.golang.org](https://play.golang.org) as a [REPL](https://en.wikipedia.org/wiki/Read-eval-print_loop) to test things and code in your browser, without even installing Go. +Voit askarrella parissa kanssa [Go playgroundissa](https://play.golang.org/p/tnWMjr16Mm). +Muuttele sitä ja aja se selaimestasi! Huomaa, että voit käyttää [https://play.golang.org](https://play.golang.org) +[REPL:na](https://en.wikipedia.org/wiki/Read-eval-print_loop) testataksesi ja koodataksesi selaimessasi, ilman Go:n asentamista. -On the reading list for students of Go is the [source code to the standard -library](http://golang.org/src/pkg/). Comprehensively documented, it -demonstrates the best of readable and understandable Go, Go style, and Go -idioms. Or you can click on a function name in [the -documentation](http://golang.org/pkg/) and the source code comes up! +Go:n opiskelijoiden lukulistalla on [oletuskirjaston lähdekoodi](http://golang.org/src/pkg/). +Kattavasti dokumentoituna se antaa parhaan kuvan helppolukuisesta ja ymmärrettävästä Go-koodista, +-tyylistä ja -tavoista. Voit klikata funktion nimeä [doukumentaatiossa](http://golang.org/pkg/) ja +lähdekoodi tulee esille! -Another great resource to learn Go is [Go by example](https://gobyexample.com/). +Toinen loistava paikka oppia on [Go by example](https://gobyexample.com/). -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. +Go Mobile lisää tuen mobiilialustoille (Android ja iOS). Voit kirjoittaa pelkällä Go:lla natiiveja applikaatioita tai tehdä kirjaston joka sisältää sidoksia +Go-paketista, jotka puolestaan voidaan kutsua Javasta (Android) ja Objective-C:stä (iOS). Katso [lisätietoja](https://github.com/golang/go/wiki/Mobile). diff --git a/fi-fi/go.html.markdown b/fi-fi/go.html.markdown deleted file mode 100644 index 714d4e06..00000000 --- a/fi-fi/go.html.markdown +++ /dev/null @@ -1,440 +0,0 @@ ---- -name: Go -category: language -language: Go -filename: learngo.go -contributors: - - ["Sonia Keys", "https://github.com/soniakeys"] - - ["Christopher Bess", "https://github.com/cbess"] - - ["Jesse Johnson", "https://github.com/holocronweaver"] - - ["Quint Guvernator", "https://github.com/qguv"] - - ["Jose Donizetti", "https://github.com/josedonizetti"] - - ["Alexej Friesen", "https://github.com/heyalexej"] - - ["Clayton Walker", "https://github.com/cwalk"] -translators: - - ["Timo Virkkunen", "https://github.com/ComSecNinja"] ---- - -Go luotiin työn tekemistä varten. Se ei ole tietojenkäsittelyn uusin trendi, -mutta se on uusin nopein tapa ratkaista oikean maailman ongelmia. - -Sillä on staattisesti tyypitetyistä imperatiivisista kielistä tuttuja -konsepteja. Se kääntyy ja suorittuu nopeasti, lisää helposti käsitettävän -samanaikaisten komentojen suorittamisen nykyaikaisten moniytimisten -prosessoreiden hyödyntämiseksi ja antaa käyttäjälle ominaisuuksia suurten -projektien käsittelemiseksi. - -Go tuo mukanaan loistavan oletuskirjaston sekä innokkaan yhteisön. - -```go -// Yhden rivin kommentti -/* Useamman - rivin kommentti */ - -// Package -lausekkeella aloitetaan jokainen lähdekooditiedosto. -// Main on erityinen nimi joka ilmoittaa -// suoritettavan tiedoston kirjaston sijasta. -package main - -// Import -lauseke ilmoittaa tässä tiedostossa käytetyt kirjastot. -import ( - "fmt" // Paketti Go:n oletuskirjastosta. - "io/ioutil" // Implementoi hyödyllisiä I/O -funktioita. - m "math" // Matematiikkakirjasto jolla on paikallinen nimi m. - "net/http" // Kyllä, web-palvelin! - "strconv" // Kirjainjonojen muuntajia. -) - -// Funktion määrittelijä. Main on erityinen: se on ohjelman suorittamisen -// aloittamisen alkupiste. Rakasta tai vihaa sitä, Go käyttää aaltosulkeita. -func main() { - // Println tulostaa rivin stdoutiin. - // Se tulee paketin fmt mukana, joten paketin nimi on mainittava. - fmt.Println("Hei maailma!") - - // Kutsu toista funktiota tämän paketin sisällä. - beyondHello() -} - -// Funktioilla voi olla parametrejä sulkeissa. -// Vaikkei parametrejä olisikaan, sulkeet ovat silti pakolliset. -func beyondHello() { - var x int // Muuttujan ilmoittaminen: ne täytyy ilmoittaa ennen käyttöä. - x = 3 // Arvon antaminen muuttujalle. - // "Lyhyet" ilmoitukset käyttävät := joka päättelee tyypin, ilmoittaa - // sekä antaa arvon muuttujalle. - y := 4 - sum, prod := learnMultiple(x, y) // Funktio palauttaa kaksi arvoa. - fmt.Println("summa:", sum, "tulo:", prod) // Yksinkertainen tuloste. - learnTypes() // < y minuuttia, opi lisää! -} - -/* <- usean rivin kommentti -Funktioilla voi olla parametrejä ja (useita!) palautusarvoja. -Tässä `x`, `y` ovat argumenttejä ja `sum`, `prod` ovat ne, mitä palautetaan. -Huomaa että `x` ja `sum` saavat tyyin `int`. -*/ -func learnMultiple(x, y int) (sum, prod int) { - return x + y, x * y // Palauta kaksi arvoa. -} - -// Sisäänrakennettuja tyyppejä ja todellisarvoja. -func learnTypes() { - // Lyhyt ilmoitus antaa yleensä haluamasi. - str := "Opi Go!" // merkkijonotyyppi. - - s2 := `"raaka" todellisarvoinen merrkijono -voi sisältää rivinvaihtoja.` // Sama merkkijonotyyppi. - - // Ei-ASCII todellisarvo. Go-lähdekoodi on UTF-8. - g := 'Σ' // riimutyyppi, lempinimi int32:lle, sisältää unicode-koodipisteen. - - f := 3.14195 //float64, IEEE-754 64-bittinen liukuluku. - c := 3 + 4i // complex128, sisäisesti ilmaistu kahdella float64:lla. - - // var -syntaksi alkuarvoilla. - var u uint = 7 // Etumerkitön, toteutus riippuvainen koosta kuten int. - var pi float32 = 22. / 7 - - // Muuntosyntaksi lyhyellä ilmoituksella. - n := byte('\n') // byte on leminimi uint8:lle. - - // Listoilla on kiinteä koko kääntöhetkellä. - var a4 [4]int // 4 int:in lista, alkiot ovat alustettu nolliksi. - a3 := [...]int{3, 1, 5} // Listan alustaja jonka kiinteäksi kooksi tulee 3 - // alkiota, jotka saavat arvot 3, 1, ja 5. - - // Siivuilla on muuttuva koko. Sekä listoilla että siivuilla on puolensa, - // mutta siivut ovat yleisempiä käyttötapojensa vuoksi. - s3 := []int{4, 5, 9} // Vertaa a3: ei sananheittoa (...). - s4 := make([]int, 4) // Varaa 4 int:n siivun, alkiot alustettu nolliksi. - var d2 [][]float64 // Vain ilmoitus, muistia ei varata. - bs := []byte("a slice") // Tyypinmuuntosyntaksi. - - // Koska siivut ovat dynaamisia, niitä voidaan yhdistellä sellaisinaan. - // Lisätäksesi alkioita siivuun, käytä sisäänrakennettua append()-funktiota. - // Ensimmäinen argumentti on siivu, johon alkoita lisätään. - s := []int{1, 2, 3} // Tuloksena on kolmen alkion pituinen lista. - s = append(s, 4, 5, 6) // Lisätty kolme alkiota. Siivun pituudeksi tulee 6. - fmt.Println(s) // Päivitetty siivu on nyt [1 2 3 4 5 6] - - // Lisätäksesi siivun toiseen voit antaa append-funktiolle referenssin - // siivuun tai todellisarvoiseen siivuun lisäämällä sanaheiton argumentin - // perään. Tämä tapa purkaa siivun alkiot ja lisää ne siivuun s. - s = append(s, []int{7, 8, 9}...) // 2. argumentti on todellisarvoinen siivu. - fmt.Println(s) // Päivitetty siivu on nyt [1 2 3 4 5 6 7 8 9] - - p, q := learnMemory() // Ilmoittaa p ja q olevan tyyppiä osoittaja int:iin. - fmt.Println(*p, *q) // * seuraa osoittajaa. Tämä tulostaa kaksi int:ä. - - // Kartat ovat dynaamisesti kasvavia assosiatiivisia listoja, kuten hash tai - // dictionary toisissa kielissä. - m := map[string]int{"three": 3, "four": 4} - m["one"] = 1 - - // Käyttämättömät muuttujat ovat virheitä Go:ssa. - // Alaviiva antaa sinun "käyttää" muuttujan mutta hylätä sen arvon. - _, _, _, _, _, _, _, _, _, _ = str, s2, g, f, u, pi, n, a3, s4, bs - // Tulostaminen tietysti lasketaan muuttujan käyttämiseksi. - fmt.Println(s, c, a4, s3, d2, m) - - learnFlowControl() // Takaisin flowiin. -} - -// Go:ssa on useista muista kielistä poiketen mahdollista käyttää nimettyjä -// palautusarvoja. -// Nimen antaminen palautettavan arvon tyypille funktion ilmoitusrivillä -// mahdollistaa helpon palaamisen useasta eri funktion suorituskohdasta sekä -// pelkän return-lausekkeen käytön ilman muita mainintoja. -func learnNamedReturns(x, y int) (z int) { - z = x * y - return // z on epäsuorasti tässä, koska nimesimme sen aiemmin. -} - -// Go kerää kaikki roskansa. Siinä on osoittajia mutta ei niiden laskentoa. -// Voit tehdä virheen mitättömällä osoittajalla, mutta et -// kasvattamalla osoittajaa. -func learnMemory() (p, q *int) { - // Nimetyillä palautusarvoilla p ja q on tyyppi osoittaja int:iin. - p = new(int) // Sisäänrakennettu funktio new varaa muistia. - // Varattu int on alustettu nollaksi, p ei ole enää mitätön. - s := make([]int, 20) // Varaa 20 int:ä yhteen kohtaan muistissa. - s[3] = 7 // Anna yhdelle niistä arvo. - r := -2 // Ilmoita toinen paikallinen muuttuja. - return &s[3], &r // & ottaa asian osoitteen muistissa. -} - -func expensiveComputation() float64 { - return m.Exp(10) -} - -func learnFlowControl() { - // If -lausekkeet vaativat aaltosulkeet mutta ei tavallisia sulkeita. - if true { - fmt.Println("mitä mä sanoin") - } - // Muotoilu on standardoitu käyttämällä komentorivin komentoa "go fmt". - if false { - // Nyrpistys. - } else { - // Nautinto. - } - // Käytä switch -lauseketta ketjutettujen if -lausekkeiden sijasta. - x := 42.0 - switch x { - case 0: - case 1: - case 42: - // Tapaukset eivät "tipu läpi". - /* - Kuitenkin meillä on erikseen `fallthrough` -avainsana. Katso: - https://github.com/golang/go/wiki/Switch#fall-through - */ - case 43: - // Saavuttamaton. - default: - // Oletustapaus (default) on valinnainen. - } - // Kuten if, for -lauseke ei myöskään käytä tavallisia sulkeita. - // for- ja if- lausekkeissa ilmoitetut muuttujat ovat paikallisia niiden - // piireissä. - for x := 0; x < 3; x++ { // ++ on lauseke. Sama kuin "x = x + 1". - fmt.Println("iteraatio", x) - } - // x == 42 tässä. - - // For on kielen ainoa silmukkalauseke mutta sillä on vaihtoehtosia muotoja. - for { // Päättymätön silmukka. - break // Kunhan vitsailin. - continue // Saavuttamaton. - } - - // Voit käyttää range -lauseketta iteroidaksesi listojen, siivujen, merkki- - // jonojen, karttojen tai kanavien läpi. range palauttaa yhden (kanava) tai - // kaksi arvoa (lista, siivu, merkkijono ja kartta). - for key, value := range map[string]int{"yksi": 1, "kaksi": 2, "kolme": 3} { - // jokaista kartan paria kohden, tulosta avain ja arvo - fmt.Printf("avain=%s, arvo=%d\n", key, value) - } - - // Kuten for -lausekkeessa := if -lausekkeessa tarkoittaa ilmoittamista ja - // arvon asettamista. - // Aseta ensin y, sitten testaa onko y > x. - if y := expensiveComputation(); y > x { - x = y - } - // Todellisarvoiset funktiot ovat sulkeumia. - xBig := func() bool { - return x > 10000 // Viittaa ylempänä ilmoitettuun x:ään. - } - fmt.Println("xBig:", xBig()) // tosi (viimeisin arvo on e^10). - x = 1.3e3 // Tämä tekee x == 1300 - fmt.Println("xBig:", xBig()) // epätosi nyt. - - // Lisäksi todellisarvoiset funktiot voidaan samalla sekä ilmoittaa että - // kutsua, jolloin niitä voidaan käyttää funtioiden argumentteina kunhan: - // a) todellisarvoinen funktio kutsutaan välittömästi (), - // b) palautettu tyyppi vastaa odotettua argumentin tyyppiä. - fmt.Println("Lisää ja tuplaa kaksi numeroa: ", - func(a, b int) int { - return (a + b) * 2 - }(10, 2)) // Kutsuttu argumenteilla 10 ja 2 - // => Lisää ja tuplaa kaksi numeroa: 24 - - // Kun tarvitset sitä, rakastat sitä. - goto love -love: - - learnFunctionFactory() // Funktioita palauttavat funktiot - learnDefer() // Nopea kiertoreitti tärkeään avainsanaan. - learnInterfaces() // Hyvää kamaa tulossa! -} - -func learnFunctionFactory() { - // Seuraavat kaksi ovat vastaavia, mutta toinen on käytännöllisempi - fmt.Println(sentenceFactory("kesä")("Kaunis", "päivä!")) - - d := sentenceFactory("kesä") - fmt.Println(d("Kaunis", "päivä!")) - fmt.Println(d("Laiska", "iltapäivä!")) -} - -// Somisteet ovat yleisiä toisissa kielissä. Sama saavutetaan Go:ssa käyttämällä -// todellisarvoisia funktioita jotka ottavat vastaan argumentteja. -func sentenceFactory(mystring string) func(before, after string) string { - return func(before, after string) string { - return fmt.Sprintf("%s %s %s", before, mystring, after) // uusi jono - } -} - -func learnDefer() (ok bool) { - // Lykätyt lausekkeet suoritetaan juuri ennen funktiosta palaamista. - defer fmt.Println("lykätyt lausekkeet suorittuvat") - defer fmt.Println("käänteisessä järjestyksessä (LIFO).") - defer fmt.Println("\nTämä rivi tulostuu ensin, koska") - // Defer -lauseketta käytetään yleisesti tiedoston sulkemiseksi, jotta - // tiedoston sulkeva funktio pysyy lähellä sen avannutta funktiota. - return true -} - -// Määrittele Stringer rajapintatyypiksi jolla on -// yksi jäsenfunktio eli metodi, String. -type Stringer interface { - String() string -} - -// Määrittele pair rakenteeksi jossa on kaksi kenttää, x ja y tyyppiä int. -type pair struct { - x, y int -} - -// Määrittele jäsenfunktio pair:lle. Pair tyydyttää nyt Stringer -rajapinnan. -func (p pair) String() string { // p:tä kutsutaan nimellä "receiver" - // Sprintf on toinen julkinen funktio paketissa fmt. - // Pistesyntaksilla viitataan P:n kenttiin. - return fmt.Sprintf("(%d, %d)", p.x, p.y) -} - -func learnInterfaces() { - // Aaltosuljesyntaksi on "todellisarvoinen rakenne". Se todentuu alustetuksi - // rakenteeksi. := -syntaksi ilmoittaa ja alustaa p:n täksi rakenteeksi. - p := pair{3, 4} - fmt.Println(p.String()) // Kutsu p:n (tyyppiä pair) jäsenfunktiota String. - var i Stringer // Ilmoita i Stringer-rajapintatyypiksi. - i = p // Pätevä koska pair tyydyttää rajapinnan Stringer. - // Kutsu i:n (Stringer) jäsenfunktiota String. Tuloste on sama kuin yllä. - fmt.Println(i.String()) - - // Funktiot fmt-paketissa kutsuvat argumenttien String-jäsenfunktiota - // selvittääkseen onko niistä saatavilla tulostettavaa vastinetta. - fmt.Println(p) // Tuloste on sama kuin yllä. Println kutsuu String-metodia. - fmt.Println(i) // Tuloste on sama kuin yllä. - - learnVariadicParams("loistavaa", "oppimista", "täällä!") -} - -// Funktioilla voi olla muuttuva eli variteettinen -// määrä argumentteja eli parametrejä. -func learnVariadicParams(myStrings ...interface{}) { - // Iteroi jokaisen argumentin läpi. - // Tässä alaviivalla sivuutetaan argumenttilistan kunkin kohdan indeksi. - for _, param := range myStrings { - fmt.Println("param:", param) - } - - // Luovuta variteettinen arvo variteettisena parametrinä. - fmt.Println("params:", fmt.Sprintln(myStrings...)) - - learnErrorHandling() -} - -func learnErrorHandling() { - // "; ok" -muotoa käytetään selvittääksemme toimiko jokin vai ei. - m := map[int]string{3: "kolme", 4: "neljä"} - if x, ok := m[1]; !ok { // ok on epätosi koska 1 ei ole kartassa. - fmt.Println("ei ketään täällä") - } else { - fmt.Print(x) // x olisi arvo jos se olisi kartassa. - } - // Virhearvo voi kertoa muutakin ongelmasta. - if _, err := strconv.Atoi("ei-luku"); err != nil { // _ sivuuttaa arvon - // tulostaa strconv.ParseInt: parsing "ei-luku": invalid syntax - fmt.Println(err) - } - // Palaamme rajapintoihin hieman myöhemmin. Sillä välin, - learnConcurrency() -} - -// c on kanava, samanaikaisturvallinen viestintäolio. -func inc(i int, c chan int) { - c <- i + 1 // <- on "lähetysoperaattori" kun kanava on siitä vasemmalla. -} - -// Käytämme inc -funktiota samanaikaiseen lukujen lisäämiseen. -func learnConcurrency() { - // Sama make -funktio jota käytimme aikaisemmin siivun luomiseksi. Make - // varaa muistin ja alustaa siivut, kartat ja kanavat. - c := make(chan int) - // Aloita kolme samanaikaista gorutiinia (goroutine). Luvut kasvavat - // samanaikaisesti ja ehkäpä rinnakkain jos laite on kykenevä ja oikein - // määritelty. Kaikki kolme lähettävät samalle kanavalle. - go inc(0, c) // go -lauseke aloittaa uuden gorutiinin. - go inc(10, c) - go inc(-805, c) - // Lue kolme palautusarvoa kanavalta ja tulosta ne. - // Niiden saapumisjärjestystä ei voida taata! - // <- on "vastaanotto-operaattori" jos kanava on oikealla - fmt.Println(<-c, <-c, <-c) - - cs := make(chan string) // Toinen kanava joka käsittelee merkkijonoja. - ccs := make(chan chan string) // Kanava joka käsittelee merkkijonokanavia. - go func() { c <- 84 }() // Aloita uusi gorutiini arvon lähettämiseksi. - go func() { cs <- "sanaa" }() // Uudestaan, mutta cs -kanava tällä kertaa. - // Select -lausekkeella on syntaksi kuten switch -lausekkeella mutta - // jokainen tapaus sisältää kanavaoperaation. Se valitsee satunnaisen - // tapauksen niistä kanavista, jotka ovat kommunikaatiovalmiita - select { - case i := <-c: // Vastaanotettu arvo voidaan antaa muuttujalle - fmt.Printf("se on %T", i) - case <-cs: // tai vastaanotettu arvo voidaan sivuuttaa. - fmt.Println("se on merkkijono") - case <-ccs: // Tyhjä kanava; ei valmis kommunikaatioon. - fmt.Println("ei tapahtunut.") - } - // Tässä vaiheessa arvo oli otettu joko c:ltä tai cs:ltä. Yksi kahdesta - // ylempänä aloitetusta gorutiinista on valmistunut, toinen pysyy tukossa. - - learnWebProgramming() // Go tekee sitä. Sinäkin haluat tehdä sitä. -} - -// Yksittäinen funktio http -paketista aloittaa web-palvelimen. -func learnWebProgramming() { - - // ListenAndServe:n ensimmäinen parametri on TCP-osoite, jota kuunnellaan. - // Toinen parametri on rajapinta, http.Handler. - go func() { - err := http.ListenAndServe(":8080", pair{}) - fmt.Println(err) // älä sivuuta virheitä. - }() - - requestServer() -} - -// Tee pair:sta http.Handler implementoimalla sen ainoa metodi, ServeHTTP. -func (p pair) ServeHTTP(w http.ResponseWriter, r *http.Request) { - // Tarjoa dataa metodilla http.ResponseWriter. - w.Write([]byte("Opit Go:n Y minuutissa!")) -} - -func requestServer() { - resp, err := http.Get("http://localhost:8080") - fmt.Println(err) - defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) - fmt.Printf("\nWeb-palvelin sanoo: `%s`", string(body)) -} -``` - -## Lisää luettavaa - -Go-tietämyksen alku ja juuri on sen [virallinen verkkosivu]()(http://golang.org/). -Siellä voit seurata oppitunteja, askarrella vuorovaikutteisesti sekä lukea paljon. -Kierroksen lisäksi [dokumentaatio](https://golang.org/doc/) pitää sisällään tietoa -siistin Go-koodin kirjoittamisesta, pakettien ja komentojen käytöstä sekä julkaisuhistoriasta. - -Kielen määritelmä itsessään on suuresti suositeltavissa. Se on helppolukuinen ja -yllättävän lyhyt (niissä määrin kuin kielimääritelmät nykypäivänä ovat.) - -Voit askarrella parissa kanssa [Go playgroundissa](https://play.golang.org/p/tnWMjr16Mm). -Muuttele sitä ja aja se selaimestasi! Huomaa, että voit käyttää [https://play.golang.org](https://play.golang.org) -[REPL:na](https://en.wikipedia.org/wiki/Read-eval-print_loop) testataksesi ja koodataksesi selaimessasi, ilman Go:n asentamista. - -Go:n opiskelijoiden lukulistalla on [oletuskirjaston lähdekoodi](http://golang.org/src/pkg/). -Kattavasti dokumentoituna se antaa parhaan kuvan helppolukuisesta ja ymmärrettävästä Go-koodista, --tyylistä ja -tavoista. Voit klikata funktion nimeä [doukumentaatiossa](http://golang.org/pkg/) ja -lähdekoodi tulee esille! - -Toinen loistava paikka oppia on [Go by example](https://gobyexample.com/). - -Go Mobile lisää tuen mobiilialustoille (Android ja iOS). Voit kirjoittaa pelkällä Go:lla natiiveja applikaatioita tai tehdä kirjaston joka sisältää sidoksia -Go-paketista, jotka puolestaan voidaan kutsua Javasta (Android) ja Objective-C:stä (iOS). Katso [lisätietoja](https://github.com/golang/go/wiki/Mobile). From 39b58bacb761d591c7e89e8de8ddfe713672f4ab Mon Sep 17 00:00:00 2001 From: ComSecNinja Date: Sat, 31 Oct 2015 22:27:44 +0200 Subject: [PATCH 579/685] More style guide abiding changes --- fi-fi/go-fi.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/fi-fi/go-fi.html.markdown b/fi-fi/go-fi.html.markdown index 8a0ca245..9ed4e0d2 100644 --- a/fi-fi/go-fi.html.markdown +++ b/fi-fi/go-fi.html.markdown @@ -13,6 +13,7 @@ contributors: - ["Clayton Walker", "https://github.com/cwalk"] translators: - ["Timo Virkkunen", "https://github.com/ComSecNinja"] +lang: fi-fi --- Go luotiin työn tekemistä varten. Se ei ole tietojenkäsittelyn uusin trendi, From bc8af24706f5f1056327c7566d398ae694671d83 Mon Sep 17 00:00:00 2001 From: Frederik Andersen Date: Sat, 31 Oct 2015 22:16:39 +0100 Subject: [PATCH 580/685] Update dart.html.markdown typo --- dart.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dart.html.markdown b/dart.html.markdown index f7601271..fc7b220e 100644 --- a/dart.html.markdown +++ b/dart.html.markdown @@ -498,7 +498,7 @@ main() { ## Further Reading -Dart has a comprehenshive web-site. It covers API reference, tutorials, articles and more, including a +Dart has a comprehensive web-site. It covers API reference, tutorials, articles and more, including a useful Try Dart online. http://www.dartlang.org/ http://try.dartlang.org/ From b42f739fa4422fb947f681b5716ae3644014ebf2 Mon Sep 17 00:00:00 2001 From: Pranit Bauva Date: Sun, 1 Nov 2015 02:54:52 +0530 Subject: [PATCH 581/685] Fix a typo is julia.html.markdown --- julia.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia.html.markdown b/julia.html.markdown index cba7cd45..675cf5d3 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -723,7 +723,7 @@ code_native(square_area, (Float64,)) # ret # # Note that julia will use floating point instructions if any of the -# arguements are floats. +# arguments are floats. # Let's calculate the area of a circle circle_area(r) = pi * r * r # circle_area (generic function with 1 method) circle_area(5) # 78.53981633974483 From b8999e88ed3d9317725c79987a379871a6eb8988 Mon Sep 17 00:00:00 2001 From: Pranit Bauva Date: Sun, 1 Nov 2015 03:06:03 +0530 Subject: [PATCH 582/685] Add Pranit Bauva to the contributors list of julia.html.markdown --- julia.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/julia.html.markdown b/julia.html.markdown index 675cf5d3..220b52a4 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -2,6 +2,7 @@ language: Julia contributors: - ["Leah Hanson", "http://leahhanson.us"] + - ["Pranit Bauva", "http://github.com/pranitbauva1997"] filename: learnjulia.jl --- From d59c326fe0d90e01f31ff10d89d7fe37a2f654e6 Mon Sep 17 00:00:00 2001 From: ComSecNinja Date: Sat, 31 Oct 2015 23:37:23 +0200 Subject: [PATCH 583/685] Translate markdown/en to Finnish --- fi-fi/markdown-fi.html.markdown | 259 ++++++++++++++++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 fi-fi/markdown-fi.html.markdown diff --git a/fi-fi/markdown-fi.html.markdown b/fi-fi/markdown-fi.html.markdown new file mode 100644 index 00000000..14b0f1d9 --- /dev/null +++ b/fi-fi/markdown-fi.html.markdown @@ -0,0 +1,259 @@ +--- +language: markdown +filename: markdown-fi.md +contributors: + - ["Dan Turkel", "http://danturkel.com/"] +translators: + - ["Timo Virkkunen", "https://github.com/ComSecNinja"] +lang: fi-fi +--- + +John Gruber loi Markdownin vuona 2004. Sen tarkoitus on olla helposti luettava ja kirjoitettava syntaksi joka muuntuu helposti HTML:ksi (ja nyt myös moneksi muuksi formaatiksi). + +```markdown + + + + + + +# Tämä on

+## Tämä on

+### Tämä on

+#### Tämä on

+##### Tämä on

+###### Tämä on
+ + +Tämä on h1 +============= + +Tämä on h2 +------------- + + + + +*Tämä teksti on kursivoitua.* +_Kuten on myös tämä teksti._ + +**Tämä teksti on lihavoitua.** +__Kuten on tämäkin teksti.__ + +***Tämä teksti on molempia.*** +**_Kuten tämäkin!_** +*__Kuten tämäkin!__* + + + +~~Tämä teksti on yliviivattua.~~ + + + +Tämä on kappala. Kirjoittelen kappaleeseen, eikö tämä olekin hauskaa? + +Nyt olen kappaleessa 2. +Olen edelleen toisessa kappaleessa! + + +Olen kolmannessa kappaleessa! + + + +Päätän tämän kahteen välilyöntiin (maalaa minut nähdäksesi ne). + +There's a
above me! + + + +> Tämä on lainaus. Voit joko +> manuaalisesti rivittää tekstisi ja laittaa >-merkin jokaisen rivin eteen tai antaa jäsentimen rivittää pitkät tekstirivit. +> Sillä ei ole merkitystä kunhan rivit alkavat >-merkillä. + +> Voit myös käyttää useampaa +>> sisennystasoa +> Kuinka hienoa se on? + + + + +* Kohta +* Kohta +* Kolmas kohta + +tai + ++ Kohta ++ Kohta ++ Kolmas kohta + +tai + +- Kohta +- Kohta +- Kolmas kohta + + + +1. Kohta yksi +2. Kohta kaksi +3. Kohta kolme + + + +1. Kohta yksi +1. Kohta kaksi +1. Kohta kolme + + + + +1. Kohta yksi +2. Kohta kaksi +3. Kohta kolme + * Alakohta + * Alakohta +4. Kohta neljä + + + +Alla olevat ruudut ilman x-merkkiä ovat merkitsemättömiä HTML-valintaruutuja. +- [ ] Ensimmäinen suoritettava tehtävä. +- [ ] Toinen tehtävä joka täytyy tehdä +Tämä alla oleva ruutu on merkitty HTML-valintaruutu. +- [x] Tämä tehtävä on suoritettu + + + + + Tämä on koodia + Kuten tämäkin + + + + my_array.each do |item| + puts item + end + + + +John ei tiennyt edes mitä `go_to()` -funktio teki! + + + +\`\`\`ruby +def foobar + puts "Hello world!" +end +\`\`\` + + + + + + +*** +--- +- - - +**************** + + + + +[Klikkaa tästä!](http://example.com/) + + + +[Klikkaa tästä!](http://example.com/ "Linkki Example.com:iin") + + + +[Musiikkia](/musiikki/). + + + +[Klikkaa tätä linkkiä][link1] saadaksesi lisätietoja! +[Katso myös tämä linkki][foobar] jos haluat. + +[link1]: http://example.com/ "Siistii!" +[foobar]: http://foobar.biz/ "Selkis!" + + + + + +[This][] is a link. + +[this]: http://tämäonlinkki.com/ + + + + + + +![Kuvan alt-attribuutti](http://imgur.com/munkuva.jpg "Vaihtoehtoinen otsikko") + + + +![Tämä on se alt-attribuutti][munkuva] + +[munkuva]: suhteellinen/polku/siitii/kuva.jpg "otsikko tähän tarvittaessa" + + + + + on sama kuin +[http://testwebsite.com/](http://testwebsite.com/) + + + + + + + +haluan kirjoittaa *tämän tekstin jonka ympärillä on asteriskit* mutta en halua +sen kursivoituvan, joten teen näin: \*tämän tekstin ympärillä on asteriskit\*. + + + + +Tietokoneesi kaatui? Kokeile painaa +Ctrl+Alt+Del + + + + +| Kolumni1 | Kolumni2 | Kolumni3 | +| :----------- | :------: | ------------: | +| Vasemmalle | Keskelle | Oikealle | +| blaa | blaa | blaa | + + + +Kolumni 1 | Kolumni 2 | Kolumni 3 +:-- | :-: | --: +Hyi tämä on ruma | saa se | loppumaan + + + +``` + +Lisää tietoa löydät John Gruberin [virallisesta julkaisusta](http://daringfireball.net/projects/markdown/syntax) +ja Adam Pritchardin loistavasta [lunttilapusta](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). From 99fbb1398edae2523411614578f2e96613743104 Mon Sep 17 00:00:00 2001 From: ComSecNinja Date: Sat, 31 Oct 2015 23:55:17 +0200 Subject: [PATCH 584/685] Revert "Translate markdown/en to Finnish" This reverts commit d59c326fe0d90e01f31ff10d89d7fe37a2f654e6. --- fi-fi/markdown-fi.html.markdown | 259 -------------------------------- 1 file changed, 259 deletions(-) delete mode 100644 fi-fi/markdown-fi.html.markdown diff --git a/fi-fi/markdown-fi.html.markdown b/fi-fi/markdown-fi.html.markdown deleted file mode 100644 index 14b0f1d9..00000000 --- a/fi-fi/markdown-fi.html.markdown +++ /dev/null @@ -1,259 +0,0 @@ ---- -language: markdown -filename: markdown-fi.md -contributors: - - ["Dan Turkel", "http://danturkel.com/"] -translators: - - ["Timo Virkkunen", "https://github.com/ComSecNinja"] -lang: fi-fi ---- - -John Gruber loi Markdownin vuona 2004. Sen tarkoitus on olla helposti luettava ja kirjoitettava syntaksi joka muuntuu helposti HTML:ksi (ja nyt myös moneksi muuksi formaatiksi). - -```markdown - - - - - - -# Tämä on

-## Tämä on

-### Tämä on

-#### Tämä on

-##### Tämä on

-###### Tämä on
- - -Tämä on h1 -============= - -Tämä on h2 -------------- - - - - -*Tämä teksti on kursivoitua.* -_Kuten on myös tämä teksti._ - -**Tämä teksti on lihavoitua.** -__Kuten on tämäkin teksti.__ - -***Tämä teksti on molempia.*** -**_Kuten tämäkin!_** -*__Kuten tämäkin!__* - - - -~~Tämä teksti on yliviivattua.~~ - - - -Tämä on kappala. Kirjoittelen kappaleeseen, eikö tämä olekin hauskaa? - -Nyt olen kappaleessa 2. -Olen edelleen toisessa kappaleessa! - - -Olen kolmannessa kappaleessa! - - - -Päätän tämän kahteen välilyöntiin (maalaa minut nähdäksesi ne). - -There's a
above me! - - - -> Tämä on lainaus. Voit joko -> manuaalisesti rivittää tekstisi ja laittaa >-merkin jokaisen rivin eteen tai antaa jäsentimen rivittää pitkät tekstirivit. -> Sillä ei ole merkitystä kunhan rivit alkavat >-merkillä. - -> Voit myös käyttää useampaa ->> sisennystasoa -> Kuinka hienoa se on? - - - - -* Kohta -* Kohta -* Kolmas kohta - -tai - -+ Kohta -+ Kohta -+ Kolmas kohta - -tai - -- Kohta -- Kohta -- Kolmas kohta - - - -1. Kohta yksi -2. Kohta kaksi -3. Kohta kolme - - - -1. Kohta yksi -1. Kohta kaksi -1. Kohta kolme - - - - -1. Kohta yksi -2. Kohta kaksi -3. Kohta kolme - * Alakohta - * Alakohta -4. Kohta neljä - - - -Alla olevat ruudut ilman x-merkkiä ovat merkitsemättömiä HTML-valintaruutuja. -- [ ] Ensimmäinen suoritettava tehtävä. -- [ ] Toinen tehtävä joka täytyy tehdä -Tämä alla oleva ruutu on merkitty HTML-valintaruutu. -- [x] Tämä tehtävä on suoritettu - - - - - Tämä on koodia - Kuten tämäkin - - - - my_array.each do |item| - puts item - end - - - -John ei tiennyt edes mitä `go_to()` -funktio teki! - - - -\`\`\`ruby -def foobar - puts "Hello world!" -end -\`\`\` - - - - - - -*** ---- -- - - -**************** - - - - -[Klikkaa tästä!](http://example.com/) - - - -[Klikkaa tästä!](http://example.com/ "Linkki Example.com:iin") - - - -[Musiikkia](/musiikki/). - - - -[Klikkaa tätä linkkiä][link1] saadaksesi lisätietoja! -[Katso myös tämä linkki][foobar] jos haluat. - -[link1]: http://example.com/ "Siistii!" -[foobar]: http://foobar.biz/ "Selkis!" - - - - - -[This][] is a link. - -[this]: http://tämäonlinkki.com/ - - - - - - -![Kuvan alt-attribuutti](http://imgur.com/munkuva.jpg "Vaihtoehtoinen otsikko") - - - -![Tämä on se alt-attribuutti][munkuva] - -[munkuva]: suhteellinen/polku/siitii/kuva.jpg "otsikko tähän tarvittaessa" - - - - - on sama kuin -[http://testwebsite.com/](http://testwebsite.com/) - - - - - - - -haluan kirjoittaa *tämän tekstin jonka ympärillä on asteriskit* mutta en halua -sen kursivoituvan, joten teen näin: \*tämän tekstin ympärillä on asteriskit\*. - - - - -Tietokoneesi kaatui? Kokeile painaa -Ctrl+Alt+Del - - - - -| Kolumni1 | Kolumni2 | Kolumni3 | -| :----------- | :------: | ------------: | -| Vasemmalle | Keskelle | Oikealle | -| blaa | blaa | blaa | - - - -Kolumni 1 | Kolumni 2 | Kolumni 3 -:-- | :-: | --: -Hyi tämä on ruma | saa se | loppumaan - - - -``` - -Lisää tietoa löydät John Gruberin [virallisesta julkaisusta](http://daringfireball.net/projects/markdown/syntax) -ja Adam Pritchardin loistavasta [lunttilapusta](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). From c3e769e4ac50d4475a530969663e073f4ff002ca Mon Sep 17 00:00:00 2001 From: Brook Zhou Date: Sat, 31 Oct 2015 16:17:58 -0700 Subject: [PATCH 585/685] [cpp/en] comparator function for std containers --- c++.html.markdown | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/c++.html.markdown b/c++.html.markdown index d03092e5..6b452b1b 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -801,6 +801,24 @@ void doSomethingWithAFile(const std::string& filename) // all automatically destroy their contents when they fall out of scope. // - Mutexes using lock_guard and unique_lock +// containers with object keys of non-primitive values (custom classes) require +// compare function in the object itself or as a function pointer. Primitives +// have default comparators, but you can override it. +class Foo { +public: + int j; + Foo(int a) : j(a) {} +}; +struct compareFunction { + bool operator()(const Foo& a, const Foo& b) const { + return a.j < b.j; + } +}; +//this isn't allowed (although it can vary depending on compiler) +//std::map fooMap; +std::map fooMap; +fooMap[Foo(1)] = 1; +fooMap.find(Foo(1)); //true ///////////////////// // Fun stuff From 6e9e1f4af018dc0e277c968d9b5fe011e0a1ce97 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 31 Oct 2015 16:49:57 -0700 Subject: [PATCH 586/685] Added new resource to javascript --- javascript.html.markdown | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/javascript.html.markdown b/javascript.html.markdown index e285ca4e..98261334 100644 --- a/javascript.html.markdown +++ b/javascript.html.markdown @@ -561,7 +561,9 @@ of the language. [Eloquent Javascript][8] by Marijn Haverbeke is an excellent JS book/ebook with attached terminal -[Javascript: The Right Way][9] is a guide intended to introduce new developers to JavaScript and help experienced developers learn more about its best practices. +[Eloquent Javascript - The Annotated Version][9] by Gordon Zhu is also a great derivative of Eloquent Javascript with extra explanations and clarifications for some of the more complicated examples. + +[Javascript: The Right Way][10] is a guide intended to introduce new developers to JavaScript and help experienced developers learn more about its best practices. In addition to direct contributors to this article, some content is adapted from @@ -577,4 +579,5 @@ Mozilla Developer Network. [6]: http://www.amazon.com/gp/product/0596805527/ [7]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript [8]: http://eloquentjavascript.net/ -[9]: http://jstherightway.org/ +[9]: http://watchandcode.com/courses/eloquent-javascript-the-annotated-version +[10]: http://jstherightway.org/ From f10292ed98674521cc80a0ab66d8508c74e7a627 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 31 Oct 2015 16:55:25 -0700 Subject: [PATCH 587/685] Added new ruby resource --- ruby.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/ruby.html.markdown b/ruby.html.markdown index 8720fec6..1118e2dd 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -588,6 +588,7 @@ Something.new.qux # => 'qux' ## Additional resources - [Learn Ruby by Example with Challenges](http://www.learneroo.com/modules/61/nodes/338) - A variant of this reference with in-browser challenges. +- [An Interactive Tutorial for Ruby](https://rubymonk.com/) - Learn Ruby through a series of interactive tutorials. - [Official Documentation](http://www.ruby-doc.org/core-2.1.1/) - [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. From dbe6184519860e526432c4987a6f67d6c0acf38e Mon Sep 17 00:00:00 2001 From: Fernando Valverde Arredondo Date: Sun, 1 Nov 2015 01:48:44 +0100 Subject: [PATCH 588/685] Update contributor list --- objective-c.html.markdown | 13 ++++++------- swift.html.markdown | 5 +++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/objective-c.html.markdown b/objective-c.html.markdown index 1fa731e3..097cb846 100644 --- a/objective-c.html.markdown +++ b/objective-c.html.markdown @@ -1,13 +1,12 @@ --- - language: Objective-C contributors: - ["Eugene Yagrushkin", "www.about.me/yagrushkin"] - ["Yannick Loriot", "https://github.com/YannickL"] - ["Levi Bostian", "https://github.com/levibostian"] - ["Clayton Walker", "https://github.com/cwalk"] + - ["Fernando Valverde", "http://visualcosita.xyz"] filename: LearnObjectiveC.m - --- Objective-C is the main programming language used by Apple for the OS X and iOS operating systems and their respective frameworks, Cocoa and Cocoa Touch. @@ -152,13 +151,13 @@ int main (int argc, const char * argv[]) [mutableDictionary setObject:@"value1" forKey:@"key1"]; [mutableDictionary setObject:@"value2" forKey:@"key2"]; [mutableDictionary removeObjectForKey:@"key1"]; - + // Change types from Mutable To Immutable //In general [object mutableCopy] will make the object mutable whereas [object copy] will make the object immutable NSMutableDictionary *aMutableDictionary = [aDictionary mutableCopy]; NSDictionary *mutableDictionaryChanged = [mutableDictionary copy]; - - + + // Set object NSSet *set = [NSSet setWithObjects:@"Hello", @"Hello", @"World", nil]; NSLog(@"%@", set); // prints => {(Hello, World)} (may be in different order) @@ -605,7 +604,7 @@ int main (int argc, const char * argv[]) { // Starting in Xcode 7.0, you can create Generic classes, // allowing you to provide greater type safety and clarity -// without writing excessive boilerplate. +// without writing excessive boilerplate. @interface Result<__covariant A> : NSObject - (void)handleSuccess:(void(^)(A))success @@ -633,7 +632,7 @@ Result *result; @property (nonatomic) NSNumber * object; @end -// It should be obvious, however, that writing one +// It should be obvious, however, that writing one // Class to solve a problem is always preferable to writing two // Note that Clang will not accept generic types in @implementations, diff --git a/swift.html.markdown b/swift.html.markdown index 1ca81bc2..f3746613 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -6,6 +6,7 @@ contributors: - ["Joey Huang", "http://github.com/kamidox"] - ["Anthony Nguyen", "http://github.com/anthonyn60"] - ["Clayton Walker", "https://github.com/cwalk"] + - ["Fernando Valverde", "http://visualcosita.xyz"] filename: learnswift.swift --- @@ -25,7 +26,7 @@ import UIKit // Xcode supports landmarks to annotate your code and lists them in the jump bar // MARK: Section mark -// MARK: - Section mark with a separator line +// MARK: - Section mark with a separator line // TODO: Do something soon // FIXME: Fix this code @@ -83,7 +84,7 @@ if someOptionalString != nil { someOptionalString = nil /* - Trying to use ! to access a non-existent optional value triggers a runtime + Trying to use ! to access a non-existent optional value triggers a runtime error. Always make sure that an optional contains a non-nil value before using ! to force-unwrap its value. */ From 0e1a77c065076993a170bc2874987a6289856a9f Mon Sep 17 00:00:00 2001 From: Willie Zhu Date: Sat, 31 Oct 2015 22:31:27 -0400 Subject: [PATCH 589/685] [whip/en] Fix typos --- whip.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/whip.html.markdown b/whip.html.markdown index 61c301a5..e7e5e427 100644 --- a/whip.html.markdown +++ b/whip.html.markdown @@ -9,7 +9,7 @@ filename: whip.lisp --- Whip is a LISP-dialect made for scripting and simplified concepts. -It has also borrowed a lot of functions and syntax from Haskell(a non-related language). +It has also borrowed a lot of functions and syntax from Haskell (a non-related language). These docs were written by the creator of the language himself. So is this line. @@ -172,12 +172,12 @@ undefined ; user to indicate a value that hasn't been set ; Comprehensions ; `range` or `..` generates a list of numbers for -; each number between it's two args. +; each number between its two args. (range 1 5) ; => (1 2 3 4 5) (.. 0 2) ; => (0 1 2) -; `map` applies it's first arg(which should be a lambda/function) -; to each item in the following arg(which should be a list) +; `map` applies its first arg (which should be a lambda/function) +; to each item in the following arg (which should be a list) (map (-> (x) (+ x 1)) (1 2 3)) ; => (2 3 4) ; Reduce From 84a1ae46c7bd98906b90e1ae0e8089382e95777f Mon Sep 17 00:00:00 2001 From: Jacob Ward Date: Sat, 31 Oct 2015 21:02:18 -0600 Subject: [PATCH 590/685] Made the rendered text more readable. I formatted the document so that the rendered page is more easily readable. (plus it also serves as even more of an example of how to use Markdown.) #meta --- markdown.html.markdown | 217 ++++++++++++++++++++++++----------------- 1 file changed, 130 insertions(+), 87 deletions(-) diff --git a/markdown.html.markdown b/markdown.html.markdown index b956a5f2..f17c2b75 100644 --- a/markdown.html.markdown +++ b/markdown.html.markdown @@ -2,45 +2,53 @@ language: markdown contributors: - ["Dan Turkel", "http://danturkel.com/"] + - ["Jacob Ward", "http://github.com/JacobCWard/"] filename: markdown.md --- + Markdown was created by John Gruber in 2004. It's meant to be an easy to read and write syntax which converts easily to HTML (and now many other formats as well). -Give me as much feedback as you want! / Feel free to fork and pull request! - - -```markdown - +element's contents. - +specific to a certain parser. - - +- [Headings](#headings) +- [Simple Text Styles](#simple-text-styles) + +## Headings + +You can create HTML elements `

` through `

` easily by prepending the +text you want to be in that element by a number of hashes (#). + +```markdown # This is an

## This is an

### This is an

#### This is an

##### This is an

###### This is an
+``` +Markdown also provides us with two alternative ways of indicating h1 and h2. - +```markdown This is an h1 ============= This is an h2 ------------- +``` +## Simple text styles - - +Text can be easily styled as italic or bold using markdown. +```markdown *This text is in italics.* _And so is this text._ @@ -50,15 +58,20 @@ __And so is this text.__ ***This text is in both.*** **_As is this!_** *__And this!__* +``` - +In Github Flavored Markdown, which is used to render markdown files on +Github, we also have strikethrough: +```markdown ~~This text is rendered with strikethrough.~~ +``` +## Paragraphs - +Paragraphs are a one or multiple adjacent lines of text separated by one or +multiple blank lines. +```markdown This is a paragraph. I'm typing in a paragraph isn't this fun? Now I'm in paragraph 2. @@ -66,16 +79,20 @@ I'm still in paragraph 2 too! I'm in paragraph three! +``` - +Should you ever want to insert an HTML
tag, you can end a paragraph +with two or more spaces and then begin a new paragraph. +```markdown I end with two spaces (highlight me to see them). There's a
above me! +``` - +Block quotes are easy and done with the > character. +```markdown > This is a block quote. You can either > manually wrap your lines and put a `>` before every line or you can let your lines get really long and wrap on their own. > It doesn't make a difference so long as they start with a `>`. @@ -84,9 +101,12 @@ There's a
above me! >> of indentation? > How neat is that? - - +``` +## Lists +Unordered lists can be made using asterisks, pluses, or hyphens. + +```markdown * Item * Item * Another item @@ -102,159 +122,182 @@ or - Item - Item - One last item +``` +Ordered lists are done with a number followed by a period. - - +```markdown 1. Item one 2. Item two 3. Item three +``` - +You don't even have to label the items correctly and markdown will still +render the numbers in order, but this may not be a good idea. +```markdown 1. Item one 1. Item two 1. Item three - - - +``` +(This renders the same as the above example) +You can also use sublists +```markdown 1. Item one 2. Item two 3. Item three * Sub-item * Sub-item 4. Item four +``` - +There are even task lists. This creates HTML checkboxes. +```markdown Boxes below without the 'x' are unchecked HTML checkboxes. - [ ] First task to complete. - [ ] Second task that needs done This checkbox below will be a checked HTML checkbox. - [x] This task has been completed +``` - - +## Code blocks +You can indicate a code block (which uses the `` element) by indenting +a line with four spaces or a tab. + +```markdown This is code So is this +``` - +You can also re-tab (or add an additional four spaces) for indentation +inside your code +```markdown my_array.each do |item| puts item end +``` - +Inline code can be created using the backtick character ` +```markdown John didn't even know what the `go_to()` function did! +``` - - +In Github Flavored Markdown, you can use a special syntax for code +```markdown \`\`\`ruby def foobar puts "Hello world!" end \`\`\` +``` - +The above text doesn't require indenting, plus Github will use syntax +highlighting of the language you specify after the \`\`\` - - +## Horizontal rule (`
`) +Horizontal rules are easily added with three or more asterisks or hyphens, +with or without spaces. +```markdown *** --- - - - **************** +``` - - +## Links +One of the best things about markdown is how easy it is to make links. Put +the text to display in hard brackets [] followed by the url in parentheses () + +```markdown [Click me!](http://test.com/) - - - +``` +You can also add a link title using quotes inside the parentheses. +```markdown [Click me!](http://test.com/ "Link to Test.com") - - - +``` +Relative paths work too. +```markdown [Go to music](/music/). - - - +``` +Markdown also supports reference style links. +```markdown [Click this link][link1] for more info about it! [Also check out this link][foobar] if you want to. [link1]: http://test.com/ "Cool!" [foobar]: http://foobar.biz/ "Alright!" - - - - +There is also "implicit naming" which lets you use the link text as the id. +```markdown [This][] is a link. [this]: http://thisisalink.com/ +``` +But it's not that commonly used. - - - - - +## Images +Images are done the same way as links but with an exclamation point in front! +```markdown ![This is the alt-attribute for my image](http://imgur.com/myimage.jpg "An optional title") - - - +``` +And reference style works as expected. +```markdown ![This is the alt-attribute.][myimage] [myimage]: relative/urls/cool/image.jpg "if you need a title, it's here" +``` - - - +## Miscellany +### Auto-links +```markdown is equivalent to [http://testwebsite.com/](http://testwebsite.com/) +``` - - +### Auto-links for emails +```markdown +``` - - +### Escaping characters +```markdown I want to type *this text surrounded by asterisks* but I don't want it to be in italics, so I do this: \*this text surrounded by asterisks\*. +``` - - +### Keyboard keys +In Github Flavored Markdown, you can use a tag to represent keyboard keys. +```markdown Your computer crashed? Try sending a Ctrl+Alt+Del +``` +### Tables - - - +Tables are only available in Github Flavored Markdown and are slightly +cumbersome, but if you really want it: +```markdown | Col1 | Col2 | Col3 | | :----------- | :------: | ------------: | | Left-aligned | Centered | Right-aligned | | blah | blah | blah | +``` +or, for the same results - - +```markdown Col 1 | Col2 | Col3 :-- | :-: | --: Ugh this is so ugly | make it | stop - - - ``` - +--- For more info, check out John Gruber's official post of syntax [here](http://daringfireball.net/projects/markdown/syntax) and Adam Pritchard's great cheatsheet [here](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). From cf9c94934533dbd3c96ac35d94bc88e50154c7ac Mon Sep 17 00:00:00 2001 From: Jacob Ward Date: Sat, 31 Oct 2015 21:09:58 -0600 Subject: [PATCH 591/685] in-page navigational links added links to the various sections of the document --- markdown.html.markdown | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/markdown.html.markdown b/markdown.html.markdown index f17c2b75..7be37f81 100644 --- a/markdown.html.markdown +++ b/markdown.html.markdown @@ -21,6 +21,13 @@ specific to a certain parser. - [Headings](#headings) - [Simple Text Styles](#simple-text-styles) +- [Paragraphs](#paragraphs) +- [Lists](#lists) +- [Code blocks](#code-blocks) +- [Horizontal rule](#horizontal-rule) +- [Links](#links) +- [Images](#images) +- [Miscellany](#miscellany) ## Headings @@ -198,9 +205,9 @@ end The above text doesn't require indenting, plus Github will use syntax highlighting of the language you specify after the \`\`\` -## Horizontal rule (`
`) +## Horizontal rule -Horizontal rules are easily added with three or more asterisks or hyphens, +Horizontal rules (`
`) are easily added with three or more asterisks or hyphens, with or without spaces. ```markdown *** From 06c6c0fe2c03f6479c5906a807a88842b780cce9 Mon Sep 17 00:00:00 2001 From: poetienshul Date: Sat, 31 Oct 2015 23:20:00 -0400 Subject: [PATCH 592/685] visualbasic Commenting spacing inconsistency --- visualbasic.html.markdown | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/visualbasic.html.markdown b/visualbasic.html.markdown index accdbf56..dfb89307 100644 --- a/visualbasic.html.markdown +++ b/visualbasic.html.markdown @@ -9,13 +9,13 @@ filename: learnvisualbasic.vb Module Module1 Sub Main() - ' A Quick Overview of Visual Basic Console Applications before we dive - ' in to the deep end. - ' Apostrophe starts comments. - ' To Navigate this tutorial within the Visual Basic Complier, I've put - ' together a navigation system. - ' This navigation system is explained however as we go deeper into this - ' tutorial, you'll understand what it all means. + 'A Quick Overview of Visual Basic Console Applications before we dive + 'in to the deep end. + 'Apostrophe starts comments. + 'To Navigate this tutorial within the Visual Basic Complier, I've put + 'together a navigation system. + 'This navigation system is explained however as we go deeper into this + 'tutorial, you'll understand what it all means. Console.Title = ("Learn X in Y Minutes") Console.WriteLine("NAVIGATION") 'Display Console.WriteLine("") @@ -32,9 +32,9 @@ Module Module1 Console.WriteLine("50. About") Console.WriteLine("Please Choose A Number From The Above List") Dim selection As String = Console.ReadLine - ' The "Case" in the Select statement is optional. - ' For example, "Select selection" instead of "Select Case selection" - ' will also work. + 'The "Case" in the Select statement is optional. + 'For example, "Select selection" instead of "Select Case selection" + 'will also work. Select Case selection Case "1" 'HelloWorld Output Console.Clear() 'Clears the application and opens the private sub @@ -91,12 +91,12 @@ Module Module1 'Two Private Sub HelloWorldInput() Console.Title = "Hello World YourName | Learn X in Y Minutes" - ' Variables - ' Data entered by a user needs to be stored. - ' Variables also start with a Dim and end with an As VariableType. + 'Variables + 'Data entered by a user needs to be stored. + 'Variables also start with a Dim and end with an As VariableType. - ' In this tutorial, we want to know what your name, and make the program - ' respond to what is said. + 'In this tutorial, we want to know what your name, and make the program + 'respond to what is said. Dim username As String 'We use string as string is a text based variable. Console.WriteLine("Hello, What is your name? ") 'Ask the user their name. From 244c649f46cad2d3955c97db26772720307647d1 Mon Sep 17 00:00:00 2001 From: ingmrb Date: Sun, 1 Nov 2015 01:40:07 -0300 Subject: [PATCH 593/685] [gites] fixed typos --- es-es/git-es.html.markdown | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/es-es/git-es.html.markdown b/es-es/git-es.html.markdown index 18b544b4..4e1e68ba 100644 --- a/es-es/git-es.html.markdown +++ b/es-es/git-es.html.markdown @@ -18,11 +18,11 @@ versionar y administrar nuestro código fuente. ## Versionamiento, conceptos. -### Qué es el control de versiones? +### ¿Qué es el control de versiones? El control de versiones es un sistema que guarda todos los cambios realizados en uno o varios archivos, a lo largo del tiempo. -### Versionamiento centralizado vs Versionamiento Distribuido. +### Versionamiento centralizado vs versionamiento distribuido. + El versionamiento centralizado se enfoca en sincronizar, rastrear, y respaldar archivos. @@ -33,9 +33,9 @@ uno o varios archivos, a lo largo del tiempo. [Información adicional](http://git-scm.com/book/es/Empezando-Acerca-del-control-de-versiones) -### Por qué usar Git? +### ¿Por qué usar Git? -* Se puede trabajar sin conexion. +* Se puede trabajar sin conexión. * ¡Colaborar con otros es sencillo!. * Derivar, crear ramas del proyecto (aka: Branching) es fácil. * Combinar (aka: Merging) @@ -47,7 +47,7 @@ uno o varios archivos, a lo largo del tiempo. ### Repositorio Un repositorio es un conjunto de archivos, directorios, registros, cambios (aka: -comits), y encabezados (aka: heads). Imagina que un repositorio es una clase, +commits), y encabezados (aka: heads). Imagina que un repositorio es una clase, y que sus atributos otorgan acceso al historial del elemento, además de otras cosas. @@ -62,12 +62,12 @@ y mas. ### Directorio de trabajo (componentes del repositorio) -Es basicamente los directorios y archivos dentro del repositorio. La mayoría de +Es básicamente los directorios y archivos dentro del repositorio. La mayoría de las veces se le llama "directorio de trabajo". ### Índice (componentes del directorio .git) -El índice es el área de inicio en git. Es basicamente la capa que separa el +El índice es el área de inicio en git. Es básicamente la capa que separa el directorio de trabajo del repositorio en git. Esto otorga a los desarrolladores más poder sobre lo que se envía y se recibe del repositorio. From db482790ec142138118a8d71a1a7b17a99cd1491 Mon Sep 17 00:00:00 2001 From: ingmrb Date: Sun, 1 Nov 2015 02:14:51 -0300 Subject: [PATCH 595/685] [json/es] fixed typos --- es-es/json-es.html.markdown | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/es-es/json-es.html.markdown b/es-es/json-es.html.markdown index fff678eb..c98049f9 100644 --- a/es-es/json-es.html.markdown +++ b/es-es/json-es.html.markdown @@ -21,22 +21,22 @@ JSON en su forma más pura no tiene comentarios, pero la mayoría de los parsead "llaves": "siempre debe estar entre comillas (ya sean dobles o simples)", "numeros": 0, "strings": "Høla, múndo. Todo el unicode está permitido, así como \"escapar\".", - "soporta booleanos?": true, - "vacios": null, + "¿soporta booleanos?": true, + "vacíos": null, "numero grande": 1.2e+100, "objetos": { - "comentario": "La mayoria de tu estructura vendra de objetos.", + "comentario": "La mayoría de tu estructura vendrá de objetos.", "arreglo": [0, 1, 2, 3, "Los arreglos pueden contener cualquier cosa.", 5], "otro objeto": { - "comentario": "Estas cosas pueden estar anidadas, muy util." + "comentario": "Estas cosas pueden estar anidadas, muy útil." } }, - "tonteria": [ + "tontería": [ { "fuentes de potasio": ["bananas"] }, @@ -50,10 +50,10 @@ JSON en su forma más pura no tiene comentarios, pero la mayoría de los parsead "estilo alternativo": { "comentario": "Mira esto!" - , "posicion de la coma": "no importa - mientras este antes del valor, entonces sera valido" - , "otro comentario": "que lindo" + , "posición de la coma": "no importa - mientras este antes del valor, entonces sera válido" + , "otro comentario": "qué lindo" }, - "eso fue rapido": "Y, estas listo. Ahora sabes todo lo que JSON tiene para ofrecer." + "eso fue rapido": "Y, estás listo. Ahora sabes todo lo que JSON tiene para ofrecer." } ``` From 471c4b129bceb74c5c38758cebd9851d9f838064 Mon Sep 17 00:00:00 2001 From: ingmrb Date: Sun, 1 Nov 2015 02:16:35 -0300 Subject: [PATCH 596/685] [javascript/es] fixed typos --- es-es/javascript-es.html.markdown | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/es-es/javascript-es.html.markdown b/es-es/javascript-es.html.markdown index d475cf42..c5419a21 100644 --- a/es-es/javascript-es.html.markdown +++ b/es-es/javascript-es.html.markdown @@ -30,7 +30,7 @@ Aunque JavaScript no sólo se limita a los navegadores web: Node.js, Un proyecto // Cada sentencia puede ser terminada con punto y coma ; hazAlgo(); -// ... aunque no es necesario, ya que el punto y coma se agrega automaticamente +// ... aunque no es necesario, ya que el punto y coma se agrega automáticamente // cada que se detecta una nueva línea, a excepción de algunos casos. hazAlgo() @@ -109,7 +109,7 @@ null == undefined; // = true null === undefined; // false // Los Strings funcionan como arreglos de caracteres -// Puedes accesar a cada caracter con la función charAt() +// Puedes acceder a cada caracter con la función charAt() "Este es un String".charAt(0); // = 'E' // ...o puedes usar la función substring() para acceder a pedazos más grandes @@ -301,7 +301,7 @@ i; // = 5 - en un lenguaje que da ámbitos por bloque esto sería undefined, per //inmediatamente", que preveé variables temporales de fugarse al ámbito global (function(){ var temporal = 5; - // Podemos accesar al ámbito global asignando al 'objeto global', el cual + // Podemos acceder al ámbito global asignando al 'objeto global', el cual // en un navegador siempre es 'window'. El objeto global puede tener // un nombre diferente en ambientes distintos, por ejemplo Node.js . window.permanente = 10; @@ -321,7 +321,7 @@ function decirHolaCadaCincoSegundos(nombre){ alert(texto); } setTimeout(interna, 5000); - // setTimeout es asíncrono, así que la funcion decirHolaCadaCincoSegundos + // setTimeout es asíncrono, así que la función decirHolaCadaCincoSegundos // terminará inmediatamente, y setTimeout llamará a interna() a los cinco segundos // Como interna está "cerrada dentro de" decirHolaCadaCindoSegundos, interna todavía tiene // acceso a la variable 'texto' cuando es llamada. @@ -339,7 +339,7 @@ var miObjeto = { }; miObjeto.miFuncion(); // = "¡Hola Mundo!" -// Cuando las funciones de un objeto son llamadas, pueden accesar a las variables +// Cuando las funciones de un objeto son llamadas, pueden acceder a las variables // del objeto con la palabra clave 'this'. miObjeto = { miString: "¡Hola Mundo!", @@ -401,11 +401,11 @@ var MiConstructor = function(){ miNuevoObjeto = new MiConstructor(); // = {miNumero: 5} miNuevoObjeto.miNumero; // = 5 -// Todos los objetos JavaScript tienen un 'prototipo'. Cuando vas a accesar a una +// Todos los objetos JavaScript tienen un 'prototipo'. Cuando vas a acceder a una // propiedad en un objeto que no existe en el objeto el intérprete buscará en // el prototipo. -// Algunas implementaciones de JavaScript te permiten accesar al prototipo de +// Algunas implementaciones de JavaScript te permiten acceder al prototipo de // un objeto con la propiedad __proto__. Mientras que esto es útil para explicar // prototipos, no es parte del estándar; veremos formas estándar de usar prototipos // más adelante. @@ -440,7 +440,7 @@ miPrototipo.sentidoDeLaVida = 43; miObjeto.sentidoDeLaVida; // = 43 // Mencionabamos anteriormente que __proto__ no está estandarizado, y que no -// existe una forma estándar de accesar al prototipo de un objeto. De todas formas. +// existe una forma estándar de acceder al prototipo de un objeto. De todas formas. // hay dos formas de crear un nuevo objeto con un prototipo dado. // El primer método es Object.create, el cual es una adición reciente a JavaScript, From 5b58fae6a3770341207e810a466c0be863d80782 Mon Sep 17 00:00:00 2001 From: ingmrb Date: Sun, 1 Nov 2015 02:19:50 -0300 Subject: [PATCH 597/685] [javascript /es] fixed typos. --- es-es/javascript-es.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es-es/javascript-es.html.markdown b/es-es/javascript-es.html.markdown index c5419a21..3273f7ad 100644 --- a/es-es/javascript-es.html.markdown +++ b/es-es/javascript-es.html.markdown @@ -186,7 +186,7 @@ miObjeto.miLlave; // = "miValor" // agregar nuevas llaves. miObjeto.miTerceraLlave = true; -// Si intentas accesar con una llave que aún no está asignada tendrás undefined. +// Si intentas acceder con una llave que aún no está asignada tendrás undefined. miObjeto.miCuartaLlave; // = undefined /////////////////////////////////// From a3b69a2275c343d4e5b4e58d6eb4010517e0eef9 Mon Sep 17 00:00:00 2001 From: ingmrb Date: Sun, 1 Nov 2015 02:24:00 -0300 Subject: [PATCH 598/685] [javascript /es] typo --- es-es/javascript-es.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es-es/javascript-es.html.markdown b/es-es/javascript-es.html.markdown index 3273f7ad..9ef0c63e 100644 --- a/es-es/javascript-es.html.markdown +++ b/es-es/javascript-es.html.markdown @@ -476,7 +476,7 @@ typeof miNumero; // = 'number' typeof miNumeroObjeto; // = 'object' miNumero === miNumeroObjeyo; // = false if (0){ - // Este código no se ejecutara porque 0 es false. + // Este código no se ejecutará porque 0 es false. } // Aún así, los objetos que envuelven y los prototipos por defecto comparten From 09c3177531eacd476ec4e822ddc485439e22c4b8 Mon Sep 17 00:00:00 2001 From: Saravanan Ganesh Date: Sat, 31 Oct 2015 22:55:11 -0700 Subject: [PATCH 599/685] [less/en] Add Less tutorial, similar to sass --- less.html.markdown | 379 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 379 insertions(+) create mode 100644 less.html.markdown diff --git a/less.html.markdown b/less.html.markdown new file mode 100644 index 00000000..41d66a54 --- /dev/null +++ b/less.html.markdown @@ -0,0 +1,379 @@ +--- +language: less +filename: learnless.less +contributors: + - ["Saravanan Ganesh", "http://srrvnn.me"] +--- + +Less is a CSS pre-processor, that adds features such as variables, nesting, mixins and more. +Less (and other preprocessors, such as [Sass](http://sass-lang.com/) help developers to write maintainable and DRY (Don't Repeat Yourself) code. + +```less + + +//Single line comments are removed when Less is compiled to CSS. + +/*Multi line comments are preserved. */ + + +/*Variables +==============================*/ + + + +/* You can store a CSS value (such as a color) in a variable. +Use the '@' symbol to create a variable. */ + +@primary-color: #A3A4FF; +@secondary-color: #51527F; +@body-font: 'Roboto', sans-serif; + +/* You can use the variables throughout your stylesheet. +Now if you want to change a color, you only have to make the change once.*/ + +body { + background-color: @primary-color; + color: @secondary-color; + font-family: @body-font; +} + +/* This would compile to: */ +body { + background-color: #A3A4FF; + color: #51527F; + font-family: 'Roboto', sans-serif; +} + + +/* This is much more maintainable than having to change the color +each time it appears throughout your stylesheet. */ + + +/*Mixins +==============================*/ + + + +/* If you find you are writing the same code for more than one +element, you might want to reuse that easily.*/ + +.center { + display: block; + margin-left: auto; + margin-right: auto; + left: 0; + right: 0; +} + +/* You can use the mixin by simply adding the selector as a style */ + +div { + .center; + background-color: @primary-color; +} + +/*Which would compile to: */ +.center { + display: block; + margin-left: auto; + margin-right: auto; + left: 0; + right: 0; +} +div { + display: block; + margin-left: auto; + margin-right: auto; + left: 0; + right: 0; + background-color: #A3A4FF; +} + +/* You can omit the mixin code from being compiled by adding paranthesis + after the selector */ + +.center() { + display: block; + margin-left: auto; + margin-right: auto; + left: 0; + right: 0; +} + +div { + .center; + background-color: @primary-color; +} + +/*Which would compile to: */ +div { + display: block; + margin-left: auto; + margin-right: auto; + left: 0; + right: 0; + background-color: #A3A4FF; +} + + +/*Functions +==============================*/ + + + +/* Less provides functions that can be used to accomplish a variety of + tasks. Consider the following */ + +/* Functions can be invoked by using their name and passing in the + required arguments */ +body { + width: round(10.25px); +} + +.footer { + background-color: fadeout(#000000, 0.25) +} + +/* Compiles to: */ + +body { + width: 10px; +} + +.footer { + background-color: rgba(0, 0, 0, 0.75); +} + +/* You may also define your own functions. Functions are very similar to + mixins. When trying to choose between a function or a mixin, remember + that mixins are best for generating CSS while functions are better for + logic that might be used throughout your Less code. The examples in + the Math Operators' section are ideal candidates for becoming a reusable + function. */ + +/* This function will take a target size and the parent size and calculate + and return the percentage */ + +.average(@x, @y) { + @average_result: ((@x + @y) / 2); +} + +div { + .average(16px, 50px); // "call" the mixin + padding: @average_result; // use its "return" value +} + +/* Compiles to: */ + +div { + padding: 33px; +} + +/*Extend (Inheritance) +==============================*/ + + + +/*Extend is a way to share the properties of one selector with another. */ + +.display { + height: 50px; +} + +.display-success { + &:extend(.display); + border-color: #22df56; +} + +/* Compiles to: */ +.display, +.display-success { + height: 50px; +} +.display-success { + border-color: #22df56; +} + +/* Extending a CSS statement is preferable to creating a mixin + because of the way it groups together the classes that all share + the same base styling. If this was done with a mixin, the properties + would be duplicated for each statement that + called the mixin. While it won't affect your workflow, it will + add unnecessary bloat to the files created by the Less compiler. */ + + + +/*Nesting +==============================*/ + + + +/*Less allows you to nest selectors within selectors */ + +ul { + list-style-type: none; + margin-top: 2em; + + li { + background-color: #FF0000; + } +} + +/* '&' will be replaced by the parent selector. */ +/* You can also nest pseudo-classes. */ +/* Keep in mind that over-nesting will make your code less maintainable. +Best practices recommend going no more than 3 levels deep when nesting. +For example: */ + +ul { + list-style-type: none; + margin-top: 2em; + + li { + background-color: red; + + &:hover { + background-color: blue; + } + + a { + color: white; + } + } +} + +/* Compiles to: */ + +ul { + list-style-type: none; + margin-top: 2em; +} + +ul li { + background-color: red; +} + +ul li:hover { + background-color: blue; +} + +ul li a { + color: white; +} + + + +/*Partials and Imports +==============================*/ + + + +/* Less allows you to create partial files. This can help keep your Less + code modularized. Partial files conventionally begin with an '_', + e.g. _reset.less. and are imported into a main less file that gets + compiled into CSS */ + +/* Consider the following CSS which we'll put in a file called _reset.less */ + +html, +body, +ul, +ol { + margin: 0; + padding: 0; +} + +/* Less offers @import which can be used to import partials into a file. + This differs from the traditional CSS @import statement which makes + another HTTP request to fetch the imported file. Less takes the + imported file and combines it with the compiled code. */ + +@import 'reset'; + +body { + font-size: 16px; + font-family: Helvetica, Arial, Sans-serif; +} + +/* Compiles to: */ + +html, body, ul, ol { + margin: 0; + padding: 0; +} + +body { + font-size: 16px; + font-family: Helvetica, Arial, Sans-serif; +} + + +/*Math Operations +==============================*/ + + + +/* Less provides the following operators: +, -, *, /, and %. These can + be useful for calculating values directly in your Less files instead + of using values that you've already calculated by hand. Below is an example + of a setting up a simple two column design. */ + +@content-area: 960px; +@main-content: 600px; +@sidebar-content: 300px; + +@main-size: @main-content / @content-area * 100%; +@sidebar-size: @sidebar-content / @content-area * 100%; +@gutter: 100% - (@main-size + @sidebar-size); + +body { + width: 100%; +} + +.main-content { + width: @main-size; +} + +.sidebar { + width: @sidebar-size; +} + +.gutter { + width: @gutter; +} + +/* Compiles to: */ + +body { + width: 100%; +} + +.main-content { + width: 62.5%; +} + +.sidebar { + width: 31.25%; +} + +.gutter { + width: 6.25%; +} + + +``` + +## Practice Less + +If you want to play with Less in your browser, check out [LESS2CSS](http://lesscss.org/less-preview/). + +## Compatibility + +Less can be used in any project as long as you have a program to compile it +into CSS. You'll want to verify that the CSS you're using is compatible +with your target browsers. + +[QuirksMode CSS](http://www.quirksmode.org/css/) and [CanIUse](http://caniuse.com) are great resources for checking compatibility. + +## Further reading +* [Official Documentation](http://lesscss.org/features/) From ecdd217522a1f1b70dd1abca720e36f24622db6d Mon Sep 17 00:00:00 2001 From: Ramanan Balakrishnan Date: Sat, 31 Oct 2015 23:35:20 -0700 Subject: [PATCH 600/685] [latex/en] Explain how to setup a bibliography section --- latex.html.markdown | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/latex.html.markdown b/latex.html.markdown index 31231a70..e89d7e3b 100644 --- a/latex.html.markdown +++ b/latex.html.markdown @@ -227,6 +227,15 @@ format you defined in Step 1. That's all for now! +% Most often, you would want to have a references section in your document. +% The easiest way to set this up would be by using the bibliography section +\begin{thebibliography}{1} + % similar to other lists, the \bibitem command can be used to list items + % each entry can then be cited directly in the body of the text + \bibitem{latexwiki} The amazing LaTeX wikibook: {\em https://en.wikibooks.org/wiki/LaTeX} + \bibitem{latextutorial} An actual tutorial: {\em http://www.latex-tutorial.com} +\end{thebibliography} + % end the document \end{document} ``` From 8d879735365461d817ccd75d0cae1be9d361197b Mon Sep 17 00:00:00 2001 From: CY Lim Date: Mon, 2 Nov 2015 11:23:59 +1100 Subject: [PATCH 601/685] println() depreciated in swift2.0 --- zh-cn/swift-cn.html.markdown | 99 ++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 50 deletions(-) diff --git a/zh-cn/swift-cn.html.markdown b/zh-cn/swift-cn.html.markdown index 28001e3f..81efbb3e 100644 --- a/zh-cn/swift-cn.html.markdown +++ b/zh-cn/swift-cn.html.markdown @@ -19,7 +19,7 @@ Swift 的官方语言教程 [Swift Programming Language](https://itunes.apple.co // 导入外部模块 import UIKit -// +// // MARK: 基础 // @@ -28,12 +28,12 @@ import UIKit // TODO: TODO 标记 // FIXME: FIXME 标记 -println("Hello, world") +print("Hello, world") // 变量 (var) 的值设置后可以随意改变 // 常量 (let) 的值设置后不能改变 var myVariable = 42 -let øπΩ = "value" // 可以支持 unicode 变量名 +let øπΩ = "value" // 可以支持 unicode 变量名 let π = 3.1415926 let myConstant = 3.1415926 let explicitDouble: Double = 70 // 明确指定变量类型为 Double ,否则编译器将自动推断变量类型 @@ -46,16 +46,16 @@ let piText = "Pi = \(π), Pi 2 = \(π * 2)" // 格式化字符串 // 条件编译 // 使用 -D 定义编译开关 #if false - println("Not printed") + print("Not printed") let buildValue = 3 #else let buildValue = 7 #endif -println("Build value: \(buildValue)") // Build value: 7 +print("Build value: \(buildValue)") // Build value: 7 /* Optionals 是 Swift 的新特性,它允许你存储两种状态的值给 Optional 变量:有效值或 None - + Swift 要求所有的 Optinal 属性都必须有明确的值,如果为空,则必须明确设定为 nil Optional 是个枚举类型 @@ -67,9 +67,9 @@ var someOptionalString2: Optional = "optional" if someOptionalString != nil { // 变量不为空 if someOptionalString!.hasPrefix("opt") { - println("has the prefix") + print("has the prefix") } - + let empty = someOptionalString?.isEmpty } someOptionalString = nil @@ -94,7 +94,7 @@ anyObjectVar = "Changed value to a string, not good practice, but possible." /* 这里是注释 - + /* 支持嵌套的注释 */ @@ -136,21 +136,21 @@ var emptyMutableDictionary = [String: Float]() // 使用 var 定义字典变量 let myArray = [1, 1, 2, 3, 5] for value in myArray { if value == 1 { - println("One!") + print("One!") } else { - println("Not one!") + print("Not one!") } } // 字典的 for 循环 var dict = ["one": 1, "two": 2] for (key, value) in dict { - println("\(key): \(value)") + print("\(key): \(value)") } // 区间的 loop 循环:其中 `...` 表示闭环区间,即[-1, 3];`..<` 表示半开闭区间,即[-1,3) for i in -1...shoppingList.count { - println(i) + print(i) } shoppingList[1...2] = ["steak", "peacons"] // 可以使用 `..<` 来去掉最后一个元素 @@ -163,7 +163,7 @@ while i < 1000 { // do-while 循环 do { - println("hello") + print("hello") } while 1 == 2 // Switch 语句 @@ -177,7 +177,7 @@ case "cucumber", "watercress": let vegetableComment = "That would make a good tea sandwich." case let localScopeValue where localScopeValue.hasSuffix("pepper"): let vegetableComment = "Is it a spicy \(localScopeValue)?" -default: // 在 Swift 里,switch 语句的 case 必须处理所有可能的情况,如果 case 无法全部处理,则必须包含 default语句 +default: // 在 Swift 里,switch 语句的 case 必须处理所有可能的情况,如果 case 无法全部处理,则必须包含 default语句 let vegetableComment = "Everything tastes good in soup." } @@ -219,8 +219,8 @@ let pricesTuple = getGasPrices() let price = pricesTuple.2 // 3.79 // 通过下划线 (_) 来忽略不关心的值 let (_, price1, _) = pricesTuple // price1 == 3.69 -println(price1 == pricesTuple.1) // true -println("Gas price: \(price)") +print(price1 == pricesTuple.1) // true +print("Gas price: \(price)") // 可变参数 func setup(numbers: Int...) { @@ -248,7 +248,7 @@ func swapTwoInts(inout a: Int, inout b: Int) { var someIntA = 7 var someIntB = 3 swapTwoInts(&someIntA, &someIntB) -println(someIntB) // 7 +print(someIntB) // 7 // @@ -296,7 +296,7 @@ print(numbers) // [3, 6, 18] struct NamesTable { let names = [String]() - + // 自定义下标运算符 subscript(index: Int) -> String { return names[index] @@ -306,7 +306,7 @@ struct NamesTable { // 结构体有一个自动生成的隐含的命名构造函数 let namesTable = NamesTable(names: ["Me", "Them"]) let name = namesTable[1] -println("Name is \(name)") // Name is Them +print("Name is \(name)") // Name is Them // // MARK: 类 @@ -329,7 +329,7 @@ public class Shape { internal class Rect: Shape { // 值属性 (Stored properties) var sideLength: Int = 1 - + // 计算属性 (Computed properties) private var perimeter: Int { get { @@ -340,11 +340,11 @@ internal class Rect: Shape { sideLength = newValue / 4 } } - + // 延时加载的属性,只有这个属性第一次被引用时才进行初始化,而不是定义时就初始化 // subShape 值为 nil ,直到 subShape 第一次被引用时才初始化为一个 Rect 实例 lazy var subShape = Rect(sideLength: 4) - + // 监控属性值的变化。 // 当我们需要在属性值改变时做一些事情,可以使用 `willSet` 和 `didSet` 来设置监控函数 // `willSet`: 值改变之前被调用 @@ -352,14 +352,14 @@ internal class Rect: Shape { var identifier: String = "defaultID" { // `willSet` 的参数是即将设置的新值,参数名可以指定,如果没有指定,就是 `newValue` willSet(someIdentifier) { - println(someIdentifier) + print(someIdentifier) } // `didSet` 的参数是已经被覆盖掉的旧的值,参数名也可以指定,如果没有指定,就是 `oldValue` didSet { - println(oldValue) + print(oldValue) } } - + // 命名构造函数 (designated inits),它必须初始化所有的成员变量, // 然后调用父类的命名构造函数继续初始化父类的所有变量。 init(sideLength: Int) { @@ -367,13 +367,13 @@ internal class Rect: Shape { // 必须显式地在构造函数最后调用父类的构造函数 super.init super.init() } - + func shrink() { if sideLength > 0 { --sideLength } } - + // 函数重载使用 override 关键字 override func getArea() -> Int { return sideLength * sideLength @@ -394,16 +394,16 @@ class Square: Rect { } var mySquare = Square() -println(mySquare.getArea()) // 25 +print(mySquare.getArea()) // 25 mySquare.shrink() -println(mySquare.sideLength) // 4 +print(mySquare.sideLength) // 4 // 类型转换 let aShape = mySquare as Shape // 使用三个等号来比较是不是同一个实例 if mySquare === aShape { - println("Yep, it's mySquare") + print("Yep, it's mySquare") } class Circle: Shape { @@ -411,12 +411,12 @@ class Circle: Shape { override func getArea() -> Int { return 3 * radius * radius } - + // optional 构造函数,可能会返回 nil init?(radius: Int) { self.radius = radius super.init() - + if radius <= 0 { return nil } @@ -425,13 +425,13 @@ class Circle: Shape { // 根据 Swift 类型推断,myCircle 是 Optional 类型的变量 var myCircle = Circle(radius: 1) -println(myCircle?.getArea()) // Optional(3) -println(myCircle!.getArea()) // 3 +print(myCircle?.getArea()) // Optional(3) +print(myCircle!.getArea()) // 3 var myEmptyCircle = Circle(radius: -1) -println(myEmptyCircle?.getArea()) // "nil" +print(myEmptyCircle?.getArea()) // "nil" if let circle = myEmptyCircle { // 此语句不会输出,因为 myEmptyCircle 变量值为 nil - println("circle is not nil") + print("circle is not nil") } @@ -461,7 +461,7 @@ enum BookName: String { case John = "John" case Luke = "Luke" } -println("Name: \(BookName.John.rawValue)") +print("Name: \(BookName.John.rawValue)") // 与特定数据类型关联的枚举 enum Furniture { @@ -469,7 +469,7 @@ enum Furniture { case Desk(height: Int) // 和 String, Int 关联的枚举记录 case Chair(brand: String, height: Int) - + func description() -> String { switch self { case .Desk(let height): @@ -481,9 +481,9 @@ enum Furniture { } var desk: Furniture = .Desk(height: 80) -println(desk.description()) // "Desk with 80 cm" +print(desk.description()) // "Desk with 80 cm" var chair = Furniture.Chair(brand: "Foo", height: 40) -println(chair.description()) // "Chair of Foo with 40 cm" +print(chair.description()) // "Chair of Foo with 40 cm" // @@ -512,7 +512,7 @@ protocol ShapeGenerator { class MyShape: Rect { var delegate: TransformShape? - + func grow() { sideLength += 2 @@ -539,21 +539,21 @@ extension Square: Printable { } } -println("Square: \(mySquare)") // Area: 16 - ID: defaultID +print("Square: \(mySquare)") // Area: 16 - ID: defaultID // 也可以给系统内置类型添加功能支持 extension Int { var customProperty: String { return "This is \(self)" } - + func multiplyBy(num: Int) -> Int { return num * self } } -println(7.customProperty) // "This is 7" -println(14.multiplyBy(3)) // 42 +print(7.customProperty) // "This is 7" +print(14.multiplyBy(3)) // 42 // 泛型: 和 Java 及 C# 的泛型类似,使用 `where` 关键字来限制类型。 // 如果只有一个类型限制,可以省略 `where` 关键字 @@ -566,7 +566,7 @@ func findIndex(array: [T], valueToFind: T) -> Int? { return nil } let foundAtIndex = findIndex([1, 2, 3, 4], 3) -println(foundAtIndex == 2) // true +print(foundAtIndex == 2) // true // 自定义运算符: // 自定义运算符可以以下面的字符打头: @@ -581,11 +581,10 @@ prefix func !!! (inout shape: Square) -> Square { } // 当前值 -println(mySquare.sideLength) // 4 +print(mySquare.sideLength) // 4 // 使用自定义的 !!! 运算符来把矩形边长放大三倍 !!!mySquare -println(mySquare.sideLength) // 12 +print(mySquare.sideLength) // 12 ``` - From 9b0242fbe95517db45347a0416b53e9ed6769bdd Mon Sep 17 00:00:00 2001 From: CY Lim Date: Mon, 2 Nov 2015 12:17:23 +1100 Subject: [PATCH 602/685] add in update from English version --- zh-cn/swift-cn.html.markdown | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/zh-cn/swift-cn.html.markdown b/zh-cn/swift-cn.html.markdown index 81efbb3e..78e97c2f 100644 --- a/zh-cn/swift-cn.html.markdown +++ b/zh-cn/swift-cn.html.markdown @@ -5,7 +5,8 @@ contributors: - ["Grant Timmerman", "http://github.com/grant"] translators: - ["Xavier Yao", "http://github.com/xavieryao"] - - ["Joey Huang", "http://github.com/kamidox"] + - ["Joey Huang", "http://github.com/kamidox"] + - ["CY Lim", "http://github.com/cylim"] lang: zh-cn --- @@ -28,7 +29,9 @@ import UIKit // TODO: TODO 标记 // FIXME: FIXME 标记 -print("Hello, world") +// Swift2.0 println() 及 print() 已经整合成 print()。 +print("Hello, world") // 这是原本的 println(),会自动进入下一行 +print("Hello, world", appendNewLine: false) // 如果不要自动进入下一行,需设定进入下一行为 false // 变量 (var) 的值设置后可以随意改变 // 常量 (let) 的值设置后不能改变 @@ -54,7 +57,8 @@ let piText = "Pi = \(π), Pi 2 = \(π * 2)" // 格式化字符串 print("Build value: \(buildValue)") // Build value: 7 /* - Optionals 是 Swift 的新特性,它允许你存储两种状态的值给 Optional 变量:有效值或 None + Optionals 是 Swift 的新特性,它允许你存储两种状态的值给 Optional 变量:有效值或 None 。 + 可在值名称后加个问号 (?) 来表示这个值是 Optional。 Swift 要求所有的 Optinal 属性都必须有明确的值,如果为空,则必须明确设定为 nil @@ -74,6 +78,10 @@ if someOptionalString != nil { } someOptionalString = nil +/* + 使用 (!) 可以解决无法访问optional值的运行错误。若要使用 (!)来强制解析,一定要确保 Optional 里不是 nil参数。 +*/ + // 显式解包 optional 变量 var unwrappedString: String! = "Value is expected." // 下面语句和上面完全等价,感叹号 (!) 是个后缀运算符,这也是个语法糖 @@ -116,6 +124,7 @@ shoppingList[1] = "bottle of water" let emptyArray = [String]() // 使用 let 定义常量,此时 emptyArray 数组不能添加或删除内容 let emptyArray2 = Array() // 与上一语句等价,上一语句更常用 var emptyMutableArray = [String]() // 使用 var 定义变量,可以向 emptyMutableArray 添加数组元素 +var explicitEmptyMutableStringArray: [String] = [] // 与上一语句等价 // 字典 var occupations = [ @@ -126,6 +135,7 @@ occupations["Jayne"] = "Public Relations" // 修改字典,如果 key 不存 let emptyDictionary = [String: Float]() // 使用 let 定义字典常量,字典常量不能修改里面的值 let emptyDictionary2 = Dictionary() // 与上一语句类型等价,上一语句更常用 var emptyMutableDictionary = [String: Float]() // 使用 var 定义字典变量 +var explicitEmptyMutableDictionary: [String: Float] = [:] // 与上一语句类型等价 // @@ -256,7 +266,7 @@ print(someIntB) // 7 // var numbers = [1, 2, 6] -// 函数是闭包的一个特例 +// 函数是闭包的一个特例 ({}) // 闭包实例 // `->` 分隔了闭包的参数和返回值 @@ -587,4 +597,18 @@ print(mySquare.sideLength) // 4 !!!mySquare print(mySquare.sideLength) // 12 +// 运算符也可以是泛型 +infix operator <-> {} +func <-> (inout a: T, inout b: T) { + let c = a + a = b + b = c +} + +var foo: Float = 10 +var bar: Float = 20 + +foo <-> bar +print("foo is \(foo), bar is \(bar)") // "foo is 20.0, bar is 10.0" + ``` From a4ed1aee75d13c237b4747b5560d209bce65f62b Mon Sep 17 00:00:00 2001 From: CY Lim Date: Mon, 2 Nov 2015 12:18:04 +1100 Subject: [PATCH 603/685] fixed Getting Start Guide link --- zh-cn/swift-cn.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zh-cn/swift-cn.html.markdown b/zh-cn/swift-cn.html.markdown index 78e97c2f..3efe4941 100644 --- a/zh-cn/swift-cn.html.markdown +++ b/zh-cn/swift-cn.html.markdown @@ -14,7 +14,7 @@ Swift 是 Apple 开发的用于 iOS 和 OS X 开发的编程语言。Swift 于20 Swift 的官方语言教程 [Swift Programming Language](https://itunes.apple.com/us/book/swift-programming-language/id881256329) 可以从 iBooks 免费下载. -亦可参阅:Apple's [getting started guide](https://developer.apple.com/library/prerelease/ios/referencelibrary/GettingStarted/RoadMapiOS/index.html) ——一个完整的Swift 教程 +亦可参阅:Apple's [getting started guide](https://developer.apple.com/library/prerelease/ios/referencelibrary/GettingStarted/DevelopiOSAppsSwift/) ——一个完整的Swift 教程 ```swift // 导入外部模块 From c32a8b2ca157c1be2d3fa67fe429a5e2e92241b6 Mon Sep 17 00:00:00 2001 From: Jacob Ward Date: Sun, 1 Nov 2015 19:38:55 -0700 Subject: [PATCH 604/685] Removed extraneous characters. --- markdown.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown.html.markdown b/markdown.html.markdown index 7be37f81..e148213c 100644 --- a/markdown.html.markdown +++ b/markdown.html.markdown @@ -242,7 +242,7 @@ Markdown also supports reference style links. ``` The title can also be in single quotes or in parentheses, or omitted entirely. The references can be anywhere in your document and the reference IDs -can be anything so long as they are unique. --> +can be anything so long as they are unique. There is also "implicit naming" which lets you use the link text as the id. ```markdown From 9444609b7d44a7f16cbd6c920374eb5e26f10725 Mon Sep 17 00:00:00 2001 From: Jacob Ward Date: Sun, 1 Nov 2015 20:32:41 -0700 Subject: [PATCH 605/685] Fixed grammar --- markdown.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown.html.markdown b/markdown.html.markdown index e148213c..d38bfe33 100644 --- a/markdown.html.markdown +++ b/markdown.html.markdown @@ -9,7 +9,7 @@ filename: markdown.md Markdown was created by John Gruber in 2004. It's meant to be an easy to read and write syntax which converts easily to HTML (and now many other formats as well). -Markdown is a superset of HTML, so any HTML file is valid Markdown, that +Markdown is a superset of HTML, so any HTML file is valid Markdown. This means we can use HTML elements in Markdown, such as the comment element, and they won't be affected by a markdown parser. However, if you create an HTML element in your markdown file, you cannot use markdown syntax within that From c64f9231a9e9eb797519a582a73dbca452f00672 Mon Sep 17 00:00:00 2001 From: Jacob Ward Date: Sun, 1 Nov 2015 20:56:59 -0700 Subject: [PATCH 606/685] fix kbd tag --- markdown.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown.html.markdown b/markdown.html.markdown index d38bfe33..64f5f351 100644 --- a/markdown.html.markdown +++ b/markdown.html.markdown @@ -284,7 +284,7 @@ in italics, so I do this: \*this text surrounded by asterisks\*. ### Keyboard keys -In Github Flavored Markdown, you can use a tag to represent keyboard keys. +In Github Flavored Markdown, you can use a `` tag to represent keyboard keys. ```markdown Your computer crashed? Try sending a Ctrl+Alt+Del From a4a7b2dd8308a8d67722d8c93e4c1a8c052f7f6a Mon Sep 17 00:00:00 2001 From: EL Date: Mon, 2 Nov 2015 16:30:15 +0300 Subject: [PATCH 607/685] fixed unintended opposite meaning --- python.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python.html.markdown b/python.html.markdown index 2b43c5fc..f8f712d3 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -458,7 +458,7 @@ add(y=6, x=5) # Keyword arguments can arrive in any order. # You can define functions that take a variable number of -# positional args, which will be interpreted as a tuple if you do not use the * +# positional args, which will be interpreted as a tuple by using * def varargs(*args): return args @@ -466,7 +466,7 @@ varargs(1, 2, 3) # => (1, 2, 3) # You can define functions that take a variable number of -# keyword args, as well, which will be interpreted as a dict if you do not use ** +# keyword args, as well, which will be interpreted as a dict by using ** def keyword_args(**kwargs): return kwargs From b13bb0ce47386d0426342c0470ddc4a52720c56d Mon Sep 17 00:00:00 2001 From: Jake Faris Date: Mon, 2 Nov 2015 10:06:01 -0500 Subject: [PATCH 608/685] adds JF to authors --- ruby.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/ruby.html.markdown b/ruby.html.markdown index 782ffc4c..243f788b 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -14,6 +14,7 @@ contributors: - ["Rahil Momin", "https://github.com/iamrahil"] - ["Gabriel Halley", "https://github.com/ghalley"] - ["Persa Zula", "http://persazula.com"] + - ["Jake Faris", "https://github.com/farisj"] --- ```ruby From db4e212602121c5d84fc987d47054dbbbe21b1b0 Mon Sep 17 00:00:00 2001 From: Jacob Ward Date: Mon, 2 Nov 2015 08:11:50 -0700 Subject: [PATCH 609/685] Demonstrate html comments --- markdown.html.markdown | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/markdown.html.markdown b/markdown.html.markdown index 64f5f351..5f8d31c8 100644 --- a/markdown.html.markdown +++ b/markdown.html.markdown @@ -19,6 +19,7 @@ Markdown also varies in implementation from one parser to a next. This guide will attempt to clarify when features are universal or when they are specific to a certain parser. +- [HTML Elements](#html-elements) - [Headings](#headings) - [Simple Text Styles](#simple-text-styles) - [Paragraphs](#paragraphs) @@ -29,6 +30,12 @@ specific to a certain parser. - [Images](#images) - [Miscellany](#miscellany) +## HTML Elements +Markdown is a superset of HTML, so any HTML file is valid Markdown. +```markdown + +``` + ## Headings You can create HTML elements `

` through `

` easily by prepending the From 6d705f17b6295be0525ff98a94dd4703912e3654 Mon Sep 17 00:00:00 2001 From: Jacob Ward Date: Mon, 2 Nov 2015 08:17:40 -0700 Subject: [PATCH 610/685] fix demonstrate html elements/comments --- markdown.html.markdown | 6 ------ 1 file changed, 6 deletions(-) diff --git a/markdown.html.markdown b/markdown.html.markdown index 5f8d31c8..fdc59067 100644 --- a/markdown.html.markdown +++ b/markdown.html.markdown @@ -9,12 +9,6 @@ filename: markdown.md Markdown was created by John Gruber in 2004. It's meant to be an easy to read and write syntax which converts easily to HTML (and now many other formats as well). -Markdown is a superset of HTML, so any HTML file is valid Markdown. This -means we can use HTML elements in Markdown, such as the comment element, and -they won't be affected by a markdown parser. However, if you create an HTML -element in your markdown file, you cannot use markdown syntax within that -element's contents. - Markdown also varies in implementation from one parser to a next. This guide will attempt to clarify when features are universal or when they are specific to a certain parser. From 2469dd6f445bee0758c621a99e24fea8adc97c59 Mon Sep 17 00:00:00 2001 From: Jacob Ward Date: Mon, 2 Nov 2015 08:29:25 -0700 Subject: [PATCH 611/685] fix line breaks --- markdown.html.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/markdown.html.markdown b/markdown.html.markdown index fdc59067..8961c995 100644 --- a/markdown.html.markdown +++ b/markdown.html.markdown @@ -27,7 +27,9 @@ specific to a certain parser. ## HTML Elements Markdown is a superset of HTML, so any HTML file is valid Markdown. ```markdown - + ``` ## Headings From 37f6f848a6393a998d75e7b587f605422952f38b Mon Sep 17 00:00:00 2001 From: Serg Date: Mon, 2 Nov 2015 21:26:21 +0200 Subject: [PATCH 612/685] Rename ua-ua/javascript-ua.html.markdown to uk-ua/javascript-ua.html.markdown Please, change lang to uk-ua. --- {ua-ua => uk-ua}/javascript-ua.html.markdown | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {ua-ua => uk-ua}/javascript-ua.html.markdown (100%) diff --git a/ua-ua/javascript-ua.html.markdown b/uk-ua/javascript-ua.html.markdown similarity index 100% rename from ua-ua/javascript-ua.html.markdown rename to uk-ua/javascript-ua.html.markdown From ae26df01957eb870401494b2f0a993920c7da665 Mon Sep 17 00:00:00 2001 From: WinChris Date: Tue, 3 Nov 2015 09:42:26 +0100 Subject: [PATCH 613/685] Create HTML-fr.html.markdown --- fr-fr/HTML-fr.html.markdown | 115 ++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 fr-fr/HTML-fr.html.markdown diff --git a/fr-fr/HTML-fr.html.markdown b/fr-fr/HTML-fr.html.markdown new file mode 100644 index 00000000..fdde9107 --- /dev/null +++ b/fr-fr/HTML-fr.html.markdown @@ -0,0 +1,115 @@ +--- +language: html +filename: learnhtml-fr.html +contributors: + - ["Christophe THOMAS", "https://github.com/WinChris"] +lang: fr-fr +--- +HTML signifie HyperText Markup Language. +C'est un langage (format de fichiers) qui permet d'écrire des pages internet. +C’est un langage de balisage, il nous permet d'écrire des pages HTML au moyen de balises (Markup, en anglais). +Les fichiers HTML sont en réalité de simple fichier texte. +Qu'est-ce que le balisage ? C'est une façon de hiérarchiser ses données en les entourant par une balise ouvrante et une balise fermante. +Ce balisage sert à donner une signification au texte ainsi entouré. +Comme tous les autres langages, HTML a plusieurs versions. Ici, nous allons parlons de HTML5. + +**NOTE :** Vous pouvez tester les différentes balises que nous allons voir au fur et à mesure du tutoriel sur des sites comme [codepen](http://codepen.io/pen/) afin de voir les résultats, comprendre, et vous familiariser avec le langage. +Cet article porte principalement sur la syntaxe et quelques astuces. + + +```HTML + + + + + + + + + + + Mon Site + + +

Hello, world!

+ Venez voir ce que ça donne +

Ceci est un paragraphe

+

Ceci est un autre paragraphe

+
    +
  • Ceci est un item d'une liste non ordonnée (liste à puces)
  • +
  • Ceci est un autre item
  • +
  • Et ceci est le dernier item de la liste
  • +
+ + + + + + + + + + + + + + + + + + + + Mon Site + + + + + + + +

Hello, world!

+ +
Venez voir ce que ça donne +

Ceci est un paragraphe

+

Ceci est un autre paragraphe

+
    + +
  • Ceci est un item d'une liste non ordonnée (liste à puces)
  • +
  • Ceci est un autre item
  • +
  • Et ceci est le dernier item de la liste
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
First Header Second Header
Première ligne, première cellule Première ligne, deuxième cellule
Deuxième ligne, première celluleDeuxième ligne, deuxième cellule
+ +## Utilisation + +Le HTML s'écrit dans des fichiers `.html`. + +## En savoir plus + +* [Tutoriel HTML](http://slaout.linux62.org/html_css/html.html) +* [W3School](http://www.w3schools.com/html/html_intro.asp) From 05dac0dd3536dcf98c453198e6ebab5c122848a8 Mon Sep 17 00:00:00 2001 From: ioab Date: Wed, 4 Nov 2015 00:07:37 +0300 Subject: [PATCH 614/685] [vb/en] typos correction --- visualbasic.html.markdown | 64 +++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/visualbasic.html.markdown b/visualbasic.html.markdown index dfb89307..4f696262 100644 --- a/visualbasic.html.markdown +++ b/visualbasic.html.markdown @@ -45,10 +45,10 @@ Module Module1 Case "3" 'Calculating Whole Numbers Console.Clear() CalculatingWholeNumbers() - Case "4" 'Calculting Decimal Numbers + Case "4" 'Calculating Decimal Numbers Console.Clear() CalculatingDecimalNumbers() - Case "5" 'Working Calcculator + Case "5" 'Working Calculator Console.Clear() WorkingCalculator() Case "6" 'Using Do While Loops @@ -77,10 +77,10 @@ Module Module1 'One - I'm using numbers to help with the above navigation when I come back 'later to build it. - 'We use private subs to seperate different sections of the program. + 'We use private subs to separate different sections of the program. Private Sub HelloWorldOutput() 'Title of Console Application - Console.Title = "Hello World Ouput | Learn X in Y Minutes" + Console.Title = "Hello World Output | Learn X in Y Minutes" 'Use Console.Write("") or Console.WriteLine("") to print outputs. 'Followed by Console.Read() alternatively Console.Readline() 'Console.ReadLine() prints the output to the console. @@ -102,7 +102,7 @@ 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() 'Outsputs the above. + Console.ReadLine() 'Outputs the above. '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 @@ -110,7 +110,7 @@ Module Module1 'Three Private Sub CalculatingWholeNumbers() Console.Title = "Calculating Whole Numbers | Learn X in Y Minutes" - Console.Write("First number: ") 'Enter a whole number, 1, 2, 50, 104 ect + Console.Write("First number: ") 'Enter a whole number, 1, 2, 50, 104, etc Dim a As Integer = Console.ReadLine() Console.Write("Second number: ") 'Enter second whole number. Dim b As Integer = Console.ReadLine() @@ -126,7 +126,7 @@ Module Module1 'Of course we would like to be able to add up decimals. 'Therefore we could change the above from Integer to Double. - 'Enter a whole number, 1.2, 2.4, 50.1, 104.9 ect + 'Enter a whole number, 1.2, 2.4, 50.1, 104.9 etc Console.Write("First number: ") Dim a As Double = Console.ReadLine Console.Write("Second number: ") 'Enter second whole number. @@ -153,7 +153,7 @@ Module Module1 Dim f As Integer = a / b 'By adding the below lines we are able to calculate the subtract, - 'multply as well as divide the a and b values + 'multiply as well as divide the a and b values Console.Write(a.ToString() + " + " + b.ToString()) 'We want to pad the answers to the left by 3 spaces. Console.WriteLine(" = " + c.ToString.PadLeft(3)) @@ -199,7 +199,7 @@ Module Module1 Console.Write("Would you like to continue? (yes / no)") 'The program grabs the variable and prints and starts again. answer = Console.ReadLine - 'The command for the variable to work would be in this case "yes" + 'The command for the variable to work would be in this case "yes" Loop While answer = "yes" End Sub @@ -211,7 +211,7 @@ Module Module1 Console.Title = "Using For Loops | Learn X in Y Minutes" 'Declare Variable and what number it should count down in Step -1, - 'Step -2, Step -3 ect. + 'Step -2, Step -3 etc. For i As Integer = 10 To 0 Step -1 Console.WriteLine(i.ToString) 'Print the value of the counter Next i 'Calculate new value @@ -238,36 +238,36 @@ Module Module1 'Nine Private Sub IfElseStatement() - Console.Title = "If / Else Statement | Learn X in Y Minutes" + Console.Title = "If / Else Statement | Learn X in Y Minutes" 'Sometimes it is important to consider more than two alternatives. 'Sometimes there are a good few others. 'When this is the case, more than one if statement would be required. 'An if statement is great for vending machines. Where the user enters a code. - 'A1, A2, A3, ect to select an item. + 'A1, A2, A3, etc to select an item. 'All choices can be combined into a single if statement. Dim selection As String = Console.ReadLine 'Value for selection - Console.WriteLine("A1. for 7Up") - Console.WriteLine("A2. for Fanta") - Console.WriteLine("A3. for Dr. Pepper") - Console.WriteLine("A4. for Diet Coke") + Console.WriteLine("A1. for 7Up") + Console.WriteLine("A2. for Fanta") + Console.WriteLine("A3. for Dr. Pepper") + Console.WriteLine("A4. for Diet Coke") + Console.ReadLine() + If selection = "A1" Then + Console.WriteLine("7up") Console.ReadLine() - If selection = "A1" Then - Console.WriteLine("7up") - Console.ReadLine() - ElseIf selection = "A2" Then - Console.WriteLine("fanta") - Console.ReadLine() - ElseIf selection = "A3" Then - Console.WriteLine("dr. pepper") - Console.ReadLine() - ElseIf selection = "A4" Then - Console.WriteLine("diet coke") - Console.ReadLine() - Else - Console.WriteLine("Please select a product") - Console.ReadLine() - End If + ElseIf selection = "A2" Then + Console.WriteLine("fanta") + Console.ReadLine() + ElseIf selection = "A3" Then + Console.WriteLine("dr. pepper") + Console.ReadLine() + ElseIf selection = "A4" Then + Console.WriteLine("diet coke") + Console.ReadLine() + Else + Console.WriteLine("Please select a product") + Console.ReadLine() + End If End Sub From d92db6ea39723c7778b225de0f27d977bdee0b99 Mon Sep 17 00:00:00 2001 From: ioab Date: Wed, 4 Nov 2015 00:24:43 +0300 Subject: [PATCH 615/685] [vb/en] fix type inconsistencies for calculator subs --- visualbasic.html.markdown | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/visualbasic.html.markdown b/visualbasic.html.markdown index 4f696262..d6d1759d 100644 --- a/visualbasic.html.markdown +++ b/visualbasic.html.markdown @@ -126,10 +126,10 @@ Module Module1 'Of course we would like to be able to add up decimals. 'Therefore we could change the above from Integer to Double. - 'Enter a whole number, 1.2, 2.4, 50.1, 104.9 etc + 'Enter a floating-point number, 1.2, 2.4, 50.1, 104.9 etc Console.Write("First number: ") Dim a As Double = Console.ReadLine - Console.Write("Second number: ") 'Enter second whole number. + Console.Write("Second number: ") 'Enter second floating-point number. Dim b As Double = Console.ReadLine Dim c As Double = a + b Console.WriteLine(c) @@ -145,12 +145,12 @@ Module Module1 'Copy and paste the above again. Console.Write("First number: ") Dim a As Double = Console.ReadLine - Console.Write("Second number: ") 'Enter second whole number. - Dim b As Integer = Console.ReadLine - Dim c As Integer = a + b - Dim d As Integer = a * b - Dim e As Integer = a - b - Dim f As Integer = a / b + Console.Write("Second number: ") 'Enter second floating-point number. + Dim b As Double = Console.ReadLine + Dim c As Double = a + b + Dim d As Double = a * b + Dim e As Double = a - b + Dim f As Double = a / b 'By adding the below lines we are able to calculate the subtract, 'multiply as well as divide the a and b values @@ -179,11 +179,11 @@ Module Module1 Console.Write("First number: ") Dim a As Double = Console.ReadLine Console.Write("Second number: ") - Dim b As Integer = Console.ReadLine - Dim c As Integer = a + b - Dim d As Integer = a * b - Dim e As Integer = a - b - Dim f As Integer = a / b + Dim b As Double = Console.ReadLine + Dim c As Double = a + b + Dim d As Double = a * b + Dim e As Double = a - b + Dim f As Double = a / b Console.Write(a.ToString() + " + " + b.ToString()) Console.WriteLine(" = " + c.ToString.PadLeft(3)) @@ -196,7 +196,7 @@ Module Module1 Console.ReadLine() 'Ask the question, does the user wish to continue? Unfortunately it 'is case sensitive. - Console.Write("Would you like to continue? (yes / no)") + Console.Write("Would you like to continue? (yes / no) ") 'The program grabs the variable and prints and starts again. answer = Console.ReadLine 'The command for the variable to work would be in this case "yes" From 4552c56f03754ac6349c96ab73f794ecf1861254 Mon Sep 17 00:00:00 2001 From: ioab Date: Wed, 4 Nov 2015 00:49:44 +0300 Subject: [PATCH 616/685] [vb/en] remove unnecessary lines. Improve conditions (8 and 9) subs. --- visualbasic.html.markdown | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/visualbasic.html.markdown b/visualbasic.html.markdown index d6d1759d..30d03f77 100644 --- a/visualbasic.html.markdown +++ b/visualbasic.html.markdown @@ -222,7 +222,7 @@ Module Module1 'Eight Private Sub ConditionalStatement() Console.Title = "Conditional Statements | Learn X in Y Minutes" - Dim userName As String = Console.ReadLine + Dim userName As String Console.WriteLine("Hello, What is your name? ") 'Ask the user their name. userName = Console.ReadLine() 'Stores the users name. If userName = "Adam" Then @@ -244,30 +244,28 @@ Module Module1 'When this is the case, more than one if statement would be required. 'An if statement is great for vending machines. Where the user enters a code. 'A1, A2, A3, etc to select an item. - 'All choices can be combined into a single if statement. + 'All choices can be combined into a single if block. - Dim selection As String = Console.ReadLine 'Value for selection + Dim selection As String 'Declare a variable for selection + Console.WriteLine("Please select a product form our lovely vending machine.") Console.WriteLine("A1. for 7Up") Console.WriteLine("A2. for Fanta") Console.WriteLine("A3. for Dr. Pepper") Console.WriteLine("A4. for Diet Coke") - Console.ReadLine() + + selection = Console.ReadLine() 'Store a selection from the user If selection = "A1" Then Console.WriteLine("7up") - Console.ReadLine() ElseIf selection = "A2" Then Console.WriteLine("fanta") - Console.ReadLine() ElseIf selection = "A3" Then Console.WriteLine("dr. pepper") - Console.ReadLine() ElseIf selection = "A4" Then Console.WriteLine("diet coke") - Console.ReadLine() Else - Console.WriteLine("Please select a product") - Console.ReadLine() + Console.WriteLine("Sorry, I don't have any " + selection) End If + Console.ReadLine() End Sub From 7cbb4ec3ca21102f49e20f864223b084928db378 Mon Sep 17 00:00:00 2001 From: Deivuh Date: Tue, 3 Nov 2015 20:49:40 -0600 Subject: [PATCH 617/685] Correcciones de ortografia y de usos de palabras --- es-es/swift-es.html.markdown | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/es-es/swift-es.html.markdown b/es-es/swift-es.html.markdown index dcc3a607..c04ab02b 100644 --- a/es-es/swift-es.html.markdown +++ b/es-es/swift-es.html.markdown @@ -16,7 +16,7 @@ por Apple. Diseñado para coexistir con Objective-C y ser más resistente contra el código erroneo, Swift fue introducido en el 2014 en el WWDC, la conferencia de desarrolladores de Apple. -Véase también la guía oficial de Apple, [getting started guide](https://developer.apple.com/library/prerelease/ios/referencelibrary/GettingStarted/RoadMapiOS/index.html), el cual tiene un completo tutorial de Swift. +Véase también la guía oficial de Apple, [getting started guide](https://developer.apple.com/library/prerelease/ios/referencelibrary/GettingStarted/DevelopiOSAppsSwift/), el cual tiene un completo tutorial de Swift. ```swift @@ -56,7 +56,7 @@ let largeIntValue = 77_000 // 77000 let label = "some text " + String(myVariable) // Conversión (casting) let piText = "Pi = \(π), Pi 2 = \(π * 2)" // Interpolación de string -// Valos específicos de la construcción (build) +// Valores específicos de la compilación (build) // utiliza la configuración -D #if false print("No impreso") @@ -185,8 +185,7 @@ do { } while 1 == 2 // Switch -// Muy potente, se puede pensar como declaraciones `if` -// Very powerful, think `if` statements with con azúcar sintáctico +// Muy potente, se puede pensar como declaraciones `if` con _azúcar sintáctico_ // Soportan String, instancias de objetos, y primitivos (Int, Double, etc) let vegetable = "red pepper" switch vegetable { @@ -196,7 +195,7 @@ case "cucumber", "watercress": let vegetableComment = "That would make a good tea sandwich." case let localScopeValue where localScopeValue.hasSuffix("pepper"): let vegetableComment = "Is it a spicy \(localScopeValue)?" -default: // required (in order to cover all possible input) +default: // obligatorio (se debe cumplir con todos los posibles valores de entrada) let vegetableComment = "Everything tastes good in soup." } @@ -273,7 +272,7 @@ print(someIntB) // 7 // -// MARK: Closures +// MARK: Closures (Clausuras) // var numbers = [1, 2, 6] @@ -288,7 +287,7 @@ numbers.map({ return result }) -// Cuando se conoce el tipo, cono en lo anterior, se puede hacer esto +// Cuando se conoce el tipo, como en lo anterior, se puede hacer esto numbers = numbers.map({ number in 3 * number }) // o esto //numbers = numbers.map({ $0 * 3 }) From d5e0a9fbf87e80427850e06511f768c19ebf74d7 Mon Sep 17 00:00:00 2001 From: Suhas Date: Wed, 4 Nov 2015 20:14:45 +0530 Subject: [PATCH 618/685] Add more complex key examples, and an example of inheritance --- yaml.html.markdown | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/yaml.html.markdown b/yaml.html.markdown index 6e3e2c94..62f08fb9 100644 --- a/yaml.html.markdown +++ b/yaml.html.markdown @@ -3,6 +3,7 @@ language: yaml filename: learnyaml.yaml contributors: - ["Adam Brenecki", "https://github.com/adambrenecki"] + - ["Suhas SG", "https://github.com/jargnar"] --- YAML is a data serialisation language designed to be directly writable and @@ -66,14 +67,19 @@ a_nested_map: # Maps don't have to have string keys. 0.25: a float key -# Keys can also be multi-line objects, using ? to indicate the start of a key. +# Keys can also be complex, like multi-line objects +# We use ? followed by a space to indicate the start of a complex key. ? | This is a key that has multiple lines : and this is its value -# YAML also allows collection types in keys, but many programming languages -# will complain. +# YAML also allows mapping between sequences with the complex key syntax +# Some language parsers might complain +# An example +? - Manchester United + - Real Madrid +: [ 2001-01-01, 2002-02-02 ] # Sequences (equivalent to lists or arrays) look like this: a_sequence: @@ -101,12 +107,31 @@ json_seq: [3, 2, 1, "takeoff"] anchored_content: &anchor_name This string will appear as the value of two keys. other_anchor: *anchor_name +# Anchors can be used to duplicate/inherit properties +base: &base + name: Everyone has same name + +foo: &foo + <<: *base + age: 10 + +bar: &bar + <<: *base + age: 20 + +# foo and bar would also have name: Everyone has same name + # YAML also has tags, which you can use to explicitly declare types. explicit_string: !!str 0.5 # Some parsers implement language specific tags, like this one for Python's # complex number type. python_complex_number: !!python/complex 1+2j +# We can also use yaml complex keys with language specific tags +? !!python/tuple [5, 7] +: Fifty Seven +# Would be {(5, 7): 'Fifty Seven'} in python + #################### # EXTRA YAML TYPES # #################### From 20f8f41ad5631f6638d42aca88ad2e0590abbccb Mon Sep 17 00:00:00 2001 From: Pranit Bauva Date: Wed, 4 Nov 2015 22:15:59 +0530 Subject: [PATCH 619/685] Add description that strings can be lexicographically compared with comparison operators --- julia.html.markdown | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/julia.html.markdown b/julia.html.markdown index cba7cd45..2fedcfd8 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -102,6 +102,11 @@ false # Printing is easy println("I'm Julia. Nice to meet you!") +# String can be compared lexicographically compared +"good" > "bye" # => true +"good" == "good" # => true +"1 + 2 = 3" == "1 + 2 = $(1+2)" # => true + #################################################### ## 2. Variables and Collections #################################################### From a6927f543ce6aee3ed409d7c88fc3695163c6609 Mon Sep 17 00:00:00 2001 From: Pranit Bauva Date: Wed, 4 Nov 2015 23:04:42 +0530 Subject: [PATCH 620/685] Add description about compact assignment of functions --- julia.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/julia.html.markdown b/julia.html.markdown index 2fedcfd8..a9eed2da 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -395,6 +395,10 @@ end add(5, 6) # => 11 after printing out "x is 5 and y is 6" +# Compact assignment of functions +f_add(x, y) = x + y # => "f (generic function with 1 method)" +f_add(3, 4) # => 7 + # You can define functions that take a variable number of # positional arguments function varargs(args...) From a00cc7127170fe47203900d1ab1aac998501e6ec Mon Sep 17 00:00:00 2001 From: Pranit Bauva Date: Wed, 4 Nov 2015 23:05:47 +0530 Subject: [PATCH 621/685] Add description about multiple return values --- julia.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/julia.html.markdown b/julia.html.markdown index a9eed2da..1a698834 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -399,6 +399,10 @@ add(5, 6) # => 11 after printing out "x is 5 and y is 6" f_add(x, y) = x + y # => "f (generic function with 1 method)" f_add(3, 4) # => 7 +# Function can also return multiple values as tuple +f(x, y) = x + y, x - y +f(3, 4) # => (7, -1) + # You can define functions that take a variable number of # positional arguments function varargs(args...) From 33628dca5cb4367cbbad1e4f48ddab0630b03330 Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Wed, 4 Nov 2015 23:28:26 -0500 Subject: [PATCH 622/685] elixir: add eval results to try-rescue examples --- elixir.html.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/elixir.html.markdown b/elixir.html.markdown index eedeb227..720e080c 100644 --- a/elixir.html.markdown +++ b/elixir.html.markdown @@ -343,6 +343,7 @@ rescue RuntimeError -> "rescued a runtime error" _error -> "this will rescue any error" end +#=> "rescued a runtime error" # All exceptions have a message try do @@ -351,6 +352,7 @@ rescue x in [RuntimeError] -> x.message end +#=> "some error" ## --------------------------- ## -- Concurrency From 646eb2a2a19c4cecc20f680c959dd42da1a2961f Mon Sep 17 00:00:00 2001 From: Leslie Zhang Date: Sat, 7 Nov 2015 16:57:44 +0800 Subject: [PATCH 623/685] Correct math.sqrt(16) math.sqrt(16) returns 4.0 instead of 4 --- python3.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.html.markdown b/python3.html.markdown index 2398e7ac..1f9d0e42 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -689,7 +689,7 @@ i.age # => raises an AttributeError # You can import modules import math -print(math.sqrt(16)) # => 4 +print(math.sqrt(16)) # => 4.0 # You can get specific functions from a module from math import ceil, floor From 3c1311a298211e099bb1d199947e88c2e09fddd4 Mon Sep 17 00:00:00 2001 From: Gnomino Date: Sat, 7 Nov 2015 18:12:21 +0100 Subject: [PATCH 624/685] [markdown/fr] Corrects the filename --- fr-fr/markdown.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fr-fr/markdown.html.markdown b/fr-fr/markdown.html.markdown index e5e7c73a..66f0efbe 100644 --- a/fr-fr/markdown.html.markdown +++ b/fr-fr/markdown.html.markdown @@ -2,7 +2,7 @@ language: markdown contributors: - ["Andrei Curelaru", "http://www.infinidad.fr"] -filename: markdown.md +filename: markdown-fr.md lang: fr-fr --- From fdf5b334392a7cadba2c89b2f5f05cb0290e5025 Mon Sep 17 00:00:00 2001 From: zygimantus Date: Sat, 7 Nov 2015 21:10:35 +0200 Subject: [PATCH 625/685] lithuanian translation of json --- lt-lt/json.html.markdown | 80 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 lt-lt/json.html.markdown diff --git a/lt-lt/json.html.markdown b/lt-lt/json.html.markdown new file mode 100644 index 00000000..70d7c714 --- /dev/null +++ b/lt-lt/json.html.markdown @@ -0,0 +1,80 @@ +--- +language: json +filename: learnjson.json +contributors: + - ["Zygimantus", "https://github.com/zygimantus"] +--- + +JSON („džeisonas“) yra itin paprastas duomenų mainų formatas, todėl tai bus pati lengviausia „Learn X in Y Minutes“ pamoka. + +JSON savo gryniausioje formoje neturi jokių komentarų, tačiau dauguma analizatorių priimtų C stiliaus komentarus (`//`, `/* */`). Kai kurie analizatoriai taip pat toleruoja gale esantį kablelį, pvz., kablelis po kiekvieno masyvo paskutinio elemento arba po paskutinio objekto lauko, tačiau jų reikėtų vengti dėl geresnio suderinamumo. + +JSON reikšmė privalo būti skaičius, eilutė, masyvas, objektas arba viena reikšmė iš šių: true, false, null. + +Palaikančios naršyklės yra: Firefox 3.5+, Internet Explorer 8.0+, Chrome 1.0+, Opera 10.0+, and Safari 4.0+. + +Failo plėtinys JSON failams yra „.json“, o MIME tipas yra „application/json“. + +Dauguma programavimo kalbų palaiko JSON duomenų serializaciją (kodavimą) ir deserializaciją (dekodavimą) į natyviasias duomenų struktūras. Javascript turi visišką JSON teksto kaip duomenų manipuliavimo palaikymą. + +Daugiau informacijos galima rasti http://www.json.org/ + +JSON yra pastatytas iš dviejų struktūrų: +* Vardų/reikšmių porų rinkinys. Daugomoje kalbų, tai yra realizuojama kaip objektas, įrašas, struktūra, žodynas, hash lentelė, sąrašas su raktais arba asociatyvusis masyvas. +* Rūšiuotas reikšmių sąrašas. Daugumoje kalbų, toks sąrašas yra realizuojama kaip masyvas, vektorius, sąrašas arba seka. + +Objektas su įvairiomis vardo/reikšmės poromis. + +```json +{ + "raktas": "reikšmė", + + "raktai": "privalo visada būti uždaryti dvigubomis kabutėmis", + "skaičiai": 0, + "eilutės": "Labas, pasauli. Visas unikodas yra leidžiamas, kartu su \"vengimu\".", + "turi logiką?": true, + "niekas": null, + + "didelis skaičius": 1.2e+100, + + "objektai": { + "komentaras": "Dauguma tavo struktūrų ateis iš objektų.", + + "masyvas": [0, 1, 2, 3, "Masyvas gali turėti bet ką savyje.", 5], + + "kitas objektas": { + "komentaras": "Šie dalykai gali būti įdedami naudingai." + } + }, + + "kvailumas": [ + { + "kalio šaltiniai": ["bananai"] + }, + [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, "neo"], + [0, 0, 0, 1] + ] + ], + + "alternativus stilius": { + "komentaras": "tik pažiūrėk!" + , "kablelio padėti": "nesvarbi - kol jis prieš kitą raktą, tada teisingas" + , "kitas komentaras": "kaip gražu" + } +} +``` + +Paprastas reikšmių masyvas pats savaime yra galiojantis JSON. + +```json +[1, 2, 3, "tekstas", true] +``` + +Objektai taip pat gali būti masyvų dalis. + +```json +[{"vardas": "Jonas", "amžius": 25}, {"vardas": "Eglė", "amžius": 29}, {"vardas": "Petras", "amžius": 31}] +``` From d50fc51aa615267ab78d18e046e94ec68529fdeb Mon Sep 17 00:00:00 2001 From: ioab Date: Sun, 8 Nov 2015 23:46:41 +0300 Subject: [PATCH 626/685] correction --- visualbasic.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/visualbasic.html.markdown b/visualbasic.html.markdown index 30d03f77..0371e6f6 100644 --- a/visualbasic.html.markdown +++ b/visualbasic.html.markdown @@ -126,7 +126,7 @@ Module Module1 'Of course we would like to be able to add up decimals. 'Therefore we could change the above from Integer to Double. - 'Enter a floating-point number, 1.2, 2.4, 50.1, 104.9 etc + 'Enter a floating-point number, 1.2, 2.4, 50.1, 104.9, etc Console.Write("First number: ") Dim a As Double = Console.ReadLine Console.Write("Second number: ") 'Enter second floating-point number. @@ -211,7 +211,7 @@ Module Module1 Console.Title = "Using For Loops | Learn X in Y Minutes" 'Declare Variable and what number it should count down in Step -1, - 'Step -2, Step -3 etc. + 'Step -2, Step -3, etc. For i As Integer = 10 To 0 Step -1 Console.WriteLine(i.ToString) 'Print the value of the counter Next i 'Calculate new value From 341066bb8668a71e455f735ab34638c3533d2bdd Mon Sep 17 00:00:00 2001 From: ven Date: Sun, 8 Nov 2015 22:04:44 +0100 Subject: [PATCH 627/685] Address #1390 @Zoffixnet, awaiting your review --- perl6.html.markdown | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/perl6.html.markdown b/perl6.html.markdown index 45b15f05..3eec19f3 100644 --- a/perl6.html.markdown +++ b/perl6.html.markdown @@ -1,10 +1,9 @@ --- -name: perl6 category: language language: perl6 filename: learnperl6.pl contributors: - - ["Nami-Doc", "http://github.com/Nami-Doc"] + - ["vendethiel", "http://github.com/vendethiel"] --- Perl 6 is a highly capable, feature-rich programming language made for at @@ -374,6 +373,8 @@ say @array[^10]; # you can pass arrays as subscripts and it'll return say join(' ', @array[15..*]); #=> 15 16 17 18 19 # which is equivalent to: say join(' ', @array[-> $n { 15..$n }]); +# Note: if you try to do either of those with an infinite loop, +# you'll trigger an infinite loop (your program won't finish) # You can use that in most places you'd expect, even assigning to an array my @numbers = ^20; @@ -763,8 +764,9 @@ try { # and `enum`) are actually packages. (Packages are the lowest common denominator) # Packages are important - especially as Perl is well-known for CPAN, # the Comprehensive Perl Archive Network. -# You usually don't use packages directly: you use `class Package::Name::Here;`, -# or if you only want to export variables/subs, you can use `module`: +# You're not supposed to use the package keyword, usually: +# you use `class Package::Name::Here;` to declare a class, +# or if you only want to export variables/subs, you can use `module`: module Hello::World { # Bracketed form # If `Hello` doesn't exist yet, it'll just be a "stub", # that can be redeclared as something else later. @@ -774,11 +776,6 @@ unit module Parse::Text; # file-scoped form grammar Parse::Text::Grammar { # A grammar is a package, which you could `use` } -# NOTE for Perl 5 users: even though the `package` keyword exists, -# the braceless form is invalid (to catch a "perl5ism"). This will error out: -# package Foo; # because Perl 6 will think the entire file is Perl 5 -# Just use `module` or the brace version of `package`. - # You can use a module (bring its declarations into scope) with `use` use JSON::Tiny; # if you installed Rakudo* or Panda, you'll have this module say from-json('[1]').perl; #=> [1] @@ -870,8 +867,16 @@ LEAVE { say "Runs everytime you leave a block, even when an exception PRE { say "Asserts a precondition at every block entry, before ENTER (especially useful for loops)" } +# exemple: +for 0..2 { + PRE { $_ > 1 } # This is going to blow up with "Precondition failed" +} + POST { say "Asserts a postcondition at every block exit, after LEAVE (especially useful for loops)" } +for 0..2 { + POST { $_ < 2 } # This is going to blow up with "Postcondition failed" +} ## * Block/exceptions phasers sub { @@ -1239,14 +1244,14 @@ so 'foo!' ~~ / <-[ a..z ] + [ f o ]> + /; # True (the + doesn't replace the left # Group: you can group parts of your regexp with `[]`. # These groups are *not* captured (like PCRE's `(?:)`). so 'abc' ~~ / a [ b ] c /; # `True`. The grouping does pretty much nothing -so 'fooABCABCbar' ~~ / foo [ A B C ] + bar /; +so 'foo012012bar' ~~ / foo [ '01' <[0..9]> ] + bar /; # The previous line returns `True`. -# We match the "ABC" 1 or more time (the `+` was applied to the group). +# We match the "012" 1 or more time (the `+` was applied to the group). # But this does not go far enough, because we can't actually get back what # we matched. # Capture: We can actually *capture* the results of the regexp, using parentheses. -so 'fooABCABCbar' ~~ / foo ( A B C ) + bar /; # `True`. (using `so` here, `$/` below) +so 'fooABCABCbar' ~~ / foo ( 'A' <[A..Z]> 'C' ) + bar /; # `True`. (using `so` here, `$/` below) # So, starting with the grouping explanations. # As we said before, our `Match` object is available as `$/`: From eee0aba489080a13cdca80af46c3128997d792b3 Mon Sep 17 00:00:00 2001 From: Pranit Bauva Date: Mon, 9 Nov 2015 10:33:22 +0530 Subject: [PATCH 628/685] Remove the extra 'compared' in julia.html.markdown --- julia.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia.html.markdown b/julia.html.markdown index 1a698834..fcfa7e30 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -102,7 +102,7 @@ false # Printing is easy println("I'm Julia. Nice to meet you!") -# String can be compared lexicographically compared +# String can be compared lexicographically "good" > "bye" # => true "good" == "good" # => true "1 + 2 = 3" == "1 + 2 = $(1+2)" # => true From afc5ea14654e0e9cd11c7ef1b672639d12418bad Mon Sep 17 00:00:00 2001 From: "C. Bess" Date: Mon, 9 Nov 2015 17:54:05 -0600 Subject: [PATCH 629/685] - update examples - add examples for labeled tuples and computed properties --- swift.html.markdown | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/swift.html.markdown b/swift.html.markdown index 0d1d2df4..5e6b76e6 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -211,7 +211,7 @@ greet("Bob", "Tuesday") func greet2(#requiredName: String, externalParamName localParamName: String) -> String { return "Hello \(requiredName), the day is \(localParamName)" } -greet2(requiredName:"John", externalParamName: "Sunday") +greet2(requiredName: "John", externalParamName: "Sunday") // Function that returns multiple items in a tuple func getGasPrices() -> (Double, Double, Double) { @@ -224,6 +224,16 @@ let (_, price1, _) = pricesTuple // price1 == 3.69 println(price1 == pricesTuple.1) // true println("Gas price: \(price)") +// Named tuple params +func getGasPrices2() -> (lowestPrice: Double, highestPrice: Double, midPrice: Double) { + return (1.77, 37.70, 7.37) +} +let pricesTuple2 = getGasPrices2() +let price2 = pricesTuple2.lowestPrice +let (_, price3, _) = pricesTuple2 +println(pricesTuple2.highestPrice == pricesTuple2.1) // true +println("Highest gas price: \(pricesTuple2.highestPrice)") + // Variadic Args func setup(numbers: Int...) { // its an array @@ -337,6 +347,11 @@ internal class Rect: Shape { } } + // Computed properties must be declared as `var`, you know, cause they can change + var smallestSideLength: Int { + return self.sideLength - 1 + } + // Lazily load a property // subShape remains nil (uninitialized) until getter called lazy var subShape = Rect(sideLength: 4) From 618f8f5badfded04ee1edb7c24ccf24ea61a947b Mon Sep 17 00:00:00 2001 From: "C. Bess" Date: Mon, 9 Nov 2015 18:09:48 -0600 Subject: [PATCH 630/685] - update Swift examples - update to upgrade to Swift 2.1 - code cleanup --- swift.html.markdown | 81 +++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 43 deletions(-) diff --git a/swift.html.markdown b/swift.html.markdown index f2e9d04c..a39bc1d6 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -32,7 +32,7 @@ import UIKit // In Swift 2, println and print were combined into one print method. Print automatically appends a new line. print("Hello, world") // println is now print -print("Hello, world", appendNewLine: false) // printing without appending a newline +print("Hello, world", terminator: "") // printing without appending a newline // variables (var) value can change after being set // constants (let) value can NOT be changed after being set @@ -60,14 +60,14 @@ let piText = "Pi = \(π), Pi 2 = \(π * 2)" // String interpolation print("Build value: \(buildValue)") // Build value: 7 /* - Optionals are a Swift language feature that either contains a value, - or contains nil (no value) to indicate that a value is missing. - A question mark (?) after the type marks the value as optional. +Optionals are a Swift language feature that either contains a value, +or contains nil (no value) to indicate that a value is missing. +A question mark (?) after the type marks the value as optional. - Because Swift requires every property to have a value, even nil must be - explicitly stored as an Optional value. +Because Swift requires every property to have a value, even nil must be +explicitly stored as an Optional value. - Optional is an enum. +Optional is an enum. */ var someOptionalString: String? = "optional" // Can be nil // same as above, but ? is a postfix operator (syntax candy) @@ -84,9 +84,9 @@ if someOptionalString != nil { someOptionalString = nil /* - Trying to use ! to access a non-existent optional value triggers a runtime - error. Always make sure that an optional contains a non-nil value before - using ! to force-unwrap its value. +Trying to use ! to access a non-existent optional value triggers a runtime +error. Always make sure that an optional contains a non-nil value before +using ! to force-unwrap its value. */ // implicitly unwrapped optional @@ -120,8 +120,8 @@ anyObjectVar = "Changed value to a string, not good practice, but possible." // /* - Array and Dictionary types are structs. So `let` and `var` also indicate - that they are mutable (var) or immutable (let) when declaring these types. +Array and Dictionary types are structs. So `let` and `var` also indicate +that they are mutable (var) or immutable (let) when declaring these types. */ // Array @@ -178,8 +178,8 @@ while i < 1000 { i *= 2 } -// do-while loop -do { +// repeat-while loop +repeat { print("hello") } while 1 == 2 @@ -209,22 +209,22 @@ default: // required (in order to cover all possible input) // Function with Swift header docs (format as reStructedText) /** - A greet operation +A greet operation - - A bullet in docs - - Another bullet in the docs +- A bullet in docs +- Another bullet in the docs - :param: name A name - :param: day A day - :returns: A string containing the name and day value. +:param: name A name +:param: day A day +:returns: A string containing the name and day value. */ func greet(name: String, day: String) -> String { return "Hello \(name), today is \(day)." } -greet("Bob", "Tuesday") +greet("Bob", day: "Tuesday") // similar to above except for the function parameter behaviors -func greet2(#requiredName: String, externalParamName localParamName: String) -> String { +func greet2(requiredName requiredName: String, externalParamName localParamName: String) -> String { return "Hello \(requiredName), the day is \(localParamName)" } greet2(requiredName: "John", externalParamName: "Sunday") @@ -247,14 +247,14 @@ func getGasPrices2() -> (lowestPrice: Double, highestPrice: Double, midPrice: Do let pricesTuple2 = getGasPrices2() let price2 = pricesTuple2.lowestPrice let (_, price3, _) = pricesTuple2 -println(pricesTuple2.highestPrice == pricesTuple2.1) // true -println("Highest gas price: \(pricesTuple2.highestPrice)") +print(pricesTuple2.highestPrice == pricesTuple2.1) // true +print("Highest gas price: \(pricesTuple2.highestPrice)") // Variadic Args func setup(numbers: Int...) { // its an array - let number = numbers[0] - let argCount = numbers.count + let _ = numbers[0] + let _ = numbers.count } // Passing and returning functions @@ -275,7 +275,7 @@ func swapTwoInts(inout a: Int, inout b: Int) { } var someIntA = 7 var someIntB = 3 -swapTwoInts(&someIntA, &someIntB) +swapTwoInts(&someIntA, b: &someIntB) print(someIntB) // 7 @@ -303,23 +303,17 @@ numbers = numbers.map({ number in 3 * number }) print(numbers) // [3, 6, 18] // Trailing closure -numbers = sorted(numbers) { $0 > $1 } +numbers = numbers.sort { $0 > $1 } print(numbers) // [18, 6, 3] -// Super shorthand, since the < operator infers the types - -numbers = sorted(numbers, < ) - -print(numbers) // [3, 6, 18] - // // MARK: Structures // // Structures and classes have very similar capabilities struct NamesTable { - let names = [String]() + let names: [String] // Custom subscript subscript(index: Int) -> String { @@ -472,9 +466,10 @@ enum Suit { // when the variable is explicitly declared var suitValue: Suit = .Hearts -// Non-Integer enums require direct raw value assignments +// String enums can have direct raw value assignments +// or their raw values will be derived from the Enum field enum BookName: String { - case John = "John" + case John case Luke = "Luke" } print("Name: \(BookName.John.rawValue)") @@ -518,7 +513,7 @@ protocol ShapeGenerator { // Protocols declared with @objc allow optional functions, // which allow you to check for conformance @objc protocol TransformShape { - optional func reshaped() + optional func reshape() optional func canReshape() -> Bool } @@ -531,9 +526,9 @@ class MyShape: Rect { // Place a question mark after an optional property, method, or // subscript to gracefully ignore a nil value and return nil // instead of throwing a runtime error ("optional chaining"). - if let allow = self.delegate?.canReshape?() { + if let reshape = self.delegate?.canReshape?() where reshape { // test for delegate then for method - self.delegate?.reshaped?() + self.delegate?.reshape?() } } } @@ -546,7 +541,7 @@ class MyShape: Rect { // `extension`s: Add extra functionality to an already existing type // Square now "conforms" to the `Printable` protocol -extension Square: Printable { +extension Square: CustomStringConvertible { var description: String { return "Area: \(self.getArea()) - ID: \(self.identifier)" } @@ -571,8 +566,8 @@ print(14.multiplyBy(3)) // 42 // Generics: Similar to Java and C#. Use the `where` keyword to specify the // requirements of the generics. -func findIndex(array: [T], valueToFind: T) -> Int? { - for (index, value) in enumerate(array) { +func findIndex(array: [T], _ valueToFind: T) -> Int? { + for (index, value) in array.enumerate() { if value == valueToFind { return index } From 70b3fa5bb6410b1c50e549a76807fd509119dd85 Mon Sep 17 00:00:00 2001 From: Ramanan Balakrishnan Date: Mon, 9 Nov 2015 18:15:18 -0800 Subject: [PATCH 631/685] add output of latex file --- latex.pdf | Bin 0 -> 145946 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100755 latex.pdf diff --git a/latex.pdf b/latex.pdf new file mode 100755 index 0000000000000000000000000000000000000000..6cf5f37862cfb3b12eca957a4cf2cd3bc35871b2 GIT binary patch literal 145946 zcma%?Q;;S=ldjvgt!Z~p+xE0=+qP}nwx?~|wr$(rnG<{VYX69{6;V-D*HxKsW#*G) z@*-lt8R=MI$mW)Y*I<~57>Mi)En#?gVCbbyY|Wg_iP#xgiT-QA(2H4EJDWHX(TiCd zIGc!=7}*({!0_?GI5|6-7}&tLZ=@*8*ex+2b-$_=V~Ud+9>j5s*DL3P{1zgCL^{~B z-I5Vm5z{E!{P7wguyakbqpKgipXz!w9iiW7JpEfPtu9z>Y_hOJ)?_QL6Cr{@W}%+b zr1QYpy<*9vF$0^bTg6tDsq81>6h4|~-wvEL?(FL6mFr`%EAT{J5NJ=F5tpl$jTT78 zNgrX3CDwbjyobi2dTumwp)5$d)|(S*V;4xg2)lT0*4Eur)JVQl-~E2!!?GcFHxXu` z{%+r$nH-_}%`pA?GZ)(!mMT93U3Ecf#;T7Jew_2HHo)6`A7IzW6I^y4OqB^0gx(|) z8BN|qBr`8Bm!JgVm#7V;C=Tc8(CLz-+3w!W(UYr09{!XlfV@V+QLg=%-;i&zvF>lk zYS(n1pY0fwCLo`2Q`*mo58ph@`UZQ)|L1eUvlSnQ9Ba&B2yDXnZC0afPlTW9gNjo7>9thR6~}EW^tALki`Wx zKBzfMEnsPZHJQZ(yQ9>fBeAYS1VF z;>lsjwBk-@wapp+{Mg?#r!e=&;xV5LZ0Xh47OBOnZy0+9aURT8$*_IyRkZo!Mb`%Q zAxz-<-m`ZzGqS2AgU%iy1-qCKygXY%WS}oscw*CZWBh~Hb?x2BK@W$>e1#1I&=mwI(inG{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Ay50_MpSX3a3^36lb}!* z5-AL3P(^7aN6h6J=AiC-Xl8i6yXzz6nJ<&qYq!%3Tn)R4OV}>6zw)?k#^0w@%J|Fc zwH$DqS0waMYvvH=0oVs33O<3ujxjHQ$N4Z0{_jI`1sJ;kJY9Z{iJ6U^jf(?@oLpQ{ H0_J}Kdm}3% literal 0 HcmV?d00001 From 99b2c3db3705b5231ca360c9fa69c8319caab69b Mon Sep 17 00:00:00 2001 From: "C. Bess" Date: Tue, 10 Nov 2015 17:03:40 -0600 Subject: [PATCH 632/685] - add where and guard examples --- swift.html.markdown | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/swift.html.markdown b/swift.html.markdown index a39bc1d6..df9c5092 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -149,6 +149,14 @@ var explicitEmptyMutableDictionary: [String: Float] = [:] // same as above // MARK: Control Flow // +// Condition statements support "where" clauses, which can be used +// to help provide conditions on optional values. +// Both the assignment and the "where" clause must pass. +let someNumber = Optional(7) +if let num = someNumber where num > 3 { + print("num is greater than 3") +} + // for loop (array) let myArray = [1, 1, 2, 3, 5] for value in myArray { @@ -198,7 +206,6 @@ default: // required (in order to cover all possible input) let vegetableComment = "Everything tastes good in soup." } - // // MARK: Functions // @@ -240,7 +247,7 @@ let (_, price1, _) = pricesTuple // price1 == 3.69 print(price1 == pricesTuple.1) // true print("Gas price: \(price)") -// Named tuple params +// Labeled/named tuple params func getGasPrices2() -> (lowestPrice: Double, highestPrice: Double, midPrice: Double) { return (1.77, 37.70, 7.37) } @@ -250,6 +257,18 @@ let (_, price3, _) = pricesTuple2 print(pricesTuple2.highestPrice == pricesTuple2.1) // true print("Highest gas price: \(pricesTuple2.highestPrice)") +// guard statements +func testGuard() { + // guards provide early exits or breaks, placing the error handler code near the conditions. + // it places variables it declares in the same scope as the guard statement. + guard let aNumber = Optional(7) else { + return + } + + print("number is \(aNumber)") +} +testGuard() + // Variadic Args func setup(numbers: Int...) { // its an array From f48bfca185bff1e8d69f29039f8e796db8ca6f68 Mon Sep 17 00:00:00 2001 From: Ramanan Balakrishnan Date: Tue, 10 Nov 2015 22:26:17 -0800 Subject: [PATCH 633/685] [latex/en] Cleanup of pdf file after previous commit --- latex.html.markdown | 1 + latex.pdf | Bin 145946 -> 0 bytes 2 files changed, 1 insertion(+) delete mode 100755 latex.pdf diff --git a/latex.html.markdown b/latex.html.markdown index e89d7e3b..2492f226 100644 --- a/latex.html.markdown +++ b/latex.html.markdown @@ -4,6 +4,7 @@ contributors: - ["Chaitanya Krishna Ande", "http://icymist.github.io"] - ["Colton Kohnke", "http://github.com/voltnor"] - ["Sricharan Chiruvolu", "http://sricharan.xyz"] + - ["Ramanan Balakrishnan", "https://github.com/ramananbalakrishnan"] filename: learn-latex.tex --- diff --git a/latex.pdf b/latex.pdf deleted file mode 100755 index 6cf5f37862cfb3b12eca957a4cf2cd3bc35871b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 145946 zcma%?Q;;S=ldjvgt!Z~p+xE0=+qP}nwx?~|wr$(rnG<{VYX69{6;V-D*HxKsW#*G) z@*-lt8R=MI$mW)Y*I<~57>Mi)En#?gVCbbyY|Wg_iP#xgiT-QA(2H4EJDWHX(TiCd zIGc!=7}*({!0_?GI5|6-7}&tLZ=@*8*ex+2b-$_=V~Ud+9>j5s*DL3P{1zgCL^{~B z-I5Vm5z{E!{P7wguyakbqpKgipXz!w9iiW7JpEfPtu9z>Y_hOJ)?_QL6Cr{@W}%+b zr1QYpy<*9vF$0^bTg6tDsq81>6h4|~-wvEL?(FL6mFr`%EAT{J5NJ=F5tpl$jTT78 zNgrX3CDwbjyobi2dTumwp)5$d)|(S*V;4xg2)lT0*4Eur)JVQl-~E2!!?GcFHxXu` z{%+r$nH-_}%`pA?GZ)(!mMT93U3Ecf#;T7Jew_2HHo)6`A7IzW6I^y4OqB^0gx(|) z8BN|qBr`8Bm!JgVm#7V;C=Tc8(CLz-+3w!W(UYr09{!Xl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Nq>3YsNTeG)x{f_*`l#x_9e3>NLcE!p|;UMz$9QcdG)* zrnFY{TzYU%N4t@2bMC7vrQX9Pmd+8p3qSP>^$nzdcnGeRuX9hbtnDv>-@~%k7*qLo zU$-bHwoncqBKKmtl{eFsfR6oBzDQFlrL%G83^9G5?II zI64A|IGKLttNe$#g(J~_28RF95hK#&W9Am)U=n3#;$jowl;9L$5)tEO<`7|F;uaN_ z5N2m#5g_`XO@3C9Gk35ASpCFh-2XdxBKn^>tMMmz6@D3`h3sY^iV59d9!jF2w|VX| zs9{tE_C;->E3M;*mQim2g*G_^4usgpw}Q10WmxBSawp*dy&wvOfq;>e@f6Z$7Ls3K z@xa!KCLje#HTj-LLe8Q?l1LYu*2WbwUJVvVAuG?GCyhj~Ay50_MpSX3a3^36lb}!* z5-AL3P(^7aN6h6J=AiC-Xl8i6yXzz6nJ<&qYq!%3Tn)R4OV}>6zw)?k#^0w@%J|Fc zwH$DqS0waMYvvH=0oVs33O<3ujxjHQ$N4Z0{_jI`1sJ;kJY9Z{iJ6U^jf(?@oLpQ{ H0_J}Kdm}3% From 4077facd3c880c96f8044fc99ca656af8d1427b3 Mon Sep 17 00:00:00 2001 From: Serg Date: Wed, 11 Nov 2015 08:58:13 +0200 Subject: [PATCH 634/685] Update javascript-ua.html.markdown Fixed translation and heading. --- uk-ua/javascript-ua.html.markdown | 88 ++++++++++++++----------------- 1 file changed, 41 insertions(+), 47 deletions(-) diff --git a/uk-ua/javascript-ua.html.markdown b/uk-ua/javascript-ua.html.markdown index fedbf5ac..dae27d32 100644 --- a/uk-ua/javascript-ua.html.markdown +++ b/uk-ua/javascript-ua.html.markdown @@ -3,11 +3,11 @@ language: javascript contributors: - ["Adam Brenecki", "http://adam.brenecki.id.au"] - ["Ariel Krakowski", "http://www.learneroo.com"] -filename: javascript-ru.js +filename: javascript-ua.js translators: - - ["Alexey Gonchar", "http://github.com/finico"] - - ["Andre Polykanine", "https://github.com/Oire"] -lang: ru-ru + - ["Ivan Neznayu", "https://github.com/IvanEh"] + - ["Serhii Maksymchuk", "https://maximchuk.tk"] +lang: uk-ua --- JavaScript було створено в 1995 році Бренданом Айком, який працював у копаніх Netscape. @@ -25,7 +25,7 @@ JavaScript було створено в 1995 році Бренданом Айк /* а багаторядкові коментарі починаються з послідовності слеша та зірочки і закінчуються символами зірочка-слеш */ -Інструкції можуть закінчуватися крапкою з комою ; +//Інструкції можуть закінчуватися крапкою з комою ; doStuff(); // ... але не обов’язково, тому що крапка з комою автоматично вставляється на @@ -51,7 +51,7 @@ doStuff() 10 * 2; // = 20 35 / 5; // = 7 -// В тому числі ділення з остачою +// В тому числі ділення з остачею 5 / 2; // = 2.5 // В JavaScript є побітові операції; коли ви виконуєте таку операцію, @@ -73,7 +73,7 @@ false; // Рядки створюються за допомогою подвійних та одинарних лапок 'абв'; -"Hello, world!"; +"Світ, привіт!"; // Для логічного заперечення використовується знак оклику. !true; // = false @@ -93,10 +93,10 @@ false; 2 <= 2; // = true 2 >= 2; // = true -// Рядки об’єднуються за допомогою оператор + +// Рядки об’єднуються за допомогою оператора + "hello, " + "world!"; // = "hello, world!" -// І порівнюються за допомогою > і < +// І порівнюються за допомогою > та < "a" < "b"; // = true // Перевірка на рівність з приведнням типів здійснюється оператором == @@ -112,7 +112,7 @@ null === undefined; // = false "13" + !0; // '13true' // Можна отримати доступ до будь-якого символа рядка за допомгою charAt -"Это строка".charAt(0); // = 'Э' +"Це рядок".charAt(0); // = 'Ц' // ... або використати метод substring, щоб отримати більший кусок "Hello, world".substring(0, 5); // = "Hello" @@ -124,8 +124,8 @@ null === undefined; // = false null; // навмисна відсутність результату undefined; // використовується для позначення відсутності присвоєного значення -// false, null, undefined, NaN, 0 и "" — хиба; все інше - істина. -// Потрібно відмітити, що 0 — це зиба, а "0" — істина, не зважаючи на те що: +// false, null, undefined, NaN, 0 та "" — хиба; все інше - істина. +// Потрібно відмітити, що 0 — це хиба, а "0" — істина, не зважаючи на те що: // 0 == "0". /////////////////////////////////// @@ -139,7 +139,7 @@ var someVar = 5; // якщо пропустити слово var, ви не отримаєте повідомлення про помилку, ... someOtherVar = 10; -// ... але ваша змінна буде створення в глобальному контексті, а не там, де +// ... але ваша змінна буде створена в глобальному контексті, а не там, де // ви її оголосили // Змінні, які оголошені без присвоєння, автоматично приймають значення undefined @@ -153,21 +153,21 @@ someVar *= 10; // тепер someVar = 100 someVar++; // тепер someVar дорівнює 101 someVar--; // а зараз 100 -// Масиви — це нумеровані списку, які зберігають значення будь-якого типу. -var myArray = ["Hello", 45, true]; +// Масиви — це нумеровані списки, які зберігають значення будь-якого типу. +var myArray = ["Привіт", 45, true]; // Доступ до елементів можна отримати за допомогою синтаксиса з квадратними дужками // Індексація починається з нуля myArray[1]; // = 45 -// Массивы можно изменять, как и их длину, -myArray.push("Мир"); +// Масиви можна змінювати, як і їх довжину +myArray.push("Привіт"); myArray.length; // = 4 -// додавання і редагування елементів -myArray[3] = "Hello"; +// Додавання і редагування елементів +myArray[3] = "світ"; -// Об’єкти в JavaScript сході на словники або асоціативні масиви в інших мовах +// Об’єкти в JavaScript схожі на словники або асоціативні масиви в інших мовах var myObj = {key1: "Hello", key2: "World"}; // Ключі - це рядки, але лапки не обов’язкі, якщо ключ задовольняє @@ -183,11 +183,11 @@ myObj.myKey; // = "myValue" // Об’єкти можна динамічно змінювати й додавати нові поля myObj.myThirdKey = true; -// Коли ви звертаєтесб до поля, яке не існує, ви отримуєте значення undefined +// Коли ви звертаєтесь до поля, що не існує, ви отримуєте значення undefined myObj.myFourthKey; // = undefined /////////////////////////////////// -// 3. Управляючі конструкції +// 3. Керуючі конструкції // Синтаксис для цього розділу майже такий самий, як у Java @@ -212,7 +212,7 @@ do { input = getInput(); } while (!isValid(input)) -// цикл for такий самий, кяк в C і Java: +// цикл for такий самий, як в C і Java: // ініціалізація; умова; крок. for (var i = 0; i < 5; i++) { // виконається 5 разів @@ -226,7 +226,7 @@ if (color == "red" || color == "blue") { // колір червоний або синій } -// && і || використовують скорочене обчислення +// && та || використовують скорочене обчислення // тому їх можна використовувати для задання значень за замовчуванням. var name = otherName || "default"; @@ -260,7 +260,7 @@ myFunction("foo"); // = "FOO" // Зверність увагу, що значення яке буде повернено, повинно починатися на тому ж // рядку, що і ключове слово return, інакше завжди буде повертатися значення undefined -// із-за автоматичної вставки крапки з комою +// через автоматичну вставку крапки з комою function myFunction() { return // <- крапка з комою вставляється автоматично @@ -279,8 +279,6 @@ function myFunction() { setTimeout(myFunction, 5000); // setTimeout не є частиною мови, але реалізований в браузерах і Node.js -// Функции не обязательно должны иметь имя при объявлении — вы можете написать -// анонимное определение функции непосредственно в аргументе другой функции. // Функції не обов’язково мають мати ім’я при оголошенні — ви можете написати // анонімну функцію прямо в якості аргумента іншої функції setTimeout(function() { @@ -288,11 +286,11 @@ setTimeout(function() { }, 5000); // В JavaScript реалізована концепція області видимості; функції мають свою -// область видимости, а інші блоки не мають +// область видимості, а інші блоки не мають if (true) { var i = 5; } -i; // = 5, а не undefined, як це звичайно буває в інших мова +i; // = 5, а не undefined, як це звичайно буває в інших мовах // Така особливість призвела до шаблону "анонімних функцій, які викликають самих себе" // що дозволяє уникнути проникнення змінних в глобальну область видимості @@ -305,26 +303,22 @@ i; // = 5, а не undefined, як це звичайно буває в інши temporary; // повідомлення про помилку ReferenceError permanent; // = 10 -// Одной из самых мощных возможностей JavaScript являются замыкания. Если функция -// определена внутри другой функции, то внутренняя функция имеет доступ к -// переменным внешней функции даже после того, как контекст выполнения выйдет из -// внешней функции. -// Замикання - одна з найпотужніших інтрументів JavaScript. Якщо функція визначена +// Замикання - один з найпотужніших інтрументів JavaScript. Якщо функція визначена // всередині іншої функції, то внутрішня функція має доступ до змінних зовнішньої // функції навіть після того, як код буде виконуватися поза контекстом зовнішньої функції function sayHelloInFiveSeconds(name) { - var prompt = "Hello, " + name + "!"; + var prompt = "Привіт, " + name + "!"; // Внутрішня функція зберігається в локальній області так, // ніби функція була оголошена за допомогою ключового слова var function inner() { alert(prompt); } setTimeout(inner, 5000); - // setTimeout асинхронна, тому функція sayHelloInFiveSeconds зразу завершиться, + // setTimeout асинхронна, тому функція sayHelloInFiveSeconds одразу завершиться, // після чого setTimeout викличе функцію inner. Але функція inner // «замкнута» кругом sayHelloInFiveSeconds, вона все рівно має доступ до змінної prompt } -sayHelloInFiveSeconds("Адам"); // Через 5 с відкриється вікно «Hello, Адам!» +sayHelloInFiveSeconds("Адам"); // Через 5 с відкриється вікно «Привіт, Адам!» /////////////////////////////////// // 5. Об’єкти: конструктори і прототипи @@ -394,7 +388,7 @@ myNewObj = new MyConstructor(); // = {myNumber: 5} myNewObj.myNumber; // = 5 // У кожного об’єкта є прототип. Коли ви звертаєтесь до поля, яке не існує в цьому -// об’єктів, інтерпретатор буде шукати поле в прототипі +// об’єкті, інтерпретатор буде шукати поле в прототипі // Деякі реалізації мови дозволяють отримати доступ до прототипа об’єкта через // "магічну" властивість __proto__. Це поле не є частиною стандарта, але існують @@ -415,24 +409,24 @@ myObj.meaningOfLife; // = 42 // Аналогічно для функцій myObj.myFunc(); // = "Hello, world!" -// Якщо інтерпретатор не знайде властивість в прототипі, то він продвжить пошук +// Якщо інтерпретатор не знайде властивість в прототипі, то він продовжить пошук // в прототипі прототипа і так далі myPrototype.__proto__ = { myBoolean: true }; myObj.myBoolean; // = true -// Кожег об’єкт зберігає посилання на свій прототип. Це значить, що ми можемо змінити +// Кожен об’єкт зберігає посилання на свій прототип. Це значить, що ми можемо змінити // наш прототип, і наші зміни будуть всюди відображені. myPrototype.meaningOfLife = 43; myObj.meaningOfLife; // = 43 -// Ми сказали, що властивість __proto__ нестандартне, і нема ніякого стандартного способу -// змінити прототип об’єкта, що вже існує. Але є два способи створити новий об’єкт зі заданим +// Ми сказали, що властивість __proto__ нестандартна, і нема ніякого стандартного способу +// змінити прототип об’єкта, що вже існує. Але є два способи створити новий об’єкт із заданим // прототипом -// Перший спосіб — це Object.create, який з’явився JavaScript недавно, -// а тому в деяких реалізаціях може бути не доступним. +// Перший спосіб — це Object.create, який з’явився в JavaScript недавно, +// а тому в деяких реалізаціях може бути недоступним. var myObj = Object.create(myPrototype); myObj.meaningOfLife; // = 43 @@ -461,7 +455,7 @@ typeof myNumber; // = 'number' typeof myNumberObj; // = 'object' myNumber === myNumberObj; // = false if (0) { - // Этот код не выполнится, потому что 0 - это ложь. + // Цей код не виконається, тому що 0 - це хиба. } // Об’єкти-обгортки і вбудовані типи мають спільні прототипи, тому @@ -475,9 +469,9 @@ String.prototype.firstCharacter = function() { // JavaScript в старій реалізації мови, так що вони можуть бути використані в старих // середовищах -// Наприклад, Object.create доступний не у всіх реалізація, но ми можемо +// Наприклад, Object.create доступний не у всіх реалізаціях, але ми можемо // використати функції за допомогою наступного поліфіла: -if (Object.create === undefined) { // не перезаписываем метод, если он существует +if (Object.create === undefined) { // не перезаписуємо метод, якщо він існує Object.create = function(proto) { // Створюємо правильний конструктор з правильним прототипом var Constructor = function(){}; From 1391eed837546e442eeaa48bfae9504b999b8c58 Mon Sep 17 00:00:00 2001 From: Dan Ellis Date: Tue, 10 Nov 2015 23:31:16 -0800 Subject: [PATCH 635/685] Fix variable name typo in dlang examples. --- d.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/d.html.markdown b/d.html.markdown index 6f3710ab..9ebba385 100644 --- a/d.html.markdown +++ b/d.html.markdown @@ -53,15 +53,15 @@ void main() { // For and while are nice, but in D-land we prefer 'foreach' loops. // The '..' creates a continuous range, including the first value // but excluding the last. - foreach(i; 1..1_000_000) { + foreach(n; 1..1_000_000) { if(n % 2 == 0) - writeln(i); + writeln(n); } // There's also 'foreach_reverse' when you want to loop backwards. - foreach_reverse(i; 1..int.max) { + foreach_reverse(n; 1..int.max) { if(n % 2 == 1) { - writeln(i); + writeln(n); } else { writeln("No!"); } From b97027263a7247110597bc6cbe6b46a78cb5e86f Mon Sep 17 00:00:00 2001 From: Zygimantus Date: Wed, 11 Nov 2015 10:22:03 +0200 Subject: [PATCH 636/685] -lt to filename added --- lt-lt/json-lt.html.markdown | 80 +++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 lt-lt/json-lt.html.markdown diff --git a/lt-lt/json-lt.html.markdown b/lt-lt/json-lt.html.markdown new file mode 100644 index 00000000..70d7c714 --- /dev/null +++ b/lt-lt/json-lt.html.markdown @@ -0,0 +1,80 @@ +--- +language: json +filename: learnjson.json +contributors: + - ["Zygimantus", "https://github.com/zygimantus"] +--- + +JSON („džeisonas“) yra itin paprastas duomenų mainų formatas, todėl tai bus pati lengviausia „Learn X in Y Minutes“ pamoka. + +JSON savo gryniausioje formoje neturi jokių komentarų, tačiau dauguma analizatorių priimtų C stiliaus komentarus (`//`, `/* */`). Kai kurie analizatoriai taip pat toleruoja gale esantį kablelį, pvz., kablelis po kiekvieno masyvo paskutinio elemento arba po paskutinio objekto lauko, tačiau jų reikėtų vengti dėl geresnio suderinamumo. + +JSON reikšmė privalo būti skaičius, eilutė, masyvas, objektas arba viena reikšmė iš šių: true, false, null. + +Palaikančios naršyklės yra: Firefox 3.5+, Internet Explorer 8.0+, Chrome 1.0+, Opera 10.0+, and Safari 4.0+. + +Failo plėtinys JSON failams yra „.json“, o MIME tipas yra „application/json“. + +Dauguma programavimo kalbų palaiko JSON duomenų serializaciją (kodavimą) ir deserializaciją (dekodavimą) į natyviasias duomenų struktūras. Javascript turi visišką JSON teksto kaip duomenų manipuliavimo palaikymą. + +Daugiau informacijos galima rasti http://www.json.org/ + +JSON yra pastatytas iš dviejų struktūrų: +* Vardų/reikšmių porų rinkinys. Daugomoje kalbų, tai yra realizuojama kaip objektas, įrašas, struktūra, žodynas, hash lentelė, sąrašas su raktais arba asociatyvusis masyvas. +* Rūšiuotas reikšmių sąrašas. Daugumoje kalbų, toks sąrašas yra realizuojama kaip masyvas, vektorius, sąrašas arba seka. + +Objektas su įvairiomis vardo/reikšmės poromis. + +```json +{ + "raktas": "reikšmė", + + "raktai": "privalo visada būti uždaryti dvigubomis kabutėmis", + "skaičiai": 0, + "eilutės": "Labas, pasauli. Visas unikodas yra leidžiamas, kartu su \"vengimu\".", + "turi logiką?": true, + "niekas": null, + + "didelis skaičius": 1.2e+100, + + "objektai": { + "komentaras": "Dauguma tavo struktūrų ateis iš objektų.", + + "masyvas": [0, 1, 2, 3, "Masyvas gali turėti bet ką savyje.", 5], + + "kitas objektas": { + "komentaras": "Šie dalykai gali būti įdedami naudingai." + } + }, + + "kvailumas": [ + { + "kalio šaltiniai": ["bananai"] + }, + [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, "neo"], + [0, 0, 0, 1] + ] + ], + + "alternativus stilius": { + "komentaras": "tik pažiūrėk!" + , "kablelio padėti": "nesvarbi - kol jis prieš kitą raktą, tada teisingas" + , "kitas komentaras": "kaip gražu" + } +} +``` + +Paprastas reikšmių masyvas pats savaime yra galiojantis JSON. + +```json +[1, 2, 3, "tekstas", true] +``` + +Objektai taip pat gali būti masyvų dalis. + +```json +[{"vardas": "Jonas", "amžius": 25}, {"vardas": "Eglė", "amžius": 29}, {"vardas": "Petras", "amžius": 31}] +``` From cbbb4cb49f658e5ce1c3404365796af3c7aa2520 Mon Sep 17 00:00:00 2001 From: Zygimantus Date: Wed, 11 Nov 2015 13:47:21 +0200 Subject: [PATCH 637/685] lang added --- lt-lt/json-lt.html.markdown | 1 + lt-lt/json.html.markdown | 80 ------------------------------------- 2 files changed, 1 insertion(+), 80 deletions(-) delete mode 100644 lt-lt/json.html.markdown diff --git a/lt-lt/json-lt.html.markdown b/lt-lt/json-lt.html.markdown index 70d7c714..bfe00709 100644 --- a/lt-lt/json-lt.html.markdown +++ b/lt-lt/json-lt.html.markdown @@ -1,6 +1,7 @@ --- language: json filename: learnjson.json +lang: lt contributors: - ["Zygimantus", "https://github.com/zygimantus"] --- diff --git a/lt-lt/json.html.markdown b/lt-lt/json.html.markdown deleted file mode 100644 index 70d7c714..00000000 --- a/lt-lt/json.html.markdown +++ /dev/null @@ -1,80 +0,0 @@ ---- -language: json -filename: learnjson.json -contributors: - - ["Zygimantus", "https://github.com/zygimantus"] ---- - -JSON („džeisonas“) yra itin paprastas duomenų mainų formatas, todėl tai bus pati lengviausia „Learn X in Y Minutes“ pamoka. - -JSON savo gryniausioje formoje neturi jokių komentarų, tačiau dauguma analizatorių priimtų C stiliaus komentarus (`//`, `/* */`). Kai kurie analizatoriai taip pat toleruoja gale esantį kablelį, pvz., kablelis po kiekvieno masyvo paskutinio elemento arba po paskutinio objekto lauko, tačiau jų reikėtų vengti dėl geresnio suderinamumo. - -JSON reikšmė privalo būti skaičius, eilutė, masyvas, objektas arba viena reikšmė iš šių: true, false, null. - -Palaikančios naršyklės yra: Firefox 3.5+, Internet Explorer 8.0+, Chrome 1.0+, Opera 10.0+, and Safari 4.0+. - -Failo plėtinys JSON failams yra „.json“, o MIME tipas yra „application/json“. - -Dauguma programavimo kalbų palaiko JSON duomenų serializaciją (kodavimą) ir deserializaciją (dekodavimą) į natyviasias duomenų struktūras. Javascript turi visišką JSON teksto kaip duomenų manipuliavimo palaikymą. - -Daugiau informacijos galima rasti http://www.json.org/ - -JSON yra pastatytas iš dviejų struktūrų: -* Vardų/reikšmių porų rinkinys. Daugomoje kalbų, tai yra realizuojama kaip objektas, įrašas, struktūra, žodynas, hash lentelė, sąrašas su raktais arba asociatyvusis masyvas. -* Rūšiuotas reikšmių sąrašas. Daugumoje kalbų, toks sąrašas yra realizuojama kaip masyvas, vektorius, sąrašas arba seka. - -Objektas su įvairiomis vardo/reikšmės poromis. - -```json -{ - "raktas": "reikšmė", - - "raktai": "privalo visada būti uždaryti dvigubomis kabutėmis", - "skaičiai": 0, - "eilutės": "Labas, pasauli. Visas unikodas yra leidžiamas, kartu su \"vengimu\".", - "turi logiką?": true, - "niekas": null, - - "didelis skaičius": 1.2e+100, - - "objektai": { - "komentaras": "Dauguma tavo struktūrų ateis iš objektų.", - - "masyvas": [0, 1, 2, 3, "Masyvas gali turėti bet ką savyje.", 5], - - "kitas objektas": { - "komentaras": "Šie dalykai gali būti įdedami naudingai." - } - }, - - "kvailumas": [ - { - "kalio šaltiniai": ["bananai"] - }, - [ - [1, 0, 0, 0], - [0, 1, 0, 0], - [0, 0, 1, "neo"], - [0, 0, 0, 1] - ] - ], - - "alternativus stilius": { - "komentaras": "tik pažiūrėk!" - , "kablelio padėti": "nesvarbi - kol jis prieš kitą raktą, tada teisingas" - , "kitas komentaras": "kaip gražu" - } -} -``` - -Paprastas reikšmių masyvas pats savaime yra galiojantis JSON. - -```json -[1, 2, 3, "tekstas", true] -``` - -Objektai taip pat gali būti masyvų dalis. - -```json -[{"vardas": "Jonas", "amžius": 25}, {"vardas": "Eglė", "amžius": 29}, {"vardas": "Petras", "amžius": 31}] -``` From 3598a6f3304fb1fd297af3e6df54d0f849e2a35d Mon Sep 17 00:00:00 2001 From: Zygimantus Date: Wed, 11 Nov 2015 15:21:56 +0200 Subject: [PATCH 638/685] small fix --- lt-lt/json-lt.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lt-lt/json-lt.html.markdown b/lt-lt/json-lt.html.markdown index bfe00709..8c97e598 100644 --- a/lt-lt/json-lt.html.markdown +++ b/lt-lt/json-lt.html.markdown @@ -1,7 +1,7 @@ --- language: json filename: learnjson.json -lang: lt +lang: lt-lt contributors: - ["Zygimantus", "https://github.com/zygimantus"] --- From 62a380dddf47d70e31f308c2120c9fa8a169e9af Mon Sep 17 00:00:00 2001 From: ComSecNinja Date: Wed, 11 Nov 2015 15:39:16 +0200 Subject: [PATCH 639/685] Translate en/Markdown to Finnish --- fi-fi/markdown-fi.html.markdown | 259 ++++++++++++++++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 fi-fi/markdown-fi.html.markdown diff --git a/fi-fi/markdown-fi.html.markdown b/fi-fi/markdown-fi.html.markdown new file mode 100644 index 00000000..14b0f1d9 --- /dev/null +++ b/fi-fi/markdown-fi.html.markdown @@ -0,0 +1,259 @@ +--- +language: markdown +filename: markdown-fi.md +contributors: + - ["Dan Turkel", "http://danturkel.com/"] +translators: + - ["Timo Virkkunen", "https://github.com/ComSecNinja"] +lang: fi-fi +--- + +John Gruber loi Markdownin vuona 2004. Sen tarkoitus on olla helposti luettava ja kirjoitettava syntaksi joka muuntuu helposti HTML:ksi (ja nyt myös moneksi muuksi formaatiksi). + +```markdown + + + + + + +# Tämä on

+## Tämä on

+### Tämä on

+#### Tämä on

+##### Tämä on

+###### Tämä on
+ + +Tämä on h1 +============= + +Tämä on h2 +------------- + + + + +*Tämä teksti on kursivoitua.* +_Kuten on myös tämä teksti._ + +**Tämä teksti on lihavoitua.** +__Kuten on tämäkin teksti.__ + +***Tämä teksti on molempia.*** +**_Kuten tämäkin!_** +*__Kuten tämäkin!__* + + + +~~Tämä teksti on yliviivattua.~~ + + + +Tämä on kappala. Kirjoittelen kappaleeseen, eikö tämä olekin hauskaa? + +Nyt olen kappaleessa 2. +Olen edelleen toisessa kappaleessa! + + +Olen kolmannessa kappaleessa! + + + +Päätän tämän kahteen välilyöntiin (maalaa minut nähdäksesi ne). + +There's a
above me! + + + +> Tämä on lainaus. Voit joko +> manuaalisesti rivittää tekstisi ja laittaa >-merkin jokaisen rivin eteen tai antaa jäsentimen rivittää pitkät tekstirivit. +> Sillä ei ole merkitystä kunhan rivit alkavat >-merkillä. + +> Voit myös käyttää useampaa +>> sisennystasoa +> Kuinka hienoa se on? + + + + +* Kohta +* Kohta +* Kolmas kohta + +tai + ++ Kohta ++ Kohta ++ Kolmas kohta + +tai + +- Kohta +- Kohta +- Kolmas kohta + + + +1. Kohta yksi +2. Kohta kaksi +3. Kohta kolme + + + +1. Kohta yksi +1. Kohta kaksi +1. Kohta kolme + + + + +1. Kohta yksi +2. Kohta kaksi +3. Kohta kolme + * Alakohta + * Alakohta +4. Kohta neljä + + + +Alla olevat ruudut ilman x-merkkiä ovat merkitsemättömiä HTML-valintaruutuja. +- [ ] Ensimmäinen suoritettava tehtävä. +- [ ] Toinen tehtävä joka täytyy tehdä +Tämä alla oleva ruutu on merkitty HTML-valintaruutu. +- [x] Tämä tehtävä on suoritettu + + + + + Tämä on koodia + Kuten tämäkin + + + + my_array.each do |item| + puts item + end + + + +John ei tiennyt edes mitä `go_to()` -funktio teki! + + + +\`\`\`ruby +def foobar + puts "Hello world!" +end +\`\`\` + + + + + + +*** +--- +- - - +**************** + + + + +[Klikkaa tästä!](http://example.com/) + + + +[Klikkaa tästä!](http://example.com/ "Linkki Example.com:iin") + + + +[Musiikkia](/musiikki/). + + + +[Klikkaa tätä linkkiä][link1] saadaksesi lisätietoja! +[Katso myös tämä linkki][foobar] jos haluat. + +[link1]: http://example.com/ "Siistii!" +[foobar]: http://foobar.biz/ "Selkis!" + + + + + +[This][] is a link. + +[this]: http://tämäonlinkki.com/ + + + + + + +![Kuvan alt-attribuutti](http://imgur.com/munkuva.jpg "Vaihtoehtoinen otsikko") + + + +![Tämä on se alt-attribuutti][munkuva] + +[munkuva]: suhteellinen/polku/siitii/kuva.jpg "otsikko tähän tarvittaessa" + + + + + on sama kuin +[http://testwebsite.com/](http://testwebsite.com/) + + + + + + + +haluan kirjoittaa *tämän tekstin jonka ympärillä on asteriskit* mutta en halua +sen kursivoituvan, joten teen näin: \*tämän tekstin ympärillä on asteriskit\*. + + + + +Tietokoneesi kaatui? Kokeile painaa +Ctrl+Alt+Del + + + + +| Kolumni1 | Kolumni2 | Kolumni3 | +| :----------- | :------: | ------------: | +| Vasemmalle | Keskelle | Oikealle | +| blaa | blaa | blaa | + + + +Kolumni 1 | Kolumni 2 | Kolumni 3 +:-- | :-: | --: +Hyi tämä on ruma | saa se | loppumaan + + + +``` + +Lisää tietoa löydät John Gruberin [virallisesta julkaisusta](http://daringfireball.net/projects/markdown/syntax) +ja Adam Pritchardin loistavasta [lunttilapusta](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). From ce0c0a2853dee805350a0423dae070bff0098eb4 Mon Sep 17 00:00:00 2001 From: Hughes Perreault Date: Wed, 11 Nov 2015 22:50:15 -0500 Subject: [PATCH 640/685] [hy/fr] A translation of Hy in french. --- fr-fr/hy-fr.html.markdown | 180 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 fr-fr/hy-fr.html.markdown diff --git a/fr-fr/hy-fr.html.markdown b/fr-fr/hy-fr.html.markdown new file mode 100644 index 00000000..ccd397cf --- /dev/null +++ b/fr-fr/hy-fr.html.markdown @@ -0,0 +1,180 @@ +--- +language: hy +filename: learnhy.hy +contributors: + - ["Abhishek L", "http://twitter.com/abhishekl"] +translators: + - ["Hughes Perreault", "https://github.com/hperreault"] +lang: fr-fr +--- + +Hy est un dialecte du lisp bâti par dessus python. Il fonctionne en +convertissant le code hy en un arbre de syntaxe abstraite de python (ast). +Ceci permet à hy d'appeler du code python et à python d'appeler du code hy. + +Ce tutoriel fonctionne pour hy > 0.9.12 + +```clojure +;; Ceci est une introduction facile à hy, pour un tutoriel rapide aller à +;; http://try-hy.appspot.com +;; +; Les commentaires se font avec des points-virgules, comme les autres LISPS + +;; les s-expression de bases +; Les programmes Lisp sont fait d'expressions symboliques ou sexps qui +; ressemble à +(some-function args) +; maintenant le quintessentiel hello world +(print "hello world") + +;; les types de données simples +; Tous les types de données simples sont exactement similaires à leurs +; homologues de python +42 ; => 42 +3.14 ; => 3.14 +True ; => True +4+10j ; => (4+10j) un nombre complexe + +; Commençons par un peu d'arithmétique très simple +(+ 4 1) ;=> 5 +; l'opérateur est appliqué à tous les arguments, comme les autres lisps +(+ 4 1 2 3) ;=> 10 +(- 2 1) ;=> 1 +(* 4 2) ;=> 8 +(/ 4 1) ;=> 4 +(% 4 2) ;=> 0 l'opérateur modulo +; l'opérateur d'élévation à la puissance est représenté par ** comme en python +(** 3 2) ;=> 9 +; les expressions imbriquées vont se comporter comme on s'y attend +(+ 2 (* 4 2)) ;=> 10 +; aussi, les opérateurs logiques and or not et equal to etc. vont se comporter +; comme on s'y attend +(= 5 4) ;=> False +(not (= 5 4)) ;=> True + +;; variables +; les variables sont déclarées en utilisant setv, les noms de variables +; peuvent utiliser UTF-8 à l'exception de ()[]{}",'`;#| +(setv a 42) +(setv π 3.14159) +(def *foo* 42) +;; d'autres types de données conteneur +; les chaînes, les listes, les tuples et dicts +; ce sont exactement les mêmes que les types de conteneurs de python +"hello world" ;=> "hello world" +; les opérations sur les chaînes fonctionnent comme en python +(+ "hello " "world") ;=> "hello world" +; les listes sont créés en utilisant [], l'indexation commence à 0 +(setv mylist [1 2 3 4]) +; les tuples sont des structures de données immuables +(setv mytuple (, 1 2)) +; les dictionnaires sont des paires clé-valeur +(setv dict1 {"key1" 42 "key2" 21}) +; :nam peut être utilisé pour définir des mots clés dans hy qui peuvent être +; utilisées comme clés +(setv dict2 {:key1 41 :key2 20}) +; utilisez `get' pour obtenir l'élément à l'index / clé +(get mylist 1) ;=> 2 +(get dict1 "key1") ;=> 42 +; Alternativement, si des mots clés ont été utilisés, l'élément peut être +; obtenu directement +(:key1 dict2) ;=> 41 + +;; fonctions et autres constructions de programme +; les fonctions sont définies en utilisant defn, la dernière sexp est renvoyé par défaut +(defn greet [name] + "A simple greeting" ; une docstring optionnelle + (print "hello " name)) + +(greet "bilbo") ;=> "hello bilbo" + +; les fonctions peuvent prendre des arguments optionnels ainsi que des +; arguments sous forme de mots clés +(defn foolists [arg1 &optional [arg2 2]] + [arg1 arg2]) + +(foolists 3) ;=> [3 2] +(foolists 10 3) ;=> [10 3] + +; les fonctions anonymes sont créés en utilisant `fn' ou `lambda' +; qui sont semblable à `defn ' +(map (fn [x] (* x x)) [1 2 3 4]) ;=> [1 4 9 16] + +;; Opérations sur les séquences +; hy a des utilitaires pré-construit pour les opérations sur les séquences etc. +; récupérez le premier élément en utilisant `first' ou `car' +(setv mylist [1 2 3 4]) +(setv mydict {"a" 1 "b" 2}) +(first mylist) ;=> 1 + +; découpez les listes en utilisant slice +(slice mylist 1 3) ;=> [2 3] + +; obtenez les éléments d'une liste ou dict en utilisant `get' +(get mylist 1) ;=> 2 +(get mydict "b") ;=> 2 +; l'indexation des listes commence à 0 comme en python +; assoc peut définir les éléments à clés/index +(assoc mylist 2 10) ; makes mylist [1 2 10 4] +(assoc mydict "c" 3) ; makes mydict {"a" 1 "b" 2 "c" 3} +; il ya tout un tas d'autres fonctions de base qui rend le travail avec +; les séquences amusant + +;; les importations fonctionnent comme en pyhtonn +(import datetime) +(import [functools [partial reduce]]) ; importe fun1 et fun2 de module1 +(import [matplotlib.pyplot :as plt]) ; faire une importation foo comme bar +; toutes les méthodes pré-construites de python sont accessibles à partir de hy +; a.foo(arg) est appelé (.foo un arg) +(.split (.strip "hello world ")) ;=> ["hello" "world"] + +;; Conditionelles +; (if condition (body-if-true) (body-if-false) +(if (= passcode "moria") + (print "welcome") + (print "Speak friend, and Enter!")) + +; imbriquez plusieurs if else if avec le mot clé cond +(cond + [(= someval 42) + (print "Life, universe and everything else!")] + [(> someval 42) + (print "val too large")] + [(< someval 42) + (print "val too small")]) + +; groupez les expressions avec do, ceux-ci seront executé séquentiellemnt +; les expressions comme defn ont un do implicite +(do + (setv someval 10) + (print "someval is set to " someval)) ;=> 10 + +; créer une liaison lexicale avec `let', toutes les variables déclarées +; comme cela ont une portée locale +(let [[nemesis {"superman" "lex luther" + "sherlock" "moriarty" + "seinfeld" "newman"}]] + (for [(, h v) (.items nemesis)] + (print (.format "{0}'s nemesis was {1}" h v)))) + +;; classes +; les classes sont définies comme ceci +(defclass Wizard [object] + [[--init-- (fn [self spell] + (setv self.spell spell) ; init the spell attr + None)] + [get-spell (fn [self] + self.spell)]]) + +;; allez voir hylang.org +``` + +### Lectures complémentaires + +Ce tutoriel est juste une simple introduction à hy/lisp/python. + +La documentation de HY: [http://hy.readthedocs.org](http://hy.readthedocs.org) + +Le repo GitHub de HY: [http://github.com/hylang/hy](http://github.com/hylang/hy) + +Sur freenode irc #hy, twitter hashtag #hylang From 5aceaa8c3469998b43642fc7e5f5251466376eda Mon Sep 17 00:00:00 2001 From: Hughes Perreault Date: Thu, 12 Nov 2015 12:11:40 -0500 Subject: [PATCH 641/685] Add "-fr" before filename extansion, Replace "facile" with "simple" --- fr-fr/hy-fr.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fr-fr/hy-fr.html.markdown b/fr-fr/hy-fr.html.markdown index ccd397cf..07007061 100644 --- a/fr-fr/hy-fr.html.markdown +++ b/fr-fr/hy-fr.html.markdown @@ -1,6 +1,6 @@ --- language: hy -filename: learnhy.hy +filename: learnhy-fr.hy contributors: - ["Abhishek L", "http://twitter.com/abhishekl"] translators: @@ -15,7 +15,7 @@ Ceci permet à hy d'appeler du code python et à python d'appeler du code hy. Ce tutoriel fonctionne pour hy > 0.9.12 ```clojure -;; Ceci est une introduction facile à hy, pour un tutoriel rapide aller à +;; Ceci est une introduction simple à hy, pour un tutoriel rapide aller à ;; http://try-hy.appspot.com ;; ; Les commentaires se font avec des points-virgules, comme les autres LISPS From cf53a882c69a40dbe1eb56506ab266042c2bb668 Mon Sep 17 00:00:00 2001 From: Marcin Klocek Date: Thu, 12 Nov 2015 20:17:55 +0100 Subject: [PATCH 642/685] Create Polish translations for Ruby --- pl-pl/ruby-pl.html.markdown | 593 ++++++++++++++++++++++++++++++++++++ 1 file changed, 593 insertions(+) create mode 100644 pl-pl/ruby-pl.html.markdown diff --git a/pl-pl/ruby-pl.html.markdown b/pl-pl/ruby-pl.html.markdown new file mode 100644 index 00000000..36f9a9bf --- /dev/null +++ b/pl-pl/ruby-pl.html.markdown @@ -0,0 +1,593 @@ +--- +language: ruby +filename: learnruby.rb +contributors: + - ["David Underwood", "http://theflyingdeveloper.com"] + - ["Joel Walden", "http://joelwalden.net"] + - ["Luke Holder", "http://twitter.com/lukeholder"] + - ["Tristan Hume", "http://thume.ca/"] + - ["Nick LaMuro", "https://github.com/NickLaMuro"] + - ["Marcos Brizeno", "http://www.about.me/marcosbrizeno"] + - ["Ariel Krakowski", "http://www.learneroo.com"] + - ["Dzianis Dashkevich", "https://github.com/dskecse"] + - ["Levi Bostian", "https://github.com/levibostian"] + - ["Rahil Momin", "https://github.com/iamrahil"] + - ["Gabriel Halley", "https://github.com/ghalley"] + - ["Persa Zula", "http://persazula.com"] +translators: + - ["Marcin Klocek", "https://github.com/mklocek"] +lang: pl-pl +--- + +```ruby +# To jest komentarz + +=begin +To jest wielolinijkowy komentarz +Nikt ich nie używa +Ty też nie powinieneś +=end + +# Przede wszystkim: Wszystko jest obiektem. + +# Liczby są obiektami + +3.class #=> Fixnum + +3.to_s #=> "3" + + +# Trochę podstawowej arytmetyki +1 + 1 #=> 2 +8 - 1 #=> 7 +10 * 2 #=> 20 +35 / 5 #=> 7 +2**5 #=> 32 +5 % 3 #=> 2 +5 ^ 6 #=> 3 + +# Arytmetyka jest zastąpeniem składni +# metod wywoływanych na obiektach +1.+(3) #=> 4 +10.* 5 #=> 50 + +# Wartości specjalne są obiektami +nil # To na prawdę jest niczym +true # prawda +false # fałsz + +nil.class #=> NilClass +true.class #=> TrueClass +false.class #=> FalseClass + +# Równość +1 == 1 #=> true +2 == 1 #=> false + +# Nierówność +1 != 1 #=> false +2 != 1 #=> true + +# jedyną 'fałszywą' wartością poza false, jest nil + +!nil #=> true +!false #=> true +!0 #=> false + +# Więcej porównań +1 < 10 #=> true +1 > 10 #=> false +2 <= 2 #=> true +2 >= 2 #=> true + +# Operatory logiczne +true && false #=> false +true || false #=> true +!true #=> false + +# Istnieją alternatywne wersje operatorów logicznych ze znacznie mniejszym +# pierwszeństwem. Używane są by kontrolować wyrażenia w łańcuchach wyrażeń +# aż jedno z nich wróci true lub false. + +# `zrob_cos_innego` wywołaj tylko wtedy gdy `zrob_cos` zakończy się sukcesem. +zrob_cos_innego() and zrob_cos() +# `log_error` wywołaj tylko wtedy gdy `zrob_cos` nie zakończy się sukcesem. +zrob_cos() or log_error() + + +# Stringi są obiektami + +'Jestem stringiem.'.class #=> String +"Ja również jestem stringiem.".class #=> String + +wypelnienie = 'użyć interpolacji stringa' +"Potrafię #{wypelnienie} używając podwójnych cudzysłowów." +#=> "Potrafię użyć interpolacji stringa używając podwójnych cudzysłowów." + +# Staraj się zapisywać stringi za pomocą apostrof, zamiast cudzysłowów tam, gdzie to możliwe +# Cudzysłowy wykonują dodatkowe wewnętrzne operacje + + +# Łączenie stringów, ale nie liczb +'hello ' + 'world' #=> "hello world" +'hello ' + 3 #=> TypeError: can't convert Fixnum into String +'hello ' + 3.to_s #=> "hello 3" + +# Łączenie stringów i operatorów +'hello ' * 3 #=> "hello hello hello " + +# Dodawanie do stringa +'hello' << ' world' #=> "hello world" + +# wydrukowanie wartości wraz z nową linią na końcu +puts "Drukuję!" +#=> Drukuję! +#=> nil + +# wydrukowanie wartości bez nowej linii na końcu +print "Drukuję!" +#=> Drukuję! => nill + +# Zmienne +x = 25 #=> 25 +x #=> 25 + +# Zauważ, że przypisanie zwraca przypisywaną wartość +# To znaczy, że możesz wykonać wielokrotne przypisanie: + +x = y = 10 #=> 10 +x #=> 10 +y #=> 10 + +# Zwyczajowo, używaj notacji snake_case dla nazw zmiennych +snake_case = true + +# Używaj opisowych nazw zmiennych +sciezka_do_projektu = '/dobra/nazwa/' +sciezka = '/zla/nazwa/' + +# Symbole (są obiektami) +# Symbole są niezmiennymi, wielokrotnie używanymi stałymi reprezentowanymi wewnętrznie jako +# liczby całkowite. Często używane są zamiast stringów w celu wydajniejszego przekazywania danych + +:oczekujacy.class #=> Symbol + +status = :oczekujacy + +status == :oczekujacy #=> true + +status == 'oczekujacy' #=> false + +status == :zatwierdzony #=> false + +# Tablice + +# To jest tablica +array = [1, 2, 3, 4, 5] #=> [1, 2, 3, 4, 5] + +# Tablice mogą zwierać różne typy danych + +[1, 'hello', false] #=> [1, "hello", false] + +# Tablice mogę być indeksowane +# Od początku +tablica[0] #=> 1 +tablica.first #=> 1 +tablica[12] #=> nil + +# Podobnie jak przy arytmetyce, dostę poprzez [zmienna] +# jest tylko czytelniejszą składnią +# dla wywoływania metody [] na obiekcie +tablica.[] 0 #=> 1 +tablica.[] 12 #=> nil + +# Od końca +tablica[-1] #=> 5 +tablica.last #=> 5 + +# Z początkowym indeksem i długością +tablica[2, 3] #=> [3, 4, 5] + +# Odwrotność tablicy +a=[1,2,3] +a.reverse! #=> [3,2,1] + +# Lub zakres +array[1..3] #=> [2, 3, 4] + +# Dodawanie do tablicy w taki sposób +tablica << 6 #=> [1, 2, 3, 4, 5, 6] +# Lub taki +tablica.push(6) #=> [1, 2, 3, 4, 5, 6] + +# Sprawdzanie, czy tablica zawiera element +tablica.include?(1) #=> true + +# Hasze są Ruby'owymi podstawowymi słownikami z parami klucz/wartość. +# Hasze są zapisywane za pomocą nawiasów klamrowych +hasz = { 'kolor' => 'zielony', 'numer' => 5 } + +hasz.keys #=> ['kolor', 'numer'] + +# Można szybko sprawdzić zawartość hasza za pomocą kluczy: +hasz['kolor'] #=> 'zielony' +hasz['numer'] #=> 5 + +# Sprawdzenie wartośći dla nieistniejącego klucza zwraca nil: +hasz['nic tutaj nie ma'] #=> nil + +# Od wersji 1.9, Ruby posiada specjalną składnię, gdy używamy symboli jako kluczy: + +nowy_hasz = { stan: 3, akcja: true } + +nowy_hasz.keys #=> [:stan, :akcja] + +# Sprawdzenie istnienia kluczy i wartości w haszu +new_hash.has_key?(:defcon) #=> true +new_hash.has_value?(3) #=> true + +# Wskazówka: Zarówno tablice, jak i hasze, są policzalne +# Współdzielą wiele metod takich jak each, map, count, i inne + +# Instrukcje warunkowe + +if true + 'wyrażenie if' +elsif false + 'wyrażenie if, opcjonalne' +else + 'wyrażenie else, również opcjonalne' +end + +for licznik in 1..5 + puts "powtórzenie #{licznik}" +end +#=> powtórzenie 1 +#=> powtórzenie 2 +#=> powtórzenie 3 +#=> powtórzenie 4 +#=> powtórzenie 5 + +# JEDNAKŻE, Nikt nie używa pętli for. +# Zamiast tego, powinno się używać metody "each" i podawać jej blok. +# Blok jest kawałkiem kodu, który możesz podać metodzie podobnej do "each". +# Jest analogiczny do wyrażeń lambda, funkcji anonimowych lub zamknięć w innych +# językach programowania. +# +# Metoda "each" danego zakresu, wykonuje blok dla każdego elementu w zakresie. +# Do bloku zostaje przekazany licznik jako parametr. +# Wykonanie metody "each" z przekazaniem bloku wygląda następująco: + +(1..5).each do |licznik| + puts "powtórzenie #{licznik}" +end +#=> powtórzenie 1 +#=> powtórzenie 2 +#=> powtórzenie 3 +#=> powtórzenie 4 +#=> powtórzenie 5 + +# Możesz również otoczyć blok nawiasami klamrowymi: +(1..5).each { |licznik| puts "powtórzenie #{licznik}" } + +# Zawartość struktur danych również może być powtarzana używając each. +tablica.each do |element| + puts "#{element} jest częścią tablicy" +end +hasz.each do |klucz, wartosc| + puts "#{klucz} jest #{wartosc}" +end + +# Jeśli nadal potrzebujesz indeksum, możesz użyć "each_with_index" i zdefiniować +# zmienną odpowiadającą indeksowi +tablica.each_with_index do |element, indeks| + puts "#{element} jest numerem #{indeks} w tablicy" +end + +licznik = 1 +while licznik <= 5 do + puts "powtórzenie #{licznik}" + licznik += 1 +end +#=> powtórzenie 1 +#=> powtórzenie 2 +#=> powtórzenie 3 +#=> powtórzenie 4 +#=> powtórzenie 5 + +# W Ruby istnieje dużo pomocnych funkcji wykonujących pętle, +# na przykład "map", "reduce", "inject" i wiele innych. Map, +# w każdym wywołaniu, pobiera tablicę, na której wykonuję pętlę, +# wykonuje kod zapisany za pomocą bloku i zwraca całkowicie nową tablicę. +tablica = [1,2,3,4,5] +podwojone = tablica.map do |element| + element * 2 +end +puts podwojona +#=> [2,4,6,8,10] +puts tablica +#=> [1,2,3,4,5] + +ocena = 2 + +case ocena +when 1 + puts 'Dobra robota, masz wolne' +when 2 + puts 'Następnym razem będziesz miał więcej szczęścia' +when 3 + puts 'Możesz to zrobić lepiej' +when 4 + puts 'Przebrnąłeś' +when 5 + puts 'Oblałeś!' +else + puts 'Inny system oceniania?' +end +#=> "Następnym razem będziesz miał więcej szczęścia" + +# case może również użwać zakresów +ocena = 82 +case ocena +when 90..100 + puts 'Hurra!' +when 80...90 + puts 'Dobra robota' +else + puts 'Oblałeś!' +end +#=> "Dobra robota" + +# obsługa błędów: +begin + # kod, który może wywołać wyjątek + raise NoMemoryError, 'Zabrakło pamięci.' +rescue NoMemoryError => zmienna_wyjatku + puts 'Został wywołany NoMemoryError', zmienna_wyjatku +rescue RuntimeError => inna_zmienna_wyjatku + puts 'Teraz został wywołany RuntimeError' +else + puts 'To zostanie uruchomione, jeśli nie wystąpi żaden wyjątek' +ensure + puts 'Ten kod wykona się zawsze' +end + +# Funkcje + +def podwojenie(x) + x * 2 +end + +# Funkcje (i wszystkie bloki) zawsze zwracają wartość ostatniego wyrażenia +podwojenie(2) #=> 4 + +# Okrągłe nawiady są opcjonalne, gdy wynik jest jednoznaczny +podwojenie 3 #=> 6 + +podwojenie podwojenie 3 #=> 12 + +def suma(x, y) + x + y +end + +# Argumenty metod są oddzielone przecinkami +suma 3, 4 #=> 7 + +suma suma(3, 4), 5 #=> 12 + +# yield +# Wszystkie metody mają ukryty, opcjonalny parametr bloku, +# który może być wykonany używając słowa kluczowego 'yield' + +def otoczenie + puts '{' + yield + puts '}' +end + +otoczenie { puts 'hello world' } + +# { +# hello world +# } + + +# Możesz przekazać blok do funkcji +# "&" oznacza referencję to przekazanego bloku +def goscie(&blok) + blok.call 'jakis_argument' +end + +# Możesz przekazać listę argumentów, które będę przekonwertowane na tablicę +# Do tego służy operator ("*") +def goscie(*tablica) + tablica.each { |gosc| puts gosc } +end + +# Definiowanie klas używając słowa kluczowego class +class Czlowiek + + # Zmienna klasowa. Jest współdzielona przez wszystkie instancje tej klasy. + @@gatunek = 'H. sapiens' + + # Podstawowe inicjalizowanie + def initialize(imie, wiek = 0) + # Przypisanie argumentu do zmiennej danej instancji o nazwie "imie" + @imie = imie + # Jeśli nie podano wieku, zostanie użyta domyślna wartość z listy argumentów. + @wiek = wiek + end + + # Podstawowa metoda przypisująca wartość + def imie=(imie) + @imie = imie + end + + # Podstawowa metoda pobierająca wartość + def imie + @imie + end + + # Powyższa funkcjonalność może być zastąpiona używając metody attr_accessor w taki sposób + attr_accessor :imie + + # Metody przypisujące/pobierające mogą być stworzone indywidualnie + attr_reader :imie + attr_writer :imie + + # Metody klasowe używają self aby odróżnić się od metody instancji. + # To może być wywołane na klasie, nie na instancji. + def self.powiedz(wiadomosc) + puts wiadomosc + end + + def gatunek + @@gatunek + end +end + + +# Tworzenie instancji klasy +jim = Czlowiek.new('Jim Halpert') + +dwight = Czlowiek.new('Dwight K. Schrute') + +# Wywołajmy parę metod +jim.gatunek #=> "H. sapiens" +jim.imie #=> "Jim Halpert" +jim.imie = "Jim Halpert II" #=> "Jim Halpert II" +jim.imie #=> "Jim Halpert II" +dwight.gatunek #=> "H. sapiens" +dwight.imie #=> "Dwight K. Schrute" + +# Wywołanie metody klasowej +Czlowiek.powiedz('Cześć') #=> "Cześć" + +# Zasięg zmiennej jest definiowany poprzez jej nazwę. +# Zmienne, które zaczynają się na $ mają zasięg globalny +$zmienna = "Jestem zmienną globalną" +defined? $zmienna #=> "global-variable" + +# Zmienne zczynające się na @ mają zasięg danej instancji +@zmienna = "Jestem zmienną instancji" +defined? @zmienna #=> "instance-variable" + +# Zmienne, które zaczynają się na @@ mają zasięg danej klasy +@@zmienna = "Jestem zmienną klasową" +defined? @@zmienna #=> "class variable" + +# Zmienne, które zaczynają się na dużą literę, są stałymi +Zmienna = "Jestem stałą" +defined? Zmienna #=> "constant" + +# Klasa jest również obiektem w ruby. Może więc mieć zmienne instancji. +# Zmienna klasowa może być współdzielona między klasą i jej potomstwem. + +# podstawowa klasa +class Czlowiek + @@cokolwiek = 0 + + def self.cokolwiek + @@cokolwiek + end + + def self.cokolwiek=(wartosc) + @@cokolwiek = wartosc + end +end + +# klasa pochodna +class Pracownik < Czlowiek +end + +Czlowiek.cokolwiek # 0 +Pracownik.cokolwiek # 0 + +Czlowiek.cokolwiek = 2 # 2 +Pracownik.cokolwiek # 2 + +# Zmienna instancji danej klasy nie jest współdzielona przez jej potomstwo. + +class Czlowiek + @cos = 0 + + def self.cos + @cos + end + + def self.cos=(wartosc) + @cos = wartosc + end +end + +class Doktor < Czlowiek +end + +Czlowiek.cos # 0 +Doktor.cos # nil + +module PrzykladowyModul + def cokolwiek + 'cokolwiek' + end +end + +# Włączanie modułów łączy ich metody z metodami instancji klasy +# Rozszerzanie modułów łączy ich metody z metodami klasy + +class Osoba + include PrzykladowyModul +end + +class Ksiazka + extend PrzykladowyModul +end + +Osoba.cokolwiek # => NoMethodError: undefined method `cokolwiek' for Osoba:Class +Osoba.new.cokolwiek # => 'cokolwiek' +Ksiazka.cokolwiek # => 'cokolwiek' +Ksiazka.new.cokolwiek # => NoMethodError: undefined method `cokolwiek' + +# Gdy włączamy lub rozszerzamy muduły, wykonywane są tzw. wywołania zwrotne + +module PrzykladowyModul + def self.included(baza) + baza.extend(MotodyKlasowe) + baza.send(:include, MetodyInstancji) + end + + module MotodyKlasowe + def cos + 'cos' + end + end + + module MetodyInstancji + def xyz + 'xyz' + end + end +end + +class Cokolwiek + include PrzykladowyModul +end + +Cokolwiek.cos # => 'cos' +Cokolwiek.xyz # => NoMethodError: undefined method `xyz' +Cokolwiek.new.cos # => NoMethodError: undefined method `cos' +Cokolwiek.new.xyz # => 'qux' +``` + +## Dodatkowe źródła +### Polskie + +- [Dokumentacja](https://www.ruby-lang.org/pl/documentation/quickstart/) + +### Angielskie + +- [Learn Ruby by Example with Challenges](http://www.learneroo.com/modules/61/nodes/338) - A variant of this reference with in-browser challenges. +- [Official Documentation](http://www.ruby-doc.org/core-2.1.1/) +- [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. From 7837603c56de212f68c9806b31f19d139ba6998d Mon Sep 17 00:00:00 2001 From: Marcin Klocek Date: Thu, 12 Nov 2015 20:26:01 +0100 Subject: [PATCH 643/685] Adjust Polish translations for Ruby --- pl-pl/ruby-pl.html.markdown | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pl-pl/ruby-pl.html.markdown b/pl-pl/ruby-pl.html.markdown index 36f9a9bf..73b1a7d8 100644 --- a/pl-pl/ruby-pl.html.markdown +++ b/pl-pl/ruby-pl.html.markdown @@ -109,15 +109,15 @@ wypelnienie = 'użyć interpolacji stringa' # Łączenie stringów, ale nie liczb -'hello ' + 'world' #=> "hello world" -'hello ' + 3 #=> TypeError: can't convert Fixnum into String -'hello ' + 3.to_s #=> "hello 3" +'hej ' + 'świecie' #=> "hej świecie" +'hej ' + 3 #=> TypeError: can't convert Fixnum into String +'hej ' + 3.to_s #=> "hej 3" # Łączenie stringów i operatorów -'hello ' * 3 #=> "hello hello hello " +'hej ' * 3 #=> "hej hej hej " # Dodawanie do stringa -'hello' << ' world' #=> "hello world" +'hej' << ' świecie' #=> "hej świecie" # wydrukowanie wartości wraz z nową linią na końcu puts "Drukuję!" @@ -139,8 +139,8 @@ x = y = 10 #=> 10 x #=> 10 y #=> 10 -# Zwyczajowo, używaj notacji snake_case dla nazw zmiennych -snake_case = true +# Zwyczajowo, używaj notacji nazwa_zmiennej dla nazw zmiennych +nazwa_zmiennej = true # Używaj opisowych nazw zmiennych sciezka_do_projektu = '/dobra/nazwa/' @@ -167,7 +167,7 @@ array = [1, 2, 3, 4, 5] #=> [1, 2, 3, 4, 5] # Tablice mogą zwierać różne typy danych -[1, 'hello', false] #=> [1, "hello", false] +[1, 'hej', false] #=> [1, "hej", false] # Tablice mogę być indeksowane # Od początku @@ -175,7 +175,7 @@ tablica[0] #=> 1 tablica.first #=> 1 tablica[12] #=> nil -# Podobnie jak przy arytmetyce, dostę poprzez [zmienna] +# Podobnie jak przy arytmetyce, dostęp poprzez [zmienna] # jest tylko czytelniejszą składnią # dla wywoływania metody [] na obiekcie tablica.[] 0 #=> 1 @@ -385,10 +385,10 @@ def otoczenie puts '}' end -otoczenie { puts 'hello world' } +otoczenie { puts 'hej świecie' } # { -# hello world +# hej świecie # } From 3b59da1f3d055b5fd9f0804de2142df90c7b762c Mon Sep 17 00:00:00 2001 From: Hughes Perreault Date: Thu, 12 Nov 2015 15:40:53 -0500 Subject: [PATCH 644/685] =?UTF-8?q?UTF-8=20->=20l'UTF-8,=20donn=C3=A9es=20?= =?UTF-8?q?conteneur=20->=20conteneurs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fr-fr/hy-fr.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fr-fr/hy-fr.html.markdown b/fr-fr/hy-fr.html.markdown index 07007061..841179f5 100644 --- a/fr-fr/hy-fr.html.markdown +++ b/fr-fr/hy-fr.html.markdown @@ -54,11 +54,11 @@ True ; => True ;; variables ; les variables sont déclarées en utilisant setv, les noms de variables -; peuvent utiliser UTF-8 à l'exception de ()[]{}",'`;#| +; peuvent utiliser l'UTF-8 à l'exception de ()[]{}",'`;#| (setv a 42) (setv π 3.14159) (def *foo* 42) -;; d'autres types de données conteneur +;; d'autres types de conteneurs ; les chaînes, les listes, les tuples et dicts ; ce sont exactement les mêmes que les types de conteneurs de python "hello world" ;=> "hello world" From 312941c5e018bee87be524697b471061cf70b285 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Fri, 13 Nov 2015 14:52:21 +0000 Subject: [PATCH 645/685] Correct "Casting" mention in swift markdown 'T()' is initialisation/creation, 'x as T' is casting --- swift.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift.html.markdown b/swift.html.markdown index df9c5092..e3934ab1 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -46,7 +46,7 @@ let `class` = "keyword" // backticks allow keywords to be used as variable names let explicitDouble: Double = 70 let intValue = 0007 // 7 let largeIntValue = 77_000 // 77000 -let label = "some text " + String(myVariable) // Casting +let label = "some text " + String(myVariable) // String construction let piText = "Pi = \(π), Pi 2 = \(π * 2)" // String interpolation // Build Specific values From 2c33662024b3b2c9975c184d9dfb5f8f8ddd02fc Mon Sep 17 00:00:00 2001 From: Hughes Perreault Date: Fri, 13 Nov 2015 11:15:58 -0500 Subject: [PATCH 646/685] =?UTF-8?q?nam=20->=20nom,=20pr=C3=A9-construit=20?= =?UTF-8?q?->=20natif,=20un=20->=20a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fr-fr/hy-fr.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fr-fr/hy-fr.html.markdown b/fr-fr/hy-fr.html.markdown index 841179f5..5220fb65 100644 --- a/fr-fr/hy-fr.html.markdown +++ b/fr-fr/hy-fr.html.markdown @@ -70,7 +70,7 @@ True ; => True (setv mytuple (, 1 2)) ; les dictionnaires sont des paires clé-valeur (setv dict1 {"key1" 42 "key2" 21}) -; :nam peut être utilisé pour définir des mots clés dans hy qui peuvent être +; :nom peut être utilisé pour définir des mots clés dans hy qui peuvent être ; utilisées comme clés (setv dict2 {:key1 41 :key2 20}) ; utilisez `get' pour obtenir l'élément à l'index / clé @@ -101,7 +101,7 @@ True ; => True (map (fn [x] (* x x)) [1 2 3 4]) ;=> [1 4 9 16] ;; Opérations sur les séquences -; hy a des utilitaires pré-construit pour les opérations sur les séquences etc. +; hy a des utilitaires natifs pour les opérations sur les séquences etc. ; récupérez le premier élément en utilisant `first' ou `car' (setv mylist [1 2 3 4]) (setv mydict {"a" 1 "b" 2}) @@ -124,8 +124,8 @@ True ; => True (import datetime) (import [functools [partial reduce]]) ; importe fun1 et fun2 de module1 (import [matplotlib.pyplot :as plt]) ; faire une importation foo comme bar -; toutes les méthodes pré-construites de python sont accessibles à partir de hy -; a.foo(arg) est appelé (.foo un arg) +; toutes les méthodes natives de python sont accessibles à partir de hy +; a.foo(arg) est appelé (.foo a arg) (.split (.strip "hello world ")) ;=> ["hello" "world"] ;; Conditionelles From e3de8870ca586cd0f084f00cc96ea540cf022638 Mon Sep 17 00:00:00 2001 From: Hughes Perreault Date: Fri, 13 Nov 2015 11:48:48 -0500 Subject: [PATCH 647/685] ressemble -> ressemblent --- fr-fr/hy-fr.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fr-fr/hy-fr.html.markdown b/fr-fr/hy-fr.html.markdown index 5220fb65..bd7c6839 100644 --- a/fr-fr/hy-fr.html.markdown +++ b/fr-fr/hy-fr.html.markdown @@ -22,7 +22,7 @@ Ce tutoriel fonctionne pour hy > 0.9.12 ;; les s-expression de bases ; Les programmes Lisp sont fait d'expressions symboliques ou sexps qui -; ressemble à +; ressemblent à (some-function args) ; maintenant le quintessentiel hello world (print "hello world") From 452b0bb21912b56b862409c50f15cb2acd4ea120 Mon Sep 17 00:00:00 2001 From: Hellseher Date: Sat, 14 Nov 2015 00:24:46 +0000 Subject: [PATCH 648/685] [A] extra links Links : : CLiki : Awesome Common Lisp : COMMON LISP A Gentle Introduction to Symbolic Computation : Common-Lisp.net --- common-lisp.html.markdown | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common-lisp.html.markdown b/common-lisp.html.markdown index 63183c1e..13f0023e 100644 --- a/common-lisp.html.markdown +++ b/common-lisp.html.markdown @@ -615,8 +615,15 @@ nil ; for false - and the empty list ## Further Reading [Keep moving on to the Practical Common Lisp book.](http://www.gigamonkeys.com/book/) +[A Gentle Introduction to...](https://www.cs.cmu.edu/~dst/LispBook/book.pdf) +## Extra Info + +[CLiki](http://www.cliki.net/) +[common-lisp.net](https://common-lisp.net/) +[Awesome Common Lisp](https://github.com/CodyReichert/awesome-cl) + ## Credits. Lots of thanks to the Scheme people for rolling up a great starting From b20abcb791cf3d2b0e7274fb300c6d0e7b791da1 Mon Sep 17 00:00:00 2001 From: Hellseher Date: Sat, 14 Nov 2015 00:33:00 +0000 Subject: [PATCH 649/685] [E] styling links --- common-lisp.html.markdown | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common-lisp.html.markdown b/common-lisp.html.markdown index 13f0023e..2b1f5de4 100644 --- a/common-lisp.html.markdown +++ b/common-lisp.html.markdown @@ -614,15 +614,15 @@ nil ; for false - and the empty list ## Further Reading -[Keep moving on to the Practical Common Lisp book.](http://www.gigamonkeys.com/book/) -[A Gentle Introduction to...](https://www.cs.cmu.edu/~dst/LispBook/book.pdf) +* [Keep moving on to the Practical Common Lisp book.](http://www.gigamonkeys.com/book/) +* [A Gentle Introduction to...](https://www.cs.cmu.edu/~dst/LispBook/book.pdf) ## Extra Info -[CLiki](http://www.cliki.net/) -[common-lisp.net](https://common-lisp.net/) -[Awesome Common Lisp](https://github.com/CodyReichert/awesome-cl) +* [CLiki](http://www.cliki.net/) +* [common-lisp.net](https://common-lisp.net/) +* [Awesome Common Lisp](https://github.com/CodyReichert/awesome-cl) ## Credits. From 68c659b366b9fde2870c8938b5666550cc59054b Mon Sep 17 00:00:00 2001 From: Hughes Perreault Date: Sat, 14 Nov 2015 13:57:01 -0500 Subject: [PATCH 650/685] "lang: hu-hu" line was missing trying to fix issue #2013 --- hu-hu/coffeescript-hu.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hu-hu/coffeescript-hu.html.markdown b/hu-hu/coffeescript-hu.html.markdown index 267db4d0..b5ae2107 100644 --- a/hu-hu/coffeescript-hu.html.markdown +++ b/hu-hu/coffeescript-hu.html.markdown @@ -5,6 +5,7 @@ contributors: - ["Xavier Yao", "http://github.com/xavieryao"] translators: - ["Tamás Diószegi", "http://github.com/ditam"] +lang: hu-hu filename: coffeescript-hu.coffee --- @@ -103,4 +104,4 @@ eat food for food in foods when food isnt 'chocolate' ## További források - [Smooth CoffeeScript](http://autotelicum.github.io/Smooth-CoffeeScript/) -- [CoffeeScript Ristretto](https://leanpub.com/coffeescript-ristretto/read) \ No newline at end of file +- [CoffeeScript Ristretto](https://leanpub.com/coffeescript-ristretto/read) From cde6ea6ca256a1249d222e692fde66ea76f19409 Mon Sep 17 00:00:00 2001 From: Terka Slan Date: Sat, 14 Nov 2015 20:24:51 +0100 Subject: [PATCH 651/685] Translated Git to Slovak[sk-sk] --- sk-sk/git.html.markdown | 525 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 525 insertions(+) create mode 100644 sk-sk/git.html.markdown diff --git a/sk-sk/git.html.markdown b/sk-sk/git.html.markdown new file mode 100644 index 00000000..b5aace7a --- /dev/null +++ b/sk-sk/git.html.markdown @@ -0,0 +1,525 @@ +--- +category: tool +tool: git + +contributors: + - ["Jake Prather", "http://github.com/JakeHP"] + - ["Leo Rudberg" , "http://github.com/LOZORD"] + - ["Betsy Lorton" , "http://github.com/schbetsy"] + - ["Bruno Volcov", "http://github.com/volcov"] + - ["Andrew Taylor", "http://github.com/andrewjt71"] +translators: + - ["Terka Slanináková", "http://github.com/TerkaSlan"] +filename: LearnGit.txt +lang: sk-sk +--- + +Git je distribuovaný systém riadenia revízií a správy zdrojového kódu. + +Funguje robením "snímkov" tvojho projektu, s ktorými ďalej pracuje na revíziach a správe zdrojových kódov. + +## Koncept Revízií + +### Čo je riadenie revízií? + +Riadenie revízií je systém, ktorý postupom času zaznamenáva zmeny súboru (súborov). + +### Centralizované Revízie VS Distribuované revízie + +* Centralizované riadenie revízií sa zameriava na synchronizáciu, sledovanie a zálohovanie súborov. +* Distribuované riadenie revízií sa zameriava na zdieľanie zmien. Kaťdá zmena má jedinečný identifikátor (id). +* Distribuované systémy nemajú definovanú štruktúru. S gitom môžeš mať centralizovaný systém v subversion (SVN) štýle. + +[Ďalšie informácie](http://git-scm.com/book/en/Getting-Started-About-Version-Control) + +### Prečo Používať Git? + +* Môžeš pracovať offline. +* Spolupráca s ostatnými je jednoduchá! +* Vetvenie je jednoduché! +* Zlučovanie je jednoduché! +* Git je rýchly. +* Git je flexibilný. + +## Architektúra Gitu + + +### Repozitár + +Skupina súborov, adresárov, minulých záznamov, commitov (konkrétnych revízií) a odkazy na aktuálu vetvu (HEADs). Predstav si ho ako údajovú štruktúru, kde ti každý "prvok" zdrojového kódu poskytne (okrem iného) prístup k minulým revíziam. + +Git repozitár sa skladá z .git adresára a pracovného stromu + +### .git Adresár (časť repozitára) + +.git adresár obsahuje všetky konfigurácie, logy, vetvy, odkaz na aktuálnu vetvu (HEAD) a ostatné. +[Detailný zoznam.](http://gitready.com/advanced/2009/03/23/whats-inside-your-git-directory.html) + +### Pracovný Strom (Working Tree - časť repozitára) + +Toto sú adresáre a súbory v tvojom repozitári. Tiež sa tomu hovorí pracovný adresár. + +### Index (časť .git adresára) + +Index je také odpočívadlo Gitu. Je to v podstate vrstva, ktorá oddeľuje pracovný strom od Git repozitára. Toto dáva vývojárom viac možností nad tým, čo do repozitára naozaj pošlú. + +### Commit + +Commit je "snímka" zmien, či manipulácií s tvojím Pracovným Stromom. Ak si napríklad pridal 5 súborov a odstránil 2 ďalšie, tieto zmeny budú zachytené v commite. Ten môže (ale nemusí) byť zverejnený (pushed) do iných repozitárov. + +### Vetva (Branch) + +Vetva je ukazateľ na posledný vykonaný commit. Po ďalších commitnutiach sa ukazateľ bude automaticky posúvať na ten najnovší. + +### Tag + +Tag je označenie špecifického bodu v minulosti. Typicky sa používa na značenie vydaných verzií (v1.0, atď). + +### HEAD a head (časť .git adresára) + +HEAD je ukazateľ na aktuálnu vetvu. Repozitár má len 1 *aktívny* HEAD. +head je ukazateľ, ktorý môže ukazovať na akýkoľvek commit. Repozitár môže mať niekoľko headov. + +### Štádia Gitu +* Modified - Súbor bol zmenený, no nebol ešte commitnutý do Git Databázy. +* Staged - Zmenený súbor, ktorý pôjde do najbližšieho commit snímku. +* Committed - Súbory boli commitnuté do Git Databázy. + +### Koncepčné zdroje + +* [Git Pre Informatikov](http://eagain.net/articles/git-for-computer-scientists/) +* [Git Pre Designerov](http://hoth.entp.com/output/git_for_designers.html) + + +## Príkazy + + +### init + +Vytvorí prázdny Git repozitár. Jeho nastavenia, uložené informácie a mnoho iného sú uložené v adresári (zložke) s názvom ".git". + +```bash +$ git init +``` + +### config + +Konfiguruj nastavenia. Či už pre repozitár, samotný systém, alebo globálne konfigurácie (súbor pre globálny config je `~/.gitconfig`). + + +```bash +# Zobraz a Nastav Základné Konfiguračné Premenné (Globálne) +$ git config --global user.email "MôjEmail@Zoho.com" +$ git config --global user.name "Moje Meno " +``` + +[Prečítaj si viac o git configu.](http://git-scm.com/docs/git-config) + +### pomoc + +Máš tiež prístup k extrémne detailnej dokumentácií pre každý príkaz (po anglicky). Hodí sa, ak potrebuješ pripomenúť semantiku. + +```bash +# Rýchlo zobraz všetky dostupné príkazy +$ git help + +# Zobraz všetky dostupné príkazy +$ git help -a + +# Zobraz konkrétnu pomoc - použivateľský manuál +# git help +$ git help add +$ git help commit +$ git help init +# alebo git --help +$ git add --help +$ git commit --help +$ git init --help +``` + +### ignoruj súbory + +Zámerne prestaneš sledovať súbor(y) a zložky. Typicky sa používa pre súkromné a dočasné súbory, ktoré by boli inak zdieľané v repozitári. +```bash +$ echo "temp/" >> .gitignore +$ echo "private_key" >> .gitignore +``` + + +### status + +Na zobrazenie rozdielov medzi indexovými súbormi (tvoj pracovný repozitár) a aktuálnym HEAD commitom. + + +```bash +# Zobrazí vetvu, nesledované súbory, zmeny a ostatné rozdiely +$ git status + +# Zisti iné vychytávky o git statuse +$ git help status +``` + +### add + +Pripraví súbory na commit pridaním do tzv. staging indexu. Ak ich nepridáš pomocou `git add` do staging indexu, nebudú zahrnuté v commitoch! + +```bash +# pridá súbor z tvojho pracovného adresára +$ git add HelloWorld.java + +# pridá súbor z iného adresára +$ git add /cesta/k/súboru/HelloWorld.c + +# Môžeš použiť regulárne výrazy! +$ git add ./*.java +``` +Tento príkaz len pridáva súbory do staging indexu, necommituje ich do repozitára. + +### branch + +Spravuj svoje vetvy. Môžeš ich pomocou tohto príkazu zobraziť, meniť, vytvoriť, či zmazať. + +```bash +# zobraz existujúce vetvy a vzdialené repozitáre +$ git branch -a + +# vytvor novú vetvu +$ git branch myNewBranch + +# vymaž vetvu +$ git branch -d myBranch + +# premenuj vetvu +# git branch -m +$ git branch -m mojaStaraVetva mojaNovaVetva + +# zmeň opis vetvy +$ git branch myBranchName --edit-description +``` + +### tag + +Spravuj svoje tagy + +```bash +# Zobraz tagy +$ git tag +# Vytvor tag so správou +# -m špecifikuje správu, ktorá bude s tagom uložená. +# Ak nešpeficikuješ správu pri tagu so správou, +# Git spustí tvoj editor, aby si ju napísal. +$ git tag -a v2.0 -m 'moja verzia 2.0' +# Ukáž informácie o tagu +# Zobrazí zadané informácie, dátum tagnutia commitu +# a správu pred zobrazením informácií o commite. +$ git show v2.0 +# Zverejní (pushne) jediný tag do vzdialeného repozitára +$ git push origin v2.0 +# Zverejní viacero tagov do vzdialeného repozitára +$ git push origin --tags +``` + +### checkout + +Aktualizuje všetky súbory v pracovnom strome, aby odpovedali verzií v indexe, alebo v inom strome. + +```bash +# Aktualizuj strom, aby odpovedal (predvolene) +# hlavnej vetve repozitáru (master branch) +$ git checkout +# Aktualizuj strom, aby odpovedal konrkétnej vetve +$ git checkout menoVetvy +# Vytvor novú vetvu & prepni sa na ňu +# ekvivalentný príkaz: "git branch ; git checkout " +$ git checkout -b nováVetva +``` + +### clone + +"Naklonuje", alebo vytvorí kópiu existujúceho repozitára do nového adresára. Tiež pridá špeciálne ďiaľkovo-monitorujúce vetvy (remote-tracking branches), ktoré ti umožnia zverejňovať do vzdialených vetiev. + +```bash +# Naklonuj learnxinyminutes-docs +$ git clone https://github.com/adambard/learnxinyminutes-docs.git +# povrchné klonovanie - rýchlejšie, uloží iba najnovšiu snímku +$ git clone --depth 1 https://github.com/adambard/learnxinyminutes-docs.git +# naklonuj iba konkrétnu vetvu +$ git clone -b master-cn https://github.com/adambard/learnxinyminutes-docs.git --single-branch +``` + +### commit + +Uloží aktuálny obsah indexu v novom "commite". Ten obsahuje vytvorené zmeny a s nimi súvisiace správy vytvorené použivateľom. + +```bash +# commitni so správou +$ git commit -m "Pridal som multiplyNumbers() funkciu do HelloWorld.c" + +# automaticky pridaj zmenené a vymazané súbory do staging indexu, potom ich commitni. +$ git commit -a -m "Zmenil som foo.php a vymazal bar.php" + +# zmeň posledný commit (toto nahradí predchádzajúci commit novým) +$ git commit --amend -m "Správna správa" +``` + +### diff + +Ukáže rozdiel medzi súborom v pracovnom repozitári, indexe a commitoch. + +```bash +# Ukáž rozdiel medzi pracovným repozitárom a indexom. +$ git diff + +# Ukáž rozdiely medzi indexom a najnovším commitom. +$ git diff --cached + +# Ukáž rozdiely medzi pracovným adresárom a najnovším commitom. +$ git diff HEAD +``` + +### grep + +Umožní ti rýchlo prehľadávať repozitár. + +Možná konfigurácia: + +```bash +# Nastav, aby sa vo výsledkoch vyhľadávania zobrazovalo číslo riadku +$ git config --global grep.lineNumber true + +# Urob výsledky vyhľadávania čitateľnejšie, vrátane zoskupovania +$ git config --global alias.g "grep --break --heading --line-number" +``` + +```bash +# Vďaka Travisovi Jefferymu za túto sekciu +# Hľadaj "názovPremennej" vo všetkých java súboroch +$ git grep 'názovPremennej' -- '*.java' + +# Hľadaj riadok, ktorý obsahuje "názovPoľa" a "add" alebo "remove" +$ git grep -e 'arrayListName' --and \( -e add -e remove \) +``` + +Google je tvoj kamarát; pre viac príkladov skoč na +[Git Grep Ninja](http://travisjeffery.com/b/2012/02/search-a-git-repo-like-a-ninja) + +### log + +Zobral commity do repozitára. + +```bash +# Zobraz všetky commity +$ git log + +# Zobraz iba správy a referencie commitov +$ git log --oneline + +# Zobraz zlúčené (merged) commity +$ git log --merges + +# Zobraz všetky commity vo forme ASCII grafu +$ git log --graph +``` + +### merge + +"Zlúč" zmeny externých commitov do aktuálnej vetvy. + +```bash +# Zlúč vybranú vetvu do aktuálnej. +$ git merge názovVetvy + +# Vždy vytvor zlučovací commit +$ git merge --no-ff názovVetvy +``` + +### mv + +Premenuj, alebo presuň súbor + +```bash +# Premenuj súbor +$ git mv HelloWorld.c HelloNewWorld.c + +# Presuň súbor +$ git mv HelloWorld.c ./nová/cesta/HelloWorld.c + +# "Nasilu" premenuj, alebo presuň +# "existujúciSúbor" už v adresári existuje, bude prepísaný +$ git mv -f môjSúbor existujúciSúbor +``` + +### pull + +Uloží obsah repozitára a zlúči ho s inou vetvou. + +```bash +# Aktualizuje tvoj lokálny repozitár zlúčením nových zmien +# zo vzdialených "origin" a "master" vetiev. +# git pull +$ git pull origin master + +# Predvolene, git pull aktualizuje tvoju aktuálnu vetvu +# zlúčením nových zmien zo vzdialenej vetvy +$ git pull + +# Zlúč zmeny zo vzdialenej vetvy a presuň vetvu do nového základného commitu (rebase) +# vetva commitne na tvoj lokálny repozitár, ekvivalentný príkaz: "git pull , git rebase " +$ git pull origin master --rebase +``` + +### push + +Zverejní a zlúči zmeny z lokálnej do vzdialenej vetvy. + +```bash +# Zverejni a zlúč zmeny z lokálneho repozitára do +# vzdialených vetiev s názvom "origin" a "master". +# git push +$ git push origin master + +# Predvolene git zverejní a zlúči zmeny z +# aktuálnej vetvy do vzdialenej vetvy s ňou spojenej +$ git push + +# Na spojenie lokálnej vetvy so vzdialenou pridaj -u: +$ git push -u origin master +# Kedykoľvek budeš chcieť zverejniť z rovnakej lokálnej vetvy, použi príkaz: +$ git push +``` + +### stash + +Umožní ti opustiť chaotický stav pracovného adresára a uloží ho na zásobník nedokončených zmien, ku ktorým sa môžeš kedykoľvek vrátiť. + +Povedzme, že si urobil nejaké zmeny vo svojom git repozitári, ale teraz potrebuješ pullnúť zo vzdialenej repo. Keďže máš necommitnuté zmeny, príkaz `git pull` nebude fungovať. Namiesto toho môžeš použiť `git stash` a uložiť svoje nedokončené zmeny na zásobník! + +```bash +$ git stash +Saved working directory and index state \ + "WIP on master: 049d078 added the index file" + HEAD is now at 049d078 added the index file + (To restore them type "git stash apply") +``` + +Teraz môžeš uložiť vzdialenú vetvu! + +```bash +git pull +``` +`...zmeny sa zaznamenajú...` + +Over, či je všetko v poriadku + +```bash +$ git status +# On branch master +nothing to commit, working directory clean +``` + +Môžeš si pozrieť, čo za chaos je na zásobníku cez `git stash list`. +Nedokončené zmeny sú uložené ako Last-In-First-Out (Prvý dnu, posledný von) štruktúra, navrchu sa objavia najnovšie zmeny. + +```bash +$ git stash list +stash@{0}: WIP on master: 049d078 added the index file +stash@{1}: WIP on master: c264051 Revert "added file_size" +stash@{2}: WIP on master: 21d80a5 added number to log +``` + +Keď so zmenami budeš chcieť pracovať, odstráň ich zo stacku. + +```bash +$ git stash pop +# On branch master +# Changes not staged for commit: +# (use "git add ..." to update what will be committed) +# +# modified: index.html +# modified: lib/simplegit.rb +# +``` + +`git stash apply` urobí presne to isté + +Hotovo, môžeš pokračovať v práci! + +[Čítaj viac.](http://git-scm.com/book/en/v1/Git-Tools-Stashing) + +### rebase (pozor) + +Zober všetky zmeny commitnuté do vetvy a aplikuj ich na inú vetvu. +*Tento príkaz nerob na verejných repozitároch*. + +```bash +# Aplikuj commity z experimentálnej vetvy na master +# git rebase +$ git rebase master experimentBranch +``` + +[Čítaj viac.](http://git-scm.com/book/en/Git-Branching-Rebasing) + +### reset (pozor) + +Resetni HEAD (ukazateľ na aktuálnu vetvu) do konrkétneho stavu. To ti umožní vziať späť zlúčenia, zverejnenia, commity, pridania atď. Je to užitočný, no nebezpečný príkaz, pokiaľ nevieš, čo robíš. + +```bash +# Resetni index (vrstvu medzi pracovným stromom a Git repozitárom), aby odpovedal najnovšiemu commitu (adresár ostane nezmenený) +$ git reset + +# Resetni index, aby odpovedal najnovšiemu commitu (adresár sa prepíše) +$ git reset --hard + +# Presunie vrchol aktuálnuej vetvy do konkrétneho commitu (adresár ostane nezmenený) +# všetky zmeny sú zachované v adresári. +$ git reset 31f2bb1 + +# Presunie vrchol aktuálnuej vetvy naopak do konkrétneho commitu +# a zosúladí ju s pracovným adresárom (vymaže nekomitnuté zmeny). +$ git reset --hard 31f2bb1 +``` +### revert + +Vezme naspäť ("od-urobí") commit. Nezamieňaj s resetom, ktorý obnoví stav +projektu do predchádzajúceho bodu v čase. Revert pridá nový commit, inverzný tomu, ktorý chceš vymazať, tým ho od-urobí. + +```bash +# Vezmi späť konkrétny commit +$ git revert +``` + +### rm + +Opak od git add, rm odstráni súbory z aktuálneho pracovného stromu. + +```bash +# odstráň HelloWorld.c +$ git rm HelloWorld.c + +# Odstráň súbor z vnoreného adresára +$ git rm /pather/to/the/file/HelloWorld.c +``` + +## Ďalšie informácie + +* [tryGit - Zábavný interaktívny spôsob, ako sa naučiť Git.](http://try.github.io/levels/1/challenges/1) + +* [Udemy Git Tutoriál: Kompletný návod](https://blog.udemy.com/git-tutorial-a-comprehensive-guide/) + +* [Git Immersion - Návod, ktorý Ťa prevedie základmi Gitu](http://gitimmersion.com/) + +* [git-scm - Video Tutoriály](http://git-scm.com/videos) + +* [git-scm - Dokumentácia](http://git-scm.com/docs) + +* [Atlassian Git - Tutoriály & Postupy](https://www.atlassian.com/git/) + +* [SalesForce Cheat Sheet](https://na1.salesforce.com/help/doc/en/salesforce_git_developer_cheatsheet.pdf) + +* [GitGuys](http://www.gitguys.com/) + +* [Git - jednoducho](http://rogerdudler.github.io/git-guide/index.html) + +* [Pro Git](http://www.git-scm.com/book/en/v2) + +* [Úvod do Gitu a GitHubu pre začiatočníkov (Tutoriál)](http://product.hubspot.com/blog/git-and-github-tutorial-for-beginners) From 42e8218146de7ac1a35c9f24ee40eefc574fdb0d Mon Sep 17 00:00:00 2001 From: Terka Slan Date: Sun, 15 Nov 2015 22:25:18 +0100 Subject: [PATCH 652/685] Translated git to Slovak and repaired formatting --- sk-sk/git.html.markdown | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sk-sk/git.html.markdown b/sk-sk/git.html.markdown index b5aace7a..e68de3f5 100644 --- a/sk-sk/git.html.markdown +++ b/sk-sk/git.html.markdown @@ -1,7 +1,6 @@ --- category: tool tool: git - contributors: - ["Jake Prather", "http://github.com/JakeHP"] - ["Leo Rudberg" , "http://github.com/LOZORD"] @@ -10,8 +9,8 @@ contributors: - ["Andrew Taylor", "http://github.com/andrewjt71"] translators: - ["Terka Slanináková", "http://github.com/TerkaSlan"] -filename: LearnGit.txt lang: sk-sk +filename: LearnGit-sk.txt --- Git je distribuovaný systém riadenia revízií a správy zdrojového kódu. From 70fa51fa36a8d2e3fbc258cbac6b37e45766bdae Mon Sep 17 00:00:00 2001 From: Terka Slan Date: Mon, 16 Nov 2015 23:07:44 +0100 Subject: [PATCH 653/685] Added LearnGit-sk.txt and adjusted the markdown file --- sk-sk/LearnGit-sk.txt | 208 ++++++++++++++++++++++++++++++++++++++++ sk-sk/git.html.markdown | 5 +- 2 files changed, 210 insertions(+), 3 deletions(-) create mode 100644 sk-sk/LearnGit-sk.txt diff --git a/sk-sk/LearnGit-sk.txt b/sk-sk/LearnGit-sk.txt new file mode 100644 index 00000000..070a0489 --- /dev/null +++ b/sk-sk/LearnGit-sk.txt @@ -0,0 +1,208 @@ +$ git init + +# Zobraz a Nastav Základné Konfiguračné Premenné (Globálne) +$ git config --global user.email "MôjEmail@Zoho.com" +$ git config --global user.name "Moje Meno + +# Rýchlo zobraz všetky dostupné príkazy +$ git help + +# Zobraz všetky dostupné príkazy +$ git help -a + +# Zobraz konkrétnu pomoc - použivateľský manuál +# git help +$ git help add +$ git help commit +$ git help init +# alebo git --help +$ git add --help +$ git commit --help +$ git init --help + +# Zobrazí vetvu, nesledované súbory, zmeny a ostatné rozdiely +$ git status +# Zistí iné vychytávky o git statuse +$ git help status + +# pridá súbor z tvojho pracovného adresára +$ git add HelloWorld.java + +# pridá súbor z iného adresára +$ git add /cesta/k/súboru/HelloWorld.c + +# Môžeš použiť regulárne výrazy! +$ git add ./*.java + +# zobraz existujúce vetvy a vzdialené repozitáre +$ git branch -a + +# vytvor novú vetvu +$ git branch myNewBranch + +# vymaž vetvu +$ git branch -d myBranch + +# premenuj vetvu +# git branch -m +$ git branch -m mojaStaraVetva mojaNovaVetva + +# zmeň opis vetvy +$ git branch myBranchName --edit-description + +# Zobrazí tagy +$ git tag +# Vytvorí tag so správou +# -m špecifikuje správu, ktorá bude s tagom uložená. +# Ak nešpeficikuješ správu pri tagu so správou, +# Git spustí tvoj editor, aby si ju napísal. +$ git tag -a v2.0 -m 'moja verzia 2.0' + +# Ukáž informácie o tagu +# Zobrazí zadané informácie, dátum tagnutia commitu +# a správu pred zobrazením informácií o commite. +$ git show v2.0 + +# Zverejní (pushne) jediný tag do vzdialeného repozitára +$ git push origin v2.0 + +# Zverejní viacero tagov do vzdialeného repozitára +$ git push origin --tags + +# Aktualizuj strom, aby odpovedal (predvolene) +# hlavnej vetve repozitáru (master branch) +$ git checkout + +# Aktualizuj strom, aby odpovedal konrkétnej vetve +$ git checkout menoVetvy + +# Vytvor novú vetvu & prepni sa na ňu +# ekvivalentný príkaz: "git branch ; git checkout " +$ git checkout -b nováVetva + +# Naklonuj learnxinyminutes-docs +$ git clone https://github.com/adambard/learnxinyminutes-docs.git + +# povrchné klonovanie - rýchlejšie, uloží iba najnovšiu snímku +$ git clone --depth 1 https://github.com/adambard/learnxinyminutes-docs.git + +# naklonuj iba konkrétnu vetvu +$ git clone -b master-cn https://github.com/adambard/learnxinyminutes-docs.git --single-branch + +# commitni so správou +$ git commit -m "Pridal som multiplyNumbers() funkciu do HelloWorld.c" + +# automaticky pridaj zmenené a vymazané súbory do staging indexu, potom ich commitni. +$ git commit -a -m "Zmenil som foo.php a vymazal bar.php" + +# zmeň posledný commit (toto nahradí predchádzajúci commit novým) +$ git commit --amend -m "Správna správa" + +# Ukáž rozdiel medzi pracovným repozitárom a indexom. +$ git diff + +# Ukáž rozdiely medzi indexom a najnovším commitom. +$ git diff --cached + +# Ukáž rozdiely medzi pracovným adresárom a najnovším commitom. +$ git diff HEAD + +# Nastav, aby sa vo výsledkoch vyhľadávania zobrazovalo číslo riadku +$ git config --global grep.lineNumber true + +# Urob výsledky vyhľadávania čitateľnejšie, vrátane zoskupovania +$ git config --global alias.g "grep --break --heading --line-number" + +# Vďaka Travisovi Jefferymu za túto sekciu +# Hľadaj "názovPremennej" vo všetkých java súboroch +$ git grep 'názovPremennej' -- '*.java' + +# Hľadaj riadok, ktorý obsahuje "názovPoľa" a "add" alebo "remove" +$ git grep -e 'arrayListName' --and \( -e add -e remove \) + +# Zobraz všetky commity +$ git log + +# Zobraz iba správy a referencie commitov +$ git log --oneline + +# Zobraz zlúčené (merged) commity +$ git log --merges + +# Zobraz všetky commity vo forme ASCII grafu +$ git log --graph + +# Zlúč vybranú vetvu do aktuálnej. +$ git merge názovVetvy + +# Vždy vytvor zlučovací commit +$ git merge --no-ff názovVetvy + +# Premenuj súbor +$ git mv HelloWorld.c HelloNewWorld.c + +# Presuň súbor +$ git mv HelloWorld.c ./nová/cesta/HelloWorld.c + +# "Nasilu" premenuj, alebo presuň +# "existujúciSúbor" už v adresári existuje, bude prepísaný +$ git mv -f môjSúbor existujúciSúbor + +# Aktualizuje tvoj lokálny repozitár zlúčením nových zmien +# zo vzdialených "origin" a "master" vetiev. +# git pull +$ git pull origin master + +# Predvolene, git pull aktualizuje tvoju aktuálnu vetvu +# zlúčením nových zmien zo vzdialenej vetvy +$ git pull + +# Zlúč zmeny zo vzdialenej vetvy a presuň vetvu do nového základného commitu (rebase) +# vetva commitne na tvoj lokálny repozitár, ekvivalentný príkaz: "git pull , git rebase " +$ git pull origin master --rebase + +# Zverejni a zlúč zmeny z lokálneho repozitára do +# vzdialených vetiev s názvom "origin" a "master". +# git push +$ git push origin master + +# Predvolene git zverejní a zlúči zmeny z +# aktuálnej vetvy do vzdialenej vetvy s ňou spojenej +$ git push + +# Na spojenie lokálnej vetvy so vzdialenou pridaj -u: +$ git push -u origin master +# Kedykoľvek budeš chcieť zverejniť z rovnakej lokálnej vetvy, použi príkaz: +$ git push + +# Aplikuj commity z experimentálnej vetvy na master +# git rebase +$ git rebase master experimentBranch + +# Resetni index (vrstvu medzi pracovným stromom a Git repozitárom), aby odpovedal najnovšiemu commitu (adresár ostane nezmenený) +$ git reset + +# Resetni index, aby odpovedal najnovšiemu commitu (adresár sa prepíše) +$ git reset --hard + +# Presunie vrchol aktuálnuej vetvy do konkrétneho commitu (adresár ostane nezmenený) +# všetky zmeny sú zachované v adresári. +$ git reset 31f2bb1 + +# Vezmi späť konkrétny commit +$ git revert + +# odstráň HelloWorld.c +$ git rm HelloWorld.c + +# Odstráň súbor z vnoreného adresára +$ git rm /pather/to/the/file/HelloWorld.c + + + + + + + + + diff --git a/sk-sk/git.html.markdown b/sk-sk/git.html.markdown index e68de3f5..21741406 100644 --- a/sk-sk/git.html.markdown +++ b/sk-sk/git.html.markdown @@ -154,7 +154,7 @@ Na zobrazenie rozdielov medzi indexovými súbormi (tvoj pracovný repozitár) a # Zobrazí vetvu, nesledované súbory, zmeny a ostatné rozdiely $ git status -# Zisti iné vychytávky o git statuse +# Zistí iné vychytávky o git statuse $ git help status ``` @@ -404,9 +404,8 @@ Saved working directory and index state \ Teraz môžeš uložiť vzdialenú vetvu! ```bash -git pull +$ git pull ``` -`...zmeny sa zaznamenajú...` Over, či je všetko v poriadku From 913830a6b37ed27588e17673d60bace5235816b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Rozwadowski?= Date: Mon, 16 Nov 2015 23:09:22 +0100 Subject: [PATCH 654/685] Fix typos, improve the language --- pl-pl/python-pl.html.markdown | 159 +++++++++++++++++----------------- 1 file changed, 81 insertions(+), 78 deletions(-) diff --git a/pl-pl/python-pl.html.markdown b/pl-pl/python-pl.html.markdown index ade1d7ca..023c3e6b 100644 --- a/pl-pl/python-pl.html.markdown +++ b/pl-pl/python-pl.html.markdown @@ -30,7 +30,7 @@ działać w wersjach 2.x. Dla wersji 3.x znajdziesz odpowiedni artykuł na stron # Pojedyncze komentarze oznaczamy takim symbolem. """ Wielolinijkowe napisy zapisywane są przy użyciu - trzech znaków cudzysłowiu i często + potrójnych cudzysłowów i często wykorzystywane są jako komentarze. """ @@ -47,11 +47,11 @@ działać w wersjach 2.x. Dla wersji 3.x znajdziesz odpowiedni artykuł na stron 10 * 2 # => 20 35 / 5 # => 7 -# Dzielenie może być kłopotliwe. Poniższe to dzielenie +# Dzielenie może być kłopotliwe. Poniższe działanie to dzielenie # całkowitoliczbowe(int) i wynik jest automatycznie zaokrąglany. 5 / 2 # => 2 -# Aby to naprawić musimy powiedzieć nieco o liczbach zmiennoprzecinkowych. +# Aby to naprawić, musimy powiedzieć nieco o liczbach zmiennoprzecinkowych. 2.0 # To liczba zmiennoprzecinkowa, tzw. float 11.0 / 4.0 # => 2.75 ahhh...znacznie lepiej @@ -65,7 +65,7 @@ działać w wersjach 2.x. Dla wersji 3.x znajdziesz odpowiedni artykuł na stron # Operator modulo - wyznaczanie reszty z dzielenia 7 % 3 # => 1 -# Potęgowanie (x do potęgi ytej) +# Potęgowanie (x do potęgi y-tej) 2**4 # => 16 # Wymuszanie pierwszeństwa w nawiasach @@ -83,7 +83,7 @@ False or True #=> True # Prawda 2 == True #=> False k1 == True #=> True -# aby zanegować użyj "not" +# aby zanegować, użyj "not" not True # => False not False # => True @@ -112,7 +112,7 @@ not False # => True # Napisy można dodawać! "Witaj " + "świecie!" # => "Witaj świecie!" -# ... a nawet mnożone +# ... a nawet mnożyć "Hej" * 3 # => "HejHejHej" # Napis może być traktowany jako lista znaków @@ -124,7 +124,7 @@ not False # => True # Jednak nowszym sposobem formatowania jest metoda "format". # Ta metoda jest obecnie polecana: "{0} są {1}".format("napisy", "fajne") -# Jeśli nie chce ci się liczyć użyj słów kluczowych. +# Jeśli nie chce ci się liczyć, użyj słów kluczowych. "{imie} chce zjeść {jadlo}".format(imie="Bob", jadlo="makaron") # None jest obiektem @@ -135,12 +135,12 @@ None # => None "etc" is None # => False None is None # => True -# Operator 'is' testuje identyczność obiektów. To nie jest zbyt +# Operator 'is' testuje identyczność obiektów. Nie jest to zbyt # pożyteczne, gdy działamy tylko na prostych wartościach, # ale przydaje się, gdy mamy do czynienia z obiektami. -# None, 0, i pusty napis "" są odpowiednikami logicznego False. -# Wszystkie inne wartości są True +# None, 0 i pusty napis "" są odpowiednikami logicznego False. +# Wszystkie inne wartości są uznawane za prawdę (True) bool(0) # => False bool("") # => False @@ -149,20 +149,20 @@ bool("") # => False ## 2. Zmienne i zbiory danych #################################################### -# Python ma wyrażenie wypisujące "print" we wszystkich wersjach 2.x, ale -# zostało usunięte z wersji 3. -print "Jestem Python. Miło poznać!" -# Python ma też funkcję "print" dostępną w wersjach 2.7 and 3... +# Python ma instrukcję wypisującą "print" we wszystkich wersjach 2.x, ale +# została ona usunięta z wersji 3. +print "Jestem Python. Miło Cię poznać!" +# Python ma też funkcję "print" dostępną w wersjach 2.7 i 3... # ale w 2.7 musisz dodać import (odkomentuj): # from __future__ import print_function print("Ja też jestem Python! ") # Nie trzeba deklarować zmiennych przed przypisaniem. -jakas_zmienna = 5 # Konwencja mówi: używaj małych znaków i kładki _ +jakas_zmienna = 5 # Konwencja mówi: używaj małych liter i znaków podkreślenia _ jakas_zmienna # => 5 # Próba dostępu do niezadeklarowanej zmiennej da błąd. -# Przejdź do sekcji Obsługa wyjątków po więcej... +# Przejdź do sekcji Obsługa wyjątków, aby dowiedzieć się więcej... inna_zmienna # Wyrzuca nazwę błędu # "if" może być użyte jako wyrażenie @@ -173,7 +173,7 @@ li = [] # Możesz zacząć od wypełnionej listy inna_li = [4, 5, 6] -# Dodaj na koniec używając "append" +# Dodaj na koniec, używając "append" li.append(1) # li to teraz [1] li.append(2) # li to teraz [1, 2] li.append(4) # li to teraz [1, 2, 4] @@ -185,7 +185,7 @@ li.append(3) # li to znowu [1, 2, 4, 3]. # Dostęp do list jak do każdej tablicy li[0] # => 1 -# Użyj = aby nadpisać wcześniej wypełnione miejsca w liście +# Aby nadpisać wcześniej wypełnione miejsca w liście, użyj znaku = li[0] = 42 li[0] # => 42 li[0] = 1 # Uwaga: ustawiamy starą wartość @@ -195,7 +195,7 @@ li[-1] # => 3 # Jeżeli wyjdziesz poza zakres... li[4] # ... zobaczysz IndexError -# Możesz tworzyć wyniki. +# Możesz też tworzyć wycinki. li[1:3] # => [2, 4] # Bez początku li[2:] # => [4, 3] @@ -213,12 +213,12 @@ del li[2] # li to teraz [1, 2, 3] # Listy można dodawać li + inna_li # => [1, 2, 3, 4, 5, 6] -# Uwaga: wartości poszczególnych list się nie zmieniają. +# Uwaga: wartości oryginalnych list li i inna_li się nie zmieniają. # Do łączenia list użyj "extend()" li.extend(other_li) # li to teraz [1, 2, 3, 4, 5, 6] -# Sprawdź czy jest w liście używając "in" +# Sprawdź, czy element jest w liście używając "in" 1 in li # => True # "len()" pokazuje długość listy @@ -238,7 +238,7 @@ tup[:2] # => (1, 2) # Można rozpakować krotki i listy do poszczególych zmiennych a, b, c = (1, 2, 3) # a to teraz 1, b jest 2, a c to 3 -# Jeżeli zapomnisz nawiasów automatycznie tworzone są krotki +# Jeżeli zapomnisz nawiasów, automatycznie tworzone są krotki d, e, f = 4, 5, 6 # Popatrz jak prosto zamienić wartości e, d = d, e # d to teraz 5 a e to 4 @@ -252,28 +252,28 @@ pelen_slownik = {"raz": 1, "dwa": 2, "trzy": 3} # Podglądany wartość pelen_slownik["one"] # => 1 -# Wypisz wszystkie klucze używając "keys()" +# Wypisz wszystkie klucze, używając "keys()" pelen_slownik.keys() # => ["trzy", "dwa", "raz"] -# Uwaga: słowniki nie gwarantują kolejności występowania kluczy. +# Uwaga: słowniki nie zapamiętują kolejności kluczy. # A teraz wszystkie wartości "values()" pelen_slownik.values() # => [3, 2, 1] # Uwaga: to samo dotyczy wartości. -# Sprawdzanie czy występuje to "in" +# Sprawdzanie czy klucz występuje w słowniku za pomocą "in" "raz" in pelen_slownik # => True 1 in pelen_slownik # => False # Próba dobrania się do nieistniejącego klucza da KeyError pelen_slownik["cztery"] # KeyError -# Użyj "get()" method aby uniknąć KeyError +# Użyj metody "get()", aby uniknąć błędu KeyError pelen_slownik.get("raz") # => 1 pelen_slownik.get("cztery") # => None # Metoda get zwraca domyślną wartość gdy brakuje klucza pelen_slownik.get("one", 4) # => 1 pelen_slownik.get("cztery", 4) # => 4 -# zauważ, że pelen_slownik.get("cztery") jest wciąż => None +# zauważ, że pelen_slownik.get("cztery") wciąż zwraca => None # (get nie ustawia wartości słownika) # przypisz wartość do klucza podobnie jak w listach @@ -284,12 +284,12 @@ pelen_slownik.setdefault("piec", 5) # pelen_slownik["piec"] daje 5 pelen_slownik.setdefault("piec", 6) # pelen_slownik["piec"] to wciąż 5 -# Teraz zbiory (set) ... cóż zbiory (to po prostu listy ale bez potórzeń) +# Teraz zbiory (set) - działają jak zwykłe listy, ale bez potórzeń pusty_zbior = set() # Inicjalizujemy "set()" pewnymi wartościami jakis_zbior = set([1, 2, 2, 3, 4]) # jakis_zbior to teraz set([1, 2, 3, 4]) -# kolejność nie jest gwarantowana, nawet gdy wydaje się posortowane +# kolejność nie jest zachowana, nawet gdy wydaje się posortowane inny_zbior = set([4, 3, 2, 2, 1]) # inny_zbior to set([1, 2, 3, 4]) # Od Pythona 2.7 nawiasy klamrowe {} mogą być użyte do deklarowania zbioru @@ -298,7 +298,7 @@ pelen_zbior = {1, 2, 2, 3, 4} # => {1, 2, 3, 4} # Dodaj więcej elementów przez "add()" pelen_zbior.add(5) # pelen_zbior is now {1, 2, 3, 4, 5} -# Znajdź przecięcie zbiorów używając & +# Znajdź przecięcie (część wspólną) zbiorów, używając & inny_zbior = {3, 4, 5, 6} pelen_zbior & other_set # => {3, 4, 5} @@ -317,32 +317,32 @@ pelen_zbior | other_set # => {1, 2, 3, 4, 5, 6} ## 3. Kontrola przepływu #################################################### -# Tworzymy zmienną some_var -some_var = 5 +# Tworzymy zmienną jakas_zm +jakas_zm = 5 -# Tutaj widzisz wyrażenie warunkowe "if". Wcięcia są ważne Pythonie! -# wypisze "some_var jest mniejsza niż 10" -if some_var > 10: - print("some_var jest wieksza niż 10") -elif some_var < 10: # This elif clause is optional. - print("some_var jest mniejsza niż 10") -else: # This is optional too. - print("some_var jest równa 10") +# Tutaj widzisz wyrażenie warunkowe "if". Wcięcia w Pythonie są ważne! +# Poniższy kod wypisze "jakas_zm jest mniejsza niż 10" +if jakas_zm > 10: + print("jakas_zm jest wieksza niż 10") +elif some_var < 10: # Opcjonalna klauzula elif + print("jakas_zm jest mniejsza niż 10") +else: # Również opcjonalna klauzula else + print("jakas_zm jest równa 10") """ -Pętla for iteruje po elementach listy wypisując: +Pętla for iteruje po elementach listy, wypisując: pies to ssak kot to ssak mysz to ssak """ for zwierze in ["pies", "kot", "mysz"]: - # Możesz użyć % aby stworzyć sformatowane napisy - print("%s to ssak" % zwierze) + # Użyj metody format, aby umieścić wartość zmiennej w ciągu + print("{0} to ssak".format(zwierze)) """ "range(liczba)" zwraca listę liczb -od zera do danej liczby: +z przedziału od zera do wskazanej liczby (bez niej): 0 1 2 @@ -352,7 +352,7 @@ for i in range(4): print(i) """ -While to pętla która jest wykonywana dopóki spełniony jest warunek: +While to pętla, która jest wykonywana, dopóki spełniony jest warunek: 0 1 2 @@ -363,46 +363,46 @@ while x < 4: print(x) x += 1 # Skrót od x = x + 1 -# Wyjątki wyłapujemy używając try, except +# Wyjątki wyłapujemy, używając try i except # Działa w Pythonie 2.6 i wyższych: try: - # Użyj "raise" aby wyrzucić wyjąte + # Użyj "raise" aby wyrzucić wyjątek raise IndexError("To błąd indeksu") except IndexError as e: - pass # Pass to brak reakcji na błąd. Zazwyczaj nanosisz tu poprawki. + pass # Pass to brak reakcji na błąd. Zwykle opisujesz tutaj, jak program ma się zachować w przypadku błędu. except (TypeError, NameError): - pass # kilka wyjątków może być przechwyce razem. + pass # kilka wyjątków można przechwycić jednocześnie. else: # Opcjonalna część bloku try/except. Musi wystąpić na końcu print "Wszystko ok!" # Zadziała tylko, gdy program nie napotka wyjatku. #################################################### -## 4. Funkcjie +## 4. Funkcje #################################################### -# Użyj "def" aby stworzyć nową funkcję +# Użyj "def", aby stworzyć nową funkcję def dodaj(x, y): - print("x to %s a y to %s" % (x, y)) - return x + y # słówko kluczowe return zwraca wynik działania + print("x to %s, a y to %s" % (x, y)) + return x + y # słowo kluczowe return zwraca wynik działania -# Tak wywołuje się funkcję z parametrami (args): -dodaj(5, 6) # => wypisze "x to 5 a y to 6" i zwróci 11 +# Tak wywołuje się funkcję z parametrami: +dodaj(5, 6) # => wypisze "x to 5, a y to 6" i zwróci 11 # Innym sposobem jest wywołanie z parametrami nazwanymi. dodaj(y=6, x=5) # tutaj kolejność podania nie ma znaczenia. -# Można też stworzyć funkcję, które przyjmują różną ilość parametrów -# nienazwanych args, co będzie interpretowane jako krotka jeśli nie użyjesz * +# Można też stworzyć funkcję, które przyjmują zmienną liczbę parametrów pozycyjnych, +# które zostaną przekazana jako krotka, pisząc w definicji funkcji "*args" def varargs(*args): return args varargs(1, 2, 3) # => (1, 2, 3) -# Można też stworzyć funkcję, które przyjmują różną ilość parametrów -# nazwanych kwargs, które będa interpretowane jako słownik jeśli nie dasz ** +# Można też stworzyć funkcję, które przyjmują zmienną liczbę parametrów +# nazwanych kwargs, które zostaną przekazane jako słownik, pisząc w definicji funkcji "**kwargs" def keyword_args(**kwargs): return kwargs @@ -410,12 +410,12 @@ def keyword_args(**kwargs): keyword_args(wielka="stopa", loch="ness") # => {"wielka": "stopa", "loch": "ness"} -# Możesz też to pomieszać +# Możesz też przyjmować jednocześnie zmienną liczbę parametrów pozycyjnych i nazwanych def all_the_args(*args, **kwargs): print(args) print(kwargs) """ -all_the_args(1, 2, a=3, b=4) wyrzuci: +all_the_args(1, 2, a=3, b=4) wypisze: (1, 2) {"a": 3, "b": 4} """ @@ -435,7 +435,7 @@ def pass_all_the_args(*args, **kwargs): print varargs(*args) print keyword_args(**kwargs) -# Zakres widoczności +# Zasięg zmiennych x = 5 def setX(num): @@ -461,14 +461,14 @@ def rob_dodawacz(x): dodaj_10 = rob_dodawacz(10) dodaj_10(3) # => 13 -# Są również funkcje nienazwane "lambda" +# Są również funkcje anonimowe "lambda" (lambda x: x > 2)(3) # => True -# Są także wbudowane funkcje wysokiego poziomu +# Python ma też wbudowane funkcje wyższego rzędu (przyjmujące inną funkcje jako parametr) map(add_10, [1, 2, 3]) # => [11, 12, 13] filter(lambda x: x > 5, [3, 4, 5, 6, 7]) # => [6, 7] -# Można używać wyrażeń listowych do mapowania (map) i filtrowania (filter) +# Można używać wyrażeń listowych (list comprehensions) do mapowania i filtrowania [add_10(i) for i in [1, 2, 3]] # => [11, 12, 13] [x for x in [3, 4, 5, 6, 7] if x > 5] # => [6, 7] @@ -485,18 +485,18 @@ class Czlowiek(object): # Podstawowa inicjalizacja - wywoływana podczas tworzenia instacji. # Zauważ, że podwójne podkreślenia przed i za nazwą oznaczają - # obietky lub atrybuty, który żyją tylko w kontrolowanej przez - # użytkownika przestrzeni nazw. Nie używaj ich we własnych metodach. + # specjalne obiekty lub atrybuty wykorzystywane wewnętrznie przez Pythona. + # Nie używaj ich we własnych metodach. def __init__(self, nazwa): # przypisz parametr "nazwa" do atrybutu instancji self.nazwa = nazwa - # Metoda instancji. Wszystkie metody biorą "self" jako pierwszy argument + # Metoda instancji. Wszystkie metody przyjmują "self" jako pierwszy argument def mow(self, wiadomosc): return "%s: %s" % (self.nazwa, wiadomosc) # Metoda klasowa współdzielona przez instancje. - # Ma wywołującą klasę jako pierwszy argument. + # Przyjmuje wywołującą klasę jako pierwszy argument. @classmethod def daj_gatunek(cls): return cls.gatunek @@ -540,7 +540,8 @@ print(ceil(3.7)) # => 4.0 print(floor(3.7)) # => 3.0 # Można zaimportować wszystkie funkcje z danego modułu. -# Ostrzeżenie: nie jest to polecane. +# Uwaga: nie jest to polecane, bo później w kodzie trudno połapać się, +# która funkcja pochodzi z którego modułu. from math import * # Można skracać nazwy modułów. @@ -550,7 +551,7 @@ math.sqrt(16) == m.sqrt(16) # => True from math import sqrt math.sqrt == m.sqrt == sqrt # => True -# Moduły pythona to zwykłe skrypty napisane w tym języku. Możesz +# Moduły Pythona to zwykłe skrypty napisane w tym języku. Możesz # pisać własne i importować je. Nazwa modułu to nazwa pliku. # W ten sposób sprawdzisz jakie funkcje wchodzą w skład modułu. @@ -568,14 +569,16 @@ def podwojne_liczby(iterowalne): yield i + i # Generatory tworzą wartości w locie. -# W przeciwienstwie do wygenerowania wartości raz i ich zachowania, -# powstają one na bieżąco, w wyniku iteracji. To oznacza, że wartości -# większe niż 15 nie będą przetworzone w funkcji "podwojne_liczby". +# Zamiast generować wartości raz i zapisywać je (np. w liście), +# generator tworzy je na bieżąco, w wyniku iteracji. To oznacza, +# że w poniższym przykładzie wartości większe niż 15 nie będą przetworzone +# w funkcji "podwojne_liczby". # Zauważ, że xrange to generator, który wykonuje tę samą operację co range. # Stworzenie listy od 1 do 900000000 zajęłoby sporo czasu i pamięci, -# a xrange tworzy obiekt generatora zamiast tworzyć całą listę jak range. -# Użyto podkreślinika, aby odróżnić nazwę zmiennej od słówka kluczowego -# Pythona. +# a xrange tworzy obiekt generatora zamiast budować całą listę jak range. + +# Aby odróżnić nazwę zmiennej od nazwy zarezerwowanej w Pythonie, używamy +# zwykle na końcu znaku podkreślenia xrange_ = xrange(1, 900000000) # poniższa pętla będzie podwajać liczby aż do 30 @@ -587,7 +590,7 @@ for i in podwojne_liczby(xrange_): # Dekoratory # w tym przykładzie "beg" jest nakładką na "say" -# Beg wywołuje say. Jeśli say_please jest prawdziwe wtedy wzracana wartość +# Beg wywołuje say. Jeśli say_please jest prawdziwe, wtedy zwracana wartość # zostanie zmieniona from functools import wraps From e538185c0a3fbbfef7017744a44e1a98a7e50565 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Tue, 17 Nov 2015 13:47:55 -0500 Subject: [PATCH 655/685] $! is not available inside the CATCH{} --- perl6.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl6.html.markdown b/perl6.html.markdown index 43327edb..fce1dca5 100644 --- a/perl6.html.markdown +++ b/perl6.html.markdown @@ -738,7 +738,7 @@ try { # You can throw an exception using `die`: die X::AdHoc.new(payload => 'Error !'); -# You can access the last exception with `$!` (usually used in a `CATCH` block) +# You can access the last exception with `$!` (use `$_` in a `CATCH` block) # There are also some subtelties to exceptions. Some Perl 6 subs return a `Failure`, # which is a kind of "unthrown exception". They're not thrown until you tried to look From 946b4f260220cc4caaaa9ab7d45109148579ca5f Mon Sep 17 00:00:00 2001 From: Michel Antoine Date: Wed, 18 Nov 2015 23:39:51 -0800 Subject: [PATCH 656/685] Add French Javascript ES6 --- fr-fr/javascript-fr.html.markdown | 275 ++++++++++++++++++++++++++---- 1 file changed, 243 insertions(+), 32 deletions(-) diff --git a/fr-fr/javascript-fr.html.markdown b/fr-fr/javascript-fr.html.markdown index 15478cdb..fd1d40a3 100644 --- a/fr-fr/javascript-fr.html.markdown +++ b/fr-fr/javascript-fr.html.markdown @@ -6,23 +6,26 @@ contributors: filename: javascript-fr.js translators: - ['@nbrugneaux', 'https://nicolasbrugneaux.me'] + - ['Michel Antoine', 'https://github.com/antoin-m'] lang: fr-fr --- JavaScript a été créé par Brendan Eich, travaillant alors a Netscape, en 1995. Le langage avait à l'origine pour but d'être un langage de scripting simple pour les sites web, complétant le Java (à ne pas confondre avec JavaScript) -pour des applications web complexes. Mais son intégration très proche et -simple des pages web, ainsi que le support natif des navigateurs a rendu -le JavaScript incontournable aujourd'hui tant bien dans le front-end que +pour des applications web complexes. Mais son intégration très proche et +simple des pages web, ainsi que le support natif des navigateurs a rendu +le JavaScript incontournable aujourd'hui tant bien dans le front-end que dans le back-end. En effet, le JavaScript n'est plus uniquement limité aux navigateurs, grâce à -Node.JS, un projet qui offre un environnement indépendant dans lequel un -interpréteur Javascript, basé sur le célèbre moteur V8 de Google Chrome, +Node.JS, un projet qui offre un environnement indépendant dans lequel un +interpréteur Javascript, basé sur le célèbre moteur V8 de Google Chrome, peut être utilisé directement côté serveur pour exécuter des programmes écrits en JavaScript. +ECMAScript (la norme du langage Javascript) entre en version 6. Cette version introduit de nombreuses mises à jour tout en restant rétrocompatible. L'implémentation de ces nouvelles fonctionnalités est en cours et celles-ci ne sont donc pas forcément compatibles avec tous les navigateurs. + ```js // Les commentaires sont comme en C. Les commentaires mono-ligne commencent par 2 slashs, /* et les commentaires sur plusieurs lignes commencent avec slash-étoile @@ -31,7 +34,7 @@ en JavaScript. // Toutes les expressions peuvent finir par ; doStuff(); -// ... mais n'en n'ont pas forcément besoin, les point-virgules sont ajoutés +// ... mais n'en n'ont pas forcément besoin, les point-virgules sont ajoutés // lors de l’interprétation aux sauts de ligne, sauf exceptions doStuff() @@ -79,6 +82,12 @@ false; // faux "abc"; 'Hello, world'; +// *ES6:* Les chaines de caractères peuvent être crées en utilisant un modèle +// entouré des quotes inverses (`) à la place des quotes classiques (' ou "). +// Les variables sont interprétées avec ${var} +let banta = "Harry", santa = "Hermione"; +`${banta}, your santa is ${santa}.` // = "Harry, your santa is Hermione." + // La négation utilise le symbole ! !true; // = false !false; // = true @@ -117,26 +126,34 @@ false; // faux // Il y a également null et undefined null; // utilisé pour une non-valeur -undefined; // utilisé pour une valeur actuellement non présente (cependant, +undefined; // utilisé pour une valeur actuellement non présente (cependant, // undefined est aussi une valeur valide) // false, null, undefined, NaN, 0 and '' sont 'presque-faux' (falsy), tout le reste // est 'presque-vrai' (truthy) // Notez que 0 est falsy mais '0' est truthy, alors même que 0 == '0' (mais 0 !== '0') +// *ES6:* Introduction d'un nouveau type primitif : Symbol +var symbol_one = Symbol(); +var symbol_two = Symbol('This is optional description, for debugging'); +typeof symbol_one === 'symbol' // = true + +// *ES6:* Un Symbol est immutable et unique +Symbol() === Symbol() // = false +Symbol('learnx') === Symbol('learnx') // = false /////////////////////////////////// -// 2. Variables, Tableaux et Objets +// 2. Variables, Tableaux, Objets, Maps et Sets -// Les variables sont déclarées avec le mot clé var. Le typage en JavaScript est +// Les variables sont déclarées avec le mot clé var. Le typage en JavaScript est // dynamique, donc pas besoin de spécifier le type. L'assignement utilise un seul =. var someVar = 5; // si vous oubliez le mot clé var, vous n'aurez pas d'erreur (sauf en mode strict) someOtherVar = 10; -// ... mais la variable aura une portée globale (plus communément trouvé en tant -// que "global scope" en anglais), et non pas une portée limitée à la fonction +// ... mais la variable aura une portée globale (plus communément trouvé en tant +// que "global scope" en anglais), et non pas une portée limitée à la fonction // dans laquelle vous l'aviez définie. // Les variables déclarées et non assignées sont undefined par défaut @@ -145,6 +162,32 @@ var someThirdVar = undefined; // ... sont deux déclarations identiques. +// Il est possible de déclarer plusieurs variables en séparant leur déclaration +// avec l'opérateur virgule +var someFourthVar = 2, someFifthVar = 4; + +// *ES6:* Les variables peuvent maintenant être déclarées avec les mots-clés +// `let` et `const` +let someSixthVar = 6; +const someSeventhVar = 7; + +// *ES6:* Le mot-clé `let` attache la variable au block de code et non à la fonction +// à l'inverse de `var` +for (let i = 0; i < 10; i++) { + x += 10; +} +i; // = raises ReferenceError + +// *ES6:* Les variables "const" doivent être assignées lors de l'initialisation +const someEighthVar = 7; +const someNinthVar; // raises SyntaxError + +// *ES6:* Modifier une variable constante ne lève par d'erreur mais échoue +// silencieusement +const someNinthVar = 9; +someNinthVar = 10; +someNinthVar; // = 9 + // Il y a des raccourcis pour les opérations mathématiques: someVar += 5; // équivalent pour someVar = someVar + 5; someVar *= 10; // de même, someVar = someVar * 100; @@ -165,6 +208,22 @@ myArray.length; // = 4 // Ajout/Modification à un index spécifique myArray[3] = 'Hello'; +// *ES6:* Les Arrays peuvent maintenant être déstructurés en utilisant le pattern matching +var [a, b] = [1, 2]; +var [a, , b] = [1, -2, 2] + +a; // = 1 +b; // = 2 + +// *ES6:* La déstructuration peut échouer silencieusement. +// Il est aussi possible d'utiliser des valeurs par défaut +var [a] = []; +a; // = undefined; +var [a = 1] = []; +a; // = 1; +var [a = 1] = [2]; +a; // = 2; + // Les objets JavaScript sont appelés 'dictionnaires' ou 'maps' dans certains autres // langages : ils sont une liste non-ordonnée de paires clé-valeur. var myObj = {key1: 'Hello', key2: 'World'}; @@ -179,12 +238,82 @@ myObj['my other key']; // = 4 // .. ou avec un point si la clé est un identifiant valide. myObj.myKey; // = 'myValue' +// *ES6:* Un Symbol peut être utilisé en tant que clé. Puisque ceux-ci sont uniques, +// le seul moyen d'accéder à la propriété est d'avoir une référence sur ce Symbol. +myObj["key"] = "public value"; +myObj[Symbol("key")] = "secret value"; +myObj[Symbol("key")]; // = undefined + // Les objets sont eux aussi modifiables. myObj.myThirdKey = true; // Si vous essayez d'accéder à une valeur non-définie, vous obtiendrez undefined myObj.myFourthKey; // = undefined +// *ES6:* Comme les Arrays, les Objects peuvent être déstructurés en utilisant le pattern matching +var {foo} = {foo: "bar"}; +foo // = "bar" + +// *ES6:* Les Objects déstructurés peuvent utiliser des noms de variables différents +// de ceux d'origine grâce au pattern matching +var {foo, moo: baz} = {foo: "bar", moo: "car"}; +foo // = "bar" +baz // = "car" + +// *ES6:* Il est possible d'utiliser des valeurs par défaut lor de la déstructuration d'un Object +var {foo="bar"} = {moo: "car"}; +foo // = "bar" + +// *ES6:* Une erreur lors de la déstructuration restera silencieuse +var {foo} = {}; +foo // = undefined + +// *ES6:* ES6 ajoute les iterateurs. Pour accéder à l'iterateur de n'importe quel +// objet il faut utiliser la clé `Symbol.iterator`. +var iterator1 = myArr[Symbol.iterator]; // = returns iterator function + +// *ES6:* Si l'objet possède une valeur à la clé `Symbol.iterator` alors la +// collection est itérable +if (typeof myObj[Symbol.iterator] !== "undefined") { + console.log("You can iterate over myObj"); +} + +// *ES6:* En utilisant la méthode next() de l'iterateur nous recevons un objet +// avec deux propriétés : `value` et `done` +var iterator = myArr[Symbol.iterator]; // myArr = [1,2] +var myArrItem = null; + +myArrItem = iterator.next(); +myArrItem.value; // = 1 +myArrItem.done; // = false + +myArrItem = iterator.next(); +myArrItem.value; // = 2 +myArrItem.done; // = false + +myArrItem = iterator.next(); +myArrItem.value; // = undefined +myArrItem.done; // = true + +// *ES6:* Les Maps sont des objets itérables de type clé-valeur. +// Il est possible de créer une nouvelle map en utilisant `new Map()` +var myMap = new Map(); + +// *ES6:* Il est possible d'ajouter un couple clé-valeur avec la méthode `.set()`, +// de récupérer une valeur avec `.get()`, +// de vérifier qu'une clé existe avec `.has()` +// et enfin de supprimer un couple clé-valeur avec `.delete()` + +myMap.set("name", "Douglas"); +myMap.get("name"); // = "Douglas" +myMap.has("name"); // = true +myMap.delete("name"); + +// *ES6:* Les Sets sont des ensembles de valeurs uniques. +// Il est possible de créer un set avec `new Set()`. +// Toute valeur non unique est ignorée. +var mySet = new Set([1,2,2]); +console.log([...mySet]); // = [1,2] /////////////////////////////////// // 3. Logique et structures de contrôle @@ -198,7 +327,7 @@ else if (count === 4) { // uniquement quand count est 4 } else { - // le reste du temps, si ni 3, ni 4. + // le reste du temps, si ni 3, ni 4. } // De même pour while. @@ -264,7 +393,21 @@ function myFunction(thing){ } myFunction('foo'); // = 'FOO' -// Les fonctions JavaScript sont des objets de première classe, donc peuvent +// Attention, la valeur à retourner doit se trouver sur la même ligne que +// le mot-clé `return` sinon la fonction retournera systématiquement `undefined` +function myFunction(){ + return // <- semicolon automatically inserted here + {thisIsAn: 'object literal'} +} +myFunction(); // = undefined + +// *ES6:* Les paramètres des fonctions peuvent désormais avoir des valeurs par défaut +function default(x, y = 2) { + return x + y; +} +default(10); // == 12 + +// Les fonctions JavaScript sont des objets de première classe, donc peuvent // être réassignées à d'autres variables et passées en tant que paramètres pour // d'autres fonctions function myFunction(){ @@ -274,13 +417,17 @@ setTimeout(myFunction, 5000); // Note: setTimeout ne fait pas parti du langage, mais les navigateurs ainsi // que Node.js le rendent disponible -// Les fonctions n'ont pas nécessairement besoin d'un nom, elles peuvent être +// Les fonctions n'ont pas nécessairement besoin d'un nom, elles peuvent être // anonymes setTimeout(function(){ // ce code s'exécutera dans 5 secondes }, 5000); -// Le Javascript crée uniquement un scope, une portée d'action limitée, pour +// *ES6:* Introduction d'un sucre syntaxique permettant de créer +// une fonction anonyme de la forme : `param => returnValue`. +setTimeout(() => console.log('5 seconds, are up.'), 5000); + +// Le Javascript crée uniquement un scope, une portée d'action limitée, pour // les fonctions, et pas dans les autres blocs. if (true){ var i = 5; @@ -293,7 +440,7 @@ i; // = 5 - et non undefined comme vous pourriez vous y attendre var temporary = 5; // Nous pouvons accéder au scope global en assignant à l'objet global, // qui dans les navigateurs est "window". Il est différent dans Node.js, - // le scope global sera en fait local au module dans lequel vous + // le scope global sera en fait local au module dans lequel vous // vous trouvez. http://nodejs.org/api/globals.html window.permanent = 10; })(); @@ -302,8 +449,8 @@ i; // = 5 - et non undefined comme vous pourriez vous y attendre temporary; // raises ReferenceError permanent; // = 10 -// Une des fonctionnalités les plus puissantes de Javascript est le système de -// closures. Si une fonction est définie dans une autre fonction, alors la +// Une des fonctionnalités les plus puissantes de Javascript est le système de +// closures. Si une fonction est définie dans une autre fonction, alors la // fonction interne aura accès aux variables de la fonction parente, même si // celle-ci a déjà finie son exécution. function sayHelloInFiveSeconds(name){ @@ -318,6 +465,18 @@ function sayHelloInFiveSeconds(name){ } sayHelloInFiveSeconds('Adam'); // ouvre un popup avec 'Hello, Adam!' dans 5sec +// *ES6:* Les paramètres des fonctions appelées avec un tableau en entré +// préfixé par `...` vont se peupler avec les éléments du tableau +function spread(x, y, z) { + return x + y + z; +} +spread(...[1,2,3]); // == 6 + +// *ES6:* Les fonctions peuvent recevoir les paramètres dans un tableau en utilisant l'opérateur `...` +function spread(x, y, z) { + return x + y + z; +} +spread(...[1,2,3]); // == 6 /////////////////////////////////// // 5. Encore plus à propos des Objets; Constructeurs and Prototypes @@ -340,7 +499,7 @@ myObj = { }; myObj.myFunc(); // = 'Hello world!' -// La valeur de "this" change de par l'endroit où la fonction est appelée, et +// La valeur de "this" change de par l'endroit où la fonction est appelée, et // non de l'endroit où elle est définie. Donc elle ne fonctionnera pas si elle // est appelée hors du contexte l'objet. var myFunc = myObj.myFunc; @@ -356,7 +515,7 @@ myObj.myOtherFunc = myOtherFunc; myObj.myOtherFunc(); // = 'HELLO WORLD!' // Le contexte correspond à la valeur de "this". -// Nous pouvons aussi spécifier un contexte, forcer la valeur de "this, +// Nous pouvons aussi spécifier un contexte, forcer la valeur de "this, // pour une fonction quand elle est appelée grâce à "call" ou "apply". var anotherFunc = function(s){ return this.myString + s; @@ -371,19 +530,19 @@ Math.min(42, 6, 27); // = 6 Math.min([42, 6, 27]); // = NaN (uh-oh!) Math.min.apply(Math, [42, 6, 27]); // = 6 -// Mais, "call" and "apply" fonctionnenent uniquement au moment de l'appel de la -// fonction. Pour lier le contexte de façon permanente, nous pouvons utiliser +// Mais, "call" and "apply" fonctionnenent uniquement au moment de l'appel de la +// fonction. Pour lier le contexte de façon permanente, nous pouvons utiliser // "bind" pour garder une référence à la fonction avec ce "this". var boundFunc = anotherFunc.bind(myObj); boundFunc(' And Hello Saturn!'); // = 'Hello World! And Hello Saturn!' -// "bind" peut aussi être utilisé pour créer une application partielle de la +// "bind" peut aussi être utilisé pour créer une application partielle de la // fonction (curry) var product = function(a, b){ return a * b; } var doubler = product.bind(this, 2); doubler(8); // = 16 -// Lorsque vous appelez une fonction avec le mot clé "new", un nouvel objet est +// Lorsque vous appelez une fonction avec le mot clé "new", un nouvel objet est // crée et mis à disposition de la fonction via "this". Ces fonctions sont // communément appelées constructeurs. var MyConstructor = function(){ @@ -395,8 +554,8 @@ myNewObj.myNumber; // = 5 // Chaque objet en Javascript a un "prototype". Quand vous essayez d'accéder à // une propriété que l'objet n'a pas, l'interpréteur va regarder son prototype. -// Quelques implémentations de JS vous laissent accéder au prototype avec la -// propriété "magique" __proto__. Ceci peut être utile, mais n'est pas standard +// Quelques implémentations de JS vous laissent accéder au prototype avec la +// propriété "magique" __proto__. Ceci peut être utile, mais n'est pas standard // et ne fonctionne pas dans certains des navigateurs actuels. var myObj = { myString: 'Hello world!' @@ -478,7 +637,7 @@ String.prototype.firstCharacter = function(){ 'abc'.firstCharacter(); // = 'a' // C'est très souvent utilisé pour le "polyfilling", qui implémente des nouvelles -// fonctionnalités de JavaScript dans de plus anciens environnements, tels que +// fonctionnalités de JavaScript dans de plus anciens environnements, tels que // les vieux navigateurs. //Par exemple, Object.create est assez récent, mais peut être implémenté grâce à @@ -492,31 +651,83 @@ if (Object.create === undefined){ // pour ne pas reécrire si la fonction existe return new Constructor(); } } + +// *ES6:* Les objets peuvent être équipés de proxies qui permettent d'intercepter +// les actions sur leurs propriétés. Voici comment créer un proxy sur un objet : +var proxyObject = new Proxy(object, handler); + +// *ES6:* Les méthodes d'un objet handler sont appelées lors de l'interception d'une action. +// La méthode `.get()` est appelée à chaque lecture d'une propriété +// tandis que la méthode `.set()` est appelée à chaque écriture. +var handler = { + get (target, key) { + console.info('Get on property' + key); + return target[key]; + }, + set (target, key, value) { + console.info('Set on property' + key); + return true; + } +} + +// *ES6:* Les classes peuvent désormais être définies en utilisant le mot-clé `class`. +// Le constructeur s'appelle `constructor` et les méthodes statiques utilisent le mot-clé `static` +class Foo { + constructor() {console.log("constructing Foo");} + bar() {return "bar";} + static baz() {return "baz";} +} + +// *ES6:* Les objets issus des classes sont initialisés avec le mot-clé `new`. +// Il est possible d'hériter d'une classe avec le mot-clé `extends` +var FooObject = new Foo(); // = "constructing Foo" +class Zoo extends Foo {} + +// *ES6:* Les méthodes statiques doivent être appelées par la classe, les autres méthodes par l'objet +Foo.baz() // = "baz" +FooObject.bar() // = "bar" + +// *ES6:* Il est désormais possible d'exporter des valeurs en tant que module. +// Les exports peuvent être n'importe quel objet, valeur ou fonction. +var api = { + foo: "bar", + baz: "ponyfoo" +}; +export default api; + +// *ES6:* La syntaxe `export default` permet d'exporter l'objet sans en changer le nom. +// Il y a plusieurs façons de l'importer: +import coolapi from "api"; // = importe le module dans la variable `coolapi` +import {foo, baz} from "api"; // = importe les attributs `foo` et `baz` du module +import {foo as moo, baz} from "api"; // = importe les attributs `foo` (en le renommant `moo`) et `baz` du module +import _, {map} from "api"; // = importe les exports par défaut ET `map` +import * as coolapi from "api"; // = importe le namespace global du module + ``` ## Pour aller plus loin (en anglais) The [Mozilla Developer Network](https://developer.mozilla.org/fr-FR/docs/Web/JavaScript) expose une -excellente documentation pour le Javascript dans les navigateurs. Et contient +excellente documentation pour le Javascript dans les navigateurs. Et contient également un wiki pour s'entraider. MDN's [A re-introduction to JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript) recouvre les principaux sujets vus ici. Le guide est délibérément uniquement -à propos du JavaScript, et ne parle pas des navigateurs; pour cela, dirigez vous +à propos du JavaScript, et ne parle pas des navigateurs; pour cela, dirigez vous plutôt ici : [Document Object Model](https://developer.mozilla.org/en-US/docs/Using_the_W3C_DOM_Level_1_Core) -[Learn Javascript by Example and with Challenges](http://www.learneroo.com/modules/64/nodes/350) quelques challenges. +[Learn Javascript by Example and with Challenges](http://www.learneroo.com/modules/64/nodes/350) quelques challenges. [JavaScript Garden](http://bonsaiden.github.io/JavaScript-Garden/) is an in-depth un guide pour vous éviter les faux-amis dans le JavaScript. -[JavaScript: The Definitive Guide](http://www.amazon.com/gp/product/0596805527/) un classique. A lire. +[JavaScript: The Definitive Guide](http://www.amazon.com/gp/product/0596805527/) un classique. A lire. -En addition aux contributeurs de cet article, du contenu provient du +En addition aux contributeurs de cet article, du contenu provient du "Python tutorial" de Louie Dinh, et de [JS Tutorial](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript) sur le réseau Mozilla. From f2d6b50bd439e971386f775228d2b9960daa0efd Mon Sep 17 00:00:00 2001 From: Michel Antoine Date: Wed, 18 Nov 2015 23:54:39 -0800 Subject: [PATCH 657/685] Remove the iterator part and add for..in and for..of --- fr-fr/javascript-fr.html.markdown | 43 ++++++++++++------------------- 1 file changed, 16 insertions(+), 27 deletions(-) diff --git a/fr-fr/javascript-fr.html.markdown b/fr-fr/javascript-fr.html.markdown index fd1d40a3..f1977dac 100644 --- a/fr-fr/javascript-fr.html.markdown +++ b/fr-fr/javascript-fr.html.markdown @@ -268,33 +268,6 @@ foo // = "bar" var {foo} = {}; foo // = undefined -// *ES6:* ES6 ajoute les iterateurs. Pour accéder à l'iterateur de n'importe quel -// objet il faut utiliser la clé `Symbol.iterator`. -var iterator1 = myArr[Symbol.iterator]; // = returns iterator function - -// *ES6:* Si l'objet possède une valeur à la clé `Symbol.iterator` alors la -// collection est itérable -if (typeof myObj[Symbol.iterator] !== "undefined") { - console.log("You can iterate over myObj"); -} - -// *ES6:* En utilisant la méthode next() de l'iterateur nous recevons un objet -// avec deux propriétés : `value` et `done` -var iterator = myArr[Symbol.iterator]; // myArr = [1,2] -var myArrItem = null; - -myArrItem = iterator.next(); -myArrItem.value; // = 1 -myArrItem.done; // = false - -myArrItem = iterator.next(); -myArrItem.value; // = 2 -myArrItem.done; // = false - -myArrItem = iterator.next(); -myArrItem.value; // = undefined -myArrItem.done; // = true - // *ES6:* Les Maps sont des objets itérables de type clé-valeur. // Il est possible de créer une nouvelle map en utilisant `new Map()` var myMap = new Map(); @@ -347,6 +320,22 @@ for (var i = 0; i < 5; i++){ // sera exécutée 5 fois } +// La boucle for...in permet d'itérer sur les noms des propriétés d'un objet +var description = ""; +var person = {fname:"Paul", lname:"Ken", age:18}; +for (var x in person){ + description += person[x] + " "; +} +description; // = "Paul Ken 18 " + +// *ES6:* La boucle for...of permet d'itérer sur les propriétés d'un objet +var description = ""; +var person = {fname:"Paul", lname:"Ken", age:18}; +for (var x of person){ + description += x + " "; +} +description; // = "Paul Ken 18 " + // && est le "et" logique, || est le "ou" logique if (house.size === 'big' && house.colour === 'blue'){ house.contains = 'bear'; From 5a62ebbc85cf8c7436ba071b87fb4a584275ebbf Mon Sep 17 00:00:00 2001 From: Byaruhanga Franklin Date: Thu, 19 Nov 2015 15:51:08 +0300 Subject: [PATCH 658/685] Replaced 'or' with a semicolons Replaced 'or' with a semicolons since the paragraph above is talking about using semicolons --- erlang.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erlang.html.markdown b/erlang.html.markdown index d6ed7b86..a57f295f 100644 --- a/erlang.html.markdown +++ b/erlang.html.markdown @@ -177,7 +177,7 @@ is_dog(A) -> false. % A guard sequence is either a single guard or a series of guards, separated % by semicolons (`;`). The guard sequence `G1; G2; ...; Gn` is true if at % least one of the guards `G1`, `G2`, ..., `Gn` evaluates to `true`. -is_pet(A) when is_atom(A), (A =:= dog) or (A =:= cat) -> true; +is_pet(A) when is_atom(A), (A =:= dog);(A =:= cat) -> true; is_pet(A) -> false. % Warning: not all valid Erlang expressions can be used as guard expressions; From 20eb659e7bb16bbb133774e8e1d916869e1beb10 Mon Sep 17 00:00:00 2001 From: Terka Slan Date: Thu, 19 Nov 2015 17:59:11 +0100 Subject: [PATCH 659/685] Translated latex to slovak --- sk-sk/latex.html.markdown.tex | 227 ++++++++++++++++++++++++++++++++++ sk-sk/learn-latex-sk.tex | 209 +++++++++++++++++++++++++++++++ 2 files changed, 436 insertions(+) create mode 100644 sk-sk/latex.html.markdown.tex create mode 100644 sk-sk/learn-latex-sk.tex diff --git a/sk-sk/latex.html.markdown.tex b/sk-sk/latex.html.markdown.tex new file mode 100644 index 00000000..5e2f9c7f --- /dev/null +++ b/sk-sk/latex.html.markdown.tex @@ -0,0 +1,227 @@ +--- +language: latex +contributors: + - ["Chaitanya Krishna Ande", "http://icymist.github.io"] + - ["Colton Kohnke", "http://github.com/voltnor"] + - ["Sricharan Chiruvolu", "http://sricharan.xyz"] +translators: + - ["Terka Slanináková", "http://github.com/TerkaSlan"] +filename: learn-latex-sk.tex +--- + +```tex +% Všetky komentáre začínajú s % +% Viac-riadkové komentáre sa nedajú urobiť + +% LaTeX NIE JE WYSIWY ("What You See Is What You Get") software ako MS Word, alebo OpenOffice Writer + +% Každý LaTeX príkaz začína s opačným lomítkom (\) + +% LaTeX dokumenty začínajú s definíciou typu kompilovaného dokumentu +% Ostatné typy sú napríklad kniha (book), správa (report), prezentácia (presentation), atď. +% Možnosti dokumentu sa píšu do [] zátvoriek. V tomto prípade tam upresňujeme veľkosť (12pt) fontu. +\documentclass[12pt]{article} + +% Ďalej definujeme balíčky, ktoré dokuemnt používa. +% Ak chceš zahrnúť grafiku, farebný text, či zdrojový kód iného jazyka, musíš rozšíriť možnosti LaTeXu dodatočnými balíčkami. +% Zahŕňam float a caption. Na podporu slovenčiny treba zahrnúť aj utf8 balíček. +\usepackage{caption} +\usepackage{float} +\usepackage[utf8]{inputenc} +% Tu môžme definovať ostatné vlastnosti dokumentu! +% Autori tohto dokumentu, "\\*" znamená "choď na nový riadok" +\author{Chaitanya Krishna Ande, Colton Kohnke \& Sricharan Chiruvolu, \\*Preklad: Terka Slanináková} +% Vygeneruje dnešný dátum +\date{\today} +\title{Nauč sa LaTeX za Y Minút!} +% Teraz môžme začať pracovať na samotnom dokumente. +% Všetko do tohto riadku sa nazýva "Preambula" ("The Preamble") +\begin{document} +% ak zadáme položky author, date a title, LaTeX vytvorí titulnú stranu. +\maketitle + +% Väčšina odborných článkov má abstrakt, na jeho vytvorenie môžeš použiť preddefinované príkazy. +% Ten by sa mal zobraziť v logickom poradí, teda po hlavičke, +% no pred hlavnými sekciami tela.. +% Tento príkaz je tiež dostupný v triedach article a report. +% Tzv. makro "abstract" je fixnou súčasťou LaTeXu, ak chceme použiť abstract +% a napísať ho po slovensky, musíme ho redefinovať nasledujúcim príkazom +\renewcommand\abstractname{Abstrakt} + +\begin{abstract} +LaTeX dokumentácia v LaTeXe! Aké netradičné riešenie cudzieho nápadu! +\end{abstract} + +% Príkazy pre sekciu sú intuitívne +% Všetky nadpisy sekcií sú pridané automaticky do obsahu. +\section{Úvod} +Čaute, volám sa Colton a spoločne sa pustíme do skúmania LaTeXu (toho druhého)! + +\section{Ďalšia sekcia} +Toto je text ďalšej sekcie. Myslím, že potrebuje podsekciu. + +\subsection{Toto je podsekcia} % Podsekcie sú tiež intuitívne. +Zdá sa mi, že treba ďalšiu. + +\subsubsection{Pytagoras} +To je ono! +\label{subsec:pytagoras} + +% Použitím '*' môžeme potlačiť zabudované číslovanie LaTeXu. +% Toto funguje aj na iné príkazy. +\section*{Toto je nečíslovaná sekcia} +Všetky číslované byť nemusia! + +\section{Nejaké poznámočky} +Zarovnávať veci tam, kde ich chceš mať, je všeobecne ľahké. Ak +potrebuješ \\ nový \\ riadok \\ pridaj \textbackslash\textbackslash do +zdrojového kódu. \\ + +\section{Zoznamy} +Zoznamy sú jednou z najjednoduchších vecí vôbec! Treba mi zajtra nakúpiť, urobím si zoznam. +\begin{enumerate} % "enumerate" spustí číslovanie prvkov. + % \item povie LaTeXu, ako že treba pripočítať 1 + \item Vlašský šalát. + \item 5 rožkov. + \item 3 Horalky. + % číslovanie môžeme pozmeniť použitím [] + \item[koľko?] Stredne veľkých guličkoviek. + + Ja už nie som položka zoznamu, no stále som časť "enumerate". + +\end{enumerate} % Všetky prostredia končia s "end". + +\section{Matika} + +Jedným z primárnych použití LaTeXu je písanie akademických, či technických prác. Zvyčajne za použitia matematiky a vedy. Podpora špeciálnych symbolov preto nemôže chýbať!\\ + +Matematika má veľa symbolov, omnoho viac, než by klávesnica mohla reprezentovať; +Množinové a relačné symboly, šípky, operátory a Grécke písmená sú len malou ukážkou.\\ + +Množiny a relácie hrajú hlavnú rolu v mnohých matematických článkoch. +Takto napíšeš, že niečo platí pre všetky x patriace do X, $\forall$ x $\in$ X. \\ +% Všimni si, že som pridal $ pred a po symboloch. Je to +% preto, lebo pri písaní sme v textovom móde, +% no matematické symboly existujú len v matematickom. +% Vstúpime doňho z textového práve '$' znamienkami. +% Platí to aj opačne. Premenná môže byť zobrazená v matematickom móde takisto. +% Do matematického módu sa dá dostať aj s \[\] + +\[a^2 + b^2 = c^2 \] + +Moje obľúbené Grécke písmeno je $\xi$. Tiež sa mi pozdávajú $\beta$, $\gamma$ a $\sigma$. +Ešte som neprišiel na Grécke písmeno, ktoré by LaTeX nepoznal! + +Operátory sú dôležitou súčasťou matematických dokumentov: +goniometrické funkcie ($\sin$, $\cos$, $\tan$), +logaritmy and exponenciálne výrazy ($\log$, $\exp$), +limity ($\lim$), atď. +majú pred-definované LaTeXové príkazy. +Napíšme si rovnicu, nech vidíme, ako to funguje: \\ + +$\cos(2\theta) = \cos^{2}(\theta) - \sin^{2}(\theta)$ + +Zlomky(Čitateľ-menovateľ) sa píšu v týchto formách: + +% 10 / 7 +$^{10}/_{7}$ + +% Relatívne komplexné zlomky sa píšu ako +% \frac{čitateľ}{menovateľ} +$\frac{n!}{k!(n - k)!}$ \\ + +Rovnice tiež môžeme zadať v "rovnicovom prostredí". + +% Takto funguje rovnicové prostredie +\begin{equation} % vstúpi do matematického módu + c^2 = a^2 + b^2. + \label{eq:pythagoras} % na odkazovanie +\end{equation} % všetky \begin príkazy musia mať konečný príkaz. + +Teraz môžeme odkázať na novovytvorenú rovnicu! +Rovn.~\ref{eq:pythagoras} je tiež známa ako Pytagorova Veta, ktorá je tiež predmetom Sekc.~\ref{subsec:pytagoras}. Odkazovať môžme na veľa vecí, napr na: čísla, rovnice, či sekcie. + +Sumácie a Integrály sa píšu príkazmi sum a int: + +% Niektoré prekladače LaTeXu sa môžu sťažovať na prázdne riadky (ak tam sú) +% v rovnicovom prostredí. +\begin{equation} + \sum_{i=0}^{5} f_{i} +\end{equation} +\begin{equation} + \int_{0}^{\infty} \mathrm{e}^{-x} \mathrm{d}x +\end{equation} + +\section{Obrázky} + +Vloženie obrázku môže byť zložitejšie. Ja si vždy možnosti vloženia pozerám pre každý obrázok. +\renewcommand\figurename{Obrázok} +\begin{figure}[H] % H značí možnosť zarovnania. + \centering % nacentruje obrázok na stránku + % Vloží obrázok na 80% šírky stránky. + %\includegraphics[width=0.8\linewidth]{right-triangle.png} + % Zakomentované kvôli kompilácií, použi svoju predstavivosť :). + \caption{Pravouhlý trojuholník so stranami $a$, $b$, $c$} + \label{fig:right-triangle} +\end{figure} +% Opäť, fixné makro "table" nahradíme slovenskou tabuľkou. Pokiaľ preferuješ table, nasledujúci riadok nepridávaj +\renewcommand\tablename{Tabuľka} + +\subsection{Tabuľky} +Tabuľky sa vkládajú podobne ako obrázky. + +\begin{table}[H] + \caption{Nadpis tabuľky.} + % zátvorky: {} hovoria ako sa vykreslí každý riadok. + % Toto si nikdy nepamätám a vždy to musím hľadať. Všetko. Každý. Jeden. Raz! + \begin{tabular}{c|cc} + Číslo & Priezvisko & Krstné meno \\ % Stĺpce sú rozdelené $ + \hline % horizontálna čiara + 1 & Ladislav & Meliško \\ + 2 & Eva & Máziková + \end{tabular} +\end{table} + +% \section{Hyperlinks} % Už čoskoro :) + +\section{Prikáž LaTeXu nekompilovať (napr. Zdrojový Kód)} +Povedzme, že chceme do dokumentu vložiť zdrojový kód, budeme musieť LaTeXu povedať, nech sa ho nesnaží skompilovať, ale nech s ním pracuje ako s textom. +Toto sa robí vo verbatim prostredí. + +% Tiež sú na to špeciálne balíčky, (napr. minty, lstlisting, atď.) +% ale verbatim je to najzákladnejšie, čo môžeš použiť. +\begin{verbatim} + print("Hello World!") + a%b; pozri! Vo verbatime môžme použiť % znamienka. + random = 4; #priradené randomným hodom kockou +\end{verbatim} + +\section{Kompilácia} + +Už by bolo načase túto nádheru skompilovať a zhliadnuť jej úžasnú úžasnosť v podobe LaTeX pdfka, čo povieš? +(áno, tento dokument sa musí kompilovať). \\ +Cesta k finálnemu dokumentu pomocou LaTeXu pozostáva z nasledujúcich krokov: + \begin{enumerate} + \item Napíš dokument v čistom texte (v "zdrojáku"). + \item Skompiluj zdroják na získanie pdfka. + Kompilácia by mala vyzerať nasledovne (v Linuxe): \\ + \begin{verbatim} + $pdflatex learn-latex.tex learn-latex.pdf + \end{verbatim} + \end{enumerate} + +Mnoho LaTeX editorov kombinuje Krok 1 a Krok 2 v jednom prostredí. Krok 1 teda uvidíš, krok 2 už nie. +Ten sa deje za oponou. Kompilácia v 2. kroku sa postará o produkciu dokumentu v tebou zadanom formáte. + +\section{Koniec} + +To je zatiaľ všetko! + +% koniec dokumentu +\end{document} +``` + +## Viac o LaTeXe (anglicky) + +* Úžasná LaTeX wikikniha: [https://en.wikibooks.org/wiki/LaTeX](https://en.wikibooks.org/wiki/LaTeX) +* Naozajstný tutoriál: [http://www.latex-tutorial.com/](http://www.latex-tutorial.com/) diff --git a/sk-sk/learn-latex-sk.tex b/sk-sk/learn-latex-sk.tex new file mode 100644 index 00000000..5cc7b11f --- /dev/null +++ b/sk-sk/learn-latex-sk.tex @@ -0,0 +1,209 @@ +% Všetky komentáre začínajú s % +% Viac-riadkové komentáre sa nedajú urobiť + +% LaTeX NIE JE WYSIWY ("What You See Is What You Get") software ako MS Word, alebo OpenOffice Writer + +% Každý LaTeX príkaz začína s opačným lomítkom (\) + +% LaTeX dokumenty začínajú s definíciou typu kompilovaného dokumentu +% Ostatné typy sú napríklad kniha (book), správa (report), prezentácia (presentation), atď. +% Možnosti dokumentu sa píšu do [] zátvoriek. V tomto prípade tam upresňujeme veľkosť (12pt) fontu. +\documentclass[12pt]{article} + +% Ďalej definujeme balíčky, ktoré dokuemnt používa. +% Ak chceš zahrnúť grafiku, farebný text, či zdrojový kód iného jazyka, musíš rozšíriť možnosti LaTeXu dodatočnými balíčkami. +% Zahŕňam float a caption. Na podporu slovenčiny treba zahrnúť aj utf8 balíček. +\usepackage{caption} +\usepackage{float} +\usepackage[utf8]{inputenc} +% Tu môžme definovať ostatné vlastnosti dokumentu! +% Autori tohto dokumentu, "\\*" znamená "choď na nový riadok" +\author{Chaitanya Krishna Ande, Colton Kohnke \& Sricharan Chiruvolu, \\*Preklad: Terka Slanináková} +% Vygeneruje dnešný dátum +\date{\today} +\title{Nauč sa LaTeX za Y Minút!} +% Teraz môžme začať pracovať na samotnom dokumente. +% Všetko do tohto riadku sa nazýva "Preambula" ("The Preamble") +\begin{document} +% ak zadáme položky author, date a title, LaTeX vytvorí titulnú stranu. +\maketitle + +% Väčšina odborných článkov má abstrakt, na jeho vytvorenie môžeš použiť preddefinované príkazy. +% Ten by sa mal zobraziť v logickom poradí, teda po hlavičke, +% no pred hlavnými sekciami tela.. +% Tento príkaz je tiež dostupný v triedach article a report. +% Tzv. makro "abstract" je fixnou súčasťou LaTeXu, ak chceme použiť abstract +% a napísať ho po slovensky, musíme ho redefinovať nasledujúcim príkazom +\renewcommand\abstractname{Abstrakt} + +\begin{abstract} +LaTeX dokumentácia v LaTeXe! Aké netradičné riešenie cudzieho nápadu! +\end{abstract} + +% Príkazy pre sekciu sú intuitívne +% Všetky nadpisy sekcií sú pridané automaticky do obsahu. +\section{Úvod} +Čaute, volám sa Colton a spoločne sa pustíme do skúmania LaTeXu (toho druhého)! + +\section{Ďalšia sekcia} +Toto je text ďalšej sekcie. Myslím, že potrebuje podsekciu. + +\subsection{Toto je podsekcia} % Podsekcie sú tiež intuitívne. +Zdá sa mi, že treba ďalšiu. + +\subsubsection{Pytagoras} +To je ono! +\label{subsec:pytagoras} + +% Použitím '*' môžeme potlačiť zabudované číslovanie LaTeXu. +% Toto funguje aj na iné príkazy. +\section*{Toto je nečíslovaná sekcia} +Všetky číslované byť nemusia! + +\section{Nejaké poznámočky} +Zarovnávať veci tam, kde ich chceš mať, je všeobecne ľahké. Ak +potrebuješ \\ nový \\ riadok \\ pridaj \textbackslash\textbackslash do +zdrojového kódu. \\ + +\section{Zoznamy} +Zoznamy sú jednou z najjednoduchších vecí vôbec! Treba mi zajtra nakúpiť, urobím si zoznam. +\begin{enumerate} % "enumerate" spustí číslovanie prvkov. + % \item povie LaTeXu, ako že treba pripočítať 1 + \item Vlašský šalát. + \item 5 rožkov. + \item 3 Horalky. + % číslovanie môžeme pozmeniť použitím [] + \item[koľko?] Stredne veľkých guličkoviek. + + Ja už nie som položka zoznamu, no stále som časť "enumerate". + +\end{enumerate} % Všetky prostredia končia s "end". + +\section{Matika} + +Jedným z primárnych použití LaTeXu je písanie akademických, či technických prác. Zvyčajne za použitia matematiky a vedy. Podpora špeciálnych symbolov preto nemôže chýbať!\\ + +Matematika má veľa symbolov, omnoho viac, než by klávesnica mohla reprezentovať; +Množinové a relačné symboly, šípky, operátory a Grécke písmená sú len malou ukážkou.\\ + +Množiny a relácie hrajú hlavnú rolu v mnohých matematických článkoch. +Takto napíšeš, že niečo platí pre všetky x patriace do X, $\forall$ x $\in$ X. \\ +% Všimni si, že som pridal $ pred a po symboloch. Je to +% preto, lebo pri písaní sme v textovom móde, +% no matematické symboly existujú len v matematickom. +% Vstúpime doňho z textového práve '$' znamienkami. +% Platí to aj opačne. Premenná môže byť zobrazená v matematickom móde takisto. +% Do matematického módu sa dá dostať aj s \[\] + +\[a^2 + b^2 = c^2 \] + +Moje obľúbené Grécke písmeno je $\xi$. Tiež sa mi pozdávajú $\beta$, $\gamma$ a $\sigma$. +Ešte som neprišiel na Grécke písmeno, ktoré by LaTeX nepoznal! + +Operátory sú dôležitou súčasťou matematických dokumentov: +goniometrické funkcie ($\sin$, $\cos$, $\tan$), +logaritmy and exponenciálne výrazy ($\log$, $\exp$), +limity ($\lim$), atď. +majú pred-definované LaTeXové príkazy. +Napíšme si rovnicu, nech vidíme, ako to funguje: \\ + +$\cos(2\theta) = \cos^{2}(\theta) - \sin^{2}(\theta)$ + +Zlomky(Čitateľ-menovateľ) sa píšu v týchto formách: + +% 10 / 7 +$^{10}/_{7}$ + +% Relatívne komplexné zlomky sa píšu ako +% \frac{čitateľ}{menovateľ} +$\frac{n!}{k!(n - k)!}$ \\ + +Rovnice tiež môžeme zadať v "rovnicovom prostredí". + +% Takto funguje rovnicové prostredie +\begin{equation} % vstúpi do matematického módu + c^2 = a^2 + b^2. + \label{eq:pythagoras} % na odkazovanie +\end{equation} % všetky \begin príkazy musia mať konečný príkaz. + +Teraz môžeme odkázať na novovytvorenú rovnicu! +Rovn.~\ref{eq:pythagoras} je tiež známa ako Pytagorova Veta, ktorá je tiež predmetom Sekc.~\ref{subsec:pytagoras}. Odkazovať môžme na veľa vecí, napr na: čísla, rovnice, či sekcie. + +Sumácie a Integrály sa píšu príkazmi sum a int: + +% Niektoré prekladače LaTeXu sa môžu sťažovať na prázdne riadky (ak tam sú) +% v rovnicovom prostredí. +\begin{equation} + \sum_{i=0}^{5} f_{i} +\end{equation} +\begin{equation} + \int_{0}^{\infty} \mathrm{e}^{-x} \mathrm{d}x +\end{equation} + +\section{Obrázky} + +Vloženie obrázku môže byť zložitejšie. Ja si vždy možnosti vloženia pozerám pre každý obrázok. +\renewcommand\figurename{Obrázok} +\begin{figure}[H] % H značí možnosť zarovnania. + \centering % nacentruje obrázok na stránku + % Vloží obrázok na 80% šírky stránky. + %\includegraphics[width=0.8\linewidth]{right-triangle.png} + % Zakomentované kvôli kompilácií, použi svoju predstavivosť :). + \caption{Pravouhlý trojuholník so stranami $a$, $b$, $c$} + \label{fig:right-triangle} +\end{figure} +% Opäť, fixné makro "table" nahradíme slovenskou tabuľkou. Pokiaľ preferuješ table, nasledujúci riadok nepridávaj +\renewcommand\tablename{Tabuľka} + +\subsection{Tabuľky} +Tabuľky sa vkládajú podobne ako obrázky. + +\begin{table}[H] + \caption{Nadpis tabuľky.} + % zátvorky: {} hovoria ako sa vykreslí každý riadok. + % Toto si nikdy nepamätám a vždy to musím hľadať. Všetko. Každý. Jeden. Raz! + \begin{tabular}{c|cc} + Číslo & Priezvisko & Krstné meno \\ % Stĺpce sú rozdelené $ + \hline % horizontálna čiara + 1 & Ladislav & Meliško \\ + 2 & Eva & Máziková + \end{tabular} +\end{table} + +% \section{Hyperlinks} % Už čoskoro :) + +\section{Prikáž LaTeXu nekompilovať (napr. Zdrojový Kód)} +Povedzme, že chceme do dokumentu vložiť zdrojový kód, budeme musieť LaTeXu povedať, nech sa ho nesnaží skompilovať, ale nech s ním pracuje ako s textom. +Toto sa robí vo verbatim prostredí. + +% Tiež sú na to špeciálne balíčky, (napr. minty, lstlisting, atď.) +% ale verbatim je to najzákladnejšie, čo môžeš použiť. +\begin{verbatim} + print("Hello World!") + a%b; pozri! Vo verbatime môžme použiť % znamienka. + random = 4; #priradené randomným hodom kockou +\end{verbatim} + +\section{Kompilácia} + +Už by bolo načase túto nádheru skompilovať a zhliadnuť jej úžasnú úžasnosť v podobe LaTeX pdfka, čo povieš? +(áno, tento dokument sa musí kompilovať). \\ +Cesta k finálnemu dokumentu pomocou LaTeXu pozostáva z nasledujúcich krokov: + \begin{enumerate} + \item Napíš dokument v čistom texte (v "zdrojáku"). + \item Skompiluj zdroják na získanie pdfka. + Kompilácia by mala vyzerať nasledovne (v Linuxe): \\ + \begin{verbatim} + $pdflatex learn-latex.tex learn-latex.pdf + \end{verbatim} + \end{enumerate} + +Mnoho LaTeX editorov kombinuje Krok 1 a Krok 2 v jednom prostredí. Krok 1 teda uvidíš, krok 2 už nie. +Ten sa deje za oponou. Kompilácia v 2. kroku sa postará o produkciu dokumentu v tebou zadanom formáte. + +\section{Koniec} + +To je zatiaľ všetko! + +% koniec dokumentu +\end{document} From bb1e07bbb7d6555d8875c03b82c5a05f8cf06c37 Mon Sep 17 00:00:00 2001 From: Kate Reading Date: Thu, 19 Nov 2015 11:23:19 -0800 Subject: [PATCH 660/685] Clarified grammar in LearnCSharp comment about naming files relative to the classes they contain. Otherwise the two comment lines blended together and were a little comfusing. --- csharp.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csharp.html.markdown b/csharp.html.markdown index dfdd98de..677c2591 100644 --- a/csharp.html.markdown +++ b/csharp.html.markdown @@ -45,8 +45,8 @@ using System.Data.Entity; // Using this code from another source file: using Learning.CSharp; namespace Learning.CSharp { - // Each .cs file should at least contain a class with the same name as the file - // you're allowed to do otherwise, but shouldn't for sanity. + // Each .cs file should at least contain a class with the same name as the file. + // You're allowed to do otherwise, but shouldn't for sanity. public class LearnCSharp { // BASIC SYNTAX - skip to INTERESTING FEATURES if you have used Java or C++ before From dff8b792c6ba946302af52e3fba113e8364ea214 Mon Sep 17 00:00:00 2001 From: Ryan Gonzalez Date: Thu, 19 Nov 2015 17:53:49 -0600 Subject: [PATCH 661/685] Fix typo in Perl 6 example (closes #2025) --- perl6.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl6.html.markdown b/perl6.html.markdown index 9f55718c..1829f964 100644 --- a/perl6.html.markdown +++ b/perl6.html.markdown @@ -373,7 +373,7 @@ say @array[^10]; # you can pass arrays as subscripts and it'll return say join(' ', @array[15..*]); #=> 15 16 17 18 19 # which is equivalent to: say join(' ', @array[-> $n { 15..$n }]); -# Note: if you try to do either of those with an infinite loop, +# Note: if you try to do either of those with an infinite array, # you'll trigger an infinite loop (your program won't finish) # You can use that in most places you'd expect, even assigning to an array From 30e364f4108fc077343a8722f3d80150f0d250fe Mon Sep 17 00:00:00 2001 From: Louis Christopher Date: Sat, 21 Nov 2015 19:28:59 +0530 Subject: [PATCH 662/685] Fixed erroneous output stated in a comment range( start = lower limit, End is < Upper limit , Step) The upper limit is never printed. Fixed the error. --- python3.html.markdown | 1 - 1 file changed, 1 deletion(-) diff --git a/python3.html.markdown b/python3.html.markdown index 1f9d0e42..3ba57738 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -425,7 +425,6 @@ by step. If step is not indicated, the default value is 1. prints: 4 6 - 8 """ for i in range(4, 8, 2): print(i) From 3c4a2ff91c6d52ccc928e1c26a28e1fdcbc7c064 Mon Sep 17 00:00:00 2001 From: Louis Christopher Date: Sat, 21 Nov 2015 19:44:23 +0530 Subject: [PATCH 663/685] Fixed erroneous output and added a little clarity on the matter list.index(argument) would return the index of the item in the list that first matched the argument It will not return the value stored at the index of the argument as it was prior. Added some more clarity to the subject as well. --- python3.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python3.html.markdown b/python3.html.markdown index 3ba57738..8cc03320 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -224,8 +224,8 @@ li.remove(2) # Raises a ValueError as 2 is not in the list # Insert an element at a specific index li.insert(1, 2) # li is now [1, 2, 3] again -# Get the index of the first item found -li.index(2) # => 3 +# Get the index of the first item found matching the argument +li.index(2) # => 1 li.index(4) # Raises a ValueError as 4 is not in the list # You can add lists From 7933ea3ce029a3418bac04210e0dd7f0f27e275d Mon Sep 17 00:00:00 2001 From: Gnomino Date: Sat, 21 Nov 2015 19:08:39 +0100 Subject: [PATCH 664/685] Applies a1ed02d6fad2b39137f52c6a04264a59e237d747 to translations --- cs-cz/python3.html.markdown | 2 +- es-es/python3-es.html.markdown | 2 +- fr-fr/python3-fr.html.markdown | 2 +- ru-ru/python3-ru.html.markdown | 2 +- tr-tr/python3-tr.html.markdown | 2 +- zh-cn/python3-cn.html.markdown | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cs-cz/python3.html.markdown b/cs-cz/python3.html.markdown index 6d2fd1eb..b498046a 100644 --- a/cs-cz/python3.html.markdown +++ b/cs-cz/python3.html.markdown @@ -566,7 +566,7 @@ Clovek.odkaslej_si() # => "*ehm*" # Lze importovat moduly import math -print(math.sqrt(16)) # => 4 +print(math.sqrt(16.0)) # => 4 # Lze také importovat pouze vybrané funkce z modulu from math import ceil, floor diff --git a/es-es/python3-es.html.markdown b/es-es/python3-es.html.markdown index 1c69481a..d30af1c8 100644 --- a/es-es/python3-es.html.markdown +++ b/es-es/python3-es.html.markdown @@ -478,7 +478,7 @@ Humano.roncar() #=> "*roncar*" # Puedes importar módulos import math -print(math.sqrt(16)) #=> 4 +print(math.sqrt(16)) #=> 4.0 # Puedes obtener funciones específicas desde un módulo from math import ceil, floor diff --git a/fr-fr/python3-fr.html.markdown b/fr-fr/python3-fr.html.markdown index 04d0a55d..3d60157c 100644 --- a/fr-fr/python3-fr.html.markdown +++ b/fr-fr/python3-fr.html.markdown @@ -627,7 +627,7 @@ Human.grunt() # => "*grunt*" # On peut importer des modules import math -print(math.sqrt(16)) # => 4 +print(math.sqrt(16)) # => 4.0 # On peut importer des fonctions spécifiques d'un module from math import ceil, floor diff --git a/ru-ru/python3-ru.html.markdown b/ru-ru/python3-ru.html.markdown index 2a7b3f7b..2b6b59a7 100644 --- a/ru-ru/python3-ru.html.markdown +++ b/ru-ru/python3-ru.html.markdown @@ -549,7 +549,7 @@ Human.grunt() #=> "*grunt*" # Вы можете импортировать модули import math -print(math.sqrt(16)) #=> 4 +print(math.sqrt(16)) #=> 4.0 # Вы можете импортировать отдельные функции модуля from math import ceil, floor diff --git a/tr-tr/python3-tr.html.markdown b/tr-tr/python3-tr.html.markdown index 2477c5da..c7de2922 100644 --- a/tr-tr/python3-tr.html.markdown +++ b/tr-tr/python3-tr.html.markdown @@ -538,7 +538,7 @@ Insan.grunt() # => "*grunt*" # Modülleri içe aktarabilirsiniz import math -print(math.sqrt(16)) # => 4 +print(math.sqrt(16)) # => 4.0 # Modülden belirli bir fonksiyonları alabilirsiniz from math import ceil, floor diff --git a/zh-cn/python3-cn.html.markdown b/zh-cn/python3-cn.html.markdown index c223297c..76455a46 100644 --- a/zh-cn/python3-cn.html.markdown +++ b/zh-cn/python3-cn.html.markdown @@ -535,7 +535,7 @@ Human.grunt() # => "*grunt*" # 用import导入模块 import math -print(math.sqrt(16)) # => 4 +print(math.sqrt(16)) # => 4.0 # 也可以从模块中导入个别值 from math import ceil, floor From e7dc56273f07066e2b4da1c02e3f723b8da834a0 Mon Sep 17 00:00:00 2001 From: Leslie Zhang Date: Mon, 23 Nov 2015 09:14:49 +0800 Subject: [PATCH 665/685] Replace Hash#has_key? with Hash#key? 1. Replace Hash#has_key? with Hash#key? 2. Replace Hash#has_value? with Hash#value? --- ruby.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruby.html.markdown b/ruby.html.markdown index 243f788b..cf1a18e3 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -230,8 +230,8 @@ new_hash = { defcon: 3, action: true } new_hash.keys #=> [:defcon, :action] # Check existence of keys and values in hash -new_hash.has_key?(:defcon) #=> true -new_hash.has_value?(3) #=> true +new_hash.key?(:defcon) #=> true +new_hash.value?(3) #=> true # Tip: Both Arrays and Hashes are Enumerable # They share a lot of useful methods such as each, map, count, and more From 50fca171c53ca5c1de63c9a09ca457df0767f713 Mon Sep 17 00:00:00 2001 From: "C. Bess" Date: Mon, 23 Nov 2015 13:12:49 -0600 Subject: [PATCH 666/685] - added error handling example - add do-try-catch examples - add throw example --- swift.html.markdown | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/swift.html.markdown b/swift.html.markdown index df9c5092..33ff8451 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -345,6 +345,44 @@ let namesTable = NamesTable(names: ["Me", "Them"]) let name = namesTable[1] print("Name is \(name)") // Name is Them +// +// MARK: Error Handling +// + +// The `ErrorType` protocol is used when throwing errors to catch +enum MyError: ErrorType { + case BadValue(msg: String) + case ReallyBadValue(msg: String) +} + +// functions marked with `throws` must be called using `try` +func fakeFetch(value: Int) throws -> String { + guard 7 == value else { + throw MyError.ReallyBadValue(msg: "Some really bad value") + } + + return "test" +} + +func testTryStuff() { + // assumes there will be no error thrown, otherwise a runtime exception is raised + let _ = try! fakeFetch(7) + + // if an error is thrown, then it proceeds, but if the value is nil + // it also wraps every return value in an optional, even if its already optional + let _ = try? fakeFetch(7) + + do { + // normal try operation that provides error handling via `catch` block + try fakeFetch(1) + } catch MyError.BadValue(let msg) { + print("Error message: \(msg)") + } catch { + // must be exhaustive + } +} +testTryStuff() + // // MARK: Classes // @@ -559,7 +597,7 @@ class MyShape: Rect { // `extension`s: Add extra functionality to an already existing type -// Square now "conforms" to the `Printable` protocol +// Square now "conforms" to the `CustomStringConvertible` protocol extension Square: CustomStringConvertible { var description: String { return "Area: \(self.getArea()) - ID: \(self.identifier)" From 083eb1c4a5ef1da2249ad9640bc2f62cf9f95af0 Mon Sep 17 00:00:00 2001 From: Laoujin Date: Fri, 27 Nov 2015 00:19:06 +0100 Subject: [PATCH 667/685] [PowerShell/en] intro --- powershell.html.markdown | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 powershell.html.markdown diff --git a/powershell.html.markdown b/powershell.html.markdown new file mode 100644 index 00000000..5ec18afb --- /dev/null +++ b/powershell.html.markdown @@ -0,0 +1,56 @@ +--- +category: tool +tool: powershell +contributors: + - ["Wouter Van Schandevijl", "https://github.com/laoujin"] +filename: LearnPowershell.ps1 +--- + +PowerShell is the Windows scripting language and configuration management framework from Microsoft built on the .NET Framework. Windows 7 and up ship with PowerShell. +Nearly all examples below can be a part of a shell script or executed directly in the shell. + +A key difference with Bash is that it is mostly objects that you manipulate rather than plain text. + +[Read more here.](https://technet.microsoft.com/en-us/library/bb978526.aspx) + +```powershell +# As you already figured, comments start with # + +# Simple hello world example: +echo Hello world! +# echo is an alias for Write-Output (=cmdlet) +# Most cmdlets and functions follow the Verb-Noun naming convention + +# Each command starts on a new line, or after semicolon: +echo 'This is the first line'; echo 'This is the second line' + +# Declaring a variable looks like this: +$Variable="Some string" +# Or like this: +$Variable1 = "Another string" + +# Using the variable: +echo $Variable +echo "$Variable" +echo '$($Variable + '1')' +echo @" +This is a Here-String +$Variable +"@ +# Note that ' (single quote) won't expand the variables! +# Here-Strings also work with single quote + +# Builtin variables: +# There are some useful builtin variables, like +echo "Booleans: $TRUE and $FALSE" +echo "Empty value: $NULL" +echo "Last program's return value: $?" +echo "Script's PID: $PID" +echo "Number of arguments passed to script: $#" +echo "All arguments passed to script: $Args" +echo "Script's arguments separated into different variables: $1 $2..." + +# Reading a value from input: +$Name = Read-Host "What's your name?" +echo "Hello, $Name!" +[int]$Age = Read-Host "What's your age?" \ No newline at end of file From 4d44e241d72b160c31e74db29ff389371d35579f Mon Sep 17 00:00:00 2001 From: Laoujin Date: Fri, 27 Nov 2015 01:07:45 +0100 Subject: [PATCH 668/685] [PowerShell/en] execution-policy, builtin variables, configure your shell --- powershell.html.markdown | 60 +++++++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/powershell.html.markdown b/powershell.html.markdown index 5ec18afb..2a7deee1 100644 --- a/powershell.html.markdown +++ b/powershell.html.markdown @@ -13,6 +13,22 @@ A key difference with Bash is that it is mostly objects that you manipulate rath [Read more here.](https://technet.microsoft.com/en-us/library/bb978526.aspx) +If you are uncertain about your environment: +```powershell +Get-ExecutionPolicy -List +Set-ExecutionPolicy AllSigned +# Execution policies include: +# - Restricted: Scripts won't run. +# - RemoteSigned: Downloaded scripts run only if signed by a trusted publisher. +# - AllSigned: Scripts need to be signed by a trusted publisher. +# - Unrestricted: Run all scripts. +help about_Execution_Policies # for more info + +# Current PowerShell version: +$PSVersionTable +``` + +The tutorial starts here: ```powershell # As you already figured, comments start with # @@ -25,17 +41,18 @@ echo Hello world! echo 'This is the first line'; echo 'This is the second line' # Declaring a variable looks like this: -$Variable="Some string" +$aString="Some string" # Or like this: -$Variable1 = "Another string" +$aNumber = 5 # Using the variable: -echo $Variable -echo "$Variable" -echo '$($Variable + '1')' +echo $aString +echo "Interpolation: $aString" +echo "`$aString has length of $($aString.length)" +echo '$aString' echo @" This is a Here-String -$Variable +$aString "@ # Note that ' (single quote) won't expand the variables! # Here-Strings also work with single quote @@ -45,12 +62,35 @@ $Variable echo "Booleans: $TRUE and $FALSE" echo "Empty value: $NULL" echo "Last program's return value: $?" +echo "Exit code of last run Windows-based program: $LastExitCode" +echo "The last token in the last line received by the session: $$" +echo "The first token: $^" echo "Script's PID: $PID" -echo "Number of arguments passed to script: $#" -echo "All arguments passed to script: $Args" -echo "Script's arguments separated into different variables: $1 $2..." +echo "Full path of current script directory: $PSScriptRoot" +echo 'Full path of current script: ' + $MyInvocation.MyCommand.Path +echo "FUll path of current directory: $Pwd" +echo "Bound arguments in a function, script or code block: $PSBoundParameters" +echo "Unbound arguments: $($Args -join ', ')." ######################## MOVE THIS TO FUNCTIONS +# More builtins: `help about_Automatic_Variables` # Reading a value from input: $Name = Read-Host "What's your name?" echo "Hello, $Name!" -[int]$Age = Read-Host "What's your age?" \ No newline at end of file +[int]$Age = Read-Host "What's your age?" + + + + +``` + + +Configuring your shell +```powershell +# $Profile is the full path for your `Microsoft.PowerShell_profile.ps1` +# All code there will be executed when the PS session starts +if (-not (Test-Path $Profile)) { + New-Item -Type file -Path $Profile -Force + notepad $Profile +} +# More info: `help about_profiles` +``` \ No newline at end of file From bc47915c8f09fc586e47fd37fef76f6d27a0a8b8 Mon Sep 17 00:00:00 2001 From: Laoujin Date: Fri, 27 Nov 2015 02:37:30 +0100 Subject: [PATCH 669/685] [PowerShell/en] control-flow, pipeline, getting help --- powershell.html.markdown | 96 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 95 insertions(+), 1 deletion(-) diff --git a/powershell.html.markdown b/powershell.html.markdown index 2a7deee1..be802916 100644 --- a/powershell.html.markdown +++ b/powershell.html.markdown @@ -28,6 +28,18 @@ help about_Execution_Policies # for more info $PSVersionTable ``` +Getting help: +```powershell +# Find commands +Get-Command about_* # alias: gcm +Get-Command -Verb Add +Get-Alias ps +Get-Alias -Definition Get-Process + +Get-Help ps | less # alias: help +ps | Get-Member # alias: gm +``` + The tutorial starts here: ```powershell # As you already figured, comments start with # @@ -44,8 +56,10 @@ echo 'This is the first line'; echo 'This is the second line' $aString="Some string" # Or like this: $aNumber = 5 +$aList = 1,2,3,4,5 +$aHashtable = @{name1='val1'; name2='val2'} -# Using the variable: +# Using variables: echo $aString echo "Interpolation: $aString" echo "`$aString has length of $($aString.length)" @@ -78,7 +92,87 @@ $Name = Read-Host "What's your name?" echo "Hello, $Name!" [int]$Age = Read-Host "What's your age?" +# Control Flow +# We have the usual if structure: +if ($Age -is [string]) { + echo 'But.. $Age cannot be a string!' +} elseif ($Age -lt 12 -and $Age -gt 0) { + echo 'Child (Less than 12. Greater than 0)' +} else { + echo 'Adult' +} +# Switch statements are more powerfull compared to most languages +$val = "20" +switch($val) { + { $_ -eq 42 } { "The answer equals 42"; break } + '20' { "Exactly 20"; break } + { $_ -like 's*' } { "Case insensitive"; break } + { $_ -clike 's*'} { "clike, ceq, cne for case sensitive"; break } + { $_ -notmatch '^.*$'} { "Regex matching. cnotmatch, cnotlike, ..."; break } + { 'x' -contains 'x'} { "FALSE! -contains is for lists!"; break } + default { "Others" } +} + +# The classic for +for($i = 1; $i -le 10; $i++) { + "Loop number $i" +} +# Or shorter +1..10 | % { "Loop number $_" } + +# PowerShell also offers +foreach ($var in 'val1','val2','val3') { echo $var } +# while () {} +# do {} while () +# do {} until () + + +# List files and directories in the current directory +ls # or `dir` +cd ~ # goto home + +Get-Alias ls # -> Get-ChildItem +# Uh!? These cmdlets have generic names because unlike other scripting +# languages, PowerShell does not only operate in the current directory. +cd HKCU: # go to the HKEY_CURRENT_USER registry hive + +# Get all providers in your session +Get-PSProvider + +# Cmdlets have parameters that control their execution: +Get-ChildItem -Filter *.txt -Name # Get just the name of all txt files +# Only need to type as much of a parameter name until it is no longer ambiguous +ls -fi *.txt -n # -f is not possible because -Force also exists +# Use `Get-Help Get-ChildItem -Full` for a complete overview + +# Results of the previous cmdlet can be passed to the next as input. +# grep cmdlet filters the input with provided patterns. +# `$_` is the current object in the pipeline object. +ls | Where-Object { $_.Name -match 'c' } | Export-CSV export.txt +ls | ? { $_.Name -match 'c' } | ConvertTo-HTML | Out-File export.html + +# If you get confused in the pipeline use `Get-Member` for an overview +# of the available methods and properties of the pipelined objects: +ls | Get-Member +Get-Date | gm + +# ` is the line continuation character. Or end the line with a | +Get-Process | Sort-Object ID -Descending | Select-Object -First 10 Name,ID,VM ` + | Stop-Process -WhatIf + +Get-EventLog Application -After (Get-Date).AddHours(-2) | Format-List + +# Use % as a shorthand for ForEach-Object +(a,b,c) | ForEach-Object ` + -Begin { "Starting"; $counter = 0 } ` + -Process { "Processing $_"; $counter++ } ` + -End { "Finishing: $counter" } + +# Get-Process as a table with three columns +# The third column is the value of the VM property in MB and 2 decimal places +# Computed columns can be written more succinctly as: `@{n='lbl';e={$_}` +ps | Format-Table ID,Name,@{name='VM(MB)';expression={'{0:n2}' -f ($_.VM / 1MB)}} -autoSize ``` From 0b7c612c3ed5c82b05bca22bcf3622e37fe55581 Mon Sep 17 00:00:00 2001 From: Laoujin Date: Fri, 27 Nov 2015 03:49:34 +0100 Subject: [PATCH 670/685] [PowerShell/en] IO, Interesting Projects, Not Covered, Exception Handling, UseFull stuff, max line 80. --- powershell.html.markdown | 144 +++++++++++++++++++++++++++++++++++---- 1 file changed, 129 insertions(+), 15 deletions(-) diff --git a/powershell.html.markdown b/powershell.html.markdown index be802916..6f38c45c 100644 --- a/powershell.html.markdown +++ b/powershell.html.markdown @@ -6,10 +6,14 @@ contributors: filename: LearnPowershell.ps1 --- -PowerShell is the Windows scripting language and configuration management framework from Microsoft built on the .NET Framework. Windows 7 and up ship with PowerShell. -Nearly all examples below can be a part of a shell script or executed directly in the shell. +PowerShell is the Windows scripting language and configuration management +framework from Microsoft built on the .NET Framework. Windows 7 and up ship +with PowerShell. +Nearly all examples below can be a part of a shell script or executed directly +in the shell. -A key difference with Bash is that it is mostly objects that you manipulate rather than plain text. +A key difference with Bash is that it is mostly objects that you manipulate +rather than plain text. [Read more here.](https://technet.microsoft.com/en-us/library/bb978526.aspx) @@ -38,6 +42,10 @@ Get-Alias -Definition Get-Process Get-Help ps | less # alias: help ps | Get-Member # alias: gm + +Show-Command Get-EventLog # Display GUI to fill in the parameters + +Update-Help # Run as admin ``` The tutorial starts here: @@ -49,20 +57,21 @@ echo Hello world! # echo is an alias for Write-Output (=cmdlet) # Most cmdlets and functions follow the Verb-Noun naming convention -# Each command starts on a new line, or after semicolon: +# Each command starts on a new line, or after a semicolon: echo 'This is the first line'; echo 'This is the second line' # Declaring a variable looks like this: $aString="Some string" # Or like this: -$aNumber = 5 +$aNumber = 5 -as [double] $aList = 1,2,3,4,5 +$aString = $aList -join '--' # yes, -split exists also $aHashtable = @{name1='val1'; name2='val2'} # Using variables: echo $aString echo "Interpolation: $aString" -echo "`$aString has length of $($aString.length)" +echo "`$aString has length of $($aString.Length)" echo '$aString' echo @" This is a Here-String @@ -84,15 +93,14 @@ echo "Full path of current script directory: $PSScriptRoot" echo 'Full path of current script: ' + $MyInvocation.MyCommand.Path echo "FUll path of current directory: $Pwd" echo "Bound arguments in a function, script or code block: $PSBoundParameters" -echo "Unbound arguments: $($Args -join ', ')." ######################## MOVE THIS TO FUNCTIONS +echo "Unbound arguments: $($Args -join ', ')." # More builtins: `help about_Automatic_Variables` -# Reading a value from input: -$Name = Read-Host "What's your name?" -echo "Hello, $Name!" -[int]$Age = Read-Host "What's your age?" +# Inline another file (dot operator) +. .\otherScriptName.ps1 -# Control Flow + +### Control Flow # We have the usual if structure: if ($Age -is [string]) { echo 'But.. $Age cannot be a string!' @@ -127,7 +135,14 @@ foreach ($var in 'val1','val2','val3') { echo $var } # do {} while () # do {} until () +# Exception handling +try {} catch {} finally {} +try {} catch [System.NullReferenceException] { + echo $_.Exception | Format-List -Force +} + +### Providers # List files and directories in the current directory ls # or `dir` cd ~ # goto home @@ -140,6 +155,8 @@ cd HKCU: # go to the HKEY_CURRENT_USER registry hive # Get all providers in your session Get-PSProvider + +### Pipeline # Cmdlets have parameters that control their execution: Get-ChildItem -Filter *.txt -Name # Get just the name of all txt files # Only need to type as much of a parameter name until it is no longer ambiguous @@ -171,10 +188,96 @@ Get-EventLog Application -After (Get-Date).AddHours(-2) | Format-List # Get-Process as a table with three columns # The third column is the value of the VM property in MB and 2 decimal places -# Computed columns can be written more succinctly as: `@{n='lbl';e={$_}` -ps | Format-Table ID,Name,@{name='VM(MB)';expression={'{0:n2}' -f ($_.VM / 1MB)}} -autoSize +# Computed columns can be written more verbose as: +# `@{name='lbl';expression={$_}` +ps | Format-Table ID,Name,@{n='VM(MB)';e={'{0:n2}' -f ($_.VM / 1MB)}} -autoSize +### Functions +# The [string] attribute is optional. +function foo([string]$name) { + echo "Hey $name, have a function" +} + +# Calling your function +foo "Say my name" + +# Functions with named parameters, parameter attributes, parsable documention +<# +.SYNOPSIS +Setup a new website +.DESCRIPTION +Creates everything your new website needs for much win +.PARAMETER siteName +The name for the new website +.EXAMPLE +New-Website -Name FancySite -Po 5000 +New-Website SiteWithDefaultPort +New-Website siteName 2000 # ERROR! Port argument could not be validated +('name1','name2') | New-Website -Verbose +#> +function New-Website() { + [CmdletBinding()] + param ( + [Parameter(ValueFromPipeline=$true, Mandatory=$true)] + [Alias('name')] + [string]$siteName, + [ValidateSet(3000,5000,8000)] + [int]$port = 3000 + ) + BEGIN { Write-Verbose 'Creating new website(s)' } + PROCESS { echo "name: $siteName, port: $port" } + END { Write-Verbose 'Website(s) created' } +} + + +### It's all .NET +# A PS string is in fact a .NET System.String +# All .NET methods and properties are thus available +'string'.ToUpper().Replace('G', 'ggg') +# Or more powershellish +'string'.ToUpper() -replace 'G', 'ggg' + +# Unsure how that .NET method is called again? +'string' | gm + +# Syntax for calling static .NET methods +[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') + +# Note that .NET functions MUST be called with parentheses +# while PS functions CANNOT be called with parentheses +$writer = New-Object System.IO.StreamWriter($path, $true) +$writer.Write([Environment]::NewLine) +$write.Dispose() + +### IO +# Reading a value from input: +$Name = Read-Host "What's your name?" +echo "Hello, $Name!" +[int]$Age = Read-Host "What's your age?" + +# Test-Path, Split-Path, Join-Path, Resolve-Path +# Get-Content filename # returns a string[] +# Set-Content, Add-Content, Clear-Content +Get-Command ConvertTo-*,ConvertFrom-* + + +### Useful stuff +# Refresh your PATH +$env:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User") +# Find Python in path +$env:PATH.Split(";") | Where-Object { $_ -like "*python*"} + +# Change working directory without having to remember previous path +Push-Location c:\temp # change working directory to c:\temp +Pop-Location # change back to previous working directory + +# Unblock a directory after download +Get-ChildItem -Recurse | Unblock-File + +# Open Windows Explorer in working directory +ii . ``` @@ -187,4 +290,15 @@ if (-not (Test-Path $Profile)) { notepad $Profile } # More info: `help about_profiles` -``` \ No newline at end of file +``` + +Interesting Projects +* [Channel9](https://channel9.msdn.com/Search?term=powershell%20pipeline#ch9Search&lang-en=en) PowerShell videos +* [PSake](https://github.com/psake/psake) Build automation tool +* [Pester](https://github.com/pester/Pester) BDD Testing Framework + +Not covered +* WMI: Windows Management Intrumentation (Get-CimInstance) +* Multitasking: Start-Job -scriptBlock {...}, +* Code Signing +* Remoting (Enter-PSSession/Exit-PSSession; Invoke-Command) \ No newline at end of file From 3cbcf0e98368d58b708fd945f96d7996386f57ed Mon Sep 17 00:00:00 2001 From: Laoujin Date: Fri, 27 Nov 2015 04:05:53 +0100 Subject: [PATCH 671/685] [PowerShell/en] More usefull snippets and interesting projects --- powershell.html.markdown | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/powershell.html.markdown b/powershell.html.markdown index 6f38c45c..ce9cfa72 100644 --- a/powershell.html.markdown +++ b/powershell.html.markdown @@ -278,6 +278,17 @@ Get-ChildItem -Recurse | Unblock-File # Open Windows Explorer in working directory ii . + +# Any key to exit +$host.UI.RawUI.ReadKey() +return + +# Create a shortcut +$WshShell = New-Object -comObject WScript.Shell +$Shortcut = $WshShell.CreateShortcut($link) +$Shortcut.TargetPath = $file +$Shortcut.WorkingDirectory = Split-Path $file +$Shortcut.Save() ``` @@ -290,12 +301,18 @@ if (-not (Test-Path $Profile)) { notepad $Profile } # More info: `help about_profiles` +# For a more usefull shell, be sure to check the project PSReadLine below ``` Interesting Projects -* [Channel9](https://channel9.msdn.com/Search?term=powershell%20pipeline#ch9Search&lang-en=en) PowerShell videos +* [Channel9](https://channel9.msdn.com/Search?term=powershell%20pipeline#ch9Search&lang-en=en) PowerShell tutorials +* [PSGet](https://github.com/psget/psget) NuGet for PowerShell +* [PSReadLine](https://github.com/lzybkr/PSReadLine/) A bash inspired readline implementation for PowerShell (So good that it now ships with Windows10 by default!) +* [Posh-Git](https://github.com/dahlbyk/posh-git/) Fancy Git Prompt (Recommended!) * [PSake](https://github.com/psake/psake) Build automation tool * [Pester](https://github.com/pester/Pester) BDD Testing Framework +* [Jump-Location](https://github.com/tkellogg/Jump-Location) Powershell `cd` that reads your mind +* [PowerShell Community Extensions](http://pscx.codeplex.com/) (Dead) Not covered * WMI: Windows Management Intrumentation (Get-CimInstance) From 276390e4583ffe471fd90d527fd0ef1c96510119 Mon Sep 17 00:00:00 2001 From: Wouter Van Schandevijl Date: Fri, 27 Nov 2015 05:44:22 +0100 Subject: [PATCH 672/685] [Powershell/en] Deleted a left-over from the bash turorial --- powershell.html.markdown | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/powershell.html.markdown b/powershell.html.markdown index ce9cfa72..9c521b27 100644 --- a/powershell.html.markdown +++ b/powershell.html.markdown @@ -164,7 +164,6 @@ ls -fi *.txt -n # -f is not possible because -Force also exists # Use `Get-Help Get-ChildItem -Full` for a complete overview # Results of the previous cmdlet can be passed to the next as input. -# grep cmdlet filters the input with provided patterns. # `$_` is the current object in the pipeline object. ls | Where-Object { $_.Name -match 'c' } | Export-CSV export.txt ls | ? { $_.Name -match 'c' } | ConvertTo-HTML | Out-File export.html @@ -318,4 +317,4 @@ Not covered * WMI: Windows Management Intrumentation (Get-CimInstance) * Multitasking: Start-Job -scriptBlock {...}, * Code Signing -* Remoting (Enter-PSSession/Exit-PSSession; Invoke-Command) \ No newline at end of file +* Remoting (Enter-PSSession/Exit-PSSession; Invoke-Command) From 8738cef0ad36614b80df63d8d942c6c1416f3e8e Mon Sep 17 00:00:00 2001 From: Serg Date: Fri, 27 Nov 2015 12:36:10 +0200 Subject: [PATCH 673/685] Update javascript-ua.html.markdown Updated according to [Andre Polykanine ](https://github.com/Oire) comments. --- uk-ua/javascript-ua.html.markdown | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/uk-ua/javascript-ua.html.markdown b/uk-ua/javascript-ua.html.markdown index dae27d32..2c534d83 100644 --- a/uk-ua/javascript-ua.html.markdown +++ b/uk-ua/javascript-ua.html.markdown @@ -5,8 +5,8 @@ contributors: - ["Ariel Krakowski", "http://www.learneroo.com"] filename: javascript-ua.js translators: - - ["Ivan Neznayu", "https://github.com/IvanEh"] - - ["Serhii Maksymchuk", "https://maximchuk.tk"] + - ["Ivan", "https://github.com/IvanEh"] + - ["Serhii Maksymchuk", "https://github.com/Serg-Maximchuk"] lang: uk-ua --- @@ -73,7 +73,7 @@ false; // Рядки створюються за допомогою подвійних та одинарних лапок 'абв'; -"Світ, привіт!"; +"Привіт, світе!"; // Для логічного заперечення використовується знак оклику. !true; // = false @@ -139,7 +139,7 @@ var someVar = 5; // якщо пропустити слово var, ви не отримаєте повідомлення про помилку, ... someOtherVar = 10; -// ... але ваша змінна буде створена в глобальному контексті, а не там, де +// ... але вашу змінну буде створено в глобальному контексті, а не там, де // ви її оголосили // Змінні, які оголошені без присвоєння, автоматично приймають значення undefined @@ -160,7 +160,7 @@ var myArray = ["Привіт", 45, true]; // Індексація починається з нуля myArray[1]; // = 45 -// Масиви можна змінювати, як і їх довжину +// Масиви в JavaScript змінюють довжину при додаванні нових елементів myArray.push("Привіт"); myArray.length; // = 4 @@ -258,7 +258,7 @@ function myFunction(thing) { } myFunction("foo"); // = "FOO" -// Зверність увагу, що значення яке буде повернено, повинно починатися на тому ж +// Зверніть увагу, що значення яке буде повернено, повинно починатися на тому ж // рядку, що і ключове слово return, інакше завжди буде повертатися значення undefined // через автоматичну вставку крапки з комою function myFunction() @@ -280,7 +280,7 @@ setTimeout(myFunction, 5000); // setTimeout не є частиною мови, але реалізований в браузерах і Node.js // Функції не обов’язково мають мати ім’я при оголошенні — ви можете написати -// анонімну функцію прямо в якості аргумента іншої функції +// анонімну функцію як аргумент іншої функції setTimeout(function() { // Цей код буде виконано через п’ять секунд }, 5000); @@ -303,7 +303,7 @@ i; // = 5, а не undefined, як це звичайно буває в інши temporary; // повідомлення про помилку ReferenceError permanent; // = 10 -// Замикання - один з найпотужніших інтрументів JavaScript. Якщо функція визначена +// Замикання - один з найпотужніших інструментів JavaScript. Якщо функція визначена // всередині іншої функції, то внутрішня функція має доступ до змінних зовнішньої // функції навіть після того, як код буде виконуватися поза контекстом зовнішньої функції function sayHelloInFiveSeconds(name) { @@ -409,7 +409,7 @@ myObj.meaningOfLife; // = 42 // Аналогічно для функцій myObj.myFunc(); // = "Hello, world!" -// Якщо інтерпретатор не знайде властивість в прототипі, то він продовжить пошук +// Якщо інтерпретатор не знайде властивості в прототипі, то він продовжить пошук // в прототипі прототипа і так далі myPrototype.__proto__ = { myBoolean: true From aca3a4382e2eeb16e383eeb9fbd6689e4caba131 Mon Sep 17 00:00:00 2001 From: Serg Date: Fri, 27 Nov 2015 12:39:27 +0200 Subject: [PATCH 674/685] Update javascript-ua.html.markdown Small fixes --- uk-ua/javascript-ua.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uk-ua/javascript-ua.html.markdown b/uk-ua/javascript-ua.html.markdown index 2c534d83..9614f9ca 100644 --- a/uk-ua/javascript-ua.html.markdown +++ b/uk-ua/javascript-ua.html.markdown @@ -3,7 +3,7 @@ language: javascript contributors: - ["Adam Brenecki", "http://adam.brenecki.id.au"] - ["Ariel Krakowski", "http://www.learneroo.com"] -filename: javascript-ua.js +filename: javascript-uk.js translators: - ["Ivan", "https://github.com/IvanEh"] - ["Serhii Maksymchuk", "https://github.com/Serg-Maximchuk"] @@ -160,7 +160,7 @@ var myArray = ["Привіт", 45, true]; // Індексація починається з нуля myArray[1]; // = 45 -// Масиви в JavaScript змінюють довжину при додаванні нових елементів +// Масиви в JavaScript змінюють свою довжину при додаванні нових елементів myArray.push("Привіт"); myArray.length; // = 4 From 3c048d79adddea0e8ada7ff2af6445160ac000fc Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Fri, 27 Nov 2015 15:30:23 -0800 Subject: [PATCH 675/685] Make typescript indentation consistently 2 spaces --- typescript.html.markdown | 52 ++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/typescript.html.markdown b/typescript.html.markdown index e9135510..26f1fcd9 100644 --- a/typescript.html.markdown +++ b/typescript.html.markdown @@ -83,23 +83,23 @@ mySearch = function(src: string, sub: string) { // Classes - members are public by default class Point { // Properties - x: number; + x: number; - // Constructor - the public/private keywords in this context will generate - // the boiler plate code for the property and the initialization in the - // constructor. - // In this example, "y" will be defined just like "x" is, but with less code - // Default values are also supported + // Constructor - the public/private keywords in this context will generate + // the boiler plate code for the property and the initialization in the + // constructor. + // In this example, "y" will be defined just like "x" is, but with less code + // Default values are also supported - constructor(x: number, public y: number = 0) { - this.x = x; - } + constructor(x: number, public y: number = 0) { + this.x = x; + } - // Functions - dist() { return Math.sqrt(this.x * this.x + this.y * this.y); } + // Functions + dist() { return Math.sqrt(this.x * this.x + this.y * this.y); } - // Static members - static origin = new Point(0, 0); + // Static members + static origin = new Point(0, 0); } var p1 = new Point(10 ,20); @@ -107,15 +107,15 @@ var p2 = new Point(25); //y will be 0 // Inheritance class Point3D extends Point { - constructor(x: number, y: number, public z: number = 0) { - super(x, y); // Explicit call to the super class constructor is mandatory - } + constructor(x: number, y: number, public z: number = 0) { + super(x, y); // Explicit call to the super class constructor is mandatory + } - // Overwrite - dist() { - var d = super.dist(); - return Math.sqrt(d * d + this.z * this.z); - } + // Overwrite + dist() { + var d = super.dist(); + return Math.sqrt(d * d + this.z * this.z); + } } // Modules, "." can be used as separator for sub modules @@ -139,19 +139,19 @@ var s2 = new G.Square(10); // Generics // Classes class Tuple { - constructor(public item1: T1, public item2: T2) { - } + constructor(public item1: T1, public item2: T2) { + } } // Interfaces interface Pair { - item1: T; - item2: T; + item1: T; + item2: T; } // And functions var pairToTuple = function(p: Pair) { - return new Tuple(p.item1, p.item2); + return new Tuple(p.item1, p.item2); }; var tuple = pairToTuple({ item1:"hello", item2:"world"}); From 90a7e8ac4910e0ab754ce1801d6743fb6c70eaba Mon Sep 17 00:00:00 2001 From: Laoujin Date: Sat, 28 Nov 2015 19:44:24 +0100 Subject: [PATCH 676/685] [PowerShell/en] Markdown ```powershell didn't render properly --- powershell.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/powershell.html.markdown b/powershell.html.markdown index ce9cfa72..70935993 100644 --- a/powershell.html.markdown +++ b/powershell.html.markdown @@ -18,7 +18,7 @@ rather than plain text. [Read more here.](https://technet.microsoft.com/en-us/library/bb978526.aspx) If you are uncertain about your environment: -```powershell +``` Get-ExecutionPolicy -List Set-ExecutionPolicy AllSigned # Execution policies include: @@ -33,7 +33,7 @@ $PSVersionTable ``` Getting help: -```powershell +``` # Find commands Get-Command about_* # alias: gcm Get-Command -Verb Add @@ -49,7 +49,7 @@ Update-Help # Run as admin ``` The tutorial starts here: -```powershell +``` # As you already figured, comments start with # # Simple hello world example: @@ -293,7 +293,7 @@ $Shortcut.Save() Configuring your shell -```powershell +``` # $Profile is the full path for your `Microsoft.PowerShell_profile.ps1` # All code there will be executed when the PS session starts if (-not (Test-Path $Profile)) { From 2099ec480194f747d4292b9d253e4fa416b35188 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 30 Nov 2015 22:22:42 +0700 Subject: [PATCH 677/685] Moved ua-ua files to uk-ua --- uk-ua/bash-ua.html.markdown | 296 ++++++++++++++++++++++++++++++++++++ uk-ua/json-ua.html.markdown | 67 ++++++++ 2 files changed, 363 insertions(+) create mode 100644 uk-ua/bash-ua.html.markdown create mode 100644 uk-ua/json-ua.html.markdown diff --git a/uk-ua/bash-ua.html.markdown b/uk-ua/bash-ua.html.markdown new file mode 100644 index 00000000..b7e4a5ba --- /dev/null +++ b/uk-ua/bash-ua.html.markdown @@ -0,0 +1,296 @@ +--- +category: tool +tool: bash +contributors: + - ["Max Yankov", "https://github.com/golergka"] + - ["Darren Lin", "https://github.com/CogBear"] + - ["Alexandre Medeiros", "http://alemedeiros.sdf.org"] + - ["Denis Arh", "https://github.com/darh"] + - ["akirahirose", "https://twitter.com/akirahirose"] + - ["Anton Strömkvist", "http://lutic.org/"] + - ["Rahil Momin", "https://github.com/iamrahil"] + - ["Gregrory Kielian", "https://github.com/gskielian"] + - ["Etan Reisner", "https://github.com/deryni"] +translators: + - ["Ehreshi Ivan", "https://github.com/IvanEh"] +lang: uk-ua +--- + +Bash - командна оболонка unix (unix shell), що також розповсюджувалась як оболонка для +операційної системи GNU і зараз використовується як командна оболонка за замовчуванням +для Linux i Max OS X. +Почти все нижеприведенные примеры могут быть частью shell-скриптов или исполнены напрямую в shell. +Майже всі приклади, що наведені нижче можуть бути частиною shell-скриптів або +виконані в оболонці + +[Більш детально тут.](http://www.gnu.org/software/bash/manual/bashref.html) + +```bash +#!/bin/bash +# Перший рядок скрипта - це shebang, який вказує системі, як потрібно виконувати +# скрипт. Як ви вже зрозуміли, коментарі починаються з #. Shebang - тоже коментар + +# Простий приклад hello world: +echo Hello world! + +# Окремі команди починаються з нового рядка або розділяються крапкою з комкою: +echo 'Перший рядок'; echo 'Другий рядок' + +# Оголошення змінної +VARIABLE="Просто рядок" + +# Але не так! +VARIABLE = "Просто рядок" +# Bash вирішить, що VARIABLE - це команда, яку він може виконати, +# і видасть помилку, тому що не зможе знайти її + +# І так також не можна писати: +VARIABLE= 'Просто рядок' +# Bash сприйме рядок 'Просто рядок' як команду. Але такої команди не має, тому +# видасть помилку. +# (тут 'VARIABLE=' інтерпретується як присвоєння тільки в контексті +# виконання команди 'Просто рядок') + +# Використання змінних: +echo $VARIABLE +echo "$VARIABLE" +echo '$VARIABLE' +# Коли ви використовуєте змінну - присвоюєте значення, експортуєте і т.д. - +# пишіть її імя без $. А для отримання значення змінної використовуйте $. +# Одинарні лапки ' не розкривають значення змінних + +# Підстановка рядків в змінні +echo ${VARIABLE/Просто/A} +# Цей вираз замінить перше входження підрядка "Просто" на "А" + +# Отримання підрядка із рядка +LENGTH=7 +echo ${VARIABLE:0:LENGTH} +# Цей вираз поверне тільки перші 7 символів змінної VARIABLE + +# Значення за замовчуванням +echo ${FOO:-"DefaultValueIfFOOIsMissingOrEmpty"} +# Це спрацює при відсутності значення (FOO=) і при пустому рядку (FOO="") +# Нуль (FOO=0) поверне 0. +# Зауважте, що у всіх випадках значення самої змінної FOO не зміниться + +# Вбудовані змінні: +# В bash є корисні вбудовані змінні, наприклад +echo "Значення, яке було повернуте в останній раз: $?" +echo "PID скрипта: $$" +echo "Кількість аргументів: $#" +echo "Аргументи скрипта: $@" +echo "Аргументи скрипта, розподілені по різним змінним: $1 $2..." + +# Зчитування змінних з пристроїв введення +echo "Як вас звати?" +read NAME # Зверніть увагу, що вам не потрібно оголошувати нову змінну +echo Привіт, $NAME! + +# В bash є звичайна умовна конструкція if: +# наберіть 'man test', щоб переглянути детальну інформацію про формати умов +if [ $NAME -ne $USER ] +then + echo "Ім’я користувача не збігається з введеним" +else + echo "Ім’я збігаєтьяс з іменем користувача" +fi + +# Зауважте! якщо $Name пуста, bash інтерпретує код вище як: +if [ -ne $USER ] +# що є неправильним синтаксисом +# тому безпечний спосіб використання потенційно пустих змінних має вигляд: +if [ "$Name" -ne $USER ] ... +# коли $Name пуста, інтерпретується наступним чином: +if [ "" -ne $USER ] ... +# що працює як і очікувалося + +# Умовне виконання (conditional execution) +echo "Виконується завжди" || echo "Виконається, якщо перша команда завершиться з помилкою" +echo "Виконується завжди" && echo "Виконається, якщо перша команда завершиться успішно" + +# Щоб використати && і || у конструкції if, потрібно декілька пар дужок: +if [ $NAME == "Steve" ] && [ $AGE -eq 15 ] +then + echo "Виконається, якщо $NAME="Steve" i AGE=15." +fi + +if [ $NAME == "Daniya" ] || [ $NAME == "Zach" ] +then + echo "Виконається, якщо NAME="Steve" або NAME="Zach"." +fi + +# Вирази позначаються наступним форматом: +echo $(( 10 + 5 )) + +# На відмінно від інших мов програмування, Bash - це командна оболонка, а +# отже, працює в контексті поточної директорії +ls + +# Ця команда може використовуватися з опціями +ls -l # Показати кожен файл і директорію на окремому рядку + +# Результат попередньої команди можна перенаправити на вхід наступної. +# Команда grep фільтрує вхід по шаблону. +# Таким чином ми можемо переглянути тільки *.txt файли в поточній директорії: +ls -l | grep "\.txt" + +# Ви можете перенаправ вхід і вихід команди (stdin, stdout, stderr). +# Наступна команда означає: читати із stdin, поки не зустрінеться ^EOF$, і +# перезаписати hello.py наступними рядками (до рядка "EOF"): +cat > hello.py << EOF +#!/usr/bin/env python +from __future__ import print_function +import sys +print("#stdout", file=sys.stdout) +print("#stderr", file=sys.stderr) +for line in sys.stdin: + print(line, file=sys.stdout) +EOF + +# Запуск hello.py з різними варіантами перенаправлення stdin, +# stdout, stderr (стандартні потоки введення, виведення і помилок): +python hello.py < "input.in" +python hello.py > "output.out" +python hello.py 2> "error.err" +python hello.py > "output-and-error.log" 2>&1 +python hello.py > /dev/null 2>&1 +# Поток помилок перезапише фпйл, якщо цей файл існує +# тому, якщо ви хочете дописувати до файлу, використовуйте ">>": +python hello.py >> "output.out" 2>> "error.err" + +# Перезаписати output.txt, дописати error.err і порахувати кількість рядків: +info bash 'Basic Shell Features' 'Redirections' > output.out 2>> error.err +wc -l output.out error.err + +# Запустити команду і вивести її файловий дескриптор (див.: man fd; наприклад /dev/fd/123) +echo <(echo "#helloworld") + +# Перезаписати output.txt рядком "#helloworld": +cat > output.out <(echo "#helloworld") +echo "#helloworld" > output.out +echo "#helloworld" | cat > output.out +echo "#helloworld" | tee output.out >/dev/null + +# Подчистить временные файлы с подробным выводом ('-i' - интерактивый режим) +# Очистити тимчасові файли з детальним виводом (додайте '-i' +# для інтерактивного режиму) +rm -v output.out error.err output-and-error.log + +# Команди можуть бути підставлені в інші команди використовуючи $(): +# наступна команда виводить кількість файлів і директорій в поточній директорії +echo "Тут $(ls | wc -l) елементів." + +# Те саме можна зробити використовуючи зворотні лапки +# Але вони не можуть бути вкладеними, тому перший варіант бажаніший +echo "Тут `ls | wc -l` елементів." + +# В Bash є структура case, яка схожа на switch в Java и C++: +case "$VARIABLE" in + # перерахуйте шаблони, які будуть використовуватися в якості умов + 0) echo "Тут нуль.";; + 1) echo "Тут один.";; + *) echo "Не пусте значення.";; +esac + +# Цикл for перебирає елементи передані в аргумент: +# Значення $VARIABLE буде напечатано тричі. +for VARIABLE in {1..3} +do + echo "$VARIABLE" +done + +# Aбо можна використати звичний синтаксис for: +for ((a=1; a <= 3; a++)) +do + echo $a +done + +# Цикл for можно використати, щоб виконувати дії над файлами. +# Цей код запустить команду 'cat' для файлів file1 и file2 +for VARIABLE in file1 file2 +do + cat "$VARIABLE" +done + +# ... або дії над виводом команд +# Запустимо cat для виведення із ls. +for OUTPUT in $(ls) +do + cat "$OUTPUT" +done + +# Цикл while: +while [ true ] +do + echo "Тіло циклу..." + break +done + +# Ви також можете оголосити функцію +# Оголошення: +function foo () +{ + echo "Аргументи функції доступні так само, як і аргументи скрипта: $@" + echo "$1 $2..." + echo "Це функція" + return 0 +} + +# Або просто +bar () +{ + echo "Інший спосіб оголошення функцій!" + return 0 +} + +# Виклик функцій +foo "Мое имя" $NAME + +# Є багато корисних команд: +# вивести останні 10 рядків файла file.txt +tail -n 10 file.txt +# вивести перші 10 рядків файла file.txt +head -n 10 file.txt +# відсортувати рядки file.txt +sort file.txt +# відібрати або пропустити рядки, що дублюються (з опцією -d відбирає) +uniq -d file.txt +# вивести тільки першу колонку перед символом ',' +cut -d ',' -f 1 file.txt +# замінити кожне 'okay' на 'great' у файлі file.txt (підтримується regex) +sed -i 's/okay/great/g' file.txt +# вивести в stdout все рядки з file.txt, що задовольняють шаблону regex; +# цей приклад виводить рядки, що починаються на foo і закінчуються на bar: +grep "^foo.*bar$" file.txt +# використайте опцію -c, щоб вивести кількість входжень +grep -c "^foo.*bar$" file.txt +# чтобы искать по строке, а не шаблону regex, используйте fgrep (или grep -F) +# щоб здійснити пошук по рядку, а не по шаблону regex, використовуйте fgrea (або grep -F) +fgrep "^foo.*bar$" file.txt + +# Читайте вбудовану документацію Bash командою 'help': +help +help help +help for +help return +help source +help . + +# Читайте Bash man-документацію +apropos bash +man 1 bash +man bash + +# Читайте документацію info (? для допомоги) +apropos info | grep '^info.*(' +man info +info info +info 5 info + +# Читайте bash info документацію: +info bash +info bash 'Bash Features' +info bash 6 +info --apropos bash +``` diff --git a/uk-ua/json-ua.html.markdown b/uk-ua/json-ua.html.markdown new file mode 100644 index 00000000..8ee12a93 --- /dev/null +++ b/uk-ua/json-ua.html.markdown @@ -0,0 +1,67 @@ +--- +language: json +filename: learnjson-ru.json +contributors: + - ["Anna Harren", "https://github.com/iirelu"] + - ["Marco Scannadinari", "https://github.com/marcoms"] +translators: + - ["Ehreshi Ivan", "https://github.com/IvanEh"] +lang: uk-ua +--- + +JSON - це надзвичайно простий формат обміну даними. Це мабуть буде найлегшим курсом +"Learn X in Y Minutes". + +В загальному випадку в JSON немає коментарів, але більшість парсерів дозволяють +використовувати коментарі в С-стилі(//, /\* \*/). Можна залишити кому після останнього +поля, але все-таки краще такого уникати для кращої сумісності + +```json +{ + "ключ": "значеннь", + + "ключі": "завжди мають бути обгорнуті в подвійні лапки", + "числа": 0, + "рядки": "Пρивет, світ. Допускаються всі unicode-символи разом з \"екрануванням\".", + "логічний тип": true, + "нічого": null, + + "велике число": 1.2e+100, + + "об’єкти": { + "коментар": "Більшість ваших структур будуть складатися з об’єктів", + + "масив": [0, 1, 2, 3, "масиви можуть містити будь-які типи", 5], + + "інший об’єкт": { + "коментра": "Об’єкти можуть містити інші об’єкти. Це дуже корисно." + } + }, + + "безглуздя": [ + { + "джерело калія": ["банани"] + }, + [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, "нео"], + [0, 0, 0, 1] + ] + ], + + "альтернативнтй стиль": { + "коментар": "Гляньте!" + , "позиція коми": "неважлива, поки вона знаходиться до наступного поля" + , "інший коментар": "класно" + }, + + "Це було не довго": "І ви справилист. Тепер ви знаєте все про JSON." +} + +Одиничний масив значень теж є правильним JSON + +[1, 2, 3, "text", true] + + +``` From 3d19a951926f52b7cafca301919233f4cda513ff Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 30 Nov 2015 12:48:13 -0800 Subject: [PATCH 678/685] [TypeScript/fr] Make TypeScript indentation consistently 2 spaces fr version of #2041 --- fr-fr/typescript-fr.html.markdown | 56 +++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/fr-fr/typescript-fr.html.markdown b/fr-fr/typescript-fr.html.markdown index b8807104..52d34650 100644 --- a/fr-fr/typescript-fr.html.markdown +++ b/fr-fr/typescript-fr.html.markdown @@ -87,22 +87,22 @@ mySearch = function(src: string, sub: string) { // Les membres des classes sont publiques par défaut. class Point { - // Propriétés - x: number; + // Propriétés + x: number; - // Constructeur - Les mots clés "public" et "private" dans ce contexte - // génèrent le code de la propriété et son initialisation dans le - // constructeur. Ici, "y" sera défini de la même façon que "x", - // mais avec moins de code. Les valeurs par défaut sont supportées. - constructor(x: number, public y: number = 0) { - this.x = x; - } + // Constructeur - Les mots clés "public" et "private" dans ce contexte + // génèrent le code de la propriété et son initialisation dans le + // constructeur. Ici, "y" sera défini de la même façon que "x", + // mais avec moins de code. Les valeurs par défaut sont supportées. + constructor(x: number, public y: number = 0) { + this.x = x; + } - // Fonctions - dist() { return Math.sqrt(this.x * this.x + this.y * this.y); } + // Fonctions + dist() { return Math.sqrt(this.x * this.x + this.y * this.y); } - // Membres statiques - static origin = new Point(0, 0); + // Membres statiques + static origin = new Point(0, 0); } var p1 = new Point(10 ,20); @@ -110,17 +110,17 @@ var p2 = new Point(25); // y sera 0 // Héritage class Point3D extends Point { - constructor(x: number, y: number, public z: number = 0) { - // Un appel explicite au constructeur de la super classe - // est obligatoire. - super(x, y); - } + constructor(x: number, y: number, public z: number = 0) { + // Un appel explicite au constructeur de la super classe + // est obligatoire. + super(x, y); + } - // Redéfinition - dist() { - var d = super.dist(); - return Math.sqrt(d * d + this.z * this.z); - } + // Redéfinition + dist() { + var d = super.dist(); + return Math.sqrt(d * d + this.z * this.z); + } } // Modules, "." peut être utilisé comme un séparateur de sous modules. @@ -144,19 +144,19 @@ var s2 = new G.Square(10); // Génériques // Classes class Tuple { - constructor(public item1: T1, public item2: T2) { - } + constructor(public item1: T1, public item2: T2) { + } } // Interfaces interface Pair { - item1: T; - item2: T; + item1: T; + item2: T; } // Et fonctions var pairToTuple = function(p: Pair) { - return new Tuple(p.item1, p.item2); + return new Tuple(p.item1, p.item2); }; var tuple = pairToTuple({ item1:"hello", item2:"world"}); From ccb05ba98a5b411029e8d7c1e7ea2cd7d87bced4 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 1 Dec 2015 20:37:23 +0700 Subject: [PATCH 679/685] Removed old ua-ua --- ua-ua/bash-ua.html.markdown | 296 ------------------------------------ ua-ua/json-ua.html.markdown | 67 -------- 2 files changed, 363 deletions(-) delete mode 100644 ua-ua/bash-ua.html.markdown delete mode 100644 ua-ua/json-ua.html.markdown diff --git a/ua-ua/bash-ua.html.markdown b/ua-ua/bash-ua.html.markdown deleted file mode 100644 index 2c930ad1..00000000 --- a/ua-ua/bash-ua.html.markdown +++ /dev/null @@ -1,296 +0,0 @@ ---- -category: tool -tool: bash -contributors: - - ["Max Yankov", "https://github.com/golergka"] - - ["Darren Lin", "https://github.com/CogBear"] - - ["Alexandre Medeiros", "http://alemedeiros.sdf.org"] - - ["Denis Arh", "https://github.com/darh"] - - ["akirahirose", "https://twitter.com/akirahirose"] - - ["Anton Strömkvist", "http://lutic.org/"] - - ["Rahil Momin", "https://github.com/iamrahil"] - - ["Gregrory Kielian", "https://github.com/gskielian"] - - ["Etan Reisner", "https://github.com/deryni"] -translators: - - ["Ehreshi Ivan", "https://github.com/IvanEh"] -lang: ua-ua ---- - -Bash - командна оболонка unix (unix shell), що також розповсюджувалась як оболонка для -операційної системи GNU і зараз використовується як командна оболонка за замовчуванням -для Linux i Max OS X. -Почти все нижеприведенные примеры могут быть частью shell-скриптов или исполнены напрямую в shell. -Майже всі приклади, що наведені нижче можуть бути частиною shell-скриптів або -виконані в оболонці - -[Більш детально тут.](http://www.gnu.org/software/bash/manual/bashref.html) - -```bash -#!/bin/bash -# Перший рядок скрипта - це shebang, який вказує системі, як потрібно виконувати -# скрипт. Як ви вже зрозуміли, коментарі починаються з #. Shebang - тоже коментар - -# Простий приклад hello world: -echo Hello world! - -# Окремі команди починаються з нового рядка або розділяються крапкою з комкою: -echo 'Перший рядок'; echo 'Другий рядок' - -# Оголошення змінної -VARIABLE="Просто рядок" - -# Але не так! -VARIABLE = "Просто рядок" -# Bash вирішить, що VARIABLE - це команда, яку він може виконати, -# і видасть помилку, тому що не зможе знайти її - -# І так також не можна писати: -VARIABLE= 'Просто рядок' -# Bash сприйме рядок 'Просто рядок' як команду. Але такої команди не має, тому -# видасть помилку. -# (тут 'VARIABLE=' інтерпретується як присвоєння тільки в контексті -# виконання команди 'Просто рядок') - -# Використання змінних: -echo $VARIABLE -echo "$VARIABLE" -echo '$VARIABLE' -# Коли ви використовуєте змінну - присвоюєте значення, експортуєте і т.д. - -# пишіть її імя без $. А для отримання значення змінної використовуйте $. -# Одинарні лапки ' не розкривають значення змінних - -# Підстановка рядків в змінні -echo ${VARIABLE/Просто/A} -# Цей вираз замінить перше входження підрядка "Просто" на "А" - -# Отримання підрядка із рядка -LENGTH=7 -echo ${VARIABLE:0:LENGTH} -# Цей вираз поверне тільки перші 7 символів змінної VARIABLE - -# Значення за замовчуванням -echo ${FOO:-"DefaultValueIfFOOIsMissingOrEmpty"} -# Це спрацює при відсутності значення (FOO=) і при пустому рядку (FOO="") -# Нуль (FOO=0) поверне 0. -# Зауважте, що у всіх випадках значення самої змінної FOO не зміниться - -# Вбудовані змінні: -# В bash є корисні вбудовані змінні, наприклад -echo "Значення, яке було повернуте в останній раз: $?" -echo "PID скрипта: $$" -echo "Кількість аргументів: $#" -echo "Аргументи скрипта: $@" -echo "Аргументи скрипта, розподілені по різним змінним: $1 $2..." - -# Зчитування змінних з пристроїв введення -echo "Як вас звати?" -read NAME # Зверніть увагу, що вам не потрібно оголошувати нову змінну -echo Привіт, $NAME! - -# В bash є звичайна умовна конструкція if: -# наберіть 'man test', щоб переглянути детальну інформацію про формати умов -if [ $NAME -ne $USER ] -then - echo "Ім’я користувача не збігається з введеним" -else - echo "Ім’я збігаєтьяс з іменем користувача" -fi - -# Зауважте! якщо $Name пуста, bash інтерпретує код вище як: -if [ -ne $USER ] -# що є неправильним синтаксисом -# тому безпечний спосіб використання потенційно пустих змінних має вигляд: -if [ "$Name" -ne $USER ] ... -# коли $Name пуста, інтерпретується наступним чином: -if [ "" -ne $USER ] ... -# що працює як і очікувалося - -# Умовне виконання (conditional execution) -echo "Виконується завжди" || echo "Виконається, якщо перша команда завершиться з помилкою" -echo "Виконується завжди" && echo "Виконається, якщо перша команда завершиться успішно" - -# Щоб використати && і || у конструкції if, потрібно декілька пар дужок: -if [ $NAME == "Steve" ] && [ $AGE -eq 15 ] -then - echo "Виконається, якщо $NAME="Steve" i AGE=15." -fi - -if [ $NAME == "Daniya" ] || [ $NAME == "Zach" ] -then - echo "Виконається, якщо NAME="Steve" або NAME="Zach"." -fi - -# Вирази позначаються наступним форматом: -echo $(( 10 + 5 )) - -# На відмінно від інших мов програмування, Bash - це командна оболонка, а -# отже, працює в контексті поточної директорії -ls - -# Ця команда може використовуватися з опціями -ls -l # Показати кожен файл і директорію на окремому рядку - -# Результат попередньої команди можна перенаправити на вхід наступної. -# Команда grep фільтрує вхід по шаблону. -# Таким чином ми можемо переглянути тільки *.txt файли в поточній директорії: -ls -l | grep "\.txt" - -# Ви можете перенаправ вхід і вихід команди (stdin, stdout, stderr). -# Наступна команда означає: читати із stdin, поки не зустрінеться ^EOF$, і -# перезаписати hello.py наступними рядками (до рядка "EOF"): -cat > hello.py << EOF -#!/usr/bin/env python -from __future__ import print_function -import sys -print("#stdout", file=sys.stdout) -print("#stderr", file=sys.stderr) -for line in sys.stdin: - print(line, file=sys.stdout) -EOF - -# Запуск hello.py з різними варіантами перенаправлення stdin, -# stdout, stderr (стандартні потоки введення, виведення і помилок): -python hello.py < "input.in" -python hello.py > "output.out" -python hello.py 2> "error.err" -python hello.py > "output-and-error.log" 2>&1 -python hello.py > /dev/null 2>&1 -# Поток помилок перезапише фпйл, якщо цей файл існує -# тому, якщо ви хочете дописувати до файлу, використовуйте ">>": -python hello.py >> "output.out" 2>> "error.err" - -# Перезаписати output.txt, дописати error.err і порахувати кількість рядків: -info bash 'Basic Shell Features' 'Redirections' > output.out 2>> error.err -wc -l output.out error.err - -# Запустити команду і вивести її файловий дескриптор (див.: man fd; наприклад /dev/fd/123) -echo <(echo "#helloworld") - -# Перезаписати output.txt рядком "#helloworld": -cat > output.out <(echo "#helloworld") -echo "#helloworld" > output.out -echo "#helloworld" | cat > output.out -echo "#helloworld" | tee output.out >/dev/null - -# Подчистить временные файлы с подробным выводом ('-i' - интерактивый режим) -# Очистити тимчасові файли з детальним виводом (додайте '-i' -# для інтерактивного режиму) -rm -v output.out error.err output-and-error.log - -# Команди можуть бути підставлені в інші команди використовуючи $(): -# наступна команда виводить кількість файлів і директорій в поточній директорії -echo "Тут $(ls | wc -l) елементів." - -# Те саме можна зробити використовуючи зворотні лапки -# Але вони не можуть бути вкладеними, тому перший варіант бажаніший -echo "Тут `ls | wc -l` елементів." - -# В Bash є структура case, яка схожа на switch в Java и C++: -case "$VARIABLE" in - # перерахуйте шаблони, які будуть використовуватися в якості умов - 0) echo "Тут нуль.";; - 1) echo "Тут один.";; - *) echo "Не пусте значення.";; -esac - -# Цикл for перебирає елементи передані в аргумент: -# Значення $VARIABLE буде напечатано тричі. -for VARIABLE in {1..3} -do - echo "$VARIABLE" -done - -# Aбо можна використати звичний синтаксис for: -for ((a=1; a <= 3; a++)) -do - echo $a -done - -# Цикл for можно використати, щоб виконувати дії над файлами. -# Цей код запустить команду 'cat' для файлів file1 и file2 -for VARIABLE in file1 file2 -do - cat "$VARIABLE" -done - -# ... або дії над виводом команд -# Запустимо cat для виведення із ls. -for OUTPUT in $(ls) -do - cat "$OUTPUT" -done - -# Цикл while: -while [ true ] -do - echo "Тіло циклу..." - break -done - -# Ви також можете оголосити функцію -# Оголошення: -function foo () -{ - echo "Аргументи функції доступні так само, як і аргументи скрипта: $@" - echo "$1 $2..." - echo "Це функція" - return 0 -} - -# Або просто -bar () -{ - echo "Інший спосіб оголошення функцій!" - return 0 -} - -# Виклик функцій -foo "Мое имя" $NAME - -# Є багато корисних команд: -# вивести останні 10 рядків файла file.txt -tail -n 10 file.txt -# вивести перші 10 рядків файла file.txt -head -n 10 file.txt -# відсортувати рядки file.txt -sort file.txt -# відібрати або пропустити рядки, що дублюються (з опцією -d відбирає) -uniq -d file.txt -# вивести тільки першу колонку перед символом ',' -cut -d ',' -f 1 file.txt -# замінити кожне 'okay' на 'great' у файлі file.txt (підтримується regex) -sed -i 's/okay/great/g' file.txt -# вивести в stdout все рядки з file.txt, що задовольняють шаблону regex; -# цей приклад виводить рядки, що починаються на foo і закінчуються на bar: -grep "^foo.*bar$" file.txt -# використайте опцію -c, щоб вивести кількість входжень -grep -c "^foo.*bar$" file.txt -# чтобы искать по строке, а не шаблону regex, используйте fgrep (или grep -F) -# щоб здійснити пошук по рядку, а не по шаблону regex, використовуйте fgrea (або grep -F) -fgrep "^foo.*bar$" file.txt - -# Читайте вбудовану документацію Bash командою 'help': -help -help help -help for -help return -help source -help . - -# Читайте Bash man-документацію -apropos bash -man 1 bash -man bash - -# Читайте документацію info (? для допомоги) -apropos info | grep '^info.*(' -man info -info info -info 5 info - -# Читайте bash info документацію: -info bash -info bash 'Bash Features' -info bash 6 -info --apropos bash -``` diff --git a/ua-ua/json-ua.html.markdown b/ua-ua/json-ua.html.markdown deleted file mode 100644 index 6281ea56..00000000 --- a/ua-ua/json-ua.html.markdown +++ /dev/null @@ -1,67 +0,0 @@ ---- -language: json -filename: learnjson-ru.json -contributors: - - ["Anna Harren", "https://github.com/iirelu"] - - ["Marco Scannadinari", "https://github.com/marcoms"] -translators: - - ["Ehreshi Ivan", "https://github.com/IvanEh"] -lang: ua-ua ---- - -JSON - це надзвичайно простий формат обміну даними. Це мабуть буде найлегшим курсом -"Learn X in Y Minutes". - -В загальному випадку в JSON немає коментарів, але більшість парсерів дозволяють -використовувати коментарі в С-стилі(//, /\* \*/). Можна залишити кому після останнього -поля, але все-таки краще такого уникати для кращої сумісності - -```json -{ - "ключ": "значеннь", - - "ключі": "завжди мають бути обгорнуті в подвійні лапки", - "числа": 0, - "рядки": "Пρивет, світ. Допускаються всі unicode-символи разом з \"екрануванням\".", - "логічний тип": true, - "нічого": null, - - "велике число": 1.2e+100, - - "об’єкти": { - "коментар": "Більшість ваших структур будуть складатися з об’єктів", - - "масив": [0, 1, 2, 3, "масиви можуть містити будь-які типи", 5], - - "інший об’єкт": { - "коментра": "Об’єкти можуть містити інші об’єкти. Це дуже корисно." - } - }, - - "безглуздя": [ - { - "джерело калія": ["банани"] - }, - [ - [1, 0, 0, 0], - [0, 1, 0, 0], - [0, 0, 1, "нео"], - [0, 0, 0, 1] - ] - ], - - "альтернативнтй стиль": { - "коментар": "Гляньте!" - , "позиція коми": "неважлива, поки вона знаходиться до наступного поля" - , "інший коментар": "класно" - }, - - "Це було не довго": "І ви справилист. Тепер ви знаєте все про JSON." -} - -Одиничний масив значень теж є правильним JSON - -[1, 2, 3, "text", true] - - -``` From 5a0f2ef998cce1343080660e0a0c6dbcc43dfe2f Mon Sep 17 00:00:00 2001 From: Elena Bolshakova Date: Wed, 2 Dec 2015 14:53:18 +0300 Subject: [PATCH 680/685] typo --- ru-ru/perl-ru.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ru-ru/perl-ru.html.markdown b/ru-ru/perl-ru.html.markdown index 0e68116c..a907ba41 100644 --- a/ru-ru/perl-ru.html.markdown +++ b/ru-ru/perl-ru.html.markdown @@ -129,7 +129,7 @@ open(my $out, ">", "output.txt") or die "Can't open output.txt: $!"; open(my $log, ">>", "my.log") or die "Can't open my.log: $!"; # Читать из файлового дескриптора можно с помощью оператора "<>". -# В скалярном контексте он читает одру строку из файла, в списковом -- +# В скалярном контексте он читает одну строку из файла, в списковом -- # читает сразу весь файл, сохраняя по одной строке в элементе массива: my $line = <$in>; From 91ed76340d139a9201262880a0cbbcbe200650f2 Mon Sep 17 00:00:00 2001 From: Jesus Tinoco Date: Wed, 2 Dec 2015 18:49:47 +0100 Subject: [PATCH 681/685] Fixing typo in ruby-es.html.markdown --- es-es/ruby-es.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es-es/ruby-es.html.markdown b/es-es/ruby-es.html.markdown index 1cf334e3..37b09e8d 100644 --- a/es-es/ruby-es.html.markdown +++ b/es-es/ruby-es.html.markdown @@ -97,7 +97,7 @@ y #=> 10 # Por convención, usa snake_case para nombres de variables snake_case = true -# Usa nombres de variables descriptivas +# Usa nombres de variables descriptivos ruta_para_la_raiz_de_un_projecto = '/buen/nombre/' ruta = '/mal/nombre/' From 0737d9be0bfdedc11842b39f8422123ac329f524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=20Polykanine=20A=2EK=2EA=2E=20Menelion=20Elens=C3=BA?= =?UTF-8?q?l=C3=AB?= Date: Wed, 2 Dec 2015 21:59:12 +0200 Subject: [PATCH 682/685] Resolving conflict in #1710 --- d.html.markdown | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/d.html.markdown b/d.html.markdown index 9ebba385..ecb9e3ac 100644 --- a/d.html.markdown +++ b/d.html.markdown @@ -218,7 +218,7 @@ void main() { // from 1 to 100. Easy! // Just pass lambda expressions as template parameters! - // You can pass any old function you like, but lambdas are convenient here. + // You can pass any function you like, but lambdas are convenient here. auto num = iota(1, 101).filter!(x => x % 2 == 0) .map!(y => y ^^ 2) .reduce!((a, b) => a + b); @@ -228,7 +228,7 @@ void main() { ``` Notice how we got to build a nice Haskellian pipeline to compute num? -That's thanks to a D innovation know as Uniform Function Call Syntax. +That's thanks to a D innovation know as Uniform Function Call Syntax (UFCS). With UFCS, we can choose whether to write a function call as a method or free function call! Walter wrote a nice article on this [here.](http://www.drdobbs.com/cpp/uniform-function-call-syntax/232700394) @@ -238,21 +238,23 @@ is of some type A on any expression of type A as a method. I like parallelism. Anyone else like parallelism? Sure you do. Let's do some! ```c +// Let's say we want to populate a large array with the square root of all +// consecutive integers starting from 1 (up until the size of the array), and we +// want to do this concurrently taking advantage of as many cores as we have +// available. + import std.stdio; import std.parallelism : parallel; import std.math : sqrt; void main() { - // We want take the square root every number in our array, - // and take advantage of as many cores as we have available. + // Create your large array auto arr = new double[1_000_000]; - // Use an index, and an array element by reference, - // and just call parallel on the array! + // 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); } } - - ``` From 410cc03b09870be6da4931725120b44f93b3bcfc Mon Sep 17 00:00:00 2001 From: Robb Shecter Date: Thu, 3 Dec 2015 14:27:24 -0800 Subject: [PATCH 683/685] Updating dev environment installation info --- haskell.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haskell.html.markdown b/haskell.html.markdown index 936744a0..34eee748 100644 --- a/haskell.html.markdown +++ b/haskell.html.markdown @@ -426,7 +426,7 @@ qsort (p:xs) = qsort lesser ++ [p] ++ qsort greater greater = filter (>= p) xs ``` -Haskell is easy to install. Get it [here](http://www.haskell.org/platform/). +There are two popular ways to install Haskell: The traditional [Cabal-based installation](http://www.haskell.org/platform/), and the newer [Stack-based process](https://www.stackage.org/install). You can find a much gentler introduction from the excellent [Learn you a Haskell](http://learnyouahaskell.com/) or From 3f91dff4282962a30e30c4831c328a682dfc4924 Mon Sep 17 00:00:00 2001 From: JustBlah Date: Fri, 4 Dec 2015 06:12:54 +0200 Subject: [PATCH 684/685] Commas added. --- ru-ru/objective-c-ru.html.markdown | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ru-ru/objective-c-ru.html.markdown b/ru-ru/objective-c-ru.html.markdown index bebd36d3..e987dd53 100644 --- a/ru-ru/objective-c-ru.html.markdown +++ b/ru-ru/objective-c-ru.html.markdown @@ -387,13 +387,13 @@ if ([myClass respondsToSelector:selectorVar]) { // Проверяет содер NSNumber height; } -// Для доступа к public переменной, объявленной в интерфейсе используйте '_' перед названием переменной: +// Для доступа к public переменной, объявленной в интерфейсе, используйте '_' перед названием переменной: _count = 5; // Ссылается на "int count" из интерфейса MyClass -// Получение доступа к переменной, объявленной в имлементации происходит следующим образом: -distance = 18; // Ссылается на "long distance" из имлементации MyClass +// Получение доступа к переменной, объявленной в реализации происходит следующим образом: +distance = 18; // Ссылается на "long distance" из реализации MyClass // Для использования в иплементации переменной, объявленной в интерфейсе с помощью @property, // следует использовать @synthesize для создания переменной аксессора: -@synthesize roString = _roString; // Теперь _roString доступна в @implementation (имплементации интерфейса) +@synthesize roString = _roString; // Теперь _roString доступна в @implementation (реализации интерфейса) // Вызывается в первую очередь, перед вызовом других медотов класса или инициализации других объектов + (void)initialize @@ -507,7 +507,7 @@ distance = 18; // Ссылается на "long distance" из имлемент @end // Теперь, если мы хотим создать объект Truck - грузовик, мы должны создать подкласс класса Car, что -// изменит функционал Car и позволит вести себя подобно грузовику. Но что если мы хотим только добавить +// изменит функционал Car и позволит вести себя подобно грузовику. Но что, если мы хотим только добавить // определенный функционал в уже существующий класс Car? Например - чистка автомобиля. Мы просто создадим // категорию, которая добавит несколько методов для чистки автомобиля в класс Car: // @interface ИмяФайла: Car+Clean.h (ИмяБазовогоКласса+ИмяКатегории.h) From d75d8e133a5d7d2e23c7afc1ea16ec68db61cff7 Mon Sep 17 00:00:00 2001 From: Max Goldstein Date: Tue, 8 Dec 2015 15:06:37 -0500 Subject: [PATCH 685/685] Add Elm --- elm.html.markdown | 346 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 346 insertions(+) create mode 100644 elm.html.markdown diff --git a/elm.html.markdown b/elm.html.markdown new file mode 100644 index 00000000..8c191509 --- /dev/null +++ b/elm.html.markdown @@ -0,0 +1,346 @@ +--- +language: Elm +contributors: + - ["Max Goldstein", "http://maxgoldste.in/"] +--- + +Elm is a functional reactive programming language that compiles to (client-side) +JavaScript. Elm is statically typed, meaning that the compiler catches most +errors immediately and provides a clear and understandable error message. Elm is +great for designing user interfaces and games for the web. + + +```haskell +-- Single line comments start with two dashes. +{- Multiline comments can be enclosed in a block like this. +{- They can be nested. -} +-} + +{-- The Basics --} + +-- Arithmetic +1 + 1 -- 2 +8 - 1 -- 7 +10 * 2 -- 20 + +-- Every number literal without a decimal point can be either an Int or a Float. +33 / 2 -- 16.5 with floating point division +33 // 2 -- 16 with integer division + +-- Exponents +5 ^ 2 -- 25 + +-- Booleans +not True -- False +not False -- True +1 == 1 -- True +1 /= 1 -- False +1 < 10 -- True + +-- Strings and characters +"This is a string." +'a' -- character +'You cant use single quotes for strings.' -- error! + +-- Strings can be appended +"Hello " ++ "world!" -- "Hello world!" + +{-- Lists, Tuples, and Records --} + +-- Every element in a list must have the same type. +["the", "quick", "brown", "fox"] +[1, 2, 3, 4, 5] +-- The second example can also be written with two dots. +[1..5] + +-- Append lists just like strings +[1..5] ++ [6..10] == [1..10] -- True + +-- To add one item, use "cons" +0 :: [1..5] -- [0, 1, 2, 3, 4, 5] + +-- The head and tail of a list are returned as a Maybe. Instead of checking +-- every value to see if it's null, you deal with missing values explicitly. +List.head [1..5] -- Just 1 +List.tail [1..5] -- Just [2, 3, 4, 5] +List.head [] -- Nothing + +-- Every element in a tuple can be a different type, but a tuple has a +-- fixed length. +("elm", 42) + +-- Access the elements of a pair with the first and second functions. +-- (This is a shortcut; we'll come to the "real way" in a bit.) +fst ("elm", 42) -- "elm" +snd ("elm", 42) -- 42 + +-- Records are like tuples but the fields have names. +-- Notice that equals signs, not colons, are used. +{ x = 3, y = 7} + +-- Access a field with a dot and the field name. +{ x = 3, y = 7}.x -- 3 + +-- Or with an accessor fuction, a dot and then the field name. +.y { x = 3, y = 7} -- 7 + +-- Update the fields of a record. (It must have the fields already.) +{ person | + name = "George" } + +{ physics | + position = physics.position + physics.velocity, + velocity = physics.velocity + physics.acceleration } + +{-- Control Flow --} + +-- If statements always have an else, and the branches must be the same type. +if powerLevel > 9000 then + "WHOA!" +else + "meh" + +-- If statements can be chained. +if n < 0 then + "n is negative" +else if n > 0 then + "n is positive" +else + "n is zero" + +-- Use case statements to pattern match on different possibilities. +case aList of + [] -> "matches the empty list" + x::xs -> "matches a list of at least one item whose head is " ++ toString x + +case List.head aList of + Just x -> "The head is " ++ toString x + Nothing -> "The list was empty" + +{-- Functions --} + +-- Elm's syntax for functions is very minimal, relying mostly on whitespace +-- rather than parentheses and curly brackets. There is no "return" keyword. + +-- Define a function with its name, arguments, an equals sign, and the body. +multiply a b = + a * b + +-- Apply (call) a function by passing it arguments (no commas necessay). +multiply 7 6 -- 42 + +-- Partially apply a function by passing only some of its arguments. +-- Then give that function a new name. +double = + multiply 2 + +-- Constants are similar, except there are no arguments. +answer = + 42 + +-- Pass functions as arguments to other functions. +List.map double [1..4] -- [2, 4, 6, 8] + +-- Or write an anonymous function. +List.map (\a -> a * 2) [1..4] -- [2, 4, 6, 8] + +-- You can pattern match in function definitions when there's only one case. +-- This function takes one tuple rather than two arguments. +area (width, height) = + width * height + +area (6, 7) -- 42 + +-- Use curly brackets to pattern match record field names +-- Use let to define intermediate values +volume {width, height, depth} = + let + area = width * height + in + area * depth + +volume { width = 3, height = 2, depth = 7 } -- 42 + +-- Functions can be recursive +fib n = + if n < 2 then + 1 + else + fib (n - 1) + fib (n - 2) + +List.map fib [0..8] -- [1, 1, 2, 3, 5, 8,13, 21, 34] + +listLength aList = + case aList of + [] -> 0 + x::xs -> 1 + listLength xs + +-- Function application happens before any infix operation +cos (degrees 30) ^ 2 + sin (degrees 30) ^ 2 -- 1 +-- First degrees is applied to 30, then the result is passed to the trig +-- functions, which is then squared, and the addition happens last. + +{-- Types and Type Annotations --} + +-- The compiler will infer the type of every value in your program. +-- Types are always uppercase. Read x : T as "x has type T". +-- Some common types, which you might see in Elm's REPL. +5 : Int +6.7 : Float +"hello" : String +True : Bool + +-- Functions have types too. Read -> as "goes to". Think of the rightmost type +-- as the type of the return value. +not : Bool -> Bool +round : Float -> Int + +-- When you define a value, it's good practice to write its type above it. +-- The annotation is a form of documentation, which is verified by the compiler. +double : Int -> Int +double x = x * 2 + +-- Function arguments are passed in parentheses. +-- Lowercase types are type variables: they can be any type, as long as each +-- call is consistent. +List.map : (a -> b) -> List a -> List b +-- "List dot map has type a-goes-to-b, goes to list of a, goes to list of b." + +-- There are three special lowercase types: number, comparable, and appendable. +-- Numbers allow you to use arithmetic on Ints and Floats. +-- Comparable allows you to order numbers and strings, like a < b. +-- Appendable things can be combined with a ++ b. + +{-- Type Aliases and Union Types --} + +-- When you write a record or tuple, its type already exists. +-- (Notice that record types use colon and record values use equals.) +origin : { x : Float, y : Float, z : Float } +origin = + { x = 0, y = 0, z = 0 } + +-- You can give existing types a nice name with a type alias. +type alias Point3D = { x : Float, y : Float, z : Float } + +-- If you alias a record, you can use the name as a constructor function. +otherOrigin : Point3D +otherOrigin = Point3D 0 0 0 + +-- But it's still the same type, you can equate them +origin == otherOrigin -- True + +-- By contrast, defining a union type creates a type that didn't exist before. +-- A union type is so called because it can be one of many possibilities. +-- Each of the possibilities is represented as a "tag". +type Direction = North | South | East | West + +-- Tags can carry other values of known type. This can work recursively. +type IntTree = Leaf | Node Int IntTree IntTree + +-- "Leaf" and "Node" are the tags. Everything following a tag is a type. +-- Tags can be used as values or functions. +root : IntTree +root = Node 7 Leaf Leaf + +-- Union types (and type aliases) can use type variables. +type Tree a = Leaf | Node a (Tree a) (Tree a) + +-- You can pattern match union tags. The uppercase tags must be matched exactly. +-- The lowercase variables will match anything. Underscore also matches +-- anything, but signifies that you aren't using it. +leftmostElement : Tree a -> Maybe a +leftmostElement tree = + case tree of + Leaf -> Nothing + Node x Leaf _ -> Just x + Node _ subtree _ -> leftmostElement subtree + +-- That's pretty much it for the language itself. Now let's see how to organize +-- and run your code. + +{-- Modules and Imports --} + +-- The core libraries are organized into modulues, as are any third-party +-- libraries you may use. For large projects, you can define your own modulues. + +-- Put this at the top of the file. If omitted, you're in Main. +module Name where + +-- By default, everything is exported. +-- Limit what values and types are exported +module Name (Type, value) where + +-- One common pattern is to export a union type but not its tags. This is known +-- as an "opaque type", and is frequently used in libraries. + +-- Import code from other modules to use it in this one +-- Places Dict in scope, so you can call Dict.insert +import Dict + +-- Imports the Dict module and the Dict type, so your annotations don't have to +-- say Dict.Dict. You can still use Dict.insert. +import Dict exposing (Dict) + +-- Rename an import. +import Graphics.Collage as C + +{-- Ports --} + +-- A port indicates that you will be communicating with the outside world. +-- Ports are only allowed in the Main module. + +-- An incoming port is just a type signature. +port clientID : Int + +-- An outgoing port has a defintion. +port clientOrders : List String +port clientOrders = ["Books", "Groceries", "Furniture"] + +-- We won't go into the details, but you set up callbacks in JavaScript to send +-- on incoming ports and receive on outgoing ports. + +{-- Command Line Tools --} + +-- Compile a file. +$ elm make MyFile.elm + +-- The first time you do this, Elm will install the core libraries and create +-- elm-package.json, where information about your project is kept. + +-- The reactor is a server that compiles and runs your files. +-- Click the wrench next to file names to enter the time-travelling debugger! +$ elm reactor + +-- Experiment with simple expressions in a Read-Eval-Print Loop. +$ elm repl + +-- Packages are identified by GitHub username and repo name. +-- Install a new package, and record it in elm-package.json. +$ elm package install evancz/elm-html + +-- Elm's package manager enforces semantic versioning, so minor version bumps +-- will never break your build! +``` + +The Elm language is surprisingly small. You can now look through almost any Elm +source code and have a rough idea of what is going on. However, the possibilties +for error-resistant and easy-to-refactor code are endless! + +Here are some useful resources. + +* The [Elm website](http://elm-lang.org/). Includes: + * Links to the [installers](http://elm-lang.org/install) + * [Documentation guides](http://elm-lang.org/docs), including the [syntax reference](http://elm-lang.org/docs/syntax) + * Lots of helpful [examples](http://elm-lang.org/examples) + +* Documentation for [Elm's core libraries](http://package.elm-lang.org/packages/elm-lang/core/latest/). Take note of: + * [Basics](http://package.elm-lang.org/packages/elm-lang/core/latest/Basics), which is imported by default + * Data structures like [Array](http://package.elm-lang.org/packages/elm-lang/core/latest/Array), [Dict](http://package.elm-lang.org/packages/elm-lang/core/latest/Dict), and [Set](http://package.elm-lang.org/packages/elm-lang/core/latest/Set) + * JSON [encoding](http://package.elm-lang.org/packages/elm-lang/core/latest/Json-Encode) and [decoding](http://package.elm-lang.org/packages/elm-lang/core/latest/Json-Decode) + +* [The Elm Architecture](https://github.com/evancz/elm-architecture-tutorial#the-elm-architecture). An essay with examples on how to organize code into components. + +* The [Elm mailing list](https://groups.google.com/forum/#!forum/elm-discuss). Everyone is friendly and helpful. + + +Go out and write some Elm!

Le$Q3b%w#rI@`%ij#^uunS02)K6k^RD75JhcK=1EuOilWwnSc@IUK8 z3atRiWP82qaFIt>ZlPw(P}X&)q=r+l`_SnUiNhKa`$TXg?7w!HCtAc1fpv*Yy zxK`f<1P4|CB zwS>iOO75W~5EQ!@q2ZC<`K^A?r;L^EBEBEalqbSi9h%r>^?w zF7PM*w!N!>-?}7P=WoNAC_MjIf-mHT-waml5u~I- zc1aESVrcL^K~@8a4g1v@%h#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