From ff3b464026313e6ca2a11a9671c27c43b340da8f Mon Sep 17 00:00:00 2001 From: Elena Bolshakova Date: Fri, 28 Nov 2014 11:36:41 +0300 Subject: [PATCH 001/457] [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 b6e9ad3b8d5b0c742f4362f48c1e9988f6a8e87e Mon Sep 17 00:00:00 2001 From: Arnie97 Date: Sun, 19 Apr 2015 11:18:51 +0800 Subject: [PATCH 002/457] Create a copy of the English version. --- zh-cn/tmux-cn.html.markdown | 251 ++++++++++++++++++++++++++++++++++++ 1 file changed, 251 insertions(+) create mode 100644 zh-cn/tmux-cn.html.markdown diff --git a/zh-cn/tmux-cn.html.markdown b/zh-cn/tmux-cn.html.markdown new file mode 100644 index 00000000..c11da5fc --- /dev/null +++ b/zh-cn/tmux-cn.html.markdown @@ -0,0 +1,251 @@ +--- +category: tool +tool: tmux +contributors: + - ["mdln", "https://github.com/mdln"] +filename: LearnTmux.txt +--- + + +[tmux](http://tmux.sourceforge.net) +is a terminal multiplexer: it enables a number of terminals +to be created, accessed, and controlled from a single screen. tmux +may be detached from a screen and continue running in the background +then later reattached. + + +``` + + tmux [command] # Run a command + # 'tmux' with no commands will create a new session + + new # Create a new session + -s "Session" # Create named session + -n "Window" # Create named Window + -c "/dir" # Start in target directory + + attach # Attach last/available session + -t "#" # Attach target session + -d # Detach the session from other instances + + ls # List open sessions + -a # List all open sessions + + lsw # List windows + -a # List all windows + -s # List all windows in session + + lsp # List panes + -a # List all panes + -s # List all panes in session + -t # List app panes in target + + kill-window # Kill current window + -t "#" # Kill target window + -a # Kill all windows + -a -t "#" # Kill all windows but the target + + kill-session # Kill current session + -t "#" # Kill target session + -a # Kill all sessions + -a -t "#" # Kill all sessions but the target + +``` + + +### Key Bindings + +The method of controlling an attached tmux session is via key +combinations called 'Prefix' keys. + +``` +---------------------------------------------------------------------- + (C-b) = Ctrl + b # 'Prefix' combination required to use keybinds + + (M-1) = Meta + 1 -or- Alt + 1 +---------------------------------------------------------------------- + + ? # List all key bindings + : # Enter the tmux command prompt + r # Force redraw of the attached client + c # Create a new window + + ! # Break the current pane out of the window. + % # Split the current pane into two, left and right + " # Split the current pane into two, top and bottom + + n # Change to the next window + p # Change to the previous window + { # Swap the current pane with the previous pane + } # Swap the current pane with the next pane + + s # Select a new session for the attached client + interactively + w # Choose the current window interactively + 0 to 9 # Select windows 0 to 9 + + d # Detach the current client + D # Choose a client to detach + + & # Kill the current window + x # Kill the current pane + + Up, Down # Change to the pane above, below, left, or right + Left, Right + + M-1 to M-5 # Arrange panes: + # 1) even-horizontal + # 2) even-vertical + # 3) main-horizontal + # 4) main-vertical + # 5) tiled + + C-Up, C-Down # Resize the current pane in steps of one cell + C-Left, C-Right + + M-Up, M-Down # Resize the current pane in steps of five cells + M-Left, M-Right + +``` + + +### Configuring ~/.tmux.conf + +tmux.conf can be used to set options automatically on start up, much +like how .vimrc or init.el are used. + +``` +# Example tmux.conf +# 2014.10 + + +### General +########################################################################### + +# Enable UTF-8 +setw -g utf8 on +set-option -g status-utf8 on + +# Scrollback/History limit +set -g history-limit 2048 + +# Index Start +set -g base-index 1 + +# Mouse +set-option -g mouse-select-pane on + +# Force reload of config file +unbind r +bind r source-file ~/.tmux.conf + + +### Keybinds +########################################################################### + +# Unbind C-b as the default prefix +unbind C-b + +# Set new default prefix +set-option -g prefix ` + +# Return to previous window when prefix is pressed twice +bind C-a last-window +bind ` last-window + +# Allow swapping C-a and ` using F11/F12 +bind F11 set-option -g prefix C-a +bind F12 set-option -g prefix ` + +# Keybind preference +setw -g mode-keys vi +set-option -g status-keys vi + +# Moving between panes with vim movement keys +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +# Window Cycle/Swap +bind e previous-window +bind f next-window +bind E swap-window -t -1 +bind F swap-window -t +1 + +# Easy split pane commands +bind = split-window -h +bind - split-window -v +unbind '"' +unbind % + +# Activate inner-most session (when nesting tmux) to send commands +bind a send-prefix + + +### Theme +########################################################################### + +# Statusbar Color Palatte +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 + +# Pane Border Color Palette +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 + +# Message Color Palette +set-option -g message-fg black +set-option -g message-bg green + +# Window Status Color Palette +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 +########################################################################### + +# Notification +setw -g monitor-activity on +set -g visual-activity on +set-option -g bell-action any +set-option -g visual-bell off + +# Automatically set window titles +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) + +# Statusbar Adjustments +set -g status-left "#[fg=red] #H#[fg=green]:#[fg=white]#S#[fg=green] |#[default]" + +# Show performance counters in statusbar +# Requires 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]" + +``` + + +### References + +[Tmux | Home](http://tmux.sourceforge.net) + +[Tmux Manual page](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) + +[Display CPU/MEM % in statusbar](https://stackoverflow.com/questions/11558907/is-there-a-better-way-to-display-cpu-usage-in-tmux) From da12b4d6f592aaf7bce4de6d78c75877cdcc968c Mon Sep 17 00:00:00 2001 From: Arnie97 Date: Sun, 19 Apr 2015 11:42:22 +0800 Subject: [PATCH 003/457] Translate the majority into Chinese. --- zh-cn/tmux-cn.html.markdown | 184 ++++++++++++++++++------------------ 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/zh-cn/tmux-cn.html.markdown b/zh-cn/tmux-cn.html.markdown index c11da5fc..184daca1 100644 --- a/zh-cn/tmux-cn.html.markdown +++ b/zh-cn/tmux-cn.html.markdown @@ -1,9 +1,12 @@ --- category: tool tool: tmux +filename: LearnTmux-cn.txt contributors: - ["mdln", "https://github.com/mdln"] -filename: LearnTmux.txt +translators: + - ["Arnie97", "https://github.com/Arnie97"] +lang: zh-cn --- @@ -16,194 +19,191 @@ then later reattached. ``` - tmux [command] # Run a command - # 'tmux' with no commands will create a new session + tmux [command] # 运行一条命令 + # 如果忽略 'tmux' 之后的命令,将会建立一个新的会话 - new # Create a new session - -s "Session" # Create named session - -n "Window" # Create named Window - -c "/dir" # Start in target directory + new # 创建一个新的会话 + -s "Session" # 创建一个named会话 + -n "Window" # 创建一个named窗口 + -c "/dir" # 在指定的工作目录中启动会话 - attach # Attach last/available session - -t "#" # Attach target session - -d # Detach the session from other instances + attach # 连接到上一次的会话(如果可用) + -t "#" # 连接到指定的会话 + -d # 断开其他客户端的会话 - ls # List open sessions - -a # List all open sessions + ls # 列出打开的会话 + -a # 列出所有打开的会话 - lsw # List windows - -a # List all windows - -s # List all windows in session + lsw # 列出窗口 + -a # 列出所有窗口 + -s # 列出会话中的所有窗口 - lsp # List panes - -a # List all panes - -s # List all panes in session + lsp # 列出窗格 + -a # 列出所有窗格 + -s # 列出会话中的所有窗格 -t # List app panes in target - kill-window # Kill current window - -t "#" # Kill target window - -a # Kill all windows - -a -t "#" # Kill all windows but the target + kill-window # 关闭当前窗口 + -t "#" # 关闭指定的窗口 + -a # 关闭所有窗口 + -a -t "#" # 关闭除指定窗口以外的所有窗口 - kill-session # Kill current session - -t "#" # Kill target session - -a # Kill all sessions - -a -t "#" # Kill all sessions but the target + kill-session # 关闭当前会话 + -t "#" # 关闭指定的会话 + -a # 关闭所有会话 + -a -t "#" # 关闭除指定会话以外的所有会话 ``` -### Key Bindings +## 快捷键 -The method of controlling an attached tmux session is via key -combinations called 'Prefix' keys. +# 通过“前缀”快捷键,可以控制一个已经连入的tmux会话。 ``` ---------------------------------------------------------------------- - (C-b) = Ctrl + b # 'Prefix' combination required to use keybinds + (C-b) = Ctrl + b # 在使用下列快捷键之前,需要按这个“前缀”快捷键 - (M-1) = Meta + 1 -or- Alt + 1 + (M-1) = Meta + 1 或 Alt + 1 ---------------------------------------------------------------------- - ? # List all key bindings - : # Enter the tmux command prompt - r # Force redraw of the attached client - c # Create a new window + ? # 列出所有快捷键 + : # 进入tmux的命令提示符 + r # 强制重绘 the attached client + c # 创建一个新窗口 ! # Break the current pane out of the window. - % # Split the current pane into two, left and right - " # Split the current pane into two, top and bottom + % # 将当前窗格分为左右两半 + " # 将当前窗格分为上下两半 - n # Change to the next window - p # Change to the previous window - { # Swap the current pane with the previous pane - } # Swap the current pane with the next pane + n # 切换到下一个窗口 + p # 切换到上一个窗口 + { # 将当前窗格与上一个窗格交换 + } # 将当前窗格与下一个窗格交换 - s # Select a new session for the attached client - interactively - w # Choose the current window interactively - 0 to 9 # Select windows 0 to 9 + s # 在交互式界面中,选择并连接至另一个会话 + w # 在交互式界面中,选择并激活一个窗口 + 0 至 9 # 选择 0 到 9 号窗口 - d # Detach the current client - D # Choose a client to detach + d # 断开当前客户端 + D # 选择并断开一个客户端 - & # Kill the current window - x # Kill the current pane + & # 关闭当前窗口 + x # 关闭当前窗格 - Up, Down # Change to the pane above, below, left, or right + Up, Down # 将焦点移动至相邻的窗格 Left, Right - M-1 to M-5 # Arrange panes: + M-1 到 M-5 # 排列窗格: # 1) even-horizontal # 2) even-vertical # 3) main-horizontal # 4) main-vertical # 5) tiled - C-Up, C-Down # Resize the current pane in steps of one cell + C-Up, C-Down # 改变当前窗格的大小,每按一次增减一个单位 C-Left, C-Right - M-Up, M-Down # Resize the current pane in steps of five cells + M-Up, M-Down # 改变当前窗格的大小,每按一次增减五个单位 M-Left, M-Right ``` -### Configuring ~/.tmux.conf +### 配置 ~/.tmux.conf -tmux.conf can be used to set options automatically on start up, much -like how .vimrc or init.el are used. +tmux.conf 可以在 tmux 启动时自动设置选项,类似于 .vimrc 或 init.el 的用法。 ``` -# Example tmux.conf +# tmux.conf 示例 # 2014.10 -### General +### 通用设置 ########################################################################### -# Enable UTF-8 +# 启用 UTF-8 编码 setw -g utf8 on set-option -g status-utf8 on -# Scrollback/History limit +# 命令回滚/历史数量限制 set -g history-limit 2048 # Index Start set -g base-index 1 -# Mouse +# 启用鼠标 set-option -g mouse-select-pane on -# Force reload of config file +# 重新加载配置文件 unbind r bind r source-file ~/.tmux.conf -### Keybinds +### 快捷键设置 ########################################################################### -# Unbind C-b as the default prefix +# 取消默认的前缀键 C-b unbind C-b -# Set new default prefix +# 设置新的前缀键 set-option -g prefix ` -# Return to previous window when prefix is pressed twice +# 再次按下前缀键时,回到之前的窗口 bind C-a last-window bind ` last-window -# Allow swapping C-a and ` using F11/F12 +# 按下F11/F12,可以选择不同的前缀键 bind F11 set-option -g prefix C-a bind F12 set-option -g prefix ` -# Keybind preference +# Vim 风格的快捷键绑定 setw -g mode-keys vi set-option -g status-keys vi -# Moving between panes with vim movement keys +# 使用 vim 风格的按键在窗格间移动 bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R -# Window Cycle/Swap +# 循环切换不同的窗口 bind e previous-window bind f next-window bind E swap-window -t -1 bind F swap-window -t +1 -# Easy split pane commands +# 较易于使用的窗格分割快捷键 bind = split-window -h bind - split-window -v unbind '"' unbind % -# Activate inner-most session (when nesting tmux) to send commands +# 在嵌套使用 tmux 的情况下,激活最内层的会话,以便向其发送命令 bind a send-prefix -### Theme +### 外观主题 ########################################################################### -# Statusbar Color Palatte +# 状态栏颜色 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 -# Pane Border Color Palette -set-option -g pane-active-border-fg green -set-option -g pane-active-border-bg black -set-option -g pane-border-fg white -set-option -g pane-border-bg black +# 窗格边框颜色 +set-option -g 窗格-active-border-fg green +set-option -g 窗格-active-border-bg black +set-option -g 窗格-border-fg white +set-option -g 窗格-border-bg black -# Message Color Palette +# 消息框颜色 set-option -g message-fg black set-option -g message-bg green -# Window Status Color Palette +# 窗口状态栏颜色 setw -g window-status-bg black setw -g window-status-current-fg green setw -g window-status-bell-attr default @@ -214,38 +214,38 @@ setw -g window-status-activity-attr default setw -g window-status-activity-fg yellow -### UI +### 用户界面 ########################################################################### -# Notification +# 通知方式 setw -g monitor-activity on set -g visual-activity on set-option -g bell-action any set-option -g visual-bell off -# Automatically set window titles +# 自动设置窗口标题 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) +set-option -g set-titles-string '#H:#S.#I.#P #W #T' # 窗口编号,程序名称,是否活动 -# Statusbar Adjustments +# 调整状态栏 set -g status-left "#[fg=red] #H#[fg=green]:#[fg=white]#S#[fg=green] |#[default]" -# Show performance counters in statusbar -# Requires https://github.com/thewtex/tmux-mem-cpu-load/ +# 在状态栏中显示性能计数器 +# 需要用到 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]" ``` -### References +### 参考资料 -[Tmux | Home](http://tmux.sourceforge.net) +[Tmux 主页](http://tmux.sourceforge.net) -[Tmux Manual page](http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/tmux.1?query=tmux) +[Tmux 手册](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) -[Display CPU/MEM % in statusbar](https://stackoverflow.com/questions/11558907/is-there-a-better-way-to-display-cpu-usage-in-tmux) +[如何在 tmux 状态栏中显示 CPU / 内存占用百分比](https://stackoverflow.com/questions/11558907/is-there-a-better-way-to-display-cpu-usage-in-tmux) From 8aa98bd572bf4a0e1e52ead5a5ee192fc2101df6 Mon Sep 17 00:00:00 2001 From: Arnie97 Date: Thu, 28 May 2015 15:54:49 +0800 Subject: [PATCH 004/457] Minor improvements. --- zh-cn/tmux-cn.html.markdown | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/zh-cn/tmux-cn.html.markdown b/zh-cn/tmux-cn.html.markdown index 184daca1..00bf35f3 100644 --- a/zh-cn/tmux-cn.html.markdown +++ b/zh-cn/tmux-cn.html.markdown @@ -10,21 +10,19 @@ lang: zh-cn --- -[tmux](http://tmux.sourceforge.net) -is a terminal multiplexer: it enables a number of terminals -to be created, accessed, and controlled from a single screen. tmux -may be detached from a screen and continue running in the background -then later reattached. - +[tmux](http://tmux.sourceforge.net)是一款终端复用工具。 +在它的帮助下,你可以在同一个控制台上建立、访问并控制多个终端。 +你可以断开与一个tmux终端的连接,此时程序将在后台运行, +当你需要时,可以随时重新连接到这个终端。 ``` tmux [command] # 运行一条命令 - # 如果忽略 'tmux' 之后的命令,将会建立一个新的会话 + # 如果单独使用 'tmux' 而不指定某个命令,将会建立一个新的会话 new # 创建一个新的会话 - -s "Session" # 创建一个named会话 - -n "Window" # 创建一个named窗口 + -s "Session" # 创建一个会话,并命名为“Session” + -n "Window" # 创建一个窗口,并命名为“Window” -c "/dir" # 在指定的工作目录中启动会话 attach # 连接到上一次的会话(如果可用) @@ -56,9 +54,9 @@ then later reattached. ``` -## 快捷键 +### 快捷键 -# 通过“前缀”快捷键,可以控制一个已经连入的tmux会话。 +通过“前缀”快捷键,可以控制一个已经连入的tmux会话。 ``` ---------------------------------------------------------------------- @@ -69,7 +67,7 @@ then later reattached. ? # 列出所有快捷键 : # 进入tmux的命令提示符 - r # 强制重绘 the attached client + r # 强制重绘当前客户端 c # 创建一个新窗口 ! # Break the current pane out of the window. @@ -194,10 +192,10 @@ set-option -g status-left-length 40 set-option -g status-right-length 80 # 窗格边框颜色 -set-option -g 窗格-active-border-fg green -set-option -g 窗格-active-border-bg black -set-option -g 窗格-border-fg white -set-option -g 窗格-border-bg black +set-option -g pane-active-border-fg green +set-option -g pane-active-border-bg black +set-option -g pane-border-fg white +set-option -g pane-border-bg black # 消息框颜色 set-option -g message-fg black From 30cff7bcefd708638e99c7a9917ca2534fb38fd5 Mon Sep 17 00:00:00 2001 From: Elena Bolshakova Date: Wed, 10 Jun 2015 11:00:00 +0300 Subject: [PATCH 005/457] 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 006/457] [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 a9febbeb223269f4cfa88287aeb13b0688537504 Mon Sep 17 00:00:00 2001 From: JustBlah Date: Thu, 24 Sep 2015 17:11:45 +0300 Subject: [PATCH 007/457] +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 008/457] 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 009/457] 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 4b0f53d964cc219c491765bfa9c8635cf6d38863 Mon Sep 17 00:00:00 2001 From: Tomasz Janiszewski Date: Thu, 1 Oct 2015 09:56:31 +0200 Subject: [PATCH 010/457] Add Polish translations for XML --- pl-pl/xml-pl.html.markdown | 137 +++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 pl-pl/xml-pl.html.markdown diff --git a/pl-pl/xml-pl.html.markdown b/pl-pl/xml-pl.html.markdown new file mode 100644 index 00000000..7cce138f --- /dev/null +++ b/pl-pl/xml-pl.html.markdown @@ -0,0 +1,137 @@ +--- +language: xml +filename: learnxml-pl.xml +contributors: + - ["João Farias", "https://github.com/JoaoGFarias"] +translators: + - ["Tomasz Janiszewski", "https://github.com/janisz"] +lang: pl-pl +--- + +XML (_Extensible Markup Language_) to rozszerzalny język znaczników, stworzony +do przechowywania i transportu danych. + +W przeciwieństwie do HTML, XML nie specyfikuje w jaki sposób wyświetlić dane, a +tylko je przechowuje. + +* Składnia XML + +```xml + + + + + + Codzienny Włoski + Giada De Laurentiis + 2005 + 30.00 + + + Harry Potter + J K. Rowling + 2005 + 29.99 + + + Nauka XML + Erik T. Ray + 2003 + 39.95 + + + + + + + + +komputer.gif + + +``` + +* Dobrze sformatowany dokument i walidacja + +Dokument XML jest dobrze sformatowany gdy jest syntaktycznie poprawny. +Jednakże możliwe jest wstrzykiwanie większej liczby ograniczeń w dokumencie, +używając definicji takich jak DTD i XML Schema. + +Dokument XML, który jest zgodny ze swoją definicją jest poprawny. + + +Korzystając z tych narzędzi możesz sprawdzić dane zawarte w dokumencie poza +logiką aplikacji. + +```xml + + + + + + + + + Everyday Italian + 30.00 + + + + + + + + + + +]> + + + + + + + + + + + + + +]> + + + + Everyday Italian + 30.00 + + +``` From 05559e8620d478b891c47d541dea978f661a8f3a Mon Sep 17 00:00:00 2001 From: Ale46 Date: Fri, 2 Oct 2015 18:41:55 +0200 Subject: [PATCH 011/457] [python/it] Translated python to Italian --- it-it/python-it.html.markdown | 647 ++++++++++++++++++++++++++++++++++ 1 file changed, 647 insertions(+) create mode 100644 it-it/python-it.html.markdown diff --git a/it-it/python-it.html.markdown b/it-it/python-it.html.markdown new file mode 100644 index 00000000..49bbab08 --- /dev/null +++ b/it-it/python-it.html.markdown @@ -0,0 +1,647 @@ +--- +language: python +contributors: + - ["Louie Dinh", "http://ldinh.ca"] + - ["Amin Bandali", "http://aminbandali.com"] + - ["Andre Polykanine", "https://github.com/Oire"] +filename: learnpython.py +translators: + - ["Ale46", "http://github.com/Ale46/"] +lang: it-it +--- +Python è stato creato da Guido Van Rossum agli inizi degli anni 90. Oggi è uno dei più popolari +linguaggi esistenti. Mi sono innamorato di Python per la sua chiarezza sintattica. E' sostanzialmente +pseudocodice eseguibile. + +Feedback sono altamente apprezzati! Potete contattarmi su [@louiedinh](http://twitter.com/louiedinh) oppure [at] [google's email service] + +Nota: Questo articolo è valido solamente per Python 2.7, ma dovrebbe andar bene anche per +Python 2.x. Per Python 3.x, dai un'occhiata a [Python 3 tutorial](http://learnxinyminutes.com/docs/python3/). + +```python + +# I commenti su una sola linea iniziano con un cancelletto + +""" Più stringhe possono essere scritte + usando tre ", e sono spesso usate + come commenti +""" + +#################################################### +## 1. Tipi di dati primitivi ed Operatori +#################################################### + +# Hai i numeri +3 # => 3 + +# La matematica è quello che vi aspettereste +1 + 1 # => 2 +8 - 1 # => 7 +10 * 2 # => 20 +35 / 5 # => 7 + +# La divisione è un po' complicata. E' una divisione fra interi in cui viene +# restituito in automatico il risultato intero. +5 / 2 # => 2 + +# Per le divisioni con la virgbola abbiamo bisogno di parlare delle variabili floats. +2.0 # Questo è un float +11.0 / 4.0 # => 2.75 ahhh...molto meglio + +# Il risultato di una divisione fra interi troncati positivi e negativi +5 // 3 # => 1 +5.0 // 3.0 # => 1.0 # funziona anche per i floats +-5 // 3 # => -2 +-5.0 // 3.0 # => -2.0 + +# Operazione Modulo +7 % 3 # => 1 + +# Elevamento a potenza (x alla y-esima potenza) +2**4 # => 16 + +# Forzare le precedenze con le parentesi +(1 + 3) * 2 # => 8 + +# Operatori Booleani +# Nota "and" e "or" sono case-sensitive +True and False #=> False +False or True #=> True + +# Note sull'uso di operatori Bool con interi +0 and 2 #=> 0 +-5 or 0 #=> -5 +0 == False #=> True +2 == True #=> False +1 == True #=> True + +# nega con not +not True # => False +not False # => True + +# Uguaglianza è == +1 == 1 # => True +2 == 1 # => False + +# Disuguaglianza è != +1 != 1 # => False +2 != 1 # => True + +# Altri confronti +1 < 10 # => True +1 > 10 # => False +2 <= 2 # => True +2 >= 2 # => True + +# I confronti possono essere concatenati! +1 < 2 < 3 # => True +2 < 3 < 2 # => False + +# Le stringhe sono create con " o ' +"Questa è una stringa." +'Anche questa è una stringa.' + +# Anche le stringhe possono essere sommate! +"Ciao " + "mondo!" # => Ciao mondo!" +# Le stringhe possono essere sommate anche senza '+' +"Ciao " "mondo!" # => Ciao mondo!" + +# ... oppure moltiplicate +"Hello" * 3 # => "HelloHelloHello" + +# Una stringa può essere considerata come una lista di caratteri +"Questa è una stringa"[0] # => 'Q' + +# % può essere usato per formattare le stringhe, in questo modo: +"%s possono essere %s" % ("le stringhe", "interpolate") + +# Un nuovo modo per fomattare le stringhe è il metodo format. +# Questo metodo è quello consigliato +"{0} possono essere {1}".format("le stringhe", "formattate") +# Puoi usare della parole chiave se non vuoi contare +"{nome} vuole mangiare {cibo}".format(nome="Bob", cibo="lasagna") + +# None è un oggetto +None # => None + +# Non usare il simbolo di uguaglianza "==" per comparare oggetti a None +# Usa "is" invece +"etc" is None # => False +None is None # => True + +# L'operatore 'is' testa l'identità di un oggetto. Questo non è +# molto utile quando non hai a che fare con valori primitivi, ma lo è +# quando hai a che fare con oggetti. + +# None, 0, e stringhe/liste vuote sono tutte considerate a False. +# Tutti gli altri valori sono True +bool(0) # => False +bool("") # => False + + +#################################################### +## 2. Variabili e Collections +#################################################### + +# Python ha una funzione di stampa +print "Sono Python. Piacere di conoscerti!" + +# Non c'è bisogno di dichiarare una variabile per assegnarle un valore +una_variabile = 5 # Convenzionalmente si usa caratteri_minuscoli_con_underscores +una_variabile # => 5 + +# Accedendo ad una variabile non precedentemente assegnata genera un'eccezione. +# Dai un'occhiata al Control Flow per imparare di più su come gestire le eccezioni. +un_altra_variabile # Genera un errore di nome + +# if può essere usato come un'espressione +"yahoo!" if 3 > 2 else 2 # => "yahoo!" + +# Liste immagazzinano sequenze +li = [] +# Puoi partire con una lista pre-riempita +altra_li = [4, 5, 6] + +# Aggiungi cose alla fine di una lista con append +li.append(1) # li ora è [1] +li.append(2) # li ora è [1, 2] +li.append(4) # li ora è [1, 2, 4] +li.append(3) # li ora è [1, 2, 4, 3] +# Rimuovi dalla fine della lista con pop +li.pop() # => 3 e li ora è [1, 2, 4] +# Rimettiamolo a posto +li.append(3) # li ora è [1, 2, 4, 3] di nuovo. + +# Accedi ad una lista come faresti con un array +li[0] # => 1 +# Assegna nuovo valore agli indici che sono già stati inizializzati con = +li[0] = 42 +li[0] # => 42 +li[0] = 1 # Nota: è resettato al valore iniziale +# Guarda l'ultimo elemento +li[-1] # => 3 + +# Guardare al di fuori dei limiti è un IndexError +li[4] # Genera IndexError + +# Puoi guardare gli intervalli con la sintassi slice (a fetta). +# (E' un intervallo chiuso/aperto per voi tipi matematici.) +li[1:3] # => [2, 4] +# Ometti l'inizio +li[2:] # => [4, 3] +# Ometti la fine +li[:3] # => [1, 2, 4] +# Seleziona ogni seconda voce +li[::2] # =>[1, 4] +# Copia al contrario della lista +li[::-1] # => [3, 4, 2, 1] +# Usa combinazioni per fare slices avanzate +# li[inizio:fine:passo] + +# Rimuovi arbitrariamente elementi da una lista con "del" +del li[2] # li è ora [1, 2, 3] +# Puoi sommare le liste +li + altra_li # => [1, 2, 3, 4, 5, 6] +# Nota: i valori per li ed _altri_li non sono modificati. + +# Concatena liste con "extend()" +li.extend(altra_li) # Ora li è [1, 2, 3, 4, 5, 6] + +# Controlla l'esistenza di un valore in una lista con "in" +1 in li # => True + +# Esamina la lunghezza con "len()" +len(li) # => 6 + + +# Tuple sono come le liste ma immutabili. +tup = (1, 2, 3) +tup[0] # => 1 +tup[0] = 3 # Genera un TypeError + +# Puoi fare tutte queste cose da lista anche sulle tuple +len(tup) # => 3 +tup + (4, 5, 6) # => (1, 2, 3, 4, 5, 6) +tup[:2] # => (1, 2) +2 in tup # => True + +# Puoi scompattare le tuple (o liste) in variabili +a, b, c = (1, 2, 3) # a è ora 1, b è ora 2 and c è ora 3 +# Le tuple sono create di default se non usi le parentesi +d, e, f = 4, 5, 6 +# Guarda come è facile scambiare due valori +e, d = d, e # d è ora 5 ed e è ora 4 + + +# Dizionari immagazzinano mappature +empty_dict = {} +# Questo è un dizionario pre-riempito +filled_dict = {"uno": 1, "due": 2, "tre": 3} + +# Accedi ai valori con [] +filled_dict["uno"] # => 1 + +# Ottieni tutte le chiavi come una lista con "keys()" +filled_dict.keys() # => ["tre", "due", "uno"] +# Nota - Nei dizionari l'ordine delle chiavi non è garantito. +# Il tuo risultato potrebbe non essere uguale a questo. + +# Ottieni tutt i valori come una lista con "values()" +filled_dict.values() # => [3, 2, 1] +# Nota - Come sopra riguardo l'ordinamento delle chiavi. + +# Controlla l'esistenza delle chiavi in un dizionario con "in" +"uno" in filled_dict # => True +1 in filled_dict # => False + +# Cercando una chiave non esistente è un KeyError +filled_dict["quattro"] # KeyError + +# Usa il metodo "get()" per evitare KeyError +filled_dict.get("uno") # => 1 +filled_dict.get("quattro") # => None +# Il metodo get supporta un argomento di default quando il valore è mancante +filled_dict.get("uno", 4) # => 1 +filled_dict.get("quattro", 4) # => 4 +# nota che filled_dict.get("quattro") è ancora => None +# (get non imposta il valore nel dizionario) + +# imposta il valore di una chiave con una sintassi simile alle liste +filled_dict["quattro"] = 4 # ora, filled_dict["quattro"] => 4 + +# "setdefault()" aggiunge al dizionario solo se la chiave data non è presente +filled_dict.setdefault("five", 5) # filled_dict["five"] è impostato a 5 +filled_dict.setdefault("five", 6) # filled_dict["five"] è ancora 5 + + +# Sets immagazzina ... sets (che sono come le liste, ma non possono contenere doppioni) +empty_set = set() +# Inizializza un "set()" con un po' di valori +some_set = set([1, 2, 2, 3, 4]) # some_set è ora set([1, 2, 3, 4]) + +# l'ordine non è garantito, anche se a volta può sembrare ordinato +another_set = set([4, 3, 2, 2, 1]) # another_set è ora set([1, 2, 3, 4]) + +# Da Python 2.7, {} può essere usato per dichiarare un set +filled_set = {1, 2, 2, 3, 4} # => {1, 2, 3, 4} + +# Aggiungere elementi ad un set +filled_set.add(5) # filled_set è ora {1, 2, 3, 4, 5} + +# Fai interazioni su un set con & +other_set = {3, 4, 5, 6} +filled_set & other_set # => {3, 4, 5} + +# Fai unioni su set con | +filled_set | other_set # => {1, 2, 3, 4, 5, 6} + +# Fai differenze su set con - +{1, 2, 3, 4} - {2, 3, 5} # => {1, 4} + +# Controlla l'esistenza in un set con in +2 in filled_set # => True +10 in filled_set # => False + + +#################################################### +## 3. Control Flow +#################################################### + +# Dichiariamo una variabile +some_var = 5 + +# Questo è un controllo if. L'indentazione è molto importante in python! +# stampa "some_var è più piccola di 10" +if some_var > 10: + print "some_var è decisamente più grande di 10." +elif some_var < 10: # Questa clausola elif è opzionale. + print "some_var è più piccola di 10." +else: # Anche questo è opzionale. + print "some_var è precisamente 10." + + +""" +I cicli for iterano sulle liste +stampa: + cane è un mammifero + gatto è un mammifero + topo è un mammifero +""" +for animale in ["cane", "gatto", "topo"]: + # Puoi usare {0} per interpolare le stringhe formattate. (Vedi di seguito.) + print "{0} è un mammifero".format(animale) + +""" +"range(numero)" restituisce una lista di numeri +da zero al numero dato +stampa: + 0 + 1 + 2 + 3 +""" +for i in range(4): + print i + +""" +"range(lower, upper)" restituisce una lista di numeri +dal più piccolo (lower) al più grande (upper) +stampa: + 4 + 5 + 6 + 7 +""" +for i in range(4, 8): + print i + +""" +I cicli while vengono eseguiti finchè una condizione viene a mancare +stampa: + 0 + 1 + 2 + 3 +""" +x = 0 +while x < 4: + print x + x += 1 # Forma compatta per x = x + 1 + +# Gestisci le eccezioni con un blocco try/except + +# Funziona da Python 2.6 in su: +try: + # Usa "raise" per generare un errore + raise IndexError("Questo è un errore di indice") +except IndexError as e: + pass # Pass è solo una non-operazione. Solitamente vorrai fare un recupero. +except (TypeError, NameError): + pass # Eccezioni multiple possono essere gestite tutte insieme, se necessario. +else: # Optional clause to the try/except block. Must follow all except blocks + print "All good!" # Viene eseguita solo se il codice dentro try non genera eccezioni +finally: # Eseguito sempre + print "Possiamo liberare risorse qui" + +# Invece di try/finally per liberare risorse puoi usare il metodo with +with open("myfile.txt") as f: + for line in f: + print line + +#################################################### +## 4. Funzioni +#################################################### + +# Usa "def" per creare nuove funzioni +def aggiungi(x, y): + print "x è {0} e y è {1}".format(x, y) + return x + y # Restituisce valori con il metodo return + +# Chiamare funzioni con parametri +aggiungi(5, 6) # => stampa "x è 5 e y è 6" e restituisce 11 + +# Un altro modo per chiamare funzioni è con parole chiave come argomenti +aggiungi(y=6, x=5) # Le parole chiave come argomenti possono arrivare in ogni ordine. + + +# Puoi definire funzioni che accettano un numero variabile di argomenti posizionali +# che verranno interpretati come come tuple se non usi il * +def varargs(*args): + return args + +varargs(1, 2, 3) # => (1, 2, 3) + + +# Puoi definire funzioni che accettano un numero variabile di parole chiave +# come argomento, che saranno interpretati come un dizionario se non usi ** +def keyword_args(**kwargs): + return kwargs + +# Chiamiamola per vedere cosa succede +keyword_args(big="foot", loch="ness") # => {"big": "foot", "loch": "ness"} + + +# Puoi farle entrambi in una volta, se ti va +def all_the_args(*args, **kwargs): + print args + print kwargs +""" +all_the_args(1, 2, a=3, b=4) stampa: + (1, 2) + {"a": 3, "b": 4} +""" + +# Quando chiami funzioni, puoi fare l'opposto di args/kwargs! +# Usa * per sviluppare gli argomenti posizionale ed usa ** per espandere gli argomenti parola chiave +args = (1, 2, 3, 4) +kwargs = {"a": 3, "b": 4} +all_the_args(*args) # equivalente a foo(1, 2, 3, 4) +all_the_args(**kwargs) # equivalente a foo(a=3, b=4) +all_the_args(*args, **kwargs) # equivalente a foo(1, 2, 3, 4, a=3, b=4) + +# puoi passare args e kwargs insieme alle altre funzioni che accettano args/kwargs +# sviluppandoli, rispettivamente, con * e ** +def pass_all_the_args(*args, **kwargs): + all_the_args(*args, **kwargs) + print varargs(*args) + print keyword_args(**kwargs) + +# Funzioni Scope +x = 5 + +def setX(num): + # La variabile locale x non è uguale alla variabile globale x + x = num # => 43 + print x # => 43 + +def setGlobalX(num): + global x + print x # => 5 + x = num # la variabile globable x è ora 6 + print x # => 6 + +setX(43) +setGlobalX(6) + +# Python ha funzioni di prima classe +def create_adder(x): + def adder(y): + return x + y + return adder + +add_10 = create_adder(10) +add_10(3) # => 13 + +# Ci sono anche funzioni anonime +(lambda x: x > 2)(3) # => True + +# Esse sono incluse in funzioni di alto livello +map(add_10, [1, 2, 3]) # => [11, 12, 13] +filter(lambda x: x > 5, [3, 4, 5, 6, 7]) # => [6, 7] + +# Possiamo usare la comprensione delle liste per mappe e filtri +[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] + + +#################################################### +## 5. Classi +#################################################### + +# Usiamo una sottoclasse da un oggetto per avere una classe. +class Human(object): + + # Un attributo della classe. E' condiviso da tutte le istanze delle classe + species = "H. sapiens" + + # Costruttore base, richiamato quando la classe viene inizializzata. + # Si noti che il doppio leading e l'underscore finali denotano oggetti + # o attributi che sono usati da python ma che vivono nello spazio dei nome controllato + # dall'utente. Non dovresti usare nomi di questo genere. + def __init__(self, name): + # Assegna l'argomento all'attributo name dell'istanza + self.name = name + + # Un metodo dell'istanza. Tutti i metodi prendo "self" come primo argomento + def say(self, msg): + return "{0}: {1}".format(self.name, msg) + + # Un metodo della classe è condiviso fra tutte le istanze + # Sono chiamate con la classe chiamante come primo argomento + @classmethod + def get_species(cls): + return cls.species + + # Un metodo statico è chiamato senza una classe od una istanza di riferimento + @staticmethod + def grunt(): + return "*grunt*" + + +# Instanziare una classe +i = Human(name="Ian") +print i.say("hi") # stampa "Ian: hi" + +j = Human("Joel") +print j.say("hello") # stampa "Joel: hello" + +# Chiamare metodi della classe +i.get_species() # => "H. sapiens" + +# Cambiare l'attributo condiviso +Human.species = "H. neanderthalensis" +i.get_species() # => "H. neanderthalensis" +j.get_species() # => "H. neanderthalensis" + +# Chiamare il metodo condiviso +Human.grunt() # => "*grunt*" + + +#################################################### +## 6. Moduli +#################################################### + +# Puoi importare moduli +import math +print math.sqrt(16) # => 4 + +# Puoi ottenere specifiche funzione da un modulo +from math import ceil, floor +print ceil(3.7) # => 4.0 +print floor(3.7) # => 3.0 + +# Puoi importare tutte le funzioni da un modulo +# Attenzione: questo non è raccomandato +from math import * + +# Puoi abbreviare i nomi dei moduli +import math as m +math.sqrt(16) == m.sqrt(16) # => True +# puoi anche verificare che le funzioni sono equivalenti +from math import sqrt +math.sqrt == m.sqrt == sqrt # => True + +# I moduli di Python sono normali file python. Ne puoi +# scrivere di tuoi ed importarli. Il nome del modulo +# è lo stesso del nome del file. + +# Potete scoprire quali funzioni e attributi +# definiscono un modulo +import math +dir(math) + + +#################################################### +## 7. Avanzate +#################################################### + +# Generators help you make lazy code +def double_numbers(iterable): + for i in iterable: + yield i + i + +# Un generatore crea valori al volo. +# Invece di generare e ritornare tutti i valori in una volta ne crea uno in ciascuna +# iterazione. Ciò significa che i valori più grandi di 15 non saranno considerati in +# double_numbers. +# Nota xrange è un generatore che fa la stessa cosa di range. +# Creare una lista 1-900000000 occuperebbe molto tempo e spazio. +# xrange crea un oggetto generatore xrange invece di creare l'intera lista +# come fa range. +# Usiamo un underscore finale nel nome delle variabile quando vogliamo usare un nome +# che normalmente colliderebbe con una parola chiave di python +xrange_ = xrange(1, 900000000) + +# raddoppierà tutti i numeri fino a che result >=30 non sarà trovato +for i in double_numbers(xrange_): + print i + if i >= 30: + break + + +# Decoratori +# in questo esempio beg include say +# Beg chiamerà say. Se say_please è True allora cambierà il messaggio +# ritornato +from functools import wraps + + +def beg(target_function): + @wraps(target_function) + def wrapper(*args, **kwargs): + msg, say_please = target_function(*args, **kwargs) + if say_please: + return "{} {}".format(msg, "Please! I am poor :(") + return msg + + return wrapper + + +@beg +def say(say_please=False): + msg = "Can you buy me a beer?" + return msg, say_please + + +print say() # Can you buy me a beer? +print say(say_please=True) # Can you buy me a beer? Please! I am poor :( +``` + +## Ready For More? + +### Free Online + +* [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/) +* [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) +* [First Steps With Python](https://realpython.com/learn/python-first-steps/) + +### Dead Tree + +* [Programming Python](http://www.amazon.com/gp/product/0596158106/ref=as_li_qf_sp_asin_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0596158106&linkCode=as2&tag=homebits04-20) +* [Dive Into Python](http://www.amazon.com/gp/product/1441413022/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1441413022&linkCode=as2&tag=homebits04-20) +* [Python Essential Reference](http://www.amazon.com/gp/product/0672329786/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0672329786&linkCode=as2&tag=homebits04-20) From 18058567c4e7570ca7fd053299eefd0d36658329 Mon Sep 17 00:00:00 2001 From: Matteo Taroli Date: Fri, 2 Oct 2015 22:17:16 +0200 Subject: [PATCH 012/457] 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 e77db2429dcc3422517763edf69efa3aaf234c05 Mon Sep 17 00:00:00 2001 From: Deivuh Date: Fri, 2 Oct 2015 16:47:19 -0600 Subject: [PATCH 013/457] 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 014/457] 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 015/457] 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 016/457] 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 b723d3284bbccbcbf5e7ecedee3469b87f4d5959 Mon Sep 17 00:00:00 2001 From: Matteo Taroli Date: Thu, 8 Oct 2015 12:38:19 +0200 Subject: [PATCH 017/457] 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 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 018/457] 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 7e294ad5aecce697d1a2b4cc2adaa5a35b090e24 Mon Sep 17 00:00:00 2001 From: Vladimir Dementyev Date: Wed, 14 Oct 2015 11:17:09 +0300 Subject: [PATCH 019/457] [erlang/ru] Fix typo --- ru-ru/erlang-ru.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ru-ru/erlang-ru.html.markdown b/ru-ru/erlang-ru.html.markdown index 99ea79ee..69f81800 100644 --- a/ru-ru/erlang-ru.html.markdown +++ b/ru-ru/erlang-ru.html.markdown @@ -18,7 +18,7 @@ lang: ru-ru % Пунктуационные знаки, используемые в Erlang: % Запятая (`,`) разделяет аргументы в вызовах функций, структурах данных и % образцах. -% Точка (`.`) (с пробелом после них) разделяет функции и выражения в +% Точка (`.`) (с пробелом после неё) разделяет функции и выражения в % оболочке. % Точка с запятой (`;`) разделяет выражения в следующих контекстах: % формулы функций, выражения `case`, `if`, `try..catch` и `receive`. From 59ce161978ccaad26f7e9c31721fd2af7f6df9c0 Mon Sep 17 00:00:00 2001 From: Whitebyte Date: Thu, 15 Oct 2015 00:10:12 +0600 Subject: [PATCH 020/457] D language russian --- ru-ru/d-ru.html.markdown | 735 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 735 insertions(+) create mode 100644 ru-ru/d-ru.html.markdown diff --git a/ru-ru/d-ru.html.markdown b/ru-ru/d-ru.html.markdown new file mode 100644 index 00000000..33bff3b7 --- /dev/null +++ b/ru-ru/d-ru.html.markdown @@ -0,0 +1,735 @@ +--- +language: d +filename: learnd-ru.d +contributors: + - ["Anton Pastukhov", "http://dprogramming.ru/"] + - ["Robert Brights-Gray", "http://lhs-blog.info/"] +lang: ru-ru +--- +D - современный компилируемый язык общего назначения с Си-подобным синтаксисом, +который сочетает удобство, продуманный дизайн и высокую производительность. +D - это С++, сделанный правильно. + +```d +// Welcome to D! Это однострочный комментарий + +/* многострочный + комментарий */ + +/+ + // вложенные кометарии + + /* еще вложенные + комментарии */ + + /+ + // мало уровней вложенности? Их может быть сколько угодно. + +/ ++/ + +/* + Имя модуля. Каждый файл с исходным кодом на D — модуль. + Если имя не указано явно, то предполагается, что оно совпадает с именем + файла. Например, для файла "test.d" имя модуля будет "test", если явно + не указать другое + */ +module app; + +// импорт модуля. Std — пространство имен стандартной библиотеки (Phobos) +import std.stdio; + +// можно импортировать только нужные части, не обязательно модуль целиком +import std.exception : assert; + +// точка входа в программу — функция main, аналогично C/C++ +void main() +{ + writeln("Hello, world!"); +} + + + +/*** типы и переменные ***/ + +int a; // объявление переменной типа int (32 бита) +float b = 12.34; // тип с плавающей точкой +double с = 56.78; // тип с плавающей точкой (64 бита) + +/* + Численные типы в D, за исключением типов с плавающей точкой и типов + комплексных чисел, могут быть беззнаковыми. + В этом случае название типа начинается с префикса "u" +*/ +uint d = 10, ulong e = 11.12; +bool b = true; // логический тип +char d = 'd'; // UTF-символ, 8 бит. D поддерживает UTF "из коробки" +wchar = 'é'; // символ UTF-16 +dchar f; // и даже UTF-32, если он вам зачем-то понадобится + +string s = "для строк есть отдельный тип, это не просто массив char-ов из Си"; +wstring ws = "поскольку у нас есть wchar, должен быть и wstring"; +dstring ds = "...и dstring, конечно"; + +typeof(a) b = 6; // typeof возвращает тип своего выражения. + // В результате, b имеет такой же тип как и a + +// Тип переменной, помеченной ключевым словом auto, +// присваивается компилятором исходя из значения этой переменной +auto x = 1; // Например, тип этой переменной будет int. +auto y = 1.1; // этой — double +auto z = "Zed is dead!"; // а этой — string + +int[3] arr = [1, 2, 3]; // простой одномерный массив с фиксированным размером +int[] arr2 = [1, 2, 3, 4]; // динамический массив +int[string] aa = ["key1": 5, "key2": 6]; // ассоциативный массив + +/* + Cтроки и массивы в D — встроенные типы. Для их использования не нужно + подключать ни внешние, ни даже стандартную библиотеку, хотя в последней + есть множество дополнительных инструментов для работы с ними. + */ +immutalbe int ia = 10; // неизменяемый тип, + // обозначается ключевым словом immutable +ia += 1; // — вызовет ошибку на этапе компиляции + +// перечислимый (enumerable) тип, +// более правильный способ работы с константами в D +enum myConsts = { Const1, Const2, Const3 }; + +// свойства типов +writeln("Имя типа : ", int.stringof); // int +writeln("Размер в байтах : ", int.sizeof); // 4 +writeln("Минимальное значение : ", int.min); // -2147483648 +writeln("Максимальное значениеe : ", int.max); // 2147483647 +writeln("Начальное значение : ", int.init); // 0. Это значение, + // присвоенное по умолчанию + +// На самом деле типов в D больше, но все мы здесь описывать не будем, +// иначе не уложимся в Y минут. + + + +/*** Приведение типов ***/ + +// Простейший вариант +int i; +double j = double(i) / 2; + +// to!(имя типа)(выражение) - для большинства конверсий +import std.conv : to; // функция "to" - часть стандартной библиотеки, а не языка +double d = -1.75; +short s = to!short(d); // s = -1 + +/* + cast - если вы знаете, что делаете. Кроме того, это единственный способ + преобразования типов-указателей в "обычные" и наоборот +*/ +void* v; +int* p = cast(int*)v; + +// Для собственного удобства можно создавать псевдонимы +// для различных встроенных объектов +alias int newInt; // теперь можно обращаться к int так, как будто бы это newInt +newInt a = 5; + +alias newInt = int; // так тоже допустимо +alias uint[2] pair; // дать псевдоним можно даже сложным структурам данных + + + +/*** Операторы ***/ + +int x = 10; // присваивание +x = x + 1; // 11 +x -= 2; // 9 +x++; // 10 +++x; // 11 +x *= 2; // 22 +x /= 2; // 11 +x ^^ 2; // 121 (возведение в степень) +x ^^= 2; // 1331 (то же самое) + +string str1 = "Hello"; +string str2 = ", world!"; +string hw = str1 ~ str2; // Конкатенация строк + +int[] arr = [1, 2, 3]; +arr ~= 4; // [1, 2, 3, 4] - добавление элемента в конец массива + + + +/*** Логика и сравнения ***/ + +int x = 0, int y = 1; + +x == y; // false +x > y; // false +x < y; // true +x >= y; // false +x != y; // true. ! — логическое "не" +x > 0 || x < 1; // true. || — логическое "или" +x > 0 && x < 1; // false && — логическое "и" +x ^ y // true; ^ - xor (исключающее "или") + +// Тернарный оператор +auto y = (x > 10) ? 1 : 0; // если x больше 10, то y равен 1, + // в противном случае y равен нулю + + +/*** Управляющие конструкции ***/ + +// if - абсолютно привычен +if (a == 1) { + // .. +} else if (a == 2) { + // .. +} else { + // .. +} + +// switch +switch (a) { + case 1: + // делаем что-нибудь + break; + case 2: + // делаем что-нибудь другое + break; + case 3: + // делаем что-нибудь еще + break; + default: + // default обязателен, без него будет ошибка компиляции + break; +} + +// while +while (a > 10) { + // .. + if (number == 42) { + break; + } +} + +while (true) { + // бесконечный цикл +} + +// do-while +do { + // .. +} while (a == 10); + +// for +for (int number = 1; number < 11; ++number) { + writeln(number); // все абсолютно стандартно +} + +for ( ; ; ) { + // секции могут быть пустыми. Это бесконечный цикл в стиле Си +} + +// foreach - универсальный и самый "правильный" цикл в D +foreach (element; array) { + writeln(element); // для простых массивов +} + +foreach (key, val; aa) { + writeln(key, ": ", val); // для ассоциативных массивов +} + +foreach (c; "hello") { + writeln(c); // hello. Поскольку строки - это вариант массива, + // foreach применим и к ним +} + +foreach (number; 10..15) { + writeln(number); // численные интервалы можно указывать явным образом +} + +// foreach_reverse - в обратную сторону +auto container = [ 1, 2, 3 ]; +foreach_reverse (element; container) { + writefln("%s ", element); // 3, 2, 1 +} + +// foreach в массивах и им подобных структурах не меняет сами структуры +int[] a = [1,2,3,4,5]; +foreach (elem; array) { + elem *= 2; // сам массив останется неизменным +} + +writeln(a); // вывод: [1,2,3,4,5] Т.е изменений нет + +// добавление ref приведет к тому, что массив будет изменяться +foreach (ref elem; array) { + elem *= 2; // сам массив останется неизменным +} + +writeln(a); // [2,4,6,8,10] + +// foreach умеет расчитывать индексы элементов +int[] a = [1,2,3,4,5]; +foreach (ind, elem; array) { + writeln(ind, " ", elem); // через ind - доступен индекс элемента, + // а через elem - сам элемент +} + + + +/*** Функции ***/ + +test(42); // Что, вот так сразу? Разве мы где-то уже объявили эту функцию? + +// Нет, вот она. Это не Си, здесь объявление функции не обязательно должно быть +// до первого вызова +int test(int argument) { + return argument * 2; +} + + +// В D используется унифицированныйй синтаксис вызова функций +// (UFCS, Uniform Function Call Syntax), поэтому так тоже можно: +int var = 42.test(); + +// и даже так, если у функции нет аргументов: +int var2 = 42.test; + +// можно выстраивать цепочки: +int var3 = 42.test.test; + +/* + Аргументы в функцию передаются по значению (т. е. функция работает не с + оригинальными значениями, переданными ей, а с их локальными копиями. + Исключение составляют объекты классов, которые передаются по ссылке. + Кроме того, любой параметр можно передать в функцию по ссылке с помощью + ключевого слова ref +*/ +int var = 10; + +void fn1(int arg) { + arg += 1; +} + +void fn2(ref int arg) { + arg += 1; +} + +fn1(var); // var все еще = 10 +fn2(var); // теперь var = 11 + +// Возвращаемое значение тоже может быть auto, +// если его можно "угадать" из контекста +auto add(int x, int y) { + return x + y; +} + +auto z = add(x, y); // тип int - компилятор вывел его автоматически + +// Значения аргументов по умолчанию +float linearFunction(float k, float x, float b = 1) +{ + return k * x + b; +} + +auto linear1 = linearFunction(0.5, 2, 3); // все аргументы используются +auto linear2 = linearFunction(0.5, 2); // один аргумент пропущен, но в функции + // он все равно использован и равен 1 + +// допускается описание вложенных функций +float quarter(float x) { + float doubled(float y) { + return y * y; + } + + return doubled(doubled(x)); +} + +// функции с переменным числом аргументов +int sum(int[] a...) +{ + int s = 0; + foreach (elem; a) { + s += elem; + } + return s; +} + +auto sum1 = sum(1); +auto sum2 = sum(1,2,3,4); + +/* + модификатор "in" перед аргументами функций говорит о том, что функция имеет + право их только просматривать. При попытке модификации такого аргумента + внутри функции - получите ошибку +*/ +float printFloat(in float a) +{ + writeln(a); +} +printFloat(a); // использование таких функций - самое обычное + +// модификатор "out" позволяет вернуть из функции несколько результатов +// без посредства глобальных переменных или массивов +uint remMod(uint a, uint b, out uint modulus) +{ + uint remainder = a / b; + modulus = a % b; + return remainder; +} + +uint modulus; // пока в этой переменной ноль +uint rem = remMod(5,2,modulus); // наша "хитрая" функция, и теперь, + // в modulus - остаток от деления +writeln(rem, " ", modulus); // вывод: 2 1 + + + +/*** Структуры, классы, базовое ООП ***/ + +// Объявление структуры. Структуры почти как в Си +struct MyStruct { + int a; + float b; + + void multiply() { + return a * b; + } +} + +MyStruct str1; // Объявление переменной с типом MyStruct +str1.a = 10; // Обращение к полю +str1.b = 20; +auto result = str1.multiply(); +MyStruct str2 = {4, 8} // Объявление + инициальзация в стиле Си +auto str3 = MyStruct(5, 10); // Объявление + инициальзация в стиле D + + +// области видимости полей и методов - 3 способа задания +struct MyStruct2 { + public int a; + + private: + float b; + bool c; + + protected { + float multiply() { + return a * b; + } + } + /* + в дополнение к знакомым public, private и protected, в D есть еще + область видимости "package". Поля и методы с этим атрибутам будут + доступны изо всех модулей, включенных в "пакет" (package), но не + за его пределами. package - это "папка", в которой может храниться + несколько модулей. Например, в "import.std.stdio", "std" - это + package, в котором есть модуль stdio (и еще множество других) + */ + package: + string d; + + /* помимо этого, имеется еще один модификатор - export, который позволяет + использовать объявленный с ним идентификатор даже вне самой программы ! + */ + export: + string description; +} + +// Конструкторы и деструкторы +struct MyStruct3 { + this() { // конструктор. Для структур его не обязательно указывать явно, + // в этом случае пустой конструктор добавляется компилятором + writeln("Hello, world!"); + } + + + // а вот это конструкция, одна из интересных идиом и представлет собой + // конструктор копирования, т.е конструктор возвращающий копию структуры. + // Работает только в структурах. + this(this) + { + return this; + } + + ~this() { // деструктор, также необязателен + writeln("Awww!"); + } +} + +// Объявление простейшего класса +class MyClass { + int a; // в D по умолчанию данные-члены являются public + float b; +} + +auto mc = new MyClass(); // ...и создание его экземпляра +auto mc2 = new MyClass; // ... тоже сработает + +// Конструктор +class MyClass2 { + int a; + float b; + + this(int a, float b) { + this.a = a; // ключевое слово "this" - ссылка на объект класса + this.b = b; + } +} + +auto mc2 = new MyClass2(1, 2.3); + +// Классы могут быть вложенными +class Outer +{ + int m; + + class Inner + { + int foo() + { + return m; // можно обращаться к полям "родительского" класса + } + } +} + +// наследование +class Base { + int a = 1; + float b = 2.34; + + + // это статический метод, т.е метод который можно вызывать обращаясь + // классу напрямую, а не через создание экземпляра объекта + static void multiply(int x, int y) + { + writeln(x * y); + } +} + +Base.multiply(2, 5); // используем статический метод. Результат: 10 + +class Derived : Base { + string c = "Поле класса - наследника"; + + + // override означает то, что наследник предоставит свою реализацию метода, + // переопределив метод базового класса + override static void multiply(int x, int y) + { + super.multiply(x, y); // super - это ссылка на класс-предок или базовый класс + writeln(x * y * 2); + } +} + +auto mc3 = new Derived(); +writeln(mc3.a); // 1 +writeln(mc3.b); // 2.34 +writeln(mc3.c); // Поле класса - наследника + +// Финальный класс, наследовать от него нельзя +// кроме того, модификатор final работает не только для классов, но и для методов +// и даже для модулей ! +final class FC { + int a; +} + +class Derived : FC { // это вызовет ошибку + float b; +} + +// Абстрактный класс не можен быть истанциирован, но может иметь наследников +abstract class AC { + int a; +} + +auto ac = new AC(); // это вызовет ошибку + +class Implementation : AC { + float b; + + // final перед методом нефинального класса означает запрет возможности + // переопределения метода + final void test() + { + writeln("test passed !"); + } +} + +auto impl = new Implementation(); // ОК + + + +/*** Микшины (mixins) ***/ + +// В D можно вставлять код как строку, если эта строка известна на этапе +// компиляции. Например: +void main() { + mixin(`writeln("Hello World!");`); +} + +// еще пример +string print(string s) { + return `writeln("` ~ s ~ `");`; +} + +void main() { + mixin (print("str1")); + mixin (print("str2")); +} + + + +/*** Шаблоны ***/ + +/* + Шаблон функции. Эта функция принимает аргументы разеых типов, которые + подсталяются вместо T на этапе компиляции. "T" - это не специальный + символ, а просто буква. Вместо "T" может быть любое слово, кроме ключевого. + */ +void print(T)(T value) { + writefln("%s", value); +} + +void main() { + print(42); // В одну и ту же функцию передается: целое + print(1.2); // ...число с плавающей точкой, + print("test"); // ...строка +} + +// "Шаблонных" параметров может быть сколько угодно +void print(T1, T2)(T1 value1, T2 value2) { + writefln(" %s %s", value1, value2); +} + +void main() { + print(42, "Test"); + print(1.2, 33); +} + +// Шаблон класса +class Stack(T) +{ + private: + T[] elements; + + public: + void push(T element) { + elements ~= element; + } + + void pop() { + --elements.length; + } + + T top() const @property { + return elements[$ - 1]; + } + + size_t length() const @property { + return elements.length; + } +} + +void main() { + /* + восклицательный знак - признак шаблона В данном случае мы создаем + класс и указывем, что "шаблонное" поле будет иметь тип string + */ + auto stack = new Stack!string; + + stack.push("Test1"); + stack.push("Test2"); + + writeln(stack.top); + writeln(stack.length); + + stack.pop; + writeln(stack.top); + writeln(stack.length); +} + + + +/*** Диапазоны (ranges) ***/ + +/* + Диапазоны - это абстракция, которая позволяет легко использовать разные + алгоритмы с разными структурами данных. Вместо того, чтобы определять свои + уникальные алгоритмы для каждой структуры, мы можем просто указать для нее + несколько единообразных функций, определяющих, _как_ мы получаем доступ + к элементам контейнера, вместо того, чтобы описывать внутреннее устройство + этого контейнера. Сложно? На самом деле не очень. +*/ + +/* + Простейший вид диапазона - Input Range. Для того, чтобы превратить любой + контейнер в Input Range, достаточно реализовать для него 3 метода: + - empty - проверяет, пуст ли контейнер + - front - дает доступ к первому элементу контейнера + - popFront - удаляет из контейнера первый элемент +*/ +struct Student +{ + string name; + int number; + string toString() { + return format("%s(%s)", name, number); + } +} + +struct School +{ + Student[] students; +} + +struct StudentRange +{ + Student[] students; + + this(School school) { + this.students = school.students; + } + + bool empty() { + return students.length == 0; + } + + ref Student front() { + return students[0]; + } + + void popFront() { + students = students[1 .. $]; + } +} + +void main(){ + auto school = School([ + Student("Mike", 1), + Student("John", 2) , + Student("Dan", 3) + ]); + auto range = StudentRange(school); + writeln(range); // [Mike(1), John(2), Dan(3)] + writeln(school.students.length); // 3 + writeln(range.front()); // Mike(1) + range.popFront(); + writeln(range.empty()); // false + writeln(range); // [John(2), Dan(3)] +} +/* + Смысл в том, что нам не так уж важно внутреннее устройство контейнера, если + у нас есть унифицированные методы доступа к его элементам. + Кроме Input Range в D есть и другие типы диапазонов, которые требуют + реализации большего числа методов, зато дают больше контроля. Это большая + тема и мы не будем в подробностях освещать ее здесь. + + Диапазоны - это важная часть D, они используются в нем повсеместно. +*/ +``` +## Что дальше? + +[Официальный сайт](http://dlang.org/) +[Онлайн-книга](http://ddili.org/ders/d.en/) +[Официальная вики](http://wiki.dlang.org/) From 50a0bbf33f19ea33c38f4b025c771e57bdfe937b Mon Sep 17 00:00:00 2001 From: Raphael Nascimento Date: Wed, 14 Oct 2015 22:12:06 -0300 Subject: [PATCH 021/457] [java/en] Enum Type Short overview about enum type. --- java.html.markdown | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/java.html.markdown b/java.html.markdown index 35ec57d8..bc119eb1 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -7,6 +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"] filename: LearnJava.java --- @@ -670,6 +671,68 @@ public abstract class Mammal() return true; } } + + +// 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: + +public enum Day { + SUNDAY, MONDAY, TUESDAY, WEDNESDAY, + THURSDAY, FRIDAY, SATURDAY +} + +// We can use our enum Day like that: + +public class EnumTest { + + // Variable Enum + Day day; + + public EnumTest(Day day) { + this.day = day; + } + + public void tellItLikeItIs() { + switch (day) { + case MONDAY: + System.out.println("Mondays are bad."); + break; + + case FRIDAY: + System.out.println("Fridays are better."); + break; + + case SATURDAY: + case SUNDAY: + System.out.println("Weekends are best."); + break; + + default: + System.out.println("Midweek days are so-so."); + break; + } + } + + public static void main(String[] args) { + EnumTest firstDay = new EnumTest(Day.MONDAY); + firstDay.tellItLikeItIs(); + EnumTest thirdDay = new EnumTest(Day.WEDNESDAY); + thirdDay.tellItLikeItIs(); + } +} + +// The output is: +// Mondays are bad. +// Midweek days are so-so. + +// Enum types are much more powerful than we show above. +// The enum body can include methods and other fields. +// You can se more at https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html + ``` ## Further Reading From 5a8a68988b7c153cf16f37c307954d7070fc9b81 Mon Sep 17 00:00:00 2001 From: Raphael Nascimento Date: Thu, 15 Oct 2015 15:59:22 -0300 Subject: [PATCH 022/457] [java/en] Enum Type Outputs in line. --- java.html.markdown | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/java.html.markdown b/java.html.markdown index bc119eb1..8544ecfc 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -719,16 +719,12 @@ public class EnumTest { public static void main(String[] args) { EnumTest firstDay = new EnumTest(Day.MONDAY); - firstDay.tellItLikeItIs(); + firstDay.tellItLikeItIs(); // => Mondays are bad. EnumTest thirdDay = new EnumTest(Day.WEDNESDAY); - thirdDay.tellItLikeItIs(); + thirdDay.tellItLikeItIs(); // => Midweek days are so-so. } } -// The output is: -// Mondays are bad. -// Midweek days are so-so. - // Enum types are much more powerful than we show above. // The enum body can include methods and other fields. // You can se more at https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html From 95af711a03e89d6f95b81e5b9d9b4cb530789a35 Mon Sep 17 00:00:00 2001 From: Tomy Date: Sun, 18 Oct 2015 13:00:23 +0900 Subject: [PATCH 023/457] begin translate --- ja-jp/php.html.markdown | 767 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 767 insertions(+) create mode 100644 ja-jp/php.html.markdown diff --git a/ja-jp/php.html.markdown b/ja-jp/php.html.markdown new file mode 100644 index 00000000..3831e220 --- /dev/null +++ b/ja-jp/php.html.markdown @@ -0,0 +1,767 @@ +--- +language: PHP +contributors: + - ["Malcolm Fell", "http://emarref.net/"] + - ["Trismegiste", "https://github.com/Trismegiste"] +translators: + - ["Kazushige Tominaga", "https://github.com/kazu9su"] +filename: learnphp.php +--- + +このドキュメントでは、 PHP 5+ について説明します。 + +```php + +Hello World Again! + 12 +$int2 = -12; // => -12 +$int3 = 012; // => 10 (a leading 0 denotes an octal number) +$int4 = 0x0F; // => 15 (a leading 0x denotes a hex literal) + +// Floats (aka doubles) +$float = 1.234; +$float = 1.2e3; +$float = 7E-10; + +// Delete variable +unset($int1); + +// Arithmetic +$sum = 1 + 1; // 2 +$difference = 2 - 1; // 1 +$product = 2 * 2; // 4 +$quotient = 2 / 1; // 2 + +// Shorthand arithmetic +$number = 0; +$number += 1; // Increment $number by 1 +echo $number++; // Prints 1 (increments after evaluation) +echo ++$number; // Prints 3 (increments before evaluation) +$number /= $float; // Divide and assign the quotient to $number + +// Strings should be enclosed in single quotes; +$sgl_quotes = '$String'; // => '$String' + +// Avoid using double quotes except to embed other variables +$dbl_quotes = "This is a $sgl_quotes."; // => 'This is a $String.' + +// Special characters are only escaped in double quotes +$escaped = "This contains a \t tab character."; +$unescaped = 'This just contains a slash and a t: \t'; + +// Enclose a variable in curly braces if needed +$money = "I have $${number} in the bank."; + +// Since PHP 5.3, nowdocs can be used for uninterpolated multi-liners +$nowdoc = <<<'END' +Multi line +string +END; + +// Heredocs will do string interpolation +$heredoc = << 1, 'Two' => 2, 'Three' => 3); + +// PHP 5.4 introduced a new syntax +$associative = ['One' => 1, 'Two' => 2, 'Three' => 3]; + +echo $associative['One']; // prints 1 + +// List literals implicitly assign integer keys +$array = ['One', 'Two', 'Three']; +echo $array[0]; // => "One" + +// Add an element to the end of an array +$array[] = 'Four'; +// or +array_push($array, 'Five'); + +// Remove element from array +unset($array[3]); + +/******************************** + * Output + */ + +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 is actually a language construct, so you can drop the parentheses. +echo 'Hello World!'; +print 'Hello World!'; // So is print + +$paragraph = 'paragraph'; + +echo 100; // Echo scalar variables directly +echo $paragraph; // or variables + +// If short open tags are configured, or your PHP version is +// 5.4.0 or greater, you can use the short echo syntax +?> +

+ 2 +echo $z; // => 2 +$y = 0; +echo $x; // => 2 +echo $z; // => 0 + +// Dumps type and value of variable to stdout +var_dump($z); // prints int(0) + +// Prints variable to stdout in human-readable format +print_r($array); // prints: Array ( [0] => One [1] => Two [2] => Three ) + +/******************************** + * Logic + */ +$a = 0; +$b = '0'; +$c = '1'; +$d = '1'; + +// assert throws a warning if its argument is not true + +// These comparisons will always be true, even if the types aren't the same. +assert($a == $b); // equality +assert($c != $a); // inequality +assert($c <> $a); // alternative inequality +assert($a < $c); +assert($c > $b); +assert($a <= $b); +assert($c >= $d); + +// The following will only be true if the values match and are the same type. +assert($c === $d); +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; +echo $integer + $integer; // => 2 + +$string = '1'; +echo $string + $string; // => 2 (strings are coerced to integers) + +$string = 'one'; +echo $string + $string; // => 0 +// Outputs 0 because the + operator cannot cast the string 'one' to a number + +// Type casting can be used to treat a variable as another type + +$boolean = (boolean) 1; // => true + +$zero = 0; +$boolean = (boolean) $zero; // => false + +// There are also dedicated functions for casting most types +$integer = 5; +$string = strval($integer); + +$var = null; // Null value + + +/******************************** + * Control Structures + */ + +if (true) { + print 'I get printed'; +} + +if (false) { + print 'I don\'t'; +} else { + print 'I get printed'; +} + +if (false) { + print 'Does not get printed'; +} elseif(true) { + print 'Does'; +} + +// 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'; +} elseif($x == '1') { + print 'Does not print'; +} else { + print 'Does print'; +} + + + +// This alternative syntax is useful for templates: +?> + + +This is displayed if the test is truthy. + +This is displayed otherwise. + + + 2, 'car' => 4]; + +// Foreach loops can iterate over arrays +foreach ($wheels as $wheel_count) { + echo $wheel_count; +} // Prints "24" + +echo "\n"; + +// You can iterate over the keys as well as the values +foreach ($wheels as $vehicle => $wheel_count) { + echo "A $vehicle has $wheel_count wheels"; +} + +echo "\n"; + +$i = 0; +while ($i < 5) { + if ($i === 3) { + break; // Exit out of the while loop + } + echo $i++; +} // Prints "012" + +for ($i = 0; $i < 5; $i++) { + if ($i === 3) { + continue; // Skip this iteration of the loop + } + echo $i; +} // Prints "0124" + + +/******************************** + * Functions + */ + +// Define a function with "function": +function my_function () { + return 'Hello'; +} + +echo my_function(); // => "Hello" + +// A valid function name starts with a letter or underscore, followed by any +// number of letters, numbers, or underscores. + +function add ($x, $y = 1) { // $y is optional and defaults to 1 + $result = $x + $y; + return $result; +} + +echo add(4); // => 5 +echo add(4, 2); // => 6 + +// $result is not accessible outside the function +// print $result; // Gives a warning. + +// Since PHP 5.3 you can declare anonymous functions; +$inc = function ($x) { + return $x + 1; +}; + +echo $inc(2); // => 3 + +function foo ($x, $y, $z) { + echo "$x - $y - $z"; +} + +// Functions can return functions +function bar ($x, $y) { + // Use 'use' to bring in outside variables + return function ($z) use ($x, $y) { + foo($x, $y, $z); + }; +} + +$bar = bar('A', 'B'); +$bar('C'); // Prints "A - B - C" + +// You can call named functions using strings +$function_name = 'add'; +echo $function_name(1, 2); // => 3 +// Useful for programatically determining which function to run. +// Or, use call_user_func(callable $callback [, $parameter [, ... ]]); + + +// You can get the all the parameters passed to a function +function parameters() { + $numargs = func_num_args(); + if ($numargs > 0) { + echo func_get_arg(0) . ' | '; + } + $args_array = func_get_args(); + foreach ($args_array as $key => $arg) { + echo $key . ' - ' . $arg . ' | '; + } +} + +parameters('Hello', 'World'); // Hello | 0 - Hello | 1 - World | + +/******************************** + * Includes + */ + +instanceProp = $instanceProp; + } + + // Methods are declared as functions inside a class + public function myMethod() + { + print 'MyClass'; + } + + //final keyword would make a function unoverridable + final function youCannotOverrideMe() + { + } + +/* + * Declaring class properties or methods as static makes them accessible without + * needing an instantiation of the class. A property declared as static can not + * be accessed with an instantiated class object (though a static method can). + */ + + public static function myStaticMethod() + { + print 'I am static'; + } +} + +// Class constants can always be accessed statically +echo MyClass::MY_CONST; // Outputs 'value'; + +echo MyClass::$staticVar; // Outputs 'static'; +MyClass::myStaticMethod(); // Outputs 'I am static'; + +// Instantiate classes using new +$my_class = new MyClass('An instance property'); +// The parentheses are optional if not passing in an argument. + +// Access class members using -> +echo $my_class->property; // => "public" +echo $my_class->instanceProp; // => "An instance property" +$my_class->myMethod(); // => "MyClass" + + +// Extend classes using "extends" +class MyOtherClass extends MyClass +{ + function printProtectedProperty() + { + echo $this->prot; + } + + // Override a method + function myMethod() + { + parent::myMethod(); + print ' > MyOtherClass'; + } +} + +$my_other_class = new MyOtherClass('Instance prop'); +$my_other_class->printProtectedProperty(); // => Prints "protected" +$my_other_class->myMethod(); // Prints "MyClass > MyOtherClass" + +final class YouCannotExtendMe +{ +} + +// You can use "magic methods" to create getters and setters +class MyMapClass +{ + private $property; + + public function __get($key) + { + return $this->$key; + } + + public function __set($key, $value) + { + $this->$key = $value; + } +} + +$x = new MyMapClass(); +echo $x->property; // Will use the __get() method +$x->property = 'Something'; // Will use the __set() method + +// Classes can be abstract (using the abstract keyword) or +// implement interfaces (using the implements keyword). +// An interface is declared with the interface keyword. + +interface InterfaceOne +{ + public function doSomething(); +} + +interface InterfaceTwo +{ + public function doSomethingElse(); +} + +// interfaces can be extended +interface InterfaceThree extends InterfaceTwo +{ + public function doAnotherContract(); +} + +abstract class MyAbstractClass implements InterfaceOne +{ + public $x = 'doSomething'; +} + +class MyConcreteClass extends MyAbstractClass implements InterfaceTwo +{ + public function doSomething() + { + echo $x; + } + + public function doSomethingElse() + { + echo 'doSomethingElse'; + } +} + + +// Classes can implement more than one interface +class SomeOtherClass implements InterfaceOne, InterfaceTwo +{ + public function doSomething() + { + echo 'doSomething'; + } + + public function doSomethingElse() + { + echo 'doSomethingElse'; + } +} + + +/******************************** + * Traits + */ + +// Traits are available from PHP 5.4.0 and are declared using "trait" + +trait MyTrait +{ + public function myTraitMethod() + { + print 'I have MyTrait'; + } +} + +class MyTraitfulClass +{ + use MyTrait; +} + +$cls = new MyTraitfulClass(); +$cls->myTraitMethod(); // Prints "I have MyTrait" + + +/******************************** + * Namespaces + */ + +// This section is separate, because a namespace declaration +// must be the first statement in a file. Let's pretend that is not the case + + Date: Sun, 18 Oct 2015 13:27:55 +0900 Subject: [PATCH 024/457] translate first block --- ja-jp/php.html.markdown | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/ja-jp/php.html.markdown b/ja-jp/php.html.markdown index 3831e220..4448a1f5 100644 --- a/ja-jp/php.html.markdown +++ b/ja-jp/php.html.markdown @@ -13,32 +13,30 @@ filename: learnphp.php ```php Hello World Again! Date: Sun, 18 Oct 2015 18:38:01 +0200 Subject: [PATCH 025/457] [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 026/457] 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 c3387b8a611b6fbb00ac8d54102b772d44d3eca2 Mon Sep 17 00:00:00 2001 From: Andrew Backes Date: Sun, 18 Oct 2015 22:32:14 -0500 Subject: [PATCH 027/457] [typescript/en] Template Strings --- typescript.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/typescript.html.markdown b/typescript.html.markdown index e9135510..101bb5dc 100644 --- a/typescript.html.markdown +++ b/typescript.html.markdown @@ -159,6 +159,10 @@ var tuple = pairToTuple({ item1:"hello", item2:"world"}); // Including references to a definition file: /// +// Template Strings +var name = 'Tyrone'; +var greeting = `Hi ${name}, how are you?` + ``` ## Further Reading From 525b6106a57baa570734e29b43f861cd8cc5de3a Mon Sep 17 00:00:00 2001 From: Andrew Backes Date: Sun, 18 Oct 2015 22:38:56 -0500 Subject: [PATCH 028/457] [typescript/en] Multiline Strings Multiline Strings via Template Strings --- typescript.html.markdown | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/typescript.html.markdown b/typescript.html.markdown index 101bb5dc..61b0fdb8 100644 --- a/typescript.html.markdown +++ b/typescript.html.markdown @@ -159,9 +159,13 @@ var tuple = pairToTuple({ item1:"hello", item2:"world"}); // Including references to a definition file: /// -// Template Strings +// Template Strings (strings that use backtics) +// String Intepolation with Template Strings var name = 'Tyrone'; var greeting = `Hi ${name}, how are you?` +// Multiline Strings with Template Strings +var multiline = `This is an example +of a multiline string`; ``` From d2d89cfa9742ef437e45885498677038563d56f5 Mon Sep 17 00:00:00 2001 From: Ankit Aggarwal Date: Mon, 19 Oct 2015 11:47:24 +0530 Subject: [PATCH 029/457] Adding documentation on ternary operator --- python3.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python3.html.markdown b/python3.html.markdown index 2398e7ac..6d657395 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -174,6 +174,10 @@ some_var # => 5 # See Control Flow to learn more about exception handling. some_unknown_var # Raises a NameError +# if can be used as an expression +# Equivalent of C's '?:' ternary operator +"yahoo!" if 3 > 2 else 2 # => "yahoo!" + # Lists store sequences li = [] # You can start with a prefilled list From a8ebd498338183f3469e37f7763aad6d644780e1 Mon Sep 17 00:00:00 2001 From: aceawan Date: Mon, 19 Oct 2015 13:34:59 +0200 Subject: [PATCH 030/457] [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 031/457] [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 032/457] 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 033/457] 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 034/457] 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 035/457] 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 998e76c310422e0946431b036eb7de03a9384e74 Mon Sep 17 00:00:00 2001 From: Andrew Backes Date: Mon, 19 Oct 2015 08:09:58 -0500 Subject: [PATCH 036/457] [typescript/en] Typo fixed in 'backticks' --- typescript.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript.html.markdown b/typescript.html.markdown index 61b0fdb8..17c56e7a 100644 --- a/typescript.html.markdown +++ b/typescript.html.markdown @@ -159,7 +159,7 @@ var tuple = pairToTuple({ item1:"hello", item2:"world"}); // Including references to a definition file: /// -// Template Strings (strings that use backtics) +// Template Strings (strings that use backticks) // String Intepolation with Template Strings var name = 'Tyrone'; var greeting = `Hi ${name}, how are you?` From f8a2b28890d5d68a252d5bc0fd8247495b680e09 Mon Sep 17 00:00:00 2001 From: aceawan Date: Mon, 19 Oct 2015 15:28:43 +0200 Subject: [PATCH 037/457] 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 13c9d9af5cc60ae747d42f73d795f360a15f3fd8 Mon Sep 17 00:00:00 2001 From: aceawan Date: Mon, 19 Oct 2015 15:33:48 +0200 Subject: [PATCH 038/457] 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 039/457] 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 5ca38bf934801c9e85e25e19842a6f84ebe6efa0 Mon Sep 17 00:00:00 2001 From: Andrew Backes Date: Mon, 19 Oct 2015 10:40:57 -0500 Subject: [PATCH 040/457] [typescript/en] Fixing typo in 'Interpolation' --- typescript.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript.html.markdown b/typescript.html.markdown index 17c56e7a..20974304 100644 --- a/typescript.html.markdown +++ b/typescript.html.markdown @@ -160,7 +160,7 @@ var tuple = pairToTuple({ item1:"hello", item2:"world"}); /// // Template Strings (strings that use backticks) -// String Intepolation with Template Strings +// String Interpolation with Template Strings var name = 'Tyrone'; var greeting = `Hi ${name}, how are you?` // Multiline Strings with Template Strings From 9aca78c50a44a4e175798c1ebc66f843f82af80f Mon Sep 17 00:00:00 2001 From: David Hsieh Date: Mon, 19 Oct 2015 17:05:09 -0700 Subject: [PATCH 041/457] 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 042/457] 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 043/457] [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 044/457] [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 045/457] 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 046/457] 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 7c15eaefcdfe21809ebab893f6d8d6321188abf1 Mon Sep 17 00:00:00 2001 From: Chaitya Shah Date: Tue, 20 Oct 2015 11:45:58 -0400 Subject: [PATCH 047/457] Fix Spacing Inconsistency Fix spacing inconsistency in PennyFarthing Constructor --- java.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java.html.markdown b/java.html.markdown index 38c9e490..a78aa9fc 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -519,7 +519,7 @@ class PennyFarthing extends Bicycle { // (Penny Farthings are those bicycles with the big front wheel. // They have no gears.) - public PennyFarthing(int startCadence, int startSpeed){ + public PennyFarthing(int startCadence, int startSpeed) { // Call the parent constructor with super super(startCadence, startSpeed, 0, "PennyFarthing"); } From 8b9c5561e7af0c5caca83ac13d306d756d6f227f Mon Sep 17 00:00:00 2001 From: Sawyer Charles Date: Mon, 19 Oct 2015 10:54:42 -0500 Subject: [PATCH 048/457] [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 049/457] 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 050/457] 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 051/457] 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 052/457] 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 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 053/457] 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 054/457] 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 ef9331fa31ab84e5a04ee024ac490b24a6b5c4dc Mon Sep 17 00:00:00 2001 From: Raphael Nascimento Date: Wed, 21 Oct 2015 09:03:12 -0300 Subject: [PATCH 055/457] [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 ecbd4540681a99cb83a201f3f09deaf2af3fb58f Mon Sep 17 00:00:00 2001 From: Peter Elmers Date: Wed, 21 Oct 2015 11:48:12 -0500 Subject: [PATCH 056/457] 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 057/457] 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 058/457] 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 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 059/457] 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 060/457] 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 061/457] 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 b238a58c9768d3b7694c4f02cbfe5ba2cac0015a Mon Sep 17 00:00:00 2001 From: payet-s Date: Wed, 21 Oct 2015 17:48:04 +0200 Subject: [PATCH 062/457] [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 063/457] [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 064/457] [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 ba7b8a613b445d1ee79ad190ceed6a008595116c Mon Sep 17 00:00:00 2001 From: Jana Trestikova Date: Fri, 23 Oct 2015 06:55:00 +0200 Subject: [PATCH 065/457] 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 066/457] 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 067/457] [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 f6b8b079b49a1fcfdc6143fc51bc5d3738ade8f0 Mon Sep 17 00:00:00 2001 From: Patrik Jansson Date: Fri, 23 Oct 2015 23:31:10 +0200 Subject: [PATCH 068/457] Some minor fixes I just noted that the example claiming that (add 10) is the same as (+10) was wrong. (A detail - it should be (10+) to match the argument order.) Then I just continued down making a few similar fixes and terminology updates. /Patrik PS. I've been teaching [Advanced Functional Programming](http://www.cse.chalmers.se/edu/course/afp/) (in Haskell) for a few years at Chalmers. --- haskell.html.markdown | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/haskell.html.markdown b/haskell.html.markdown index 08611e63..2f58b357 100644 --- a/haskell.html.markdown +++ b/haskell.html.markdown @@ -189,16 +189,16 @@ foo = add 10 -- foo is now a function that takes a number and adds 10 to it foo 5 -- 15 -- Another way to write the same thing -foo = (+10) +foo = (10+) 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 4, and then returns the final value. -foo = (*4) . (+10) +foo = (4*) . (10+) --- (5 + 10) * 4 = 60 +-- 4*(10 + 5) = 60 foo 5 -- 60 -- fixing precedence @@ -222,7 +222,7 @@ even . fib $ 7 -- false -- 5. Type signatures ---------------------------------------------------- --- Haskell has a very strong type system, and everything has a type signature. +-- Haskell has a very strong type system, and every valid expression has a type. -- Some basic types: 5 :: Integer @@ -259,7 +259,7 @@ case args of _ -> putStrLn "bad args" -- Haskell doesn't have loops; it uses recursion instead. --- map applies a function over every element in an array +-- map applies a function over every element in a list map (*2) [1..5] -- [2, 4, 6, 8, 10] @@ -279,7 +279,7 @@ foldl (\x y -> 2*x + y) 4 [1,2,3] -- 43 -- This is the same as (2 * (2 * (2 * 4 + 1) + 2) + 3) --- foldl is left-handed, foldr is right- +-- foldl is left-handed, foldr is right-handed foldr (\x y -> 2*x + y) 4 [1,2,3] -- 16 -- This is now the same as @@ -318,7 +318,7 @@ Nothing -- of type `Maybe a` for any `a` -- it is not hard to explain enough to get going. -- When a Haskell program is executed, `main` is --- called. It must return a value of type `IO ()`. For example: +-- called. It must return a value of type `IO a` for some type `a`. For example: main :: IO () main = putStrLn $ "Hello, sky! " ++ (say Blue) @@ -361,7 +361,7 @@ sayHello = do -- You can think of a value of type `IO a` as representing a -- computer program that will generate a value of type `a` -- when executed (in addition to anything else it does). We can --- store and reuse this value using `<-`. We can also +-- name and reuse this value using `<-`. We can also -- make our own action of type `IO String`: action :: IO String @@ -417,7 +417,7 @@ Hello, Friend! There's a lot more to Haskell, including typeclasses and monads. These are the big ideas that make Haskell such fun to code in. I'll leave you with one final -Haskell example: an implementation of quicksort in Haskell: +Haskell example: an implementation of a quicksort variant in Haskell: ```haskell qsort [] = [] From 8e4d294227590194285cec139bae5930d470eaf2 Mon Sep 17 00:00:00 2001 From: Jana Trestikova Date: Fri, 23 Oct 2015 23:54:45 +0200 Subject: [PATCH 069/457] 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 070/457] 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 071/457] 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 072/457] 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 073/457] [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 074/457] 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 075/457] 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 076/457] 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 3dec2d03a7c327dcf5049ef087d1dd395b04ffd8 Mon Sep 17 00:00:00 2001 From: Jean Matheus Souto Date: Sat, 24 Oct 2015 20:51:42 -0200 Subject: [PATCH 077/457] Add more resources, add me to contributors --- pt-br/ruby-pt.html.markdown | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pt-br/ruby-pt.html.markdown b/pt-br/ruby-pt.html.markdown index 89a051d4..668cd25f 100644 --- a/pt-br/ruby-pt.html.markdown +++ b/pt-br/ruby-pt.html.markdown @@ -4,6 +4,7 @@ lang: pt-br filename: learnruby-pt.rb contributors: - ["Bruno Henrique - Garu", "http://garulab.com"] + - ["Jean Matheus Souto", "http://jeanmatheussouto.github.io"] translators: - ["Katyanna Moura", "https://twitter.com/amelie_kn"] --- @@ -161,9 +162,6 @@ hash['numero'] #=> 5 hash['nada aqui'] #=> nil # Interar sobre hashes com o método #each: -hash.each do |k, v| - puts "#{k} is #{v}" -end hash.each do |k, v| puts "#{k} é #{v}" @@ -385,3 +383,11 @@ Humano.bar # 0 Doutor.bar # nil ``` + +## Mais sobre Ruby + +- [Documentação oficial](http://www.ruby-doc.org/core-2.1.1/) +- [Aprenda Ruby com desafios](http://www.learneroo.com/modules/61/nodes/338) - Uma coleção de desafios para testar a linguagem. +- [Ruby a partir de outras linguagens](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/)- Um mais antigo [free edition](http://ruby-doc.com/docs/ProgrammingRuby/) e tambem uma versão online disponível. +- [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide) - Uma versão colaborativa de um *style-guide* From 069e127ff83820ba809bc437bfadda9839d91062 Mon Sep 17 00:00:00 2001 From: chris-hranj Date: Sat, 24 Oct 2015 23:53:17 -0400 Subject: [PATCH 078/457] 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 4b0dda63b31873fad1b038c1db4745aaa20756cf Mon Sep 17 00:00:00 2001 From: Zane Sterling Date: Sun, 25 Oct 2015 12:55:50 -0400 Subject: [PATCH 079/457] Fix typo in README.md --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 94afbcbe..092785f8 100644 --- a/README.markdown +++ b/README.markdown @@ -51,7 +51,7 @@ Long version: ### Header configuration The actual site uses Middleman to generate HTML files from these Markdown ones. Middleman, or at least -the custom scripts underpinning the site, required that some key information be defined in the header. +the custom scripts underpinning the site, requires that some key information be defined in the header. The following fields are necessary for English articles about programming languages: 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 080/457] 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 081/457] 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 082/457] 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 083/457] 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 e60a7d73e846e683bd4345cff4d1a514beab5b91 Mon Sep 17 00:00:00 2001 From: jxu093 Date: Sun, 25 Oct 2015 22:19:40 -0400 Subject: [PATCH 084/457] Added Python Resource --- python.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/python.html.markdown b/python.html.markdown index 42a52bcf..254235ab 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -712,6 +712,7 @@ print say(say_please=True) # Can you buy me a beer? Please! I am poor :( * [Python Module of the Week](http://pymotw.com/2/) * [A Crash Course in Python for Scientists](http://nbviewer.ipython.org/5920182) * [First Steps With Python](https://realpython.com/learn/python-first-steps/) +* [Fullstack Python](https://www.fullstackpython.com/) ### Dead Tree From d41fdbcba9a8d764ffcd1eaca453c7870567784f Mon Sep 17 00:00:00 2001 From: Kristian Date: Mon, 26 Oct 2015 17:56:28 +1000 Subject: [PATCH 085/457] 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 5acb0c1a604d468af2cd651229866c48ed7c4e24 Mon Sep 17 00:00:00 2001 From: Bruno Volcov Date: Mon, 26 Oct 2015 17:23:27 -0200 Subject: [PATCH 086/457] add a cool reference for learn Ruby =) --- ruby.html.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ruby.html.markdown b/ruby.html.markdown index c10255d8..b3ef2a4d 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -13,6 +13,7 @@ contributors: - ["Levi Bostian", "https://github.com/levibostian"] - ["Rahil Momin", "https://github.com/iamrahil"] - ["Gabriel Halley", https://github.com/ghalley] + - ["Bruno Volcov", https://github.com/volcov] --- @@ -285,7 +286,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. @@ -576,3 +577,4 @@ Something.new.qux # => 'qux' - [Ruby from other languages](https://www.ruby-lang.org/en/documentation/ruby-from-other-languages/) - [Programming Ruby](http://www.amazon.com/Programming-Ruby-1-9-2-0-Programmers/dp/1937785491/) - An older [free edition](http://ruby-doc.com/docs/ProgrammingRuby/) is available online. - [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide) - A community-driven Ruby coding style guide. +- [Try Ruby](http://tryruby.org) - Learn the basic of Ruby programming language, interactive in the browser. From 69efce9e8340216164b8aeae3af72994fae64582 Mon Sep 17 00:00:00 2001 From: Juuso Mikkonen Date: Mon, 26 Oct 2015 22:33:53 +0200 Subject: [PATCH 087/457] [scala/eng] Added Java import to misc --- scala.html.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scala.html.markdown b/scala.html.markdown index 192e03d7..166285f2 100644 --- a/scala.html.markdown +++ b/scala.html.markdown @@ -606,6 +606,9 @@ import scala.collection.immutable.{List => ImmutableList} // Import all classes, except some. The following excludes Map and Set: import scala.collection.immutable.{Map => _, Set => _, _} +// Java classes can also be imported. Scala syntax can be used +import java.swing.{JFrame, JWindow} + // Your programs entry point is defined in an scala file using an object, with a // single method, main: object Application { From b31fda3a8e9f4d0ff021dc707f1e47af4add90ac Mon Sep 17 00:00:00 2001 From: Jody Leonard Date: Mon, 26 Oct 2015 19:38:36 -0400 Subject: [PATCH 088/457] 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 089/457] [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 090/457] 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 091/457] 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 092/457] 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 093/457] 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 094/457] 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 095/457] 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 096/457] 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 097/457] 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 098/457] 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 099/457] 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 100/457] "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 101/457] [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 102/457] [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 103/457] [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 104/457] [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 105/457] [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 106/457] [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 107/457] 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 108/457] 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 109/457] [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 110/457] 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 111/457] 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 112/457] 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 35a1cd4eeb96557c70de57b972b0000c94245f13 Mon Sep 17 00:00:00 2001 From: ditam Date: Wed, 28 Oct 2015 23:31:15 +0100 Subject: [PATCH 113/457] add Hungarian translation --- hu-hu/yaml-hu.html.markdown | 146 ++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 hu-hu/yaml-hu.html.markdown diff --git a/hu-hu/yaml-hu.html.markdown b/hu-hu/yaml-hu.html.markdown new file mode 100644 index 00000000..eeafbfb3 --- /dev/null +++ b/hu-hu/yaml-hu.html.markdown @@ -0,0 +1,146 @@ +--- +language: yaml +filename: learnyaml.yaml +contributors: + - ["Adam Brenecki", "https://github.com/adambrenecki"] +translators: + - ["Tamás Diószegi", "https://github.com/ditam"] +--- + +A YAML egy adat sorosító nyelv amit úgy terveztek, hogy közvetlenül is +olvasható és írható legyen emberi szemmel. + +A JSON formátum egy szigorú befoglaló halmazát alkotja, kiegészítve azt +szintaktikai jelentéssel bíró sortörésekkel és indentációval, +a Python-hoz hasonlóan. A Python-nal ellentétben azonban a YAML nem engedélyezi +a közvetlen tab karakterek jelenlétét. + +Megjegyzés: UTF-8 ékezetes betűk használhatóak, ha a fájl kódlása megfelelő, +a kódolást a tartalomban explicit nem kell (és nem is lehet) feltüntetni. + +```yaml +# A kommentek YAML-ban így néznek ki. + +################## +# Skalár típusok # +################## + +# A gyökér objektumunk (az egész dokumentumra értve) egy map, +# ami a más nyelvekből ismert dictionary, hash vagy object típusokkal egyenértékű. +kulcs: érték +masik_kulcs: Másik érték jön ide. +egy_szam: 100 +tudomanyos_jelolessel: 1e+12 +boolean: true +null_value: null +kulcs benne szóközökkel: érték +# Látható, hogy a sztringeket nem szükséges idézőjelek közé zárni, bár szabad. +Továbbá: "Idézőjelekkel megadott sztring." +"A kulcs is lehet idézőjeles.": "Hasznos lehet, ha ':'-ot akarsz a kulcsban." + +# Többsoros sztringek írhatóak 'literal block'-ként ('|' jelet használva) +# vagy 'folded block'-ként is ('>' jelet használva). +literal_block: | + Ez az egész szöveg-blokk lesz az értéke a literal_block kulcsnak, + a sortöréseket megtartva. + + Az ilyen sztringet az indentáció visszahúzása zárja le, a behúzás pedig + eltávolításra kerül. + + A 'még jobban' behúzott részek megtartják a behúzásukat - + ezeknek a soroknak 4 szóköz behúzása lesz. +folded_style: > + Az az egész szöveg-blokk lesz az értéke a 'folded_style' kulcsnak, de + ezúttal minden sortörés egy szóközre lesz cserélve. + + Az üres sorok, mint a fenti, új sor karakterre cserélődnek. + + A 'még jobban' behúzott sorok megtartják a sortöréseiket, - + ez a szöveg két sorban jelenik meg. + +###################### +# Gyűjtemény típusok # +###################### + +# Egymásba ágyazás a behúzás változtatásával érhető el. +beagyazott_map: + key: value + another_key: Another Value + masik_beagyazott_map: + hello: hello + +# A mapeknek nem csak sztring kulcsaik lehetnek. +0.25: lebegőpontos kulcs + +# A kulcsok lehetnek többsoros objektumok is, ? jellel jelezve a kulcs kezdetét +? | + Ez itt egy + többsoros kulcs +: és ez az értéke + +# Szintén engedélyezett a kollekció típusok használata kulcsként, de egyéb +# nyelvekben ez gyakran problémákat fog okozni. + +# Szekvenciák (listákkal vagy tömbökkel egyenértékűek) így néznek ki: +egy_szekvencia: + - Item 1 + - Item 2 + - 0.5 # Többféle típust is tartalmazhat + - Item 4 + - key: value + another_key: another_value + - + - Ez egy szekvencia + - egy másik szekvenciába ágyazva + +# Mivel a YAML a JSON befoglaló halmazát alkotja, JSON szintaxisú +# mapek és szekvenciák is használhatóak: +json_map: {"key": "value"} +json_seq: [3, 2, 1, "takeoff"] + +######################### +# EXTRA YAML KÉPESSÉGEK # +######################### + +# A YAML-ben ún. 'anchor'-ök segítségével könnyen lehet duplikálni +# tartalmakat a dokumentumon belül. A következő kulcsok azonos értékkel bírnak: +anchored_tartalom: &anchor_neve Ez a sztring két kulcs értéke is lesz. +másik_anchor: *anchor_neve + +# Vannak a YAML-ben tagek is, amivel explicit lehet típusokat jelölni. +explicit_string: !!str 0.5 +# Bizonyos implementációk nyelv-specifikus tageket tartalmaznak, mint +# például ez a Python komplex szám típusának jelölésére: +python_complex_number: !!python/complex 1+2j + +###################### +# EXTRA YAML TÍPUSOK # +###################### + +# Nem a sztringek és a számok az egyedüli skalár típusok YAML-ben. +# ISO-formátumú dátumok és dátumot jelölő literal kifejezések is értelmezettek. +datetime: 2001-12-15T02:59:43.1Z +datetime_with_spaces: 2001-12-14 21:59:43.10 -5 +date: 2002-12-14 + +# A !!binary tag jelöli, hogy egy sztring valójában base64-kódolású +# reprezentációja egy bináris blob-nak +gif_file: !!binary | + R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5 + OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+ + +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC + AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs= + +# Létezik a YAML-ban egy halmaz típus (set) is, ami így néz ki: +set: + ? elem1 + ? elem2 + ? elem3 + +# Mint Pythonban, a halmazok null értékekkel feltöltött mapek, vagyis a fenti +# halmaz egyenértékű a következővel: +set2: + item1: null + item2: null + item3: null +``` \ No newline at end of file From 78dee8ef7505e8ebc34bb8bf3d6be124231ee1a7 Mon Sep 17 00:00:00 2001 From: ditam Date: Wed, 28 Oct 2015 23:36:48 +0100 Subject: [PATCH 114/457] fix small typos and grammar. --- hu-hu/yaml-hu.html.markdown | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hu-hu/yaml-hu.html.markdown b/hu-hu/yaml-hu.html.markdown index eeafbfb3..757b8417 100644 --- a/hu-hu/yaml-hu.html.markdown +++ b/hu-hu/yaml-hu.html.markdown @@ -7,12 +7,12 @@ translators: - ["Tamás Diószegi", "https://github.com/ditam"] --- -A YAML egy adat sorosító nyelv amit úgy terveztek, hogy közvetlenül is +A YAML egy adat sorosító nyelv, amit úgy terveztek, hogy közvetlenül is olvasható és írható legyen emberi szemmel. A JSON formátum egy szigorú befoglaló halmazát alkotja, kiegészítve azt szintaktikai jelentéssel bíró sortörésekkel és indentációval, -a Python-hoz hasonlóan. A Python-nal ellentétben azonban a YAML nem engedélyezi +a Pythonhoz hasonlóan. A Pythonnal ellentétben azonban a YAML nem engedélyezi a közvetlen tab karakterek jelenlétét. Megjegyzés: UTF-8 ékezetes betűk használhatóak, ha a fájl kódlása megfelelő, @@ -140,7 +140,7 @@ set: # Mint Pythonban, a halmazok null értékekkel feltöltött mapek, vagyis a fenti # halmaz egyenértékű a következővel: set2: - item1: null - item2: null - item3: null + elem1: null + elem2: null + elem3: null ``` \ 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 115/457] 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 3b1940b9cc9c0e46a9275b2ae64e4c5996d7de75 Mon Sep 17 00:00:00 2001 From: Alex Luehm Date: Wed, 28 Oct 2015 17:45:31 -0500 Subject: [PATCH 116/457] [C/en] Added tidbit about fall-though in switch statements. Another pitfall, as not all languages have fall-through in switches. --- c.html.markdown | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/c.html.markdown b/c.html.markdown index 3d632eab..2a5e460f 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -76,7 +76,7 @@ int main (int argc, char** argv) /////////////////////////////////////// // Types /////////////////////////////////////// - + // All variables MUST be declared at the top of the current block scope // we declare them dynamically along the code for the sake of the tutorial @@ -318,6 +318,12 @@ int main (int argc, char** argv) case 1: printf("Huh, 'a' equals 1!\n"); break; + // Be careful - without a "break", execution continues until the + // next "break" is reached. + case 3: + case 4: + printf("Look at that.. 'a' is either 3, or 4\n"); + break; default: // if `some_integral_expression` didn't match any of the labels fputs("error!\n", stderr); @@ -345,8 +351,8 @@ int main (int argc, char** argv) https://ideone.com/GuPhd6 this will print out "Error occured at i = 52 & j = 99." */ - - + + /////////////////////////////////////// // Typecasting /////////////////////////////////////// @@ -445,7 +451,7 @@ int main (int argc, char** argv) for (xx = 0; xx < 20; xx++) { *(my_ptr + xx) = 20 - xx; // my_ptr[xx] = 20-xx } // Initialize memory to 20, 19, 18, 17... 2, 1 (as ints) - + // Note that there is no standard way to get the length of a // dynamically allocated array in C. Because of this, if your arrays are // going to be passed around your program a lot, you need another variable @@ -721,13 +727,13 @@ typedef void (*my_fnp_type)(char *); /******************************* Header Files ********************************** -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 +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 +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. */ From d0ab5fc7729062d24b8f3aac1d8578e914a5955a Mon Sep 17 00:00:00 2001 From: ditam Date: Wed, 28 Oct 2015 23:47:41 +0100 Subject: [PATCH 117/457] add language suffix to filename --- hu-hu/yaml-hu.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hu-hu/yaml-hu.html.markdown b/hu-hu/yaml-hu.html.markdown index 757b8417..aca6cd37 100644 --- a/hu-hu/yaml-hu.html.markdown +++ b/hu-hu/yaml-hu.html.markdown @@ -1,6 +1,6 @@ --- language: yaml -filename: learnyaml.yaml +filename: learnyaml-hu.yaml contributors: - ["Adam Brenecki", "https://github.com/adambrenecki"] translators: From cdd64ecee34af20ed101ba5dc8d7dc73a8189c15 Mon Sep 17 00:00:00 2001 From: Vipul Sharma Date: Thu, 29 Oct 2015 15:23:37 +0530 Subject: [PATCH 118/457] 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 119/457] 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 120/457] [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 121/457] [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 54c67dfb38d1bb2a9dc004b3244d2ae3102107f3 Mon Sep 17 00:00:00 2001 From: bk2dcradle Date: Thu, 29 Oct 2015 22:13:24 +0530 Subject: [PATCH 122/457] [c++] Added Lambda Expressions and Range for --- c++.html.markdown | 100 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/c++.html.markdown b/c++.html.markdown index d03092e5..6033ca06 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -801,6 +801,106 @@ void doSomethingWithAFile(const std::string& filename) // all automatically destroy their contents when they fall out of scope. // - Mutexes using lock_guard and unique_lock +/////////////////////////////////////// +// Lambda Expressions (C++11 and above) +/////////////////////////////////////// + +// lambdas are a convenient way of defining an anonymous function +// object right at the location where it is invoked or passed as +// an argument to a function. + +// Example consider sorting a vector of pairs using the second +// value of the pair + +vector > tester; +tester.push_back(make_pair(3, 6)); +tester.push_back(make_pair(1, 9)); +tester.push_back(make_pair(5, 0)); + +// Pass a lambda expression as third argument to the sort function +// sort is from the header + +sort(tester.begin(), tester.end(), [](const pair &lhs, const pair &rhs) { + return lhs.second < rhs.second; + }); + +// Notice the syntax of the lambda expression, +// [] in the lambda is used to "capture" variables. +// For Example: + +vector dog_ids; +// number_of_dogs = 3; +for(int i = 0; i < 3; i++){ + dog_ids.push_back(i); +} + +int weight[3]; +weight[0] = 30, weight[1] = 50, weight[2] = 10; + +// Say you want to sort dog_ids according to the dogs' weights +// So dog_ids should in the end become: [2, 0, 1] + +// Here's where lambda expressions come in handy + +sort(dog_ids.begin(), dog_ids.end(), [weight](const int &lhs, const int &rhs) { + return weight[lhs] < weight[rhs]; + }); +// Note we captured "weight" in the above example. + +// lambda are really useful for the case of structs +// You can use lambda expressions instead of overloading +// the "<" operator + +struct dog{ + int weight, age; +}dogs[3]; + +dogs[0].weight = 30, dogs[0].age = 4; +dogs[1].weight = 40, dogs[1].age = 10; +dogs[2].weight = 20, dogs[2].age = 9; + +// Say I want to sort the dogs array by the dogs' weights + +sort(dogs, dogs+3, [](const dog &lhs, const dog &rhs) { + return lhs.weight < rhs.weight; + }); +// dogs is now sorted according to their weight + +// Do something with the dogs + +// Now I want to sort the dogs by in descending order of their age + +sort(dogs, dogs+3, [](const dog &lhs, const dog &rhs) { + return lhs.age > rhs.age; + }); +// dogs is now sorted in descending order of their age + + +/////////////////////////////// +// Range For (C++11 and above) +/////////////////////////////// + +// You can use a range for loop to iterate over a container +int arr[] = {1, 10, 3}; + +for(int elem: arr){ + cout< Date: Thu, 29 Oct 2015 19:21:48 +0100 Subject: [PATCH 123/457] Czech translation for Sass --- cs-cz/sass.html.markdown | 439 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 439 insertions(+) create mode 100644 cs-cz/sass.html.markdown diff --git a/cs-cz/sass.html.markdown b/cs-cz/sass.html.markdown new file mode 100644 index 00000000..e890debe --- /dev/null +++ b/cs-cz/sass.html.markdown @@ -0,0 +1,439 @@ +--- +language: sass +filename: learnsass.scss +contributors: + - ["Laura Kyle", "https://github.com/LauraNK"] + - ["Sean Corrales", "https://github.com/droidenator"] +translators: + - ["Michal Martinek", "https://github.com/MichalMartinek"] + +--- + +Sass je rozšíření jazyka CSS, který přidává nové vlastnosti jako proměnné, zanořování, mixiny a další. +Sass (a další preprocesory, jako [Less](http://lesscss.org/)) pomáhají vývojářům psát udržovatelný a neopakující (DRY) kód. + +Sass nabízí dvě možnosti syntaxe. SCSS, které je stejná jako CSS, akorát obsahuje nové vlastnosti Sassu. Nebo Sass, který používá odsazení místo složených závorek a středníků. +Tento tutoriál bude používat syntaxi CSS. + + +Pokud jste již obeznámeni s CSS3, budete schopni používat Sass relativně rychle. Nezprostředkovává nějaké úplně nové stylové možnosti, spíše nátroje, jak psát Vás CSS kód více efektivně, udržitelně a jednoduše. + +```scss + + +//Jednořádkové komentáře jsou ze Sassu při kompilaci vymazány + +/*Víceřádkové komentáře jsou naopak zachovány */ + + + +/*Proměnné +==============================*/ + + + +/* Můžete uložit CSS hodnotu (jako třeba barvu) do proměnné. +Použijte symbol '$' k jejímu vytvoření. */ + +$hlavni-barva: #A3A4FF; +$sekundarni-barva: #51527F; +$body-font: 'Roboto', sans-serif; + +/* Můžete používat proměnné napříč vaším souborem. +Teď, když chcete změnit barvu, stačí ji změnit pouze jednou.*/ + +body { + background-color: $hlavni-barva; + color: $sekundarni-barva; + font-family: $body-font; +} + +/* Toto se zkompiluje do: */ +body { + background-color: #A3A4FF; + color: #51527F; + font-family: 'Roboto', sans-serif; +} + + +/* Toto je o hodně více praktické, než měnit každý výskyt barvy. */ + + + +/*Mixiny +==============================*/ + + + +/* Pokud zjistíte, že píšete kód pro více než jeden element, můžete jej uložit do mixinu. + +Použijte '@mixin' direktivu, plus jméno vašeho mixinu.*/ + +@mixin na-stred { + display: block; + margin-left: auto; + margin-right: auto; + left: 0; + right: 0; +} + +/* Mixin vložíte pomocí '@include' a jména mixinu */ + +div { + @include na-stred; + background-color: $hlavni-barva; +} + +/*Což se zkompiluje do: */ +div { + display: block; + margin-left: auto; + margin-right: auto; + left: 0; + right: 0; + background-color: #A3A4FF; +} + + +/* Můžete využít mixiny i třeba pro takovéto ušetření práce: */ + +@mixin velikost($sirka, $vyska) { + width: $sirka; + height: $vyska; +} + +/*Stačí vložit argumenty: */ + +.obdelnik { + @include velikost(100px, 60px); +} + +.ctverec { + @include velikost(40px, 40px); +} + +/* Toto se zkompiluje do: */ +.obdelnik { + width: 100px; + height: 60px; +} + +.ctverec { + width: 40px; + height: 40px; +} + + + +/*Funkce +==============================*/ + + + +/* Sass obsahuje funkce, které vám pomůžou splnit různé úkoly. */ + +/* Funkce se spouštějí pomocí jejich jména, které následuje seznam argumentů uzavřený v kulatých závorkách. */ +body { + width: round(10.25px); +} + +.footer { + background-color: fade_out(#000000, 0.25) +} + +/* Se zkompiluje do: */ + +body { + width: 10px; +} + +.footer { + background-color: rgba(0, 0, 0, 0.75); +} + +/* Můžete také definovat vlastní funkce. Funkce jsou velmi podobné mixinům. + Když se snažíte vybrat mezi funkcí a mixinem, mějte na paměti, že mixiny + jsou lepší pro generování CSS kódu, zatímco funkce jsou lepší pro logiku. + Příklady ze sekce Matematické operátory jsou skvělí kandidáti na + znovupoužitelné funkce. */ + +/* Tato funkce vrací poměr k velikosti rodiče v procentech. +@function vypocitat-pomer($velikost, $velikost-rodice) { + @return $velikost / $velikost-rodice * 100%; +} + +$hlavni obsah: vypocitat-pomer(600px, 960px); + +.hlavni-obsah { + width: $hlavni-obsah; +} + +.sloupec { + width: vypocitat-pomer(300px, 960px); +} + +/* Zkompiluje do: */ + +.hlavni-obsah { + width: 62.5%; +} + +.sloupec { + width: 31.25%; +} + + + +/*Dědění +==============================*/ + + + +/*Dědění je způsob jak používat vlastnosti pro jeden selektor ve druhém. */ + +.oznameni { + @include velikost(5em, 5em); + border: 5px solid $sekundarni-barva; +} + +.oznameni-uspech { + @extend .oznameni; + border-color: #22df56; +} + +/* Zkompiluje do: */ +.oznameni, .oznameni-uspech { + width: 5em; + height: 5em; + border: 5px solid #51527F; +} + +.oznameni-uspech { + border-color: #22df56; +} + + +/* Dědění CSS výrazů je preferováno před vytvořením mixinu kvůli způsobu, + jakým způsobem Sass dává dohromady třídy, které sdílejí stejný kód. + Kdyby to bylo udělané pomocí mixinu, tak výška, šířka, rámeček by byl v + každém výrazu, který by volal mixin. I když tohle neovlivní vaše workflow, + přidá to kód navíc do souborů. */ + + +/*Zanořování +==============================*/ + + + +/*Sass vám umožňuje zanořovat selektory do selektorů */ + +ul { + list-style-type: none; + margin-top: 2em; + + li { + background-color: #FF0000; + } +} + +/* '&' nahradí rodičovský element. */ +/* Můžete také zanořovat pseudo třídy. */ +/* Pamatujte, že moc velké zanoření do hloubky snižuje čitelnost. + Doporučuje se používat maximálně trojité zanoření. + Na příklad: */ + +ul { + list-style-type: none; + margin-top: 2em; + + li { + background-color: red; + + &:hover { + background-color: blue; + } + + a { + color: white; + } + } +} + +/* Zkompiluje do: */ + +ul { + list-style-type: none; + margin-top: 2em; +} + +ul li { + background-color: red; +} + +ul li:hover { + background-color: blue; +} + +ul li a { + color: white; +} + + + +/*Částečné soubory a importy +==============================*/ + + + +/* Sass umožňuje vytvářet částečné soubory. Tyto soubory pomahájí udržovat váš + kód modulární. Tyto soubory by měli začínat vždy '_', např. _reset.css. + Částečné soubory se nepřevádí do CSS. */ + +/* Toto je kód, který si uložíme do souboru _reset.css */ + +html, +body, +ul, +ol { + margin: 0; + padding: 0; +} + +/* Sass obsahuje @import, které může být použit pro import částečných souborů. + Toto se liší od klasického CSS @import, který dělá HTTP požadavek na stáhnutí + souboru. Sass vezme importovaný soubor a vloží ho do kompilovaného kódu. */ + +@import 'reset'; + +body { + font-size: 16px; + font-family: Helvetica, Arial, Sans-serif; +} + +/* Zkompiluje do: */ + +html, body, ul, ol { + margin: 0; + padding: 0; +} + +body { + font-size: 16px; + font-family: Helvetica, Arial, Sans-serif; +} + + + +/*Zástupné selektory +==============================*/ + + + +/* Zástupné selektory jsou užitečné, když vytváříte CSS výraz, ze kterého + chcete později dědit. Když chcete vytvořit výraz, ze kterého je možné pouze + dědit pomocí @extend, vytvořte zástupný selektor s CSS výrazem. Ten začíná + symbolem '%' místo '.' nebo '#'. Tyto výrazy se neobjeví ve výsledném CSS */ + +%okno-obsahu { + font-size: 14px; + padding: 10px; + color: #000; + border-radius: 4px; +} + +.okno-zpravy { + @extend %okno-obsahu; + background-color: #0000ff; +} + +/* Zkompiluje do: */ + +.okno-zpravy { + font-size: 14px; + padding: 10px; + color: #000; + border-radius: 4px; +} + +.okno-zpravy { + background-color: #0000ff; +} + + + +/*Matematické operace +==============================*/ + + + +/* Sass obsahuje následující operátory: +, -, *, /, and %. Tyto operátory + můžou být velmi užitečné pro počítání hodnot přímo ve vašem souboru Sass. + Níže je příklad, jak udělat jednoduchý dvousloupcový layout. */ + +$oblast-obsahu: 960px; +$hlavni-obsah: 600px; +$vedlejsi-sloupec: 300px; + +$obsah-velikost: $hlavni-obsah / $oblast-obsahu * 100%; +$vedlejsi-sloupec-velikost: $vedlejsi-sloupec / $oblast-obsahu * 100%; +$zbytek-velikost: 100% - ($main-size + $vedlejsi-sloupec-size); + +body { + width: 100%; +} + +.hlavni-obsah { + width: $obsah-velikost; +} + +.vedlejsi-sloupec { + width: $vedlejsi-sloupec-velikost; +} + +.zbytek { + width: $zbytek-velikost; +} + +/* Zkompiluje do: */ + +body { + width: 100%; +} + +.hlavni-obsah { + width: 62.5%; +} + +.vedlejsi-sloupec { + width: 31.25%; +} + +.gutter { + width: 6.25%; +} + + +``` + + + +## SASS nebo Sass? +Divili jste se někdy, jestli je Sass zkratka nebo ne? Pravděpodobně ne, ale řeknu vám to stejně. Jméno tohoto jazyka je slovo, "Sass", a ne zkratka. +Protože to lidé konstatně píší jako "SASS", nazval ho autor jazyka jako "Syntactically Awesome StyleSheets" (Syntaktický úžasně styly). + + +## Procvičování Sassu +Pokud si chcete hrát se Sassem ve vašem prohlížeči, navštivte [SassMeister](http://sassmeister.com/). +Můžete používát oba dva způsoby zápisu, stačí si vybrat v nastavení SCSS nebo SASS. + + +## Kompatibilita + +Sass může být použit v jakémkoliv projektu, jakmile máte program, pomocí kterého ho zkompilujete do CSS. Pokud si chcete ověřit, že CSS, které Sass produkuje je kompatibilní s prohlížeči: + +[QuirksMode CSS](http://www.quirksmode.org/css/) a [CanIUse](http://caniuse.com) jsou skvělé stránky pro kontrolu kompatibility. + + +## Kam dál? +* [Oficiální dokumentace](http://sass-lang.com/documentation/file.SASS_REFERENCE.html) +* [The Sass Way](http://thesassway.com/) obsahuje tutoriál a řadu skvělých článků From b27ddf1bd65c0d62293934eee085fafe340937d4 Mon Sep 17 00:00:00 2001 From: meinkej Date: Thu, 29 Oct 2015 19:44:21 +0100 Subject: [PATCH 124/457] [go/de] More infos, reformulation and typo fixes for Go. --- de-de/go-de.html.markdown | 40 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/de-de/go-de.html.markdown b/de-de/go-de.html.markdown index d3a192fe..099927b6 100644 --- a/de-de/go-de.html.markdown +++ b/de-de/go-de.html.markdown @@ -4,17 +4,16 @@ filename: learngo-de.go contributors: - ["Joseph Adams", "https://github.com/jcla1"] - ["Dennis Keller", "https://github.com/denniskeller"] + - ["Jerome Meinke", "https://github.com/jmeinke"] lang: de-de --- -Go wurde entwickelt, um Probleme zu lösen. Sie ist zwar nicht der neueste Trend in -der Informatik, aber sie ist einer der neuesten und schnellsten Wege, um Aufgabe in -der realen Welt zu lösen. - -Sie hat vertraute Elemente von imperativen Sprachen mit statischer Typisierung -und kann schnell kompiliert und ausgeführt werden. Verbunden mit leicht zu -verstehenden Parallelitäts-Konstrukten, um die heute üblichen mehrkern -Prozessoren optimal nutzen zu können, eignet sich Go äußerst gut für große -Programmierprojekte. +Die Sprache Go (auch golang) wurde von Google entwickelt und wird seit 2007 +benutzt. Go ähnelt in der Syntax der Sprache C, bietet darüber hinaus aber viele +Vorteile. Einerseits verzichtet Gp auf Speicherarithmetik und +benutzt einen Garbabe Collector. Andererseits enthält Go native Sprachelemente +für die Unterstützung von Nebenläufigkeit. Durch den Fokus auf einen schnellen +Kompilierprozess wird außerdem die Softwareentwicklung in Großprojekten +erleichtert. Außerdem beinhaltet Go eine gut ausgestattete Standardbibliothek und hat eine aktive Community. @@ -24,7 +23,7 @@ aktive Community. /* Mehr- zeiliger Kommentar */ -// Eine jede Quelldatei beginnt mit einer Paket-Klausel. +// Wie bei Java gehört jede Quelldatei einem Paket an (Modularisierung). // "main" ist ein besonderer Paketname, da er ein ausführbares Programm // einleitet, im Gegensatz zu jedem anderen Namen, der eine Bibliothek // deklariert. @@ -40,7 +39,7 @@ import ( // 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! +// Programms. func main() { // Println gibt eine Zeile zu stdout aus. // Der Prefix "fmt" bestimmt das Paket aus welchem die Funktion stammt. @@ -50,8 +49,8 @@ func main() { beyondHello() } -// Funktionen können Parameter akzeptieren, diese werden in Klammern deklariert, -// die aber auch bei keinen Parametern erforderlich sind. +// Funktionen können Parameter akzeptieren. Siese werden in Klammern deklariert, +// die aber auch ohne Parameter erforderlich sind. func beyondHello() { var x int // Deklaration einer Variable, muss vor Gebrauch geschehen. x = 3 // Zuweisung eines Werts. @@ -306,14 +305,13 @@ 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 dem Tutorial folgen, interaktiv Quelltext ausprobieren und viel -Dokumentation lesen. +Informationen zu Go findet man auf der [offiziellen Go Webseite](http://golang.org/). +Dort gibt es unter anderem ein Tutorial und interaktive Quelltext-Beispiele, vor +allem aber Dokumentation zur Sprache und den Paketen. 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 dokumentiert, demonstriert sie leicht zu verstehendes und im idiomatischen Stil -verfasstes Go. Erreichbar ist der Quelltext auch durch das Klicken der Funktionsnamen +kurz und 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/) +einzusehen. Dieser kann als Referenz für leicht zu verstehendes und im idiomatischen Stil +verfasstes Go dienen. Erreichbar ist der Quelltext auch durch das Klicken der Funktionsnamen in der [offiziellen Dokumentation von Go](http://golang.org/pkg/). - From e5a02057227506b95630658971caabb30b64f705 Mon Sep 17 00:00:00 2001 From: meinkej Date: Thu, 29 Oct 2015 19:50:17 +0100 Subject: [PATCH 125/457] Fix a typo introduced in the previous commit. Reformatted some lines. --- de-de/go-de.html.markdown | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/de-de/go-de.html.markdown b/de-de/go-de.html.markdown index 099927b6..94f48e65 100644 --- a/de-de/go-de.html.markdown +++ b/de-de/go-de.html.markdown @@ -49,7 +49,7 @@ func main() { beyondHello() } -// Funktionen können Parameter akzeptieren. Siese werden in Klammern deklariert, +// Funktionen können Parameter akzeptieren. Diese werden in Klammern deklariert, // die aber auch ohne Parameter erforderlich sind. func beyondHello() { var x int // Deklaration einer Variable, muss vor Gebrauch geschehen. @@ -98,7 +98,7 @@ Zeilenumbrüche beinhalten.` // Selber Zeichenketten-Typ // "slices" haben eine dynamische Größe. Arrays und Slices haben beide ihre // Vorzüge, aber slices werden viel häufiger verwendet s3 := []int{4, 5, 9} // Vergleichen Sie mit a3, hier: keine Ellipse - s4 := make([]int, 4) // Weist Speicher für 4 ints zu, alle mit Initialwert 0 + s4 := make([]int, 4) // Weist Speicher für 4 ints zu, alle mit Wert 0 var d2 [][]float64 // Nur eine Deklaration, keine Speicherzuweisung bs := []byte("eine slice") // Umwandlungs-Syntax @@ -200,7 +200,8 @@ type pair struct { x, y int } -// Definiere eine Methode von "pair". Dieser Typ erfüllt jetzt das Stringer interface. +// Definiere eine Methode von "pair". +// Dieser Typ erfüllt jetzt das Stringer interface. func (p pair) String() string { // p ist der Empfänger // Sprintf ist eine weitere öffentliche Funktion von fmt. // Der Syntax mit Punkt greift auf die Felder zu. @@ -254,8 +255,9 @@ func learnConcurrency() { // Die selbe "make"-Funktion wie vorhin. Sie initialisiert Speicher für // maps, slices und Kanäle. c := make(chan int) - // Starte drei parallele "Goroutines". Die Zahlen werden parallel (concurrently) - // erhöht. Alle drei senden ihr Ergebnis in den gleichen Kanal. + // Starte drei parallele "Goroutines". + // Die Zahlen werden parallel (concurrently) erhöht. + // Alle drei senden ihr Ergebnis in den gleichen Kanal. go inc(0, c) // "go" ist das Statement zum Start einer neuen Goroutine go inc(10, c) go inc(-805, c) From fe1c5e86ede2786580c414bf608bb09d5c7ceb40 Mon Sep 17 00:00:00 2001 From: Nasgul Date: Thu, 29 Oct 2015 22:15:40 +0200 Subject: [PATCH 126/457] 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 127/457] 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 128/457] 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 129/457] 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 130/457] 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 131/457] 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 132/457] 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 133/457] 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 134/457] 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 135/457] 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 136/457] 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 137/457] 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 138/457] 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 139/457] 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 8aff0a65dc106f4718b8d5da27178757e4f41eba Mon Sep 17 00:00:00 2001 From: Anton Pastukhoff Date: Fri, 30 Oct 2015 20:10:22 +0500 Subject: [PATCH 140/457] Update d-ru.html.markdown --- ru-ru/d-ru.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ru-ru/d-ru.html.markdown b/ru-ru/d-ru.html.markdown index 33bff3b7..cbd5b127 100644 --- a/ru-ru/d-ru.html.markdown +++ b/ru-ru/d-ru.html.markdown @@ -39,7 +39,7 @@ module app; import std.stdio; // можно импортировать только нужные части, не обязательно модуль целиком -import std.exception : assert; +import std.exception : enforce; // точка входа в программу — функция main, аналогично C/C++ void main() @@ -60,7 +60,7 @@ double с = 56.78; // тип с плавающей точкой (64 бита) комплексных чисел, могут быть беззнаковыми. В этом случае название типа начинается с префикса "u" */ -uint d = 10, ulong e = 11.12; +uint d = 10; ulong e = 11; bool b = true; // логический тип char d = 'd'; // UTF-символ, 8 бит. D поддерживает UTF "из коробки" wchar = 'é'; // символ UTF-16 @@ -146,7 +146,7 @@ x++; // 10 ++x; // 11 x *= 2; // 22 x /= 2; // 11 -x ^^ 2; // 121 (возведение в степень) +x = x ^^ 2; // 121 (возведение в степень) x ^^= 2; // 1331 (то же самое) string str1 = "Hello"; @@ -160,7 +160,7 @@ arr ~= 4; // [1, 2, 3, 4] - добавление элемента в конец /*** Логика и сравнения ***/ -int x = 0, int y = 1; +int x = 0; int y = 1; x == y; // false x > y; // false From 9a152c0490ba38e791ba1444d74dcf184d3c847e Mon Sep 17 00:00:00 2001 From: Jacob Ward Date: Fri, 30 Oct 2015 09:24:49 -0600 Subject: [PATCH 141/457] 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 142/457] [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 143/457] 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 144/457] 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 145/457] 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 146/457] 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 147/457] 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 148/457] 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 149/457] 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 150/457] 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 151/457] 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 152/457] [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 153/457] [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 154/457] 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 155/457] 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 156/457] 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 157/457] 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 158/457] 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 159/457] 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 160/457] 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 161/457] 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 162/457] 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 163/457] 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 164/457] 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 165/457] 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 166/457] 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 167/457] [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 168/457] 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 169/457] 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 170/457] 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 db632ee03ca837fcdc4ca45e428ad7efb9c8135f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20P=C3=A9rez?= Date: Sat, 31 Oct 2015 11:27:29 +0100 Subject: [PATCH 171/457] Create file for PHP translation es-ES --- es-es/php-es.html.markdown | 823 +++++++++++++++++++++++++++++++++++++ 1 file changed, 823 insertions(+) create mode 100644 es-es/php-es.html.markdown diff --git a/es-es/php-es.html.markdown b/es-es/php-es.html.markdown new file mode 100644 index 00000000..a8276e53 --- /dev/null +++ b/es-es/php-es.html.markdown @@ -0,0 +1,823 @@ +--- +language: PHP +contributors: + - ["Malcolm Fell", "http://emarref.net/"] + - ["Trismegiste", "https://github.com/Trismegiste"] +translators: + - ["Mario Pérez", "https://github.com/MarioPerezEsteso"] +lang: es-es +filename: learnphp-es.php +--- + +This document describes PHP 5+. + +```php + +Hello World Again! + 12 +$int2 = -12; // => -12 +$int3 = 012; // => 10 (a leading 0 denotes an octal number) +$int4 = 0x0F; // => 15 (a leading 0x denotes a hex literal) + +// Floats (aka doubles) +$float = 1.234; +$float = 1.2e3; +$float = 7E-10; + +// Delete variable +unset($int1); + +// Arithmetic +$sum = 1 + 1; // 2 +$difference = 2 - 1; // 1 +$product = 2 * 2; // 4 +$quotient = 2 / 1; // 2 + +// Shorthand arithmetic +$number = 0; +$number += 1; // Increment $number by 1 +echo $number++; // Prints 1 (increments after evaluation) +echo ++$number; // Prints 3 (increments before evaluation) +$number /= $float; // Divide and assign the quotient to $number + +// Strings should be enclosed in single quotes; +$sgl_quotes = '$String'; // => '$String' + +// Avoid using double quotes except to embed other variables +$dbl_quotes = "This is a $sgl_quotes."; // => 'This is a $String.' + +// Special characters are only escaped in double quotes +$escaped = "This contains a \t tab character."; +$unescaped = 'This just contains a slash and a t: \t'; + +// Enclose a variable in curly braces if needed +$money = "I have $${number} in the bank."; + +// Since PHP 5.3, nowdocs can be used for uninterpolated multi-liners +$nowdoc = <<<'END' +Multi line +string +END; + +// Heredocs will do string interpolation +$heredoc = << 1, 'Two' => 2, 'Three' => 3); + +// PHP 5.4 introduced a new syntax +$associative = ['One' => 1, 'Two' => 2, 'Three' => 3]; + +echo $associative['One']; // prints 1 + +// List literals implicitly assign integer keys +$array = ['One', 'Two', 'Three']; +echo $array[0]; // => "One" + +// Add an element to the end of an array +$array[] = 'Four'; +// or +array_push($array, 'Five'); + +// Remove element from array +unset($array[3]); + +/******************************** + * Output + */ + +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 'Hello World!'; + +$paragraph = 'paragraph'; + +echo 100; // Echo scalar variables directly +echo $paragraph; // or variables + +// If short open tags are configured, or your PHP version is +// 5.4.0 or greater, you can use the short echo syntax +?> +

+ 2 +echo $z; // => 2 +$y = 0; +echo $x; // => 2 +echo $z; // => 0 + +// Dumps type and value of variable to stdout +var_dump($z); // prints int(0) + +// Prints variable to stdout in human-readable format +print_r($array); // prints: Array ( [0] => One [1] => Two [2] => Three ) + +/******************************** + * Logic + */ +$a = 0; +$b = '0'; +$c = '1'; +$d = '1'; + +// assert throws a warning if its argument is not true + +// These comparisons will always be true, even if the types aren't the same. +assert($a == $b); // equality +assert($c != $a); // inequality +assert($c <> $a); // alternative inequality +assert($a < $c); +assert($c > $b); +assert($a <= $b); +assert($c >= $d); + +// The following will only be true if the values match and are the same type. +assert($c === $d); +assert($a !== $d); +assert(1 === '1'); +assert(1 !== '1'); + +// '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; + +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; +echo $integer + $integer; // => 2 + +$string = '1'; +echo $string + $string; // => 2 (strings are coerced to integers) + +$string = 'one'; +echo $string + $string; // => 0 +// Outputs 0 because the + operator cannot cast the string 'one' to a number + +// Type casting can be used to treat a variable as another type + +$boolean = (boolean) 1; // => true + +$zero = 0; +$boolean = (boolean) $zero; // => false + +// There are also dedicated functions for casting most types +$integer = 5; +$string = strval($integer); + +$var = null; // Null value + + +/******************************** + * Control Structures + */ + +if (true) { + print 'I get printed'; +} + +if (false) { + print 'I don\'t'; +} else { + print 'I get printed'; +} + +if (false) { + print 'Does not get printed'; +} elseif(true) { + print 'Does'; +} + +// 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'; +} elseif($x == '1') { + print 'Does not print'; +} else { + print 'Does print'; +} + + + +// This alternative syntax is useful for templates: +?> + + +This is displayed if the test is truthy. + +This is displayed otherwise. + + + 2, 'car' => 4]; + +// Foreach loops can iterate over arrays +foreach ($wheels as $wheel_count) { + echo $wheel_count; +} // Prints "24" + +echo "\n"; + +// You can iterate over the keys as well as the values +foreach ($wheels as $vehicle => $wheel_count) { + echo "A $vehicle has $wheel_count wheels"; +} + +echo "\n"; + +$i = 0; +while ($i < 5) { + if ($i === 3) { + break; // Exit out of the while loop + } + echo $i++; +} // Prints "012" + +for ($i = 0; $i < 5; $i++) { + if ($i === 3) { + continue; // Skip this iteration of the loop + } + echo $i; +} // Prints "0124" + + +/******************************** + * Functions + */ + +// Define a function with "function": +function my_function () { + return 'Hello'; +} + +echo my_function(); // => "Hello" + +// A valid function name starts with a letter or underscore, followed by any +// number of letters, numbers, or underscores. + +function add ($x, $y = 1) { // $y is optional and defaults to 1 + $result = $x + $y; + return $result; +} + +echo add(4); // => 5 +echo add(4, 2); // => 6 + +// $result is not accessible outside the function +// print $result; // Gives a warning. + +// Since PHP 5.3 you can declare anonymous functions; +$inc = function ($x) { + return $x + 1; +}; + +echo $inc(2); // => 3 + +function foo ($x, $y, $z) { + echo "$x - $y - $z"; +} + +// Functions can return functions +function bar ($x, $y) { + // Use 'use' to bring in outside variables + return function ($z) use ($x, $y) { + foo($x, $y, $z); + }; +} + +$bar = bar('A', 'B'); +$bar('C'); // Prints "A - B - C" + +// You can call named functions using strings +$function_name = 'add'; +echo $function_name(1, 2); // => 3 +// Useful for programatically determining which function to run. +// Or, use call_user_func(callable $callback [, $parameter [, ... ]]); + + +// You can get the all the parameters passed to a function +function parameters() { + $numargs = func_num_args(); + if ($numargs > 0) { + echo func_get_arg(0) . ' | '; + } + $args_array = func_get_args(); + foreach ($args_array as $key => $arg) { + echo $key . ' - ' . $arg . ' | '; + } +} + +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 + */ + +instanceProp = $instanceProp; + } + + // Methods are declared as functions inside a class + public function myMethod() + { + print 'MyClass'; + } + + //final keyword would make a function unoverridable + final function youCannotOverrideMe() + { + } + +/* + * Declaring class properties or methods as static makes them accessible without + * needing an instantiation of the class. A property declared as static can not + * be accessed with an instantiated class object (though a static method can). + */ + + public static function myStaticMethod() + { + print 'I am static'; + } +} + +// Class constants can always be accessed statically +echo MyClass::MY_CONST; // Outputs 'value'; + +echo MyClass::$staticVar; // Outputs 'static'; +MyClass::myStaticMethod(); // Outputs 'I am static'; + +// Instantiate classes using new +$my_class = new MyClass('An instance property'); +// The parentheses are optional if not passing in an argument. + +// Access class members using -> +echo $my_class->property; // => "public" +echo $my_class->instanceProp; // => "An instance property" +$my_class->myMethod(); // => "MyClass" + + +// Extend classes using "extends" +class MyOtherClass extends MyClass +{ + function printProtectedProperty() + { + echo $this->prot; + } + + // Override a method + function myMethod() + { + parent::myMethod(); + print ' > MyOtherClass'; + } +} + +$my_other_class = new MyOtherClass('Instance prop'); +$my_other_class->printProtectedProperty(); // => Prints "protected" +$my_other_class->myMethod(); // Prints "MyClass > MyOtherClass" + +final class YouCannotExtendMe +{ +} + +// You can use "magic methods" to create getters and setters +class MyMapClass +{ + private $property; + + public function __get($key) + { + return $this->$key; + } + + public function __set($key, $value) + { + $this->$key = $value; + } +} + +$x = new MyMapClass(); +echo $x->property; // Will use the __get() method +$x->property = 'Something'; // Will use the __set() method + +// Classes can be abstract (using the abstract keyword) or +// implement interfaces (using the implements keyword). +// An interface is declared with the interface keyword. + +interface InterfaceOne +{ + public function doSomething(); +} + +interface InterfaceTwo +{ + public function doSomethingElse(); +} + +// interfaces can be extended +interface InterfaceThree extends InterfaceTwo +{ + public function doAnotherContract(); +} + +abstract class MyAbstractClass implements InterfaceOne +{ + public $x = 'doSomething'; +} + +class MyConcreteClass extends MyAbstractClass implements InterfaceTwo +{ + public function doSomething() + { + echo $x; + } + + public function doSomethingElse() + { + echo 'doSomethingElse'; + } +} + + +// Classes can implement more than one interface +class SomeOtherClass implements InterfaceOne, InterfaceTwo +{ + public function doSomething() + { + echo 'doSomething'; + } + + public function doSomethingElse() + { + echo 'doSomethingElse'; + } +} + + +/******************************** + * Traits + */ + +// Traits are available from PHP 5.4.0 and are declared using "trait" + +trait MyTrait +{ + public function myTraitMethod() + { + print 'I have MyTrait'; + } +} + +class MyTraitfulClass +{ + use MyTrait; +} + +$cls = new MyTraitfulClass(); +$cls->myTraitMethod(); // Prints "I have MyTrait" + + +/******************************** + * Namespaces + */ + +// This section is separate, because a namespace declaration +// must be the first statement in a file. Let's pretend that is not the case + + Date: Sat, 31 Oct 2015 21:29:46 +1100 Subject: [PATCH 172/457] 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 173/457] [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 174/457] 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 b307b65e8df4e27991c8cf7ade1e3d7faa1e87fd Mon Sep 17 00:00:00 2001 From: Anton Ivanov Date: Sat, 31 Oct 2015 14:37:12 +0300 Subject: [PATCH 175/457] Add binary number example. --- php.html.markdown | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/php.html.markdown b/php.html.markdown index 7b0cf61c..d03b89fe 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -54,6 +54,8 @@ $int1 = 12; // => 12 $int2 = -12; // => -12 $int3 = 012; // => 10 (a leading 0 denotes an octal number) $int4 = 0x0F; // => 15 (a leading 0x denotes a hex literal) +// Binary integer literals are available since PHP 5.4.0. +$int5 = 0b11111111; // 255 (a leading 0b denotes a binary number) // Floats (aka doubles) $float = 1.234; @@ -117,11 +119,11 @@ echo 'Multiple', 'Parameters', 'Valid'; // Returns 'MultipleParametersValid' // a valid constant name starts with a letter or underscore, // followed by any number of letters, numbers, or underscores. -define("FOO", "something"); +define("FOO", "something"); // access to a constant is possible by calling the choosen name without a $ echo FOO; // Returns 'something' -echo 'This outputs '.FOO; // Returns 'This ouputs something' +echo 'This outputs ' . FOO; // Returns 'This ouputs something' From c990b720e4416fd5c516af906ba548d0b2b12f0f Mon Sep 17 00:00:00 2001 From: Reinoud Kruithof Date: Sat, 31 Oct 2015 12:37:39 +0100 Subject: [PATCH 176/457] 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 177/457] 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 608615360c7f49cb33c9e7eb3957e031b9b8a89c Mon Sep 17 00:00:00 2001 From: Niko Weh Date: Sat, 31 Oct 2015 22:37:13 +1000 Subject: [PATCH 178/457] [haskell/en] Extended section on GHCi - Added the :i command, as i feel that it is as useful as :t. - Added another example for :t, hopefully showcasing it's flexibility - For consistency, changed the name of (.) from function to operator (as is already the case with ($)), and added a short remark in the GHCi section that (most) operators are also functions. --- haskell.html.markdown | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/haskell.html.markdown b/haskell.html.markdown index 936744a0..940cf4c7 100644 --- a/haskell.html.markdown +++ b/haskell.html.markdown @@ -193,7 +193,7 @@ foo = (+10) foo 5 -- 15 -- function composition --- the (.) function chains functions together. +-- the operator `.` 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 4, and then returns the final value. foo = (*4) . (+10) @@ -401,11 +401,26 @@ main'' = do let foo = 5 --- You can see the type of any value with `:t`: +-- You can see the type of any value or expression with `:t`: ->:t foo +> :t foo foo :: Integer +-- Operators, such as `+`, `:` and `$`, are functions. +-- Their type can be inspected by putting the operator in parentheses: + +> :t (:) +(:) :: a -> [a] -> [a] + +-- You can get additional information on any `name` using `:i`: + +> :i (+) +class Num a where + (+) :: a -> a -> a + ... + -- Defined in ‘GHC.Num’ +infixl 6 + + -- You can also run any action of type `IO ()` > sayHello From bda1e01ae0260e5ebbc7f93972b57bbad39c2ab4 Mon Sep 17 00:00:00 2001 From: IvanEh Date: Sat, 31 Oct 2015 14:46:06 +0200 Subject: [PATCH 179/457] 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 b336e810865a1a2ce54c53b467bcd1545455a679 Mon Sep 17 00:00:00 2001 From: Pavel Kazlou Date: Sat, 31 Oct 2015 16:12:18 +0300 Subject: [PATCH 180/457] removed controversial performance info, fixed recursion info and typos --- scala.html.markdown | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scala.html.markdown b/scala.html.markdown index 192e03d7..13e8d9d8 100644 --- a/scala.html.markdown +++ b/scala.html.markdown @@ -231,7 +231,7 @@ r foreach println (5 to 1 by -1) foreach (println) -// A while loops +// A while loop var i = 0 while (i < 10) { println("i " + i); i += 1 } @@ -239,17 +239,18 @@ while (i < 10) { println("i " + i); i += 1 } // Yes, again. What happened? Why i // Show the value of i. Note that while is a loop in the classical sense - // it executes sequentially while changing the loop variable. while is very - // fast, faster that Java loops, but using the combinators and - // comprehensions above is easier to understand and parallelize + // fast, but using the combinators and comprehensions above is easier + // to understand and parallelize -// A do while loop +// A do-while loop i = 0 do { println("i is still less than 10") i += 1 } while (i < 10) -// Tail recursion is an idiomatic way of doing recurring things in Scala. +// Recursion is the idiomatic way of repeating an action in Scala (as in most +// other functional languages). // Recursive functions need an explicit return type, the compiler can't infer it. // Here it's Unit. def showNumbersInRange(a: Int, b: Int): Unit = { @@ -267,7 +268,7 @@ 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") +if (x == 11) println("yeah") else println("nay") println(if (x == 10) "yeah" else "nope") val text = if (x == 10) "yeah" else "nope" From 3dbcf1c2c6092b0287bae150eec2271446f95927 Mon Sep 17 00:00:00 2001 From: Pavel Kazlou Date: Sat, 31 Oct 2015 16:22:59 +0300 Subject: [PATCH 181/457] added docs for multi-variable tuple assignment --- scala.html.markdown | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scala.html.markdown b/scala.html.markdown index 192e03d7..4ba9a31b 100644 --- a/scala.html.markdown +++ b/scala.html.markdown @@ -321,9 +321,15 @@ divideInts(10, 3) // (Int, Int) = (3,1) val d = divideInts(10, 3) // (Int, Int) = (3,1) d._1 // Int = 3 - d._2 // Int = 1 +// Alternatively you can do multiple-variable assignment to tuple, which is more +// convenient and readable in many cases +val (div, mod) = divideInts(10, 3) + +div // Int = 3 +mod // Int = 1 + ///////////////////////////////////////////////// // 5. Object Oriented Programming From bc087b50370a3c32c35ef026047c2fa9db9944d8 Mon Sep 17 00:00:00 2001 From: Pavel Kazlou Date: Sat, 31 Oct 2015 16:39:47 +0300 Subject: [PATCH 182/457] 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 d47f06345b37cecf4072523c1c79f63f37846d8c Mon Sep 17 00:00:00 2001 From: Pavel Kazlou Date: Sat, 31 Oct 2015 16:50:40 +0300 Subject: [PATCH 183/457] added docs for default case in pattern matching --- scala.html.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scala.html.markdown b/scala.html.markdown index 192e03d7..131bd71c 100644 --- a/scala.html.markdown +++ b/scala.html.markdown @@ -454,6 +454,9 @@ def matchEverything(obj: Any): String = obj match { // You can nest patterns: case List(List((1, 2, "YAY"))) => "Got a list of list of tuple" + + // Match any case (default) if all previous haven't matched + case _ => "Got unknown object" } // In fact, you can pattern match any object with an "unapply" method. This From a11e01b82162ad43db9b4f751ead0fdd09ad3fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20P=C3=A9rez?= Date: Sat, 31 Oct 2015 15:32:24 +0100 Subject: [PATCH 184/457] Translate learn PHP to es-es --- es-es/php-es.html.markdown | 714 +++++++++++++++++++------------------ 1 file changed, 358 insertions(+), 356 deletions(-) diff --git a/es-es/php-es.html.markdown b/es-es/php-es.html.markdown index a8276e53..fa52353c 100644 --- a/es-es/php-es.html.markdown +++ b/es-es/php-es.html.markdown @@ -9,121 +9,121 @@ lang: es-es filename: learnphp-es.php --- -This document describes PHP 5+. +Este documento explica el funcionamiento de PHP 5+. ```php - -Hello World Again! +¡Hola Mundo de nuevo! 12 $int2 = -12; // => -12 -$int3 = 012; // => 10 (a leading 0 denotes an octal number) -$int4 = 0x0F; // => 15 (a leading 0x denotes a hex literal) +$int3 = 012; // => 10 (un 0 al comienzo declara un número octal) +$int4 = 0x0F; // => 15 (un 0x al comienzo declara un hexadecimal) -// Floats (aka doubles) +// Floats (también conocidos como doubles) $float = 1.234; $float = 1.2e3; $float = 7E-10; -// Delete variable +// Eliminar variable unset($int1); -// Arithmetic -$sum = 1 + 1; // 2 -$difference = 2 - 1; // 1 -$product = 2 * 2; // 4 -$quotient = 2 / 1; // 2 +// Operaciones aritméticas +$suma = 1 + 1; // 2 +$diferencia = 2 - 1; // 1 +$producto = 2 * 2; // 4 +$cociente = 2 / 1; // 2 -// Shorthand arithmetic -$number = 0; -$number += 1; // Increment $number by 1 -echo $number++; // Prints 1 (increments after evaluation) -echo ++$number; // Prints 3 (increments before evaluation) -$number /= $float; // Divide and assign the quotient to $number +// Operaciones aritméticas de escritura rápida +$numero = 0; +$numero += 1; // Incrementa $numero en 1 +echo $numero++; // Imprime 1 (incremento después la evaluación) +echo ++$numero; // Imprime 3 (incremento antes de la evaluación) +$numero /= $float; // Divide y asigna el cociente a $numero -// Strings should be enclosed in single quotes; +// Las cadenas de caracteres deben declararse entre comillas simples $sgl_quotes = '$String'; // => '$String' -// Avoid using double quotes except to embed other variables +// Evita utilizar comillas dobles excepto para embeber otras variables $dbl_quotes = "This is a $sgl_quotes."; // => 'This is a $String.' -// Special characters are only escaped in double quotes -$escaped = "This contains a \t tab character."; -$unescaped = 'This just contains a slash and a t: \t'; +// Los caracteres especiales solo son válidos entre comillas dobles +$escaped = "Esto contiene \t un caracter tabulador."; +$unescaped = 'Esto solo contiene una barra y una t: \t'; -// Enclose a variable in curly braces if needed -$money = "I have $${number} in the bank."; +// Rodea una variable entre corchetes si es necesario +$dinero = "Tengo $${numero} en el banco."; -// Since PHP 5.3, nowdocs can be used for uninterpolated multi-liners +// Desde PHP 5.3, los nowdocs pueden ser utilizados para multilíneas no interpoladas $nowdoc = <<<'END' Multi line string END; -// Heredocs will do string interpolation +// Heredocs interpola cadenas de caracteres $heredoc = << 1, 'Two' => 2, 'Three' => 3); +// Funciona con todas las versiones de php +$asociativo = array('Uno' => 1, 'Dos' => 2, 'Tres' => 3); -// PHP 5.4 introduced a new syntax -$associative = ['One' => 1, 'Two' => 2, 'Three' => 3]; +// PHP 5.4 introdujo una nueva sintaxis +$asociativo = ['Uno' => 1, 'Dos' => 2, 'Tres' => 3]; -echo $associative['One']; // prints 1 +echo $asociativo['Uno']; // imprime 1 -// List literals implicitly assign integer keys -$array = ['One', 'Two', 'Three']; -echo $array[0]; // => "One" +// Lista literales implícitamente asignados con claves enteras +$array = ['Uno', 'Dos', 'Tres']; +echo $array[0]; // => "Uno" -// Add an element to the end of an array -$array[] = 'Four'; -// or -array_push($array, 'Five'); +// Añadir un elemento al final de un array +$array[] = 'Cuatro'; +// o +array_push($array, 'Cinco'); -// Remove element from array +// Eliminar un elemento de un array unset($array[3]); /******************************** - * Output + * Salidas por pantalla */ -echo('Hello World!'); -// Prints Hello World! to stdout. -// Stdout is the web page if running in a browser. +echo('¡Hola Mundo!'); +// Imprime ¡Hola Mundo! en stdout. +// Stdout es la página web si se está ejecutando en un navegador. -print('Hello World!'); // The same as echo +print('!Hola Mundo!'); // Es lo mismo que echo -// echo and print are language constructs too, so you can drop the parentheses -echo 'Hello World!'; -print 'Hello World!'; +// No es necesario el paréntesis en echo y print +echo '¡Hola Mundo!'; +print '¡Hola Mundo!'; -$paragraph = 'paragraph'; +$parrafo = 'parrafo'; -echo 100; // Echo scalar variables directly -echo $paragraph; // or variables +echo 100; // Haz echo de escalares directamente +echo $parrafo; // o de variables -// If short open tags are configured, or your PHP version is -// 5.4.0 or greater, you can use the short echo syntax +// Si las etiquetas cortas estás configuradas y tu versión de PHP es +// la 5.4.0 o superior, puede utilizar la sintaxis abreviada de echo ?> -

+

2 echo $z; // => 2 @@ -194,179 +194,178 @@ $y = 0; echo $x; // => 2 echo $z; // => 0 -// Dumps type and value of variable to stdout -var_dump($z); // prints int(0) +// Dump muestra el tipo y valor de una variable en stdout +var_dump($z); // imprime int(0) -// Prints variable to stdout in human-readable format -print_r($array); // prints: Array ( [0] => One [1] => Two [2] => Three ) +// Para mostrar el valor de una variable en un formato legible para humanos +print_r($array); // imprime: Array ( [0] => Uno [1] => Dos [2] => Tres ) /******************************** - * Logic + * Lógica */ $a = 0; $b = '0'; $c = '1'; $d = '1'; -// assert throws a warning if its argument is not true +// assert lanza una advertencia si su argumento no es verdadero -// These comparisons will always be true, even if the types aren't the same. -assert($a == $b); // equality -assert($c != $a); // inequality -assert($c <> $a); // alternative inequality +// Estas comparaciones siempre serán verdaderas, incluso si los tipos no son los mismos. +assert($a == $b); // igualdad +assert($c != $a); // desigualdad +assert($c <> $a); // desigualdad alternativa assert($a < $c); assert($c > $b); assert($a <= $b); assert($c >= $d); -// The following will only be true if the values match and are the same type. +// Los siguiente solo será verdadero si los valores coinciden y son del mismo tipo. assert($c === $d); assert($a !== $d); assert(1 === '1'); assert(1 !== '1'); -// '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 +// Operador 'Spaceship' (desde PHP 7) +// Devuelve 0 si ambos valores son iguales +// Devuelve 1 si el valor de la izquierda es mayor +// Devuelve -1 si el valor de la derecha es mayor $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 +echo $a <=> $a; // 0 porque son iguales +echo $a <=> $b; // -1 porque $a < $b +echo $b <=> $a; // 1 porque $b > $a -// Variables can be converted between types, depending on their usage. +// Las variables pueden ser convertidas entre tipos, dependiendo de su uso. -$integer = 1; -echo $integer + $integer; // => 2 +$entero = 1; +echo $entero + $entero; // => 2 $string = '1'; -echo $string + $string; // => 2 (strings are coerced to integers) +echo $string + $string; // => 2 (los strings son convertidos a enteros) -$string = 'one'; +$string = 'uno'; echo $string + $string; // => 0 -// Outputs 0 because the + operator cannot cast the string 'one' to a number +// Muestra un 0 porque el operador + no puede convertir la cadena de caracteres 'uno' a un número -// Type casting can be used to treat a variable as another type +// La conversión de tipos puede ser utilizada para tratar a una variable como otro tipo $boolean = (boolean) 1; // => true -$zero = 0; -$boolean = (boolean) $zero; // => false +$cero = 0; +$boolean = (boolean) $cero; // => false -// There are also dedicated functions for casting most types -$integer = 5; -$string = strval($integer); +// También hay funciones dedicadas a la conversión de tipos +$entero = 5; +$string = strval($entero); -$var = null; // Null value +$var = null; // Valor nulo /******************************** - * Control Structures + * Estructuras de control */ if (true) { - print 'I get printed'; + print 'He sido imprimido'; } if (false) { - print 'I don\'t'; + print 'Yo no'; } else { - print 'I get printed'; + print 'He sido imprimido'; } if (false) { - print 'Does not get printed'; + print 'No se imprime'; } elseif(true) { - print 'Does'; + print 'Sí se imprime'; } -// ternary operator -print (false ? 'Does not get printed' : 'Does'); +// operador ternario +print (false ? 'No se imprime' : 'Sí se imprime'); -// ternary shortcut operator since PHP 5.3 -// equivalent of "$x ? $x : 'Does'"" +// atajo para el operador ternario desde PHP 5.3 +// equivalente de "$x ? $x : 'Sí'"" $x = false; -print($x ?: 'Does'); +print($x ?: 'Sí'); -// null coalesce operator since php 7 +// operador 'no definido' desde 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' +$b = 'Imprime'; +echo $a ?? 'a no está definido'; // imprime 'a no está definido' +echo $b ?? 'b no está definido'; // imprime 'Imprime' $x = 0; if ($x === '0') { - print 'Does not print'; + print 'No imprime'; } elseif($x == '1') { - print 'Does not print'; + print 'No imprime'; } else { - print 'Does print'; + print 'Imprime'; } -// This alternative syntax is useful for templates: +// Esta sintaxis alternativa se utiliza para plantillas: ?> -This is displayed if the test is truthy. +Esto se muestra si la evaluación es verdadera. -This is displayed otherwise. +En otro caso, se muestra esto. 2, 'car' => 4]; +$ruedas = ['bicicleta' => 2, 'coche' => 4]; -// Foreach loops can iterate over arrays -foreach ($wheels as $wheel_count) { - echo $wheel_count; -} // Prints "24" +// Los bucles foreach pueden iterar por arrays +foreach ($ruedas as $numero_ruedas) { + echo $numero_ruedas; +} // Imprime "24" echo "\n"; -// You can iterate over the keys as well as the values -foreach ($wheels as $vehicle => $wheel_count) { - echo "A $vehicle has $wheel_count wheels"; +// También se puede iterar sobre las claves, así como sobre los valores +foreach ($ruedas as $vehiculo => $numero_ruedas) { + echo "Un $vehiculo tiene $numero_ruedas ruedas"; } echo "\n"; @@ -374,45 +373,45 @@ echo "\n"; $i = 0; while ($i < 5) { if ($i === 3) { - break; // Exit out of the while loop + break; // Sale fuera del bucle while } echo $i++; -} // Prints "012" +} // Imprime "012" for ($i = 0; $i < 5; $i++) { if ($i === 3) { - continue; // Skip this iteration of the loop + continue; // Se salta esta iteración del bucle } echo $i; -} // Prints "0124" +} // Imprime "0124" /******************************** - * Functions + * Funciones */ -// Define a function with "function": -function my_function () { - return 'Hello'; +// Define una función con "function": +function mi_funcion () { + return 'Hola'; } -echo my_function(); // => "Hello" +echo mi_funcion(); // => "Hola" -// A valid function name starts with a letter or underscore, followed by any -// number of letters, numbers, or underscores. +// Un nombre válido de función comienza con una letra o guión bajo, seguido de cualquier +// número de letras, números o guiones bajos. -function add ($x, $y = 1) { // $y is optional and defaults to 1 - $result = $x + $y; - return $result; +function anadir ($x, $y = 1) { // $y es opcional y por defecto es 1 + $resultado = $x + $y; + return $resultado; } -echo add(4); // => 5 -echo add(4, 2); // => 6 +echo anadir(4); // => 5 +echo anadir(4, 2); // => 6 -// $result is not accessible outside the function -// print $result; // Gives a warning. +// $resultado no es accesible fuera de la función +// print $resultado; // Devuelve una advertencia. -// Since PHP 5.3 you can declare anonymous functions; +// Desde PHP 5.3 se pueden declarar funciones anónimas $inc = function ($x) { return $x + 1; }; @@ -423,28 +422,28 @@ function foo ($x, $y, $z) { echo "$x - $y - $z"; } -// Functions can return functions +// Las funciones pueden devolver funciones function bar ($x, $y) { - // Use 'use' to bring in outside variables + // Utiliza 'use' para meter variables de fuera de la función return function ($z) use ($x, $y) { foo($x, $y, $z); }; } $bar = bar('A', 'B'); -$bar('C'); // Prints "A - B - C" +$bar('C'); // Imprime "A - B - C" -// You can call named functions using strings -$function_name = 'add'; -echo $function_name(1, 2); // => 3 -// Useful for programatically determining which function to run. -// Or, use call_user_func(callable $callback [, $parameter [, ... ]]); +// Puedes llamar a funciones utilizando cadenas de caracteres +$nombre_funcion = 'add'; +echo $nombre_funcion(1, 2); // => 3 +// Es útil para determinarl qué función ejecutar. +// O, utiliza call_user_func(callable $callback [, $parameter [, ... ]]); -// You can get the all the parameters passed to a function -function parameters() { - $numargs = func_num_args(); - if ($numargs > 0) { +// Puedes obtener todos los parámetros pasados a una función +function parametros() { + $numero_argumentos = func_num_args(); + if ($numero_argumentos > 0) { echo func_get_arg(0) . ' | '; } $args_array = func_get_args(); @@ -453,151 +452,153 @@ function parameters() { } } -parameters('Hello', 'World'); // Hello | 0 - Hello | 1 - World | +parametros('Hola', 'Mundo'); // Hola | 0 - Hola | 1 - Mundo | -// Since PHP 5.6 you can get a variable number of arguments -function variable($word, ...$list) { - echo $word . " || "; - foreach ($list as $item) { +// Desde PHP 5.6 se puede obtener un número variable de argumentos +function variable($palabra, ...$lista) { + echo $palabra . " || "; + foreach ($lista as $item) { echo $item . ' | '; } } -variable("Separate", "Hello", "World") // Separate || Hello | World | +variable("Separa", "Hola", "Mundo") // Separa || Hola | Mundo | /******************************** * Includes */ instanceProp = $instanceProp; } - // Methods are declared as functions inside a class - public function myMethod() + // Los métodos son declarados como funciones dentro de una clase + public function miMetodo() { - print 'MyClass'; + print 'MiClase'; } - //final keyword would make a function unoverridable - final function youCannotOverrideMe() + // la palabra clave final hará una función no sobreescribible + final function noMePuedesSobreEscribir() { } /* - * Declaring class properties or methods as static makes them accessible without - * needing an instantiation of the class. A property declared as static can not - * be accessed with an instantiated class object (though a static method can). + * Declarar propiedades de clase o métodos como estáticos los hace accesibles sin + * necesidad de instanciar la clase. Una propiedad declarada como estática no + * puede ser accedida mediante una instancia de la clase, pero sí mediante un + * método estático. */ - public static function myStaticMethod() + public static function miMetodoEstatico() { - print 'I am static'; + print 'Soy estático'; } } -// Class constants can always be accessed statically -echo MyClass::MY_CONST; // Outputs 'value'; +// Las constantes de una clase siempre pueden ser accedidas estáticamente +echo MiClase::MI_CONSTANTE; // Muestra 'valor'; -echo MyClass::$staticVar; // Outputs 'static'; -MyClass::myStaticMethod(); // Outputs 'I am static'; +echo MiClase::$staticVar; // Muestra 'static'; +MiClase::miMetodoEstatico(); // Muestra 'Soy estático'; -// Instantiate classes using new -$my_class = new MyClass('An instance property'); -// The parentheses are optional if not passing in an argument. +// Instancia una clase usando new +$mi_clase = new MiClase('Una instancia'); +// Los paréntesis son opcionales si no se pasa ningún argumento. -// Access class members using -> -echo $my_class->property; // => "public" -echo $my_class->instanceProp; // => "An instance property" -$my_class->myMethod(); // => "MyClass" +// Accede a los miembros de una clase utilizando -> +echo $mi_clase->propiedad; // => "public" +echo $mi_clase->instanceProp; // => "Una instancia" +$mi_clase->miMetodo(); // => "MiClase" -// Extend classes using "extends" -class MyOtherClass extends MyClass +// Extender clases utilizando "extends" +class MiOtraClase extends MiClase { - function printProtectedProperty() + function imprimePropiedadProtegida() { echo $this->prot; } - // Override a method - function myMethod() + // Sobreescribe un método + function miMetodo() { - parent::myMethod(); - print ' > MyOtherClass'; + parent::miMetodo(); + print ' > MiOtraClase'; } } -$my_other_class = new MyOtherClass('Instance prop'); -$my_other_class->printProtectedProperty(); // => Prints "protected" -$my_other_class->myMethod(); // Prints "MyClass > MyOtherClass" +$mi_otra_clase = new MiOtraClase('Propiedad de instancia'); +$mi_otra_clase->imprimePropiedadProtegida(); // => Imprime "protected" +$mi_otra_clase->miMetodo(); // Imprime "MiClase > MiOtraClase" -final class YouCannotExtendMe +final class NoMePuedesExtender { } -// You can use "magic methods" to create getters and setters -class MyMapClass +// Puedes utilizar "métodos mágicos" para crear los getters y setters +class MiClaseMapeada { - private $property; + private $propiedad; public function __get($key) { @@ -610,60 +611,60 @@ class MyMapClass } } -$x = new MyMapClass(); -echo $x->property; // Will use the __get() method -$x->property = 'Something'; // Will use the __set() method +$x = new MiClaseMapeada(); +echo $x->propiedad; // Utilizará el método __get() +$x->propiedad = 'Algo'; // Utilizará el método __set() -// Classes can be abstract (using the abstract keyword) or -// implement interfaces (using the implements keyword). -// An interface is declared with the interface keyword. +// Las clases pueden ser abstractas (utilizando la palabra clave abstract) o +// implementando interfaces (utilizando la palabra clave implements). +// Una interfaz puede ser declarada con la palabra clave interface. -interface InterfaceOne +interface InterfazUno { - public function doSomething(); + public function hazAlgo(); } -interface InterfaceTwo +interface InterfazDos { - public function doSomethingElse(); + public function hazOtraCosa(); } -// interfaces can be extended -interface InterfaceThree extends InterfaceTwo +// las interfaces pueden ser extendidas +interface InterfazTres extends InterfazDos { - public function doAnotherContract(); + public function hazCualquierOtraCosa(); } -abstract class MyAbstractClass implements InterfaceOne +abstract class MiClaseAbstracta implements InterfazUno { - public $x = 'doSomething'; + public $x = 'hazAlgo'; } -class MyConcreteClass extends MyAbstractClass implements InterfaceTwo +class MiOtraClase extends MiClaseAbstracta implements InterfazDos { - public function doSomething() + public function hazAlgo() { echo $x; } - public function doSomethingElse() + public function hazOtraCosa() { - echo 'doSomethingElse'; + echo 'hazOtraCosa'; } } -// Classes can implement more than one interface -class SomeOtherClass implements InterfaceOne, InterfaceTwo +// Las clases pueden implementar más de una interfaz +class CualquierOtraClase implements InterfazUno, InterfazDos { - public function doSomething() + public function hazAlgo() { - echo 'doSomething'; + echo 'hazAlgo'; } - public function doSomethingElse() + public function hazOtraCosa() { - echo 'doSomethingElse'; + echo 'hazOtraCosa'; } } @@ -672,65 +673,65 @@ class SomeOtherClass implements InterfaceOne, InterfaceTwo * Traits */ -// Traits are available from PHP 5.4.0 and are declared using "trait" +// Los traits están disponibles desde PHP 5.4.0 y son declarados utilizando "trait" -trait MyTrait +trait MiTrait { - public function myTraitMethod() + public function miMetodoTrait() { - print 'I have MyTrait'; + print 'Tengo trait'; } } -class MyTraitfulClass +class MiClaseTrait { - use MyTrait; + use MiTrait; } -$cls = new MyTraitfulClass(); -$cls->myTraitMethod(); // Prints "I have MyTrait" +$cls = new MiClaseTrait(); +$cls->miMetodoTrait(); // Imprime "Tengo trait" /******************************** * Namespaces */ -// This section is separate, because a namespace declaration -// must be the first statement in a file. Let's pretend that is not the case +// Esta sección está separada porque una declaración de namespace debe +// ser la primera sentencia en un archivo. Vamos a suponer que no es el caso Date: Sat, 31 Oct 2015 15:39:50 +0100 Subject: [PATCH 185/457] Improvements to the german LaTeX document. Fix a sentence, added a command to be able to define multiline comment blocks. Additionally, make use of the \LaTeX command to correctly show the LaTeX logo. --- de-de/latex-de.html.markdown | 91 ++++++++++++++++++++---------------- 1 file changed, 51 insertions(+), 40 deletions(-) diff --git a/de-de/latex-de.html.markdown b/de-de/latex-de.html.markdown index 2c18b8fd..ee9c6e3e 100644 --- a/de-de/latex-de.html.markdown +++ b/de-de/latex-de.html.markdown @@ -6,19 +6,19 @@ contributors: - ["Sricharan Chiruvolu", "http://sricharan.xyz"] translators: - ["Moritz Kammerer", "https://github.com/phxql"] + - ["Jerome Meinke", "https://github.com/jmeinke"] lang: de-de filename: latex-de.tex --- ``` -% Alle Kommentare starten fangen mit % an -% Es gibt keine Kommentare über mehrere Zeilen +% Alle Kommentare starten mit einem Prozentzeichen % -% LateX ist keine "What You See Is What You Get" Textverarbeitungssoftware wie z.B. +% LaTeX ist keine "What You See Is What You Get" Textverarbeitungssoftware wie z.B. % MS Word oder OpenOffice Writer -% Jedes LateX-Kommando startet mit einem Backslash (\) +% Jedes LaTeX-Kommando startet mit einem Backslash (\) -% LateX-Dokumente starten immer mit der Definition des Dokuments, die sie darstellen +% LaTeX-Dokumente starten immer mit der Definition des Dokuments, die sie darstellen % Weitere Dokumententypen sind z.B. book, report, presentations, etc. % Optionen des Dokuments stehen zwischen den eckigen Klammern []. In diesem Fall % wollen wir einen 12 Punkte-Font verwenden. @@ -26,7 +26,7 @@ filename: latex-de.tex % Als nächstes definieren wir die Pakete, die wir verwenden wollen. % Wenn du z.B. Grafiken, farbigen Text oder Quelltext in dein Dokument einbetten möchtest, -% musst du die Fähigkeiten von Latex durch Hinzufügen von Paketen erweitern. +% musst du die Fähigkeiten von LaTeX durch Hinzufügen von Paketen erweitern. % Wir verwenden die Pakete float und caption für Bilder. \usepackage{caption} \usepackage{float} @@ -34,30 +34,41 @@ filename: latex-de.tex % Mit diesem Paket können leichter Umlaute getippt werden \usepackage[utf8]{inputenc} +% Es gibt eigentlich keine Kommentare über mehrere Zeilen, solche kann man +% aber selbst durch die Angabe eigener Kommandos definieren. +% Dieses Kommando kann man später benutzen. +\newcommand{\comment}[1]{} + % Es können durchaus noch weitere Optione für das Dokument gesetzt werden! \author{Chaitanya Krishna Ande, Colton Kohnke \& Sricharan Chiruvolu} \date{\today} -\title{Learn LaTeX in Y Minutes!} +\title{Learn \LaTeX\ in Y Minutes!} % Nun kann's losgehen mit unserem Dokument. % Alles vor dieser Zeile wird die Preamble genannt. -\begin{document} +\begin{document} + +\comment{ + Dies ist unser selbst-definierter Befehl + für mehrzeilige Kommentare. +} + % Wenn wir den Autor, das Datum und den Titel gesetzt haben, kann -% LateX für uns eine Titelseite generieren +% LaTeX für uns eine Titelseite generieren \maketitle -% Die meisten Paper haben ein Abstract. LateX bietet dafür einen vorgefertigen Befehl an. +% Die meisten Paper haben ein Abstract. LaTeX bietet dafür einen vorgefertigen Befehl an. % Das Abstract sollte in der logischen Reihenfolge, also nach dem Titel, aber vor dem % Inhalt erscheinen. % Dieser Befehl ist in den Dokumentenklassen article und report verfügbar. \begin{abstract} - LateX documentation geschrieben in LateX! Wie ungewöhnlich und garantiert nicht meine Idee! + \LaTeX -Documentation geschrieben in \LaTeX ! Wie ungewöhnlich und garantiert nicht meine Idee! \end{abstract} % Section Befehle sind intuitiv. % Alle Titel der sections werden automatisch in das Inhaltsverzeichnis übernommen. \section{Einleitung} -Hi, mein Name ist Moritz und zusammen werden wir LateX erforschen! +Hi, mein Name ist Moritz und zusammen werden wir \LaTeX\ erforschen! \section{Noch eine section} Das hier ist der Text für noch eine section. Ich glaube, wir brauchen eine subsection. @@ -71,16 +82,16 @@ So ist's schon viel besser. % Wenn wir den Stern nach section schreiben, dann unterdrückt LateX die Nummerierung. % Das funktioniert auch bei anderen Befehlen. -\section*{Das ist eine unnummerierte section} -Es müssen nicht alle sections nummeriert sein! +\section*{Das ist eine unnummerierte section} +Es müssen nicht alle Sections nummeriert sein! \section{Ein paar Notizen} -LateX ist ziemlich gut darin, Text so zu platzieren, dass es gut aussieht. +\LaTeX\ ist ziemlich gut darin, Text so zu platzieren, dass es gut aussieht. Falls eine Zeile \\ mal \\ woanders \\ umgebrochen \\ werden \\ soll, füge \textbackslash\textbackslash in den Code ein.\\ \section{Listen} -Listen sind eine der einfachsten Dinge in LateX. Ich muss morgen einkaufen gehen, +Listen sind eine der einfachsten Dinge in \LaTeX. Ich muss morgen einkaufen gehen, also lass uns eine Einkaufsliste schreiben: \begin{enumerate} % Dieser Befehl erstellt eine "enumerate" Umgebung. % \item bringt enumerate dazu, eins weiterzuzählen. @@ -96,7 +107,7 @@ also lass uns eine Einkaufsliste schreiben: \section{Mathe} -Einer der Haupteinsatzzwecke von LateX ist das Schreiben von akademischen +Einer der Haupteinsatzzwecke von \LaTeX\ ist das Schreiben von akademischen Artikeln oder Papern. Meistens stammen diese aus dem Bereich der Mathe oder anderen Wissenschaften. Und deswegen müssen wir in der Lage sein, spezielle Symbole zu unserem Paper hinzuzufügen! \\ @@ -106,18 +117,18 @@ Symbole für Mengen und relationen, Pfeile, Operatoren und Griechische Buchstabe um nur ein paar zu nennen.\\ Mengen und Relationen spielen eine sehr wichtige Rolle in vielen mathematischen -Papern. So schreibt man in LateX, dass alle y zu X gehören: $\forall$ y $\in$ X. \\ +Papern. So schreibt man in \LaTeX, dass alle y zu X gehören: $\forall$ y $\in$ X. \\ -% Achte auf die $ Zeichen vor und nach den Symbolen. Wenn wir in LateX schreiben, +% Achte auf die $ Zeichen vor und nach den Symbolen. Wenn wir in LaTeX schreiben, % geschieht dies standardmäßig im Textmodus. Die Mathe-Symbole existieren allerdings % nur im Mathe-Modus. Wir können den Mathe-Modus durch das $ Zeichen aktivieren und % ihn mit $ wieder verlassen. Variablen können auch im Mathe-Modus angezeigt werden. Mein Lieblingsbuchstabe im Griechischen ist $\xi$. Ich mag auch $\beta$, $\gamma$ und $\sigma$. -Bis jetzt habe ich noch keinen griechischen Buchstaben gefunden, den LateX nicht kennt! +Bis jetzt habe ich noch keinen griechischen Buchstaben gefunden, den \LaTeX nicht kennt! Operatoren sind ebenfalls wichtige Bestandteile von mathematischen Dokumenten: -Trigonometrische Funktionen ($\sin$, $\cos$, $\tan$), +Trigonometrische Funktionen ($\sin$, $\cos$, $\tan$), Logarithmus und Exponenten ($\log$, $\exp$), Grenzwerte ($\lim$), etc. haben vordefinierte Befehle. Lass uns eine Gleichung schreiben: \\ @@ -127,7 +138,7 @@ $\cos(2\theta) = \cos^{2}(\theta) - \sin^{2}(\theta)$\\ Brüche (Zähler / Nenner) können so geschrieben werden: % 10 / 7 -$^{10}/_{7}$ +$^{10}/_{7}$ % Komplexere Brüche können so geschrieben werden: % \frac{Zähler}{Nenner} @@ -142,19 +153,19 @@ Wir können Gleichungen auch in einer equation Umgebung verwenden. \end{equation} % Alle \begin Befehle müssen einen \end Befehl besitzen Wir können nun unsere Gleichung referenzieren! -Gleichung ~\ref{eq:pythagoras} ist auch als das Theorem des Pythagoras bekannt. Dieses wird in +Gleichung ~\ref{eq:pythagoras} ist auch als das Theorem des Pythagoras bekannt. Dieses wird in Abschnitt ~\ref{subsec:pythagoras} behandelt. Es können sehr viele Sachen mit Labels versehen werden: Grafiken, Gleichungen, Sections, etc. Summen und Integrale können mit den sum und int Befehlen dargestellt werden: -% Manche LateX-Compiler beschweren sich, wenn Leerzeilen in Gleichungen auftauchen -\begin{equation} +% Manche LaTeX-Compiler beschweren sich, wenn Leerzeilen in Gleichungen auftauchen +\begin{equation} \sum_{i=0}^{5} f_{i} -\end{equation} -\begin{equation} +\end{equation} +\begin{equation} \int_{0}^{\infty} \mathrm{e}^{-x} \mathrm{d}x -\end{equation} +\end{equation} \section{Grafiken} @@ -164,7 +175,7 @@ Aber keine Sorge, ich muss auch jedes mal nachschauen, welche Option wie wirkt. \begin{figure}[H] % H ist die Platzierungsoption \centering % Zentriert die Grafik auf der Seite % Fügt eine Grafik ein, die auf 80% der Seitenbreite einnimmt. - %\includegraphics[width=0.8\linewidth]{right-triangle.png} + %\includegraphics[width=0.8\linewidth]{right-triangle.png} % Auskommentiert, damit es nicht im Dokument auftaucht. \caption{Dreieck mit den Seiten $a$, $b$, $c$} \label{fig:right-triangle} @@ -177,7 +188,7 @@ Wir können Tabellen genauso wie Grafiken einfügen. \caption{Überschrift der Tabelle.} % Die {} Argumente geben an, wie eine Zeile der Tabelle dargestellt werden soll. % Auch hier muss ich jedes Mal nachschauen. Jedes. einzelne. Mal. - \begin{tabular}{c|cc} + \begin{tabular}{c|cc} Nummer & Nachname & Vorname \\ % Spalten werden durch & getrennt \hline % Eine horizontale Linie 1 & Biggus & Dickus \\ @@ -187,36 +198,36 @@ Wir können Tabellen genauso wie Grafiken einfügen. % \section{Links} % Kommen bald! -\section{Verhindern, dass LateX etwas kompiliert (z.B. Quelltext)} -Angenommen, wir wollen Quelltext in unserem LateX-Dokument. LateX soll -in diesem Fall nicht den Quelltext als LateX-Kommandos interpretieren, +\section{Verhindern, dass \LaTeX\ etwas kompiliert (z.B. Quelltext)} +Angenommen, wir wollen Quelltext in unserem \LaTeX-Dokument. \LaTeX\ soll +in diesem Fall nicht den Quelltext als \LaTeX-Kommandos interpretieren, sondern es einfach ins Dokument schreiben. Um das hinzubekommen, verwenden wir eine verbatim Umgebung. % Es gibt noch weitere Pakete für Quelltexte (z.B. minty, lstlisting, etc.) % aber verbatim ist das simpelste. -\begin{verbatim} +\begin{verbatim} print("Hello World!") a%b; % Schau dir das an! Wir können % im verbatim verwenden! random = 4; #decided by fair random dice roll \end{verbatim} -\section{Kompilieren} +\section{Kompilieren} Ich vermute, du wunderst dich, wie du dieses tolle Dokument in ein PDF verwandeln kannst. (Ja, dieses Dokument kompiliert wirklich!) \\ Dafür musst du folgende Schritte durchführen: \begin{enumerate} - \item Schreibe das Dokument. (den LateX-Quelltext). - \item Kompiliere den Quelltext in ein PDF. + \item Schreibe das Dokument. (den \LaTeX -Quelltext). + \item Kompiliere den Quelltext in ein PDF. Das Kompilieren sieht so ähnlich wie das hier aus (Linux): \\ - \begin{verbatim} - $pdflatex learn-latex.tex learn-latex.pdf + \begin{verbatim} + $pdflatex learn-latex.tex learn-latex.pdf \end{verbatim} \end{enumerate} -Manche LateX-Editoren kombinieren Schritt 1 und 2. Du siehst also nur Schritt 1 und Schritt +Manche \LaTeX-Editoren kombinieren Schritt 1 und 2. Du siehst also nur Schritt 1 und Schritt 2 wird unsichtbar im Hintergrund ausgeführt. Alle Formatierungsoptionen werden in Schritt 1 in den Quelltext geschrieben. Schritt 2 verwendet From c0b2ccdb43ab8b49cfdab277c8cc266abf532bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20P=C3=A9rez?= Date: Sat, 31 Oct 2015 15:45:36 +0100 Subject: [PATCH 186/457] Create latex es-es file --- es-es/latex-es.html.markdown | 239 +++++++++++++++++++++++++++++++++++ 1 file changed, 239 insertions(+) create mode 100644 es-es/latex-es.html.markdown diff --git a/es-es/latex-es.html.markdown b/es-es/latex-es.html.markdown new file mode 100644 index 00000000..11bac4fc --- /dev/null +++ b/es-es/latex-es.html.markdown @@ -0,0 +1,239 @@ +--- +language: latex +contributors: + - ["Chaitanya Krishna Ande", "http://icymist.github.io"] + - ["Colton Kohnke", "http://github.com/voltnor"] + - ["Sricharan Chiruvolu", "http://sricharan.xyz"] +translators: + - ["Mario Pérez", "https://github.com/MarioPerezEsteso"] +filename: learn-latex-es.tex +--- + +```tex +% 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 + +% Every LaTeX command starts with a backslash (\) + +% LaTeX documents start with a defining the type of document it's compiling +% Other document types include book, report, presentations, etc. +% The options for the document appear in the [] brackets. In this case +% it specifies we want to use 12pt font. +\documentclass[12pt]{article} + +% Next we define the packages the document uses. +% If you want to include graphics, colored text, or +% source code from another language 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 \& Sricharan Chiruvolu} +\date{\today} +\title{Learn LaTeX in Y Minutes!} + +% 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 for 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 the 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! + +\section{Another section} +This is the text for another section. I think it needs a subsection. + +\subsection{This is a subsection} % Subsections are also intuitive. +I think we need another one + +\subsubsection{Pythagoras} +Much better now. +\label{subsec:pythagoras} + +% By using the asterisk we can suppress LaTeX's inbuilt numbering. +% This works for other LaTeX commands as well. +\section*{This is an unnumbered section} +However not all sections have to be numbered! + +\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 source code. \\ + +\section{Lists} +Lists are one of the easiest things to create in LaTeX! I need to go shopping +tomorrow, so let's make a grocery list. +\begin{enumerate} % This creates an "enumerate" environment. + % \item tells the enumerate to increment + \item Salad. + \item 27 watermelon. + \item A single jackrabbit. + % we can even override the item number by using [] + \item[how many?] Medium sized squirt guns. + + Not a list item, but still part of the enumerate. + +\end{enumerate} % All environments must have an end. + +\section{Math} + +One of the primary uses for LaTeX is to produce academic articles 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! \\ + +Math has many symbols, far beyond what you can find on a keyboard; +Set and relation symbols, arrows, operators, and 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 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! + +Operators are essential parts of a mathematical document: +trigonometric functions ($\sin$, $\cos$, $\tan$), +logarithms and exponentials ($\log$, $\exp$), +limits ($\lim$), etc. +have per-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)!}$ \\ + +We can also insert equations in an "equation environment". + +% Display math with the equation 'environment' +\begin{equation} % enters math-mode + c^2 = a^2 + b^2. + \label{eq:pythagoras} % for referencing +\end{equation} % all \begin statements must have an end statement + +We can then reference our new equation! +Eqn.~\ref{eq:pythagoras} is also known as the Pythagoras Theorem which is also +the subject of Sec.~\ref{subsec:pythagoras}. A lot of things can be labeled: +figures, equations, sections, etc. + +Summations and Integrals are written with sum and int commands: + +% Some LaTeX compilers will complain if there are blank lines +% In an equation environment. +\begin{equation} + \sum_{i=0}^{5} f_{i} +\end{equation} +\begin{equation} + \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 definitely have to lookup the placement options each time. + +\begin{figure}[H] % H here denoted the placement option. + \centering % centers the figure on the page + % Inserts a figure scaled to 0.8 the width of the page. + %\includegraphics[width=0.8\linewidth]{right-triangle.png} + % Commented out for compilation purposes. Please use your imagination. + \caption{Right triangle with sides $a$, $b$, $c$} + \label{fig:right-triangle} +\end{figure} + +\subsection{Table} +We can also insert Tables in the same way as figures. + +\begin{table}[H] + \caption{Caption for the Table.} + % the {} arguments below describe how each row of the table is drawn. + % Again, I have to look these up. Each. And. Every. Time. + \begin{tabular}{c|cc} + Number & Last Name & First Name \\ % Column rows are separated by $ + \hline % a horizontal line + 1 & Biggus & Dickus \\ + 2 & Monty & Python + \end{tabular} +\end{table} + +% \section{Hyperlinks} % Coming soon + +\section{Getting LaTeX to not compile something (i.e. Source Code)} +Let's say we want to include some code into our LaTeX document, +we would then need LaTeX to not try and interpret that text and +instead just print it to the document. We do this we a verbatim +environment. + +% There are other packages that exist (i.e. minty, lstlisting, etc.) +% but verbatim is the bare-bones basic one. +\begin{verbatim} + print("Hello World!") + a%b; % look! We can use % signs in verbatim. + random = 4; #decided by fair random dice roll +\end{verbatim} + +\section{Compiling} + +By now you're probably wondering how to compile this fabulous document +and look at the glorious glory that is a LaTeX pdf. +(yes, this document actually does compiles). \\ +Getting to the final document using LaTeX consists of the following steps: + \begin{enumerate} + \item Write the document in plain text (the "source code"). + \item Compile source code to produce a pdf. + The compilation step looks something like this (in Linux): \\ + \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} +``` + +## Más información sobre LaTeX + +* El wikilibro LaTeX: [https://es.wikibooks.org/wiki/Manual_de_LaTeX](https://es.wikibooks.org/wiki/Manual_de_LaTeX) +* Un tutorial real: [http://www.latex-tutorial.com/](http://www.latex-tutorial.com/) From 23b35d9da0b3c1de5ff6a0b262b08020f0f56c4f Mon Sep 17 00:00:00 2001 From: roymiloh Date: Sat, 31 Oct 2015 17:20:03 +0200 Subject: [PATCH 187/457] [C#/en] Fix to "extension methods" over using "extension functions", it's more accurate. --- csharp.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp.html.markdown b/csharp.html.markdown index dfdd98de..d6c503ae 100644 --- a/csharp.html.markdown +++ b/csharp.html.markdown @@ -630,7 +630,7 @@ on a new line! ""Wow!"", the masses cried"; public static class Extensions { - // EXTENSION FUNCTIONS + // EXTENSION METHODS public static void Print(this object obj) { Console.WriteLine(obj.ToString()); From 09cbaa6536e13dc2e4e20d8222423968cd989492 Mon Sep 17 00:00:00 2001 From: Abdul Alim Date: Sat, 31 Oct 2015 23:28:39 +0800 Subject: [PATCH 188/457] [JSON/ms-my] Added Malay (Malaysia) translation for JSON --- ms-my/json-my.html.markdown | 102 ++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 ms-my/json-my.html.markdown diff --git a/ms-my/json-my.html.markdown b/ms-my/json-my.html.markdown new file mode 100644 index 00000000..2d2da519 --- /dev/null +++ b/ms-my/json-my.html.markdown @@ -0,0 +1,102 @@ +--- +language: json +filename: learnjson-ms.json +contributors: + - ["Anna Harren", "https://github.com/iirelu"] + - ["Marco Scannadinari", "https://github.com/marcoms"] + - ["himanshu", "https://github.com/himanshu81494"] + - ["Michael Neth", "https://github.com/infernocloud"] +translators: + - ["abdalim", "https://github.com/abdalim"] +lang: ms-my +--- + +Disebabkan JSON adalah format pertukaran-data yang sangat ringkas, panduan ini +kemungkinan besar adalah Learn X in Y Minutes yang paling mudah. + +JSON dalam bentuk paling aslinya sebenarnya tidak mempunyai sebarang komentar, +tetapi kebanyakan pembaca menerima komen dalam bentuk C (`\\`,`/* */`). Beberapa +pembaca juga bertoleransi terhadap koma terakhir (iaitu koma selepas elemen +terakhir di dalam array atau selepas ciri terakhir sesuatu objek), tetapi semua +ini harus dielakkan dan dijauhkan untuk keserasian yang lebih baik. + +Untuk tujuan ini bagaimanapun, semua di dalam panduan ini adalah 100% JSON yang +sah. Luckily, it kind of speaks for itself. + +Sebuah nilai JSON harus terdiri dari salah satu, iaitu, nombor, string, array, +objek atau salah satu dari nama literal berikut: true, false, null. + +Pelayar web yang menyokong adalah: Firefox 3.5+, Internet Explorer 8.0+, Chrome +1.0+, Opera 10.0+, dan Safari 4.0+. + +Sambungan fail untuk fail - fail JSON adalah ".json" dan jenis MIME untuk teks +JSON adalah "application/json". + +Banyak bahasa aturcara mempunyai fungsi untuk menyirikan (mengekod) dan +menyah-sirikan (men-dekod) data JSON kepada struktur data asal. Javascript +mempunyai sokongon tersirat untuk memanipulasi teks JSON sebagai data. + +Maklumat lebih lanjut boleh dijumpai di http://www.json.org/ + +JSON dibina pada dua struktur: +* Sebuah koleksi pasangan nama/nilai. Di dalam pelbagai bahasa aturcara, ini +direalisasikan sebagai objek, rekod, "struct", "dictionary", "hash table", +senarai berkunci, atau "associative array". +* Sebuah senarai nilai yang tersusun. Dalam kebanyakan bahasa aturcara, ini +direalisasikan sebagai array, vektor, senarai atau urutan. + +Sebuah objek dengan pelbagai pasangan nama/nilai. + +```json +{ + "kunci": "nilai", + + "kekunci": "harus sentiasa dibalut dengan 'double quotes'", + "nombor": 0, + "strings": "Hellø, wørld. Semua unicode dibenarkan, bersama \"escaping\".", + "ada bools?": true, + "tiada apa - apa": null, + + "nombor besar": 1.2e+100, + + "objek": { + "komen": "Sebahagian besar struktur akan terdiri daripada objek.", + + "array": [0, 1, 2, 3, "Array boleh mempunyai sebarang jenis data di dalamnya.", 5], + + "objek lain": { + "komen": "Objek boleh dibina dengan pelbagai lapisan, sangat berguna." + } + }, + + "kebendulan": [ + { + "punca potassium": ["pisang"] + }, + [ + [1, 0, 0, 0], + [0, 1, 0, 0], + [0, 0, 1, "neo"], + [0, 0, 0, 1] + ] + ], + + "stail alternatif": { + "komen": "cuba lihat ini!" + , "posisi koma": "tidak mengapa - selagi ia adalah sebelum nama atau kunci seterusnya, maka ia sah" + , "komen lain": "sungguh bagus" + } +} +``` + +Sebuah array sahaja yang mengandungi nilai - nilai juga adalah JSON yang sah. + +```json +[1, 2, 3, "text", true] +``` + +Objek - objek boleh menjadi sebahagian dari array juga. + +```json +[{"nama": "Abe", "umur": 25}, {"nama": "Jemah", "umur": 29}, {"name": "Yob", "umur": 31}] +``` From fd512d12fcda159469d9450416a527a0a17f2774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20P=C3=A9rez?= Date: Sat, 31 Oct 2015 16:45:36 +0100 Subject: [PATCH 189/457] Translate learn LaTeX to es-ES --- es-es/latex-es.html.markdown | 241 ++++++++++++++++------------------- 1 file changed, 107 insertions(+), 134 deletions(-) diff --git a/es-es/latex-es.html.markdown b/es-es/latex-es.html.markdown index 11bac4fc..6743ad80 100644 --- a/es-es/latex-es.html.markdown +++ b/es-es/latex-es.html.markdown @@ -10,146 +10,131 @@ filename: learn-latex-es.tex --- ```tex -% All comment lines start with % -% There are no multi-line comments +% Todas las líneas comentadas comienzan con % +% No existen los comentarios multilínea -% LaTeX is NOT a "What You See Is What You Get" word processing software like -% MS Word, or OpenOffice Writer +% LaTeX NO es un software de procesamiento de texto que cumple con +% "Lo que ves es lo que tienes" como MS Word u OpenOffice -% Every LaTeX command starts with a backslash (\) +% Todos los comandos de LaTeX comienzan con una contrabarra (\) -% LaTeX documents start with a defining the type of document it's compiling -% Other document types include book, report, presentations, etc. -% The options for the document appear in the [] brackets. In this case -% it specifies we want to use 12pt font. +% Los documentos LaTeX comienzan definiendo el tipo de documento que se va a +% compilar. Algunos tipos de documentos son libros, informes, presentaciones, +% etc. Las opciones para el documento comienzan en los corchetes []. En este +% caso, se especifica que queremos utilizar una fuente de tamaño 12pt. \documentclass[12pt]{article} -% Next we define the packages the document uses. -% If you want to include graphics, colored text, or -% source code from another language 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. +% A continuación, definimos los paquetes que utilizará el documento. +% Si quieres incluir gráficos, texto coloreado o código fuente de otro lenguaje, +% debes extender las funciones de LaTeX. Esto se consigue añadiendo paquetes. +% A continuación se incluirán los paquetes float y caption para figuras. \usepackage{caption} \usepackage{float} -% We can define some other document properties too! +% También podemos definir otras propiedades en el documento \author{Chaitanya Krishna Ande, Colton Kohnke \& Sricharan Chiruvolu} \date{\today} \title{Learn LaTeX in Y Minutes!} -% Now we're ready to begin the document -% Everything before this line is called "The Preamble" +% Ahora estamos preparados para comenzar el documento +% Todo lo que se encuentre antes de esta línea se llama "El Preámbulo" \begin{document} -% if we set the author, date, title fields, we can have LaTeX -% create a title page for us. +% Si especificamos el autor, fecha y título, LaTeX creará una página como título +% por nosotros \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 the document classes article and report. +% La mayoría de los artículos de investigación tienen un abstract. Es posible +% utilizar comandos predefinidos para ello. +% Esto debería aparecer en su orden lógico. Tras el título pero antes de las +% secciones principales del cuerpo. +% Este comando está disponible en los tipos de documentos article y report. \begin{abstract} - LaTeX documentation written as LaTeX! How novel and totally not my idea! + Documentación de LaTex escrita en LaTex. \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! +% Los comandos de sección son intuitivos. +% Todos los títulos de secciones son añadidos automáticamente a la tabla de contenidos. +\section{Introducción} +Hola, mi nombre es Mario Pérez y estoy traduciendo este documento para aprender LaTex. -\section{Another section} -This is the text for another section. I think it needs a subsection. +\section{Otra sección} +Este es el texto de otra sección. Creo que necesitará una subsección. -\subsection{This is a subsection} % Subsections are also intuitive. -I think we need another one +\subsection{Esto es una subsección} % Las subsecciones también son fáciles. +Creo que necesitamos otra más. -\subsubsection{Pythagoras} -Much better now. -\label{subsec:pythagoras} +\subsubsection{Pitágoras} +Mejor ahora. +\label{subsec:pitagoras} -% By using the asterisk we can suppress LaTeX's inbuilt numbering. -% This works for other LaTeX commands as well. -\section*{This is an unnumbered section} -However not all sections have to be numbered! +% Utilizando el asterisco podemos decirle a LaTeX que no ponga los números de secciones y subsecciones. +% Esto también funciona con otros comandos de LaTeX. +\section*{Esto es una sección no numerada} +¡No todas las secciones tienen que estar numeradas! -\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 source code. \\ +\section{Algunas notas} +LaTeX es generalmente bastante bueno situando el texto donde debe ir. Si una lína \\ necesita \\ ser \\ rota \\ puedes poner \textbackslash\textbackslash en el código fuente. \\ -\section{Lists} -Lists are one of the easiest things to create in LaTeX! I need to go shopping -tomorrow, so let's make a grocery list. -\begin{enumerate} % This creates an "enumerate" environment. - % \item tells the enumerate to increment - \item Salad. - \item 27 watermelon. - \item A single jackrabbit. - % we can even override the item number by using [] - \item[how many?] Medium sized squirt guns. +\section{Listas} +Las listas son de las cosas más fáciles de crear en LaTeX. Necesito ir a comprar mañana, así que vamos a crear una lista de la compra. +\begin{enumerate} % Esto crea una lista numerada. + % \item crea un elemento + \item Ensalada. + \item 27 sandías. + \item Pescado. + % podemos incluso sobreescribir el número del ítem usando [] + \item[cuántos?] Plátanos. - Not a list item, but still part of the enumerate. + No es un ítem de la lista, pero sigue siendo parte de la enumeración. -\end{enumerate} % All environments must have an end. +\end{enumerate} % Todos los contextos deben tener un final. -\section{Math} +\section{Matemáticas} -One of the primary uses for LaTeX is to produce academic articles 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! \\ +Uno de los usos principales de LaTeX es la producción de artículos académicos o técnicos. Normalmente relacionados con la ciencia y las matemáticas. Debido a esto, necesitamos poder añadir símbolos especiales a nuestro artículo.\\ -Math has many symbols, far beyond what you can find on a keyboard; -Set and relation symbols, arrows, operators, and Greek letters to name a few.\\ +En matemáticas hay muchos símbolos. Más de los que podemos encontrar en un teclado. Flechas o letras por nombrar un par.\\ -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 enter math mode with \[\] +Algunos símbolos juegan un papel fundamental en muchos artículos de investigación matemática. Así es como se establece que todo Y pertenece a X: $\forall$ x $\in$ X. \\ +He necesitado añadir el signo $ antes de los símbolos. Esto se debe a que cuando escribimos, estamos en modo texto. Sin embargo, los símbolos solo pueden utilizarse en modo matemático, al cual se entra con el signo $. +% Lo opuesto también se cumple. Una variable también puede ser mostrada en modo matemático, al que también se puede entrar con \[\] \[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! +Mi letra griega favorita es $\xi$. También me gustan $\beta$, $\gamma$ y $\sigma$. +Todavía no he encontrado una letra griega que LaTeX no conozca. -Operators are essential parts of a mathematical document: -trigonometric functions ($\sin$, $\cos$, $\tan$), -logarithms and exponentials ($\log$, $\exp$), -limits ($\lim$), etc. -have per-defined LaTeX commands. -Let's write an equation to see how it's done: \\ +Los operadores son también una parte esencial de un documento matemático: +funciones trigonométricas ($\sin$, $\cos$, $\tan$), logaritmos y exponenciales ($\log$, $\exp$), límites ($\lim$), etc. tienen comandos predefinidos en LaTeX. + +Vamos a escribir una ecuación para ver cómo se hace: \\ $\cos(2\theta) = \cos^{2}(\theta) - \sin^{2}(\theta)$ -Fractions(Numerator-denominators) can be written in these forms: +Las fracciones (numeradores-denominadores) pueden escribirse de la siguiente forma: % 10 / 7 $^{10}/_{7}$ -% Relatively complex fractions can be written as -% \frac{numerator}{denominator} +% Las fracciones relativamente complejas pueden escribirse como +% \frac{numerador}{denominador} $\frac{n!}{k!(n - k)!}$ \\ -We can also insert equations in an "equation environment". +También podemos insertar ecuaciones en un contexto de ecuación. -% Display math with the equation 'environment' -\begin{equation} % enters math-mode +% Mostrar matemáticas en el contexto de ecuaciones +\begin{equation} % entra en modo matemático c^2 = a^2 + b^2. - \label{eq:pythagoras} % for referencing -\end{equation} % all \begin statements must have an end statement + \label{eq:pitagoras} % para referencias +\end{equation} % Todos los contextos deben tener un final. -We can then reference our new equation! -Eqn.~\ref{eq:pythagoras} is also known as the Pythagoras Theorem which is also -the subject of Sec.~\ref{subsec:pythagoras}. A lot of things can be labeled: -figures, equations, sections, etc. +Podemos referenciar nuestra nueva ecuación. +Ecuación ~\ref{eq:pythagoras} también se conoce como el Teorema de Pitágoras, el cual también se encuentra en la sección ~\ref{subsec:pythagoras}. Muchas cosas pueden ser etiquetadas: figures, equations, sections, etc. -Summations and Integrals are written with sum and int commands: +Los sumatorios e integrales son escritor son los comandos sum e int: -% Some LaTeX compilers will complain if there are blank lines -% In an equation environment. +% Algunos compiladores de LaTeX se quejarán si hay líneas en blanco +% En un contexto de ecuación. \begin{equation} \sum_{i=0}^{5} f_{i} \end{equation} @@ -157,79 +142,67 @@ Summations and Integrals are written with sum and int commands: \int_{0}^{\infty} \mathrm{e}^{-x} \mathrm{d}x \end{equation} -\section{Figures} +\section{Figuras} -Let's insert a Figure. Figure placement can get a little tricky. -I definitely have to lookup the placement options each time. +Vamos a insertar una figura. Situarla puede ser algo complicado. -\begin{figure}[H] % H here denoted the placement option. - \centering % centers the figure on the page - % Inserts a figure scaled to 0.8 the width of the page. +\begin{figure}[H] % H aquí establece la situación de la figura. + \centering % centra la figura en la página + % Inserta una figura escalada por 0.8 el ancho de la página. %\includegraphics[width=0.8\linewidth]{right-triangle.png} - % Commented out for compilation purposes. Please use your imagination. - \caption{Right triangle with sides $a$, $b$, $c$} + % La línea anterior ha sido comentada para poder compilar este archivo. Por favor, usa tu imaginación. + \caption{Triángulo con lados $a$, $b$, $c$} \label{fig:right-triangle} \end{figure} -\subsection{Table} -We can also insert Tables in the same way as figures. +\subsection{Tablas} +También podemos insertar tablas de la misma manera que las figuras. \begin{table}[H] - \caption{Caption for the Table.} - % the {} arguments below describe how each row of the table is drawn. - % Again, I have to look these up. Each. And. Every. Time. + \caption{Título para la tabla.} + % los argumentos en {} describen cómo cada fila va a ser representada. \begin{tabular}{c|cc} - Number & Last Name & First Name \\ % Column rows are separated by $ - \hline % a horizontal line + Número & Nombre & Apellido \\ + \hline % una línea horizontal 1 & Biggus & Dickus \\ 2 & Monty & Python \end{tabular} \end{table} -% \section{Hyperlinks} % Coming soon +% \section{Hyperlinks} % En construcción -\section{Getting LaTeX to not compile something (i.e. Source Code)} -Let's say we want to include some code into our LaTeX document, -we would then need LaTeX to not try and interpret that text and -instead just print it to the document. We do this we a verbatim -environment. +\section{Haciendo que LaTeX no compile algo (por ejemplo, código fuente)} +Digamos que queremos incluir código fuente dentro de nuestro documento LaTex. En ese caso, debemos indicarle a LaTeX que no trate de compilarlo y simplemente lo muestre en el documento. Esto lo realizamos en el contexto verbatim. -% There are other packages that exist (i.e. minty, lstlisting, etc.) -% but verbatim is the bare-bones basic one. +% Hay otros paquetes para esta misma tarea, pero verbatim es el más básico. \begin{verbatim} - print("Hello World!") - a%b; % look! We can use % signs in verbatim. - random = 4; #decided by fair random dice roll + print("Hola Mundo!") + a%b; % Podemos usar los signos % en verbatim. + aleatorio = 4; # Número aleatorio \end{verbatim} -\section{Compiling} +\section{Compilación} -By now you're probably wondering how to compile this fabulous document -and look at the glorious glory that is a LaTeX pdf. -(yes, this document actually does compiles). \\ -Getting to the final document using LaTeX consists of the following steps: +Ahora mismo te estarás preguntando cómo compilar este fabuloso documento y obtener un documento PDF.\\ +Para obtener el documento final utilizando LaTeX hay que seguir los siguientes pasos: \begin{enumerate} - \item Write the document in plain text (the "source code"). - \item Compile source code to produce a pdf. - The compilation step looks something like this (in Linux): \\ + \item Escribe el documento en texto plano. + \item Compila el código para producir un PDF. + Los pasos de compilación serán algo parecido a esto (en Linux): \\ \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. +Un gran número de editores LaTeX combinan ambos pasos para que sea más sencillo obtener el documento. -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. +Escribe toda la información de formato en el paso 1 y con el paso 2 obtendrás el documento que has definido en el paso anterior. \section{End} -That's all for now! +Esto es todo por ahora. -% end the document +% fin del documento \end{document} ``` From 0049a475edba88f6537b2490ca9506df23b46368 Mon Sep 17 00:00:00 2001 From: Aayush Ranaut Date: Sat, 31 Oct 2015 22:20:51 +0530 Subject: [PATCH 190/457] 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 191/457] 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 192/457] 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 db690c17c5335b746e3e7867e3d7cf5aab724a9a Mon Sep 17 00:00:00 2001 From: Rudy Affandi Date: Sat, 31 Oct 2015 10:54:55 -0700 Subject: [PATCH 193/457] Add PHP magic constants entry --- php.html.markdown | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/php.html.markdown b/php.html.markdown index 0504ced2..06a289f4 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -765,6 +765,13 @@ I'm a ParentClass But I'm ChildClass */ +/********************** +* Magic constants +* +*/ + +// Get directory of the file +require __DIR__ . '/vendor/autoload.php'; /********************** * Error Handling From 2cebd90205c7caedc001202b7a517971f8f1ec20 Mon Sep 17 00:00:00 2001 From: bureken Date: Sat, 31 Oct 2015 21:19:11 +0300 Subject: [PATCH 194/457] Comment lines fixed --- tr-tr/swift-tr.html.markdown | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tr-tr/swift-tr.html.markdown b/tr-tr/swift-tr.html.markdown index c13f5ecf..15056bb8 100644 --- a/tr-tr/swift-tr.html.markdown +++ b/tr-tr/swift-tr.html.markdown @@ -25,14 +25,14 @@ import UIKit //XCode işaretlemelerle kodunuzu bölümlere ayırmanızı ve sağ üstteki metot - listesinde gruplama yapmanıza olanak sağlıyor +//listesinde gruplama yapmanıza olanak sağlıyor // MARK: Bölüm işareti // TODO: Daha sonra yapılacak // FIXME: Bu kodu düzelt -//Swift 2 de, println ve print metotları print komutunda birleştirildi. Print - otomatik olarak yeni satır ekliyor. +//Swift 2 de, println ve print metotları print komutunda birleştirildi. +//Print otomatik olarak yeni satır ekliyor. print("Merhaba dünya") // println print olarak kullanılıyor. print("Merhaba dünya", appendNewLine: false) // yeni bir satır eklemeden yazar. @@ -75,7 +75,7 @@ print("Build degiskeni: \(buildDegiskeni)") // Build degeri: 7 */ var baziOptionalString: String? = "optional" // nil olabilir. // yukarıdakiyle aynı ama ? bir postfix (sona eklenir) operatördür. (kolay -okunabilir) +//okunabilir) var someOptionalString2: Optional = "optional" @@ -104,7 +104,8 @@ if let baziOpsiyonelSabitString = baziOptionalString { // Swift değişkenlerde herhangi bir tip saklanabilir. // AnyObject == id // Objective-C deki `id` den farklı olarak, AnyObject tüm değişkenlerle - çalışabilir (Class, Int, struct, etc) +//çalışabilir +(Class, Int, struct, etc) var herhangiBirObject: AnyObject = 7 herhangiBirObject = "Değer string olarak değişti, iyi bir yöntem değil ama mümkün" @@ -234,7 +235,7 @@ func fiyatlariGetir() -> (Double, Double, Double) { let fiyatTuple = fiyatlariGetir() let fiyat = fiyatTuple.2 // 3.79 // _ (alt çizgi) kullanımı Tuple degerlerini veya diğer değerleri görmezden -gelir +//gelir let (_, fiyat1, _) = fiyatTuple // fiyat1 == 3.69 print(fiyat1 == fiyatTuple.1) // true print("Benzin fiyatı: \(fiyat)") From dc1c759c2903f15fd3c52c2241c765c65fbe9d89 Mon Sep 17 00:00:00 2001 From: Rudy Affandi Date: Sat, 31 Oct 2015 11:27:13 -0700 Subject: [PATCH 195/457] Add the rest of the magic constants --- php.html.markdown | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/php.html.markdown b/php.html.markdown index 06a289f4..5034cfd1 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -770,8 +770,32 @@ But I'm ChildClass * */ -// Get directory of the file -require __DIR__ . '/vendor/autoload.php'; +// Get current class name. Must be used inside a class declaration. +echo "Current class name is " . __CLASS__; + +// Get full path directory of a file +echo "Current directory is " . __DIR__; + + // Typical usage + require __DIR__ . '/vendor/autoload.php'; + +// Get full path of a file +echo "Current file path is " . __FILE__; + +// Get current function name +echo "Current function name is " . __FUNCTION__; + +// Get current line number +echo "Current line number is " . __LINE__; + +// Get the name of the current method. Only returns a value when used inside a trait or object declaration. +echo "Current method is " . __METHOD__; + +// Get the name of the current namespace +echo "Current namespace is " . __NAMESPACE__; + +// Get the name of the current trait. Only returns a value when used inside a trait or object declaration. +echo "Current namespace is " . __TRAIT__; /********************** * Error Handling From 04694a00e54272799e50ef8570ddef70a1fd5779 Mon Sep 17 00:00:00 2001 From: Victor Caldas Date: Sat, 31 Oct 2015 16:31:22 -0200 Subject: [PATCH 196/457] 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 197/457] 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 198/457] [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 199/457] 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 200/457] 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 201/457] 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 202/457] 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 203/457] 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 204/457] 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 205/457] 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 206/457] 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 207/457] [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 208/457] 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 209/457] 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 210/457] 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 211/457] [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 212/457] 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 213/457] 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 214/457] 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 215/457] [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 217/457] [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 218/457] [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 219/457] [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 220/457] [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 221/457] [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 222/457] [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 96f0b3b3903c6f619b4a964a98e1cb0a463c47e6 Mon Sep 17 00:00:00 2001 From: Hinet60613 Date: Mon, 2 Nov 2015 00:03:58 +0800 Subject: [PATCH 223/457] Transated Python 2 to zh-tw. Line 01 .. 143 --- zh-tw/python-tw.html.markdown | 731 ++++++++++++++++++++++++++++++++++ 1 file changed, 731 insertions(+) create mode 100644 zh-tw/python-tw.html.markdown diff --git a/zh-tw/python-tw.html.markdown b/zh-tw/python-tw.html.markdown new file mode 100644 index 00000000..8381f325 --- /dev/null +++ b/zh-tw/python-tw.html.markdown @@ -0,0 +1,731 @@ +--- +language: python +contributors: + - ["Louie Dinh", "http://ldinh.ca"] + - ["Amin Bandali", "http://aminbandali.com"] + - ["Andre Polykanine", "https://github.com/Oire"] + - ["evuez", "http://github.com/evuez"] +translators: + - ["Michael Yeh", "https://github.com/hinet60613"] +filename: learnpython.py +--- + +Python是在1990年代早期由Guido Van Rossum創建的。它是現在最流行的程式語言之一。我愛上Python是因為他極為清晰的語法,甚至可以說它就是可執行的虛擬碼。 + +非常歡迎各位給我們任何回饋! 你可以在[@louiedinh](http://twitter.com/louiedinh) 或 louiedinh [at] [google's email service]聯絡到我。 + +註: 本篇文章適用的版本為Python 2.7,但大部分的Python 2.X版本應該都適用。 Python 2.7將會在2020年停止維護,因此建議您可以從Python 3開始學Python。 +Python 3.X可以看這篇[Python 3 教學 (英文)](http://learnxinyminutes.com/docs/python3/). + +讓程式碼同時支援Python 2.7和3.X是可以做到的,只要引入 + [`__future__` imports](https://docs.python.org/2/library/__future__.html) 模組. + `__future__` 模組允許你撰寫可以在Python 2上執行的Python 3程式碼,詳細訊息請參考Python 3 教學。 + +```python + +# 單行註解從井字號開始 + +""" 多行字串可以用三個雙引號 + 包住,不過通常這種寫法會 + 被拿來當作多行註解 +""" + +#################################################### +## 1. 原始型別與運算元 +#################################################### + +# 你可以使用數字 +3 # => 3 + +# 還有四則運算 +1 + 1 # => 2 +8 - 1 # => 7 +10 * 2 # => 20 +35 / 5 # => 7 + +# 除法比較麻煩,除以整數時會自動捨去小數位。 +5 / 2 # => 2 + +# 要做精確的除法,我們需要浮點數 +2.0 # 浮點數 +11.0 / 4.0 # => 2.75 精確多了! + +# 整數除法的無條件捨去對正數或負數都適用 +5 // 3 # => 1 +5.0 // 3.0 # => 1.0 # 浮點數的整數也適用 +-5 // 3 # => -2 +-5.0 // 3.0 # => -2.0 + +# 我們可以用除法模組(參考第六節:模組),讓 +# 單一斜線代表普通除法,而非無條件捨去 +from __future__ import division +11/4 # => 2.75 ...普通除法 +11//4 # => 2 ...無條件捨去 + +# 取餘數 +7 % 3 # => 1 + +# 指數 (x的y次方) +2**4 # => 16 + +# 括號即先乘除後加減 +(1 + 3) * 2 # => 8 + +# 布林運算 +# 注意 "and" 和 "or" 的大小寫 +True and False #=> False +False or True #=> True + +# 用整數與布林值做運算 +0 and 2 #=> 0 +-5 or 0 #=> -5 +0 == False #=> True +2 == True #=> False +1 == True #=> True + +# 用not取反向 +not True # => False +not 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 + +# 比較是可以串接的 +1 < 2 < 3 # => True +2 < 3 < 2 # => False + +# 字串用單引號 ' 或雙引號 " 建立 +"This is a string." +'This is also a string.' + +# 字串相加會被串接再一起 +"Hello " + "world!" # => "Hello world!" +# 不用加號也可以做字串相加 +"Hello " "world!" # => "Hello world!" + +# ... 也可以做相乘 +"Hello" * 3 # => "HelloHelloHello" + +# 字串可以被視為字元的陣列 +"This is a string"[0] # => 'T' + +# 字串的格式化可以用百分之符號 % +# 儘管在Python 3.1後這個功能被廢棄了,並且在 +# 之後的版本會被移除,但還是可以了解一下 +x = 'apple' +y = 'lemon' +z = "The items in the basket are %s and %s" % (x,y) + +# 新的格式化方式是使用format函式 +# 這個方式也是較為推薦的 +"{} is a {}".format("This", "placeholder") +"{0} can be {1}".format("strings", "formatted") +# 你也可以用關鍵字,如果你不想數你是要用第幾個變數的話 +"{name} wants to eat {food}".format(name="Bob", food="lasagna") + +# 無(None) 是一個物件 +None # => None + +# 不要用等於符號 "==" 對 無(None)做比較 +# 用 "is" +"etc" is None # => False +None is None # => True + +# The 'is' operator tests for object identity. This isn't +# very useful when dealing with primitive values, but is +# very useful when dealing with objects. + +# 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 + + +#################################################### +## 2. Variables and Collections +#################################################### + +# Python has a print statement +print "I'm Python. Nice to meet you!" # => I'm Python. Nice to meet you! + +# Simple way to get input data from console +input_string_var = raw_input("Enter some data: ") # Returns the data as a string +input_var = input("Enter some data: ") # Evaluates the data as python code +# Warning: Caution is recommended for input() method usage +# Note: In python 3, input() is deprecated and raw_input() is renamed to input() + +# No need to declare variables before assigning to them. +some_var = 5 # Convention is to use lower_case_with_underscores +some_var # => 5 + +# Accessing a previously unassigned variable is an exception. +# See Control Flow to learn more about exception handling. +some_other_var # Raises a name error + +# if can be used as an expression +# Equivalent of C's '?:' ternary operator +"yahoo!" if 3 > 2 else 2 # => "yahoo!" + +# Lists store sequences +li = [] +# You can start with a prefilled list +other_li = [4, 5, 6] + +# Add stuff to the end of a list with append +li.append(1) # li is now [1] +li.append(2) # li is now [1, 2] +li.append(4) # li is now [1, 2, 4] +li.append(3) # li is now [1, 2, 4, 3] +# Remove from the end with pop +li.pop() # => 3 and li is now [1, 2, 4] +# Let's put it back +li.append(3) # li is now [1, 2, 4, 3] again. + +# Access a list like you would any array +li[0] # => 1 +# Assign new values to indexes that have already been initialized with = +li[0] = 42 +li[0] # => 42 +li[0] = 1 # Note: setting it back to the original value +# Look at the last element +li[-1] # => 3 + +# Looking out of bounds is an IndexError +li[4] # Raises an IndexError + +# You can look at ranges with slice syntax. +# (It's a closed/open range for you mathy types.) +li[1:3] # => [2, 4] +# Omit the beginning +li[2:] # => [4, 3] +# Omit the end +li[:3] # => [1, 2, 4] +# Select every second entry +li[::2] # =>[1, 4] +# Reverse a copy of the list +li[::-1] # => [3, 4, 2, 1] +# Use any combination of these to make advanced slices +# li[start:end:step] + +# Remove arbitrary elements from a list with "del" +del li[2] # li is now [1, 2, 3] + +# You can add lists +li + other_li # => [1, 2, 3, 4, 5, 6] +# Note: values for li and for other_li are not modified. + +# Concatenate lists with "extend()" +li.extend(other_li) # Now li is [1, 2, 3, 4, 5, 6] + +# Remove first occurrence of a value +li.remove(2) # li is now [1, 3, 4, 5, 6] +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, 4, 5, 6] again + +# Get the index of the first item found +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" +1 in li # => True + +# Examine the length with "len()" +len(li) # => 6 + + +# Tuples are like lists but are immutable. +tup = (1, 2, 3) +tup[0] # => 1 +tup[0] = 3 # Raises a TypeError + +# You can do all those list thingies on tuples too +len(tup) # => 3 +tup + (4, 5, 6) # => (1, 2, 3, 4, 5, 6) +tup[:2] # => (1, 2) +2 in tup # => True + +# 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 +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 + + +# Dictionaries store mappings +empty_dict = {} +# Here is a prefilled dictionary +filled_dict = {"one": 1, "two": 2, "three": 3} + +# Look up values with [] +filled_dict["one"] # => 1 + +# Get all keys as a list with "keys()" +filled_dict.keys() # => ["three", "two", "one"] +# Note - Dictionary key ordering is not guaranteed. +# Your results might not match this exactly. + +# Get all values as a list with "values()" +filled_dict.values() # => [3, 2, 1] +# Note - Same as above regarding key ordering. + +# Check for existence of keys in a dictionary with "in" +"one" in filled_dict # => True +1 in filled_dict # => False + +# Looking up a non-existing key is a KeyError +filled_dict["four"] # KeyError + +# Use "get()" method to avoid the KeyError +filled_dict.get("one") # => 1 +filled_dict.get("four") # => None +# The get method supports a default argument when the value is missing +filled_dict.get("one", 4) # => 1 +filled_dict.get("four", 4) # => 4 +# note that filled_dict.get("four") is still => None +# (get doesn't set the value in the dictionary) + +# set the value of a key with a syntax similar to lists +filled_dict["four"] = 4 # now, filled_dict["four"] => 4 + +# "setdefault()" inserts into a dictionary only if the given key isn't present +filled_dict.setdefault("five", 5) # filled_dict["five"] is set to 5 +filled_dict.setdefault("five", 6) # filled_dict["five"] is still 5 + + +# Sets store ... well sets (which are like lists but can contain no duplicates) +empty_set = set() +# Initialize a "set()" with a bunch of values +some_set = set([1, 2, 2, 3, 4]) # some_set is now set([1, 2, 3, 4]) + +# order is not guaranteed, even though it may sometimes look sorted +another_set = set([4, 3, 2, 2, 1]) # another_set is now set([1, 2, 3, 4]) + +# Since Python 2.7, {} can be used to declare a set +filled_set = {1, 2, 2, 3, 4} # => {1, 2, 3, 4} + +# Add more items to a set +filled_set.add(5) # filled_set is now {1, 2, 3, 4, 5} + +# Do set intersection with & +other_set = {3, 4, 5, 6} +filled_set & other_set # => {3, 4, 5} + +# Do set union with | +filled_set | other_set # => {1, 2, 3, 4, 5, 6} + +# Do set difference with - +{1, 2, 3, 4} - {2, 3, 5} # => {1, 4} + +# Do set symmetric difference with ^ +{1, 2, 3, 4} ^ {2, 3, 5} # => {1, 4, 5} + +# Check if set on the left is a superset of set on the right +{1, 2} >= {1, 2, 3} # => False + +# Check if set on the left is a subset of set on the right +{1, 2} <= {1, 2, 3} # => True + +# Check for existence in a set with in +2 in filled_set # => True +10 in filled_set # => False + + +#################################################### +## 3. Control Flow +#################################################### + +# Let's just make a variable +some_var = 5 + +# Here is an if statement. Indentation is significant in python! +# prints "some_var is smaller than 10" +if some_var > 10: + print "some_var is totally bigger than 10." +elif some_var < 10: # This elif clause is optional. + print "some_var is smaller than 10." +else: # This is optional too. + print "some_var is indeed 10." + + +""" +For loops iterate over lists +prints: + dog is a mammal + cat is a mammal + mouse is a mammal +""" +for animal in ["dog", "cat", "mouse"]: + # You can use {0} to interpolate formatted strings. (See above.) + print "{0} is a mammal".format(animal) + +""" +"range(number)" returns a list of numbers +from zero to the given number +prints: + 0 + 1 + 2 + 3 +""" +for i in range(4): + print i + +""" +"range(lower, upper)" returns a list of numbers +from the lower number to the upper number +prints: + 4 + 5 + 6 + 7 +""" +for i in range(4, 8): + print i + +""" +While loops go until a condition is no longer met. +prints: + 0 + 1 + 2 + 3 +""" +x = 0 +while x < 4: + print x + x += 1 # Shorthand for x = x + 1 + +# Handle exceptions with a try/except block + +# Works on Python 2.6 and up: +try: + # Use "raise" to raise an error + raise IndexError("This is an index error") +except IndexError as e: + pass # Pass is just a no-op. Usually you would do recovery here. +except (TypeError, NameError): + pass # Multiple exceptions can be handled together, if required. +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: + print line + +#################################################### +## 4. Functions +#################################################### + +# Use "def" to create new functions +def add(x, y): + print "x is {0} and y is {1}".format(x, y) + return x + y # Return values with a return statement + +# Calling functions with parameters +add(5, 6) # => prints out "x is 5 and y is 6" and returns 11 + +# Another way to call functions is with keyword arguments +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 * +def varargs(*args): + return args + +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 ** +def keyword_args(**kwargs): + return kwargs + +# Let's call it to see what happens +keyword_args(big="foot", loch="ness") # => {"big": "foot", "loch": "ness"} + + +# You can do both at once, if you like +def all_the_args(*args, **kwargs): + print args + print kwargs +""" +all_the_args(1, 2, a=3, b=4) prints: + (1, 2) + {"a": 3, "b": 4} +""" + +# When calling functions, you can do the opposite of args/kwargs! +# Use * to expand positional args and use ** to expand keyword args. +args = (1, 2, 3, 4) +kwargs = {"a": 3, "b": 4} +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) + +# you can pass args and kwargs along to other functions that take args/kwargs +# by expanding them with * and ** respectively +def pass_all_the_args(*args, **kwargs): + all_the_args(*args, **kwargs) + print varargs(*args) + print keyword_args(**kwargs) + +# Function Scope +x = 5 + +def set_x(num): + # Local var x not the same as global variable x + x = num # => 43 + print x # => 43 + +def set_global_x(num): + global x + print x # => 5 + x = num # global var x is now set to 6 + print x # => 6 + +set_x(43) +set_global_x(6) + +# Python has first class functions +def create_adder(x): + def adder(y): + return x + y + return adder + +add_10 = create_adder(10) +add_10(3) # => 13 + +# There are also anonymous functions +(lambda x: x > 2)(3) # => True +(lambda x, y: x ** 2 + y ** 2)(2, 1) # => 5 + +# There are built-in higher order functions +map(add_10, [1, 2, 3]) # => [11, 12, 13] +map(max, [1, 2, 3], [4, 2, 1]) # => [4, 2, 3] + +filter(lambda x: x > 5, [3, 4, 5, 6, 7]) # => [6, 7] + +# We can use list comprehensions for nice maps and filters +[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] + + +#################################################### +## 5. Classes +#################################################### + +# We subclass from object to get a class. +class Human(object): + + # A class attribute. It is shared by all instances of this class + species = "H. sapiens" + + # Basic initializer, this is called when this class is instantiated. + # Note that the double leading and trailing underscores denote objects + # or attributes that are used by python but that live in user-controlled + # namespaces. You should not invent such names on your own. + def __init__(self, name): + # Assign the argument to the instance's name attribute + self.name = name + + # Initialize property + self.age = 0 + + + # An instance method. All methods take "self" as the first argument + def say(self, msg): + return "{0}: {1}".format(self.name, msg) + + # A class method is shared among all instances + # They are called with the calling class as the first argument + @classmethod + def get_species(cls): + return cls.species + + # A static method is called without a class or instance reference + @staticmethod + def grunt(): + return "*grunt*" + + # A property is just like a getter. + # It turns the method age() into an read-only attribute + # of the same name. + @property + def age(self): + return self._age + + # This allows the property to be set + @age.setter + def age(self, age): + self._age = age + + # This allows the property to be deleted + @age.deleter + def age(self): + del self._age + + +# Instantiate a class +i = Human(name="Ian") +print i.say("hi") # prints out "Ian: hi" + +j = Human("Joel") +print j.say("hello") # prints out "Joel: hello" + +# Call our class method +i.get_species() # => "H. sapiens" + +# Change the shared attribute +Human.species = "H. neanderthalensis" +i.get_species() # => "H. neanderthalensis" +j.get_species() # => "H. neanderthalensis" + +# Call the static method +Human.grunt() # => "*grunt*" + +# Update the property +i.age = 42 + +# Get the property +i.age # => 42 + +# Delete the property +del i.age +i.age # => raises an AttributeError + + +#################################################### +## 6. Modules +#################################################### + +# You can import modules +import math +print math.sqrt(16) # => 4 + +# You can get specific functions from a module +from math import ceil, floor +print ceil(3.7) # => 4.0 +print floor(3.7) # => 3.0 + +# You can import all functions from a module. +# Warning: this is not recommended +from math import * + +# You can shorten module names +import math as m +math.sqrt(16) == m.sqrt(16) # => True +# you can also test that the functions are equivalent +from math import sqrt +math.sqrt == m.sqrt == sqrt # => True + +# Python modules are just ordinary python files. You +# can write your own, and import them. The name of the +# module is the same as the name of the file. + +# You can find out which functions and attributes +# defines a module. +import math +dir(math) + + +#################################################### +## 7. Advanced +#################################################### + +# Generators help you make lazy code +def double_numbers(iterable): + for i in iterable: + yield i + i + +# A generator creates values on the fly. +# Instead of generating and returning all values at once it creates one in each +# iteration. This means values bigger than 15 wont be processed in +# double_numbers. +# Note xrange is a generator that does the same thing range does. +# Creating a list 1-900000000 would take lot of time and space to be made. +# xrange creates an xrange generator object instead of creating the entire list +# like range does. +# We use a trailing underscore in variable names when we want to use a name that +# would normally collide with a python keyword +xrange_ = xrange(1, 900000000) + +# will double all numbers until a result >=30 found +for i in double_numbers(xrange_): + print i + if i >= 30: + break + + +# Decorators +# in this example beg wraps say +# Beg will call say. If say_please is True then it will change the returned +# message +from functools import wraps + + +def beg(target_function): + @wraps(target_function) + def wrapper(*args, **kwargs): + msg, say_please = target_function(*args, **kwargs) + if say_please: + return "{} {}".format(msg, "Please! I am poor :(") + return msg + + return wrapper + + +@beg +def say(say_please=False): + msg = "Can you buy me a beer?" + return msg, say_please + + +print say() # Can you buy me a beer? +print say(say_please=True) # Can you buy me a beer? Please! I am poor :( +``` + +## Ready For More? + +### Free Online + +* [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/) +* [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) +* [First Steps With Python](https://realpython.com/learn/python-first-steps/) + +### Dead Tree + +* [Programming Python](http://www.amazon.com/gp/product/0596158106/ref=as_li_qf_sp_asin_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0596158106&linkCode=as2&tag=homebits04-20) +* [Dive Into Python](http://www.amazon.com/gp/product/1441413022/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1441413022&linkCode=as2&tag=homebits04-20) +* [Python Essential Reference](http://www.amazon.com/gp/product/0672329786/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0672329786&linkCode=as2&tag=homebits04-20) From 09cd1ab461ad8b560824f687cc818d7708aea427 Mon Sep 17 00:00:00 2001 From: Hinet60613 Date: Mon, 2 Nov 2015 00:40:41 +0800 Subject: [PATCH 224/457] Add lang of translation. Translate to Line 255 --- zh-tw/python-tw.html.markdown | 127 +++++++++++++++++----------------- 1 file changed, 64 insertions(+), 63 deletions(-) diff --git a/zh-tw/python-tw.html.markdown b/zh-tw/python-tw.html.markdown index 8381f325..8e9ca79a 100644 --- a/zh-tw/python-tw.html.markdown +++ b/zh-tw/python-tw.html.markdown @@ -8,6 +8,7 @@ contributors: translators: - ["Michael Yeh", "https://github.com/hinet60613"] filename: learnpython.py +lang: zh-tw --- Python是在1990年代早期由Guido Van Rossum創建的。它是現在最流行的程式語言之一。我愛上Python是因為他極為清晰的語法,甚至可以說它就是可執行的虛擬碼。 @@ -142,115 +143,115 @@ None # => None "etc" is None # => False None is None # => True -# The 'is' operator tests for object identity. This isn't -# very useful when dealing with primitive values, but is -# very useful when dealing with objects. +# 'is' 運算元是用來識別物件的。對原始型別來說或許沒什麼用, +# 但對物件來說是很有用的。 -# 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__ +# 任何物件都可以被當作布林值使用 +# 以下的值會被視為是False : +# - 無(None) +# - 任何型別的零 (例如: 0, 0L, 0.0, 0j) +# - 空序列 (例如: '', (), []) +# - 空容器 (例如: {}, set()) +# - 自定義型別的實體,且滿足某些條件 +# 請參考文件: https://docs.python.org/2/reference/datamodel.html#object.__nonzero__ # -# All other values are truthy (using the bool() function on them returns True). +# 其餘的值都會被視為True (用bool()函式讓他們回傳布林值). bool(0) # => False bool("") # => False #################################################### -## 2. Variables and Collections +## 2. 變數與集合 #################################################### -# Python has a print statement +# Python的輸出很方便 print "I'm Python. Nice to meet you!" # => I'm Python. Nice to meet you! -# Simple way to get input data from console -input_string_var = raw_input("Enter some data: ") # Returns the data as a string -input_var = input("Enter some data: ") # Evaluates the data as python code -# Warning: Caution is recommended for input() method usage -# Note: In python 3, input() is deprecated and raw_input() is renamed to input() +# 從命令列獲得值也很方便 +input_string_var = raw_input("Enter some data: ") # 資料會被視為字串存進變數 +input_var = input("Enter some data: ") # 輸入的資料會被當作Python程式碼執行 +# 注意: 請謹慎使用input()函式 +# 註: 在Python 3中,input()已被棄用,raw_input()已被更名為input() -# No need to declare variables before assigning to them. -some_var = 5 # Convention is to use lower_case_with_underscores +# 使用變數前不需要先宣告 +some_var = 5 # 方便好用 +lower_case_with_underscores some_var # => 5 -# Accessing a previously unassigned variable is an exception. -# See Control Flow to learn more about exception handling. -some_other_var # Raises a name error +# 存取沒有被賦值的變數會造成例外 +# 請參考錯誤流程部分做例外處理 +some_other_var # 造成 NameError -# if can be used as an expression -# Equivalent of C's '?:' ternary operator +# if可以當判斷式使用 +# 相當於C語言中的二元判斷式 "yahoo!" if 3 > 2 else 2 # => "yahoo!" -# Lists store sequences +# 串列型態可以儲存集合 li = [] -# You can start with a prefilled list +# 你可以預先填好串列內容 other_li = [4, 5, 6] -# Add stuff to the end of a list with append -li.append(1) # li is now [1] -li.append(2) # li is now [1, 2] -li.append(4) # li is now [1, 2, 4] -li.append(3) # li is now [1, 2, 4, 3] -# Remove from the end with pop +# 用append()在串列後新增東西 append +li.append(1) # 此時 li 內容為 [1] +li.append(2) # 此時 li 內容為 [1, 2] +li.append(4) # 此時 li 內容為 [1, 2, 4] +li.append(3) # 此時 li 內容為 [1, 2, 4, 3] +# 用pop()移除串列尾端的元素 li.pop() # => 3 and li is now [1, 2, 4] -# Let's put it back +# 然後再塞回去 li.append(3) # li is now [1, 2, 4, 3] again. -# Access a list like you would any array +# 你可以像存取陣列一樣的存取串列 li[0] # => 1 -# Assign new values to indexes that have already been initialized with = +# 用等號 = 給串列中特定索引的元素賦值 li[0] = 42 li[0] # => 42 -li[0] = 1 # Note: setting it back to the original value -# Look at the last element +li[0] = 1 # 註: 將其設定回原本的值 +# 用 -1 索引值查看串列最後一個元素 li[-1] # => 3 -# Looking out of bounds is an IndexError +# 存取超過範圍會產生IndexError li[4] # Raises an IndexError -# You can look at ranges with slice syntax. -# (It's a closed/open range for you mathy types.) +# 你可以用切片語法來存取特定範圍的值 +# (相當於數學中的左閉右開區間,即包含最左邊界,但不包含右邊界) li[1:3] # => [2, 4] -# Omit the beginning +# 略過開頭元素 li[2:] # => [4, 3] -# Omit the end +# 略過結尾元素 li[:3] # => [1, 2, 4] -# Select every second entry +# 每隔兩個元素取值 li[::2] # =>[1, 4] -# Reverse a copy of the list +# 串列反轉 li[::-1] # => [3, 4, 2, 1] -# Use any combination of these to make advanced slices -# li[start:end:step] +# 你可以任意組合來達到你想要的效果 +# li[開始索引:結束索引:間隔] -# Remove arbitrary elements from a list with "del" -del li[2] # li is now [1, 2, 3] +# 用 "del" 從串列中移除任意元素 +del li[2] # 現在 li 內容為 [1, 2, 3] -# You can add lists +# 你可以做串列相加 li + other_li # => [1, 2, 3, 4, 5, 6] -# Note: values for li and for other_li are not modified. +# 註: li 及 other_li 沒有被更動 -# Concatenate lists with "extend()" -li.extend(other_li) # Now li is [1, 2, 3, 4, 5, 6] +# 用 "extend()" 做串列串接 +li.extend(other_li) # 現在 li 內容為 [1, 2, 3, 4, 5, 6] -# Remove first occurrence of a value -li.remove(2) # li is now [1, 3, 4, 5, 6] -li.remove(2) # Raises a ValueError as 2 is not in the list +# 移除特定值的第一次出現 +li.remove(2) # 現在 li 內容為 [1, 3, 4, 5, 6] +li.remove(2) # 2 不在串列中,造成 ValueError -# Insert an element at a specific index -li.insert(1, 2) # li is now [1, 2, 3, 4, 5, 6] again +# 在特定位置插入值 +li.insert(1, 2) # 現在 li 內容再次回復為 [1, 2, 3, 4, 5, 6] -# Get the index of the first item found +# 取得特定值在串列中第一次出現的位置 li.index(2) # => 1 -li.index(7) # Raises a ValueError as 7 is not in the list +li.index(7) # 7 不在串列中,造成 ValueError -# Check for existence in a list with "in" +# 用 "in" 檢查特定值是否出現在串列中 1 in li # => True -# Examine the length with "len()" +# 用 "len()" 取得串列長度 len(li) # => 6 From 6c9bf0dc5bccf644439346763f36b047a898a694 Mon Sep 17 00:00:00 2001 From: Hinet60613 Date: Mon, 2 Nov 2015 02:06:40 +0800 Subject: [PATCH 225/457] Translate to Sec. 4 finished. --- zh-tw/python-tw.html.markdown | 197 +++++++++++++++++----------------- 1 file changed, 100 insertions(+), 97 deletions(-) diff --git a/zh-tw/python-tw.html.markdown b/zh-tw/python-tw.html.markdown index 8e9ca79a..073c5e91 100644 --- a/zh-tw/python-tw.html.markdown +++ b/zh-tw/python-tw.html.markdown @@ -6,7 +6,7 @@ contributors: - ["Andre Polykanine", "https://github.com/Oire"] - ["evuez", "http://github.com/evuez"] translators: - - ["Michael Yeh", "https://github.com/hinet60613"] + - ["Michael Yeh", "https://hinet60613.github.io/"] filename: learnpython.py lang: zh-tw --- @@ -255,137 +255,139 @@ li.index(7) # 7 不在串列中,造成 ValueError len(li) # => 6 -# Tuples are like lists but are immutable. +# 元組(Tuple,以下仍用原文)類似於串列,但是它是不可改變的 tup = (1, 2, 3) tup[0] # => 1 -tup[0] = 3 # Raises a TypeError +tup[0] = 3 # 產生TypeError -# You can do all those list thingies on tuples too +# 能對串列做的東西都可以對tuple做 len(tup) # => 3 tup + (4, 5, 6) # => (1, 2, 3, 4, 5, 6) tup[:2] # => (1, 2) 2 in tup # => True -# 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 +# 你可以把tuple拆開並分別將值存入不同變數 +a, b, c = (1, 2, 3) # a 現在是 1, b 現在是 2, c 現在是 3 +d, e, f = 4, 5, 6 # 也可以不寫括號 +# 如果不加括號,預設會產生tuple 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 -# Dictionaries store mappings +# 字典(Dictionary)用來儲存映射關係 empty_dict = {} -# Here is a prefilled dictionary +# 你可以對字典做初始化 filled_dict = {"one": 1, "two": 2, "three": 3} -# Look up values with [] +# 用 [] 取值 filled_dict["one"] # => 1 -# Get all keys as a list with "keys()" +# 用 "keys()" 將所有的Key輸出到一個List中 filled_dict.keys() # => ["three", "two", "one"] -# Note - Dictionary key ordering is not guaranteed. -# Your results might not match this exactly. +# 註: 字典裡key的排序是不固定的 +# 你的執行結果可能與上面不同 +# 譯註: 只能保證所有的key都有出現,但不保證順序 -# Get all values as a list with "values()" +# 用 "valuess()" 將所有的Value輸出到一個List中 filled_dict.values() # => [3, 2, 1] -# Note - Same as above regarding key ordering. +# 註: 同上,不保證順序 -# Check for existence of keys in a dictionary with "in" +# 用 "in" 來檢查指定的Key是否在字典中 "one" in filled_dict # => True 1 in filled_dict # => False -# Looking up a non-existing key is a KeyError +# 查詢不存在的Key會造成KeyError filled_dict["four"] # KeyError -# Use "get()" method to avoid the KeyError +# 用 "get()" 來避免KeyError +# 若指定的Key不存在的話會得到None filled_dict.get("one") # => 1 filled_dict.get("four") # => None -# The get method supports a default argument when the value is missing +# "get()" 函式支援預設值,當找不到指定的值時,會回傳指定的預設值 filled_dict.get("one", 4) # => 1 filled_dict.get("four", 4) # => 4 -# note that filled_dict.get("four") is still => None -# (get doesn't set the value in the dictionary) +# 注意此時 filled_dict.get("four") 仍然為 None +# (get()此時並沒有產生出任何的值) -# set the value of a key with a syntax similar to lists -filled_dict["four"] = 4 # now, filled_dict["four"] => 4 +# 像操作list一樣,對指定的Key賦值 +filled_dict["four"] = 4 # 此時 filled_dict["four"] => 4 -# "setdefault()" inserts into a dictionary only if the given key isn't present -filled_dict.setdefault("five", 5) # filled_dict["five"] is set to 5 -filled_dict.setdefault("five", 6) # filled_dict["five"] is still 5 +# "setdefault()" 只在指定的Key不存在時才會將值插入dictionary +filled_dict.setdefault("five", 5) # filled_dict["five"] 被指定為 5 +filled_dict.setdefault("five", 6) # filled_dict["five"] 仍保持 5 -# Sets store ... well sets (which are like lists but can contain no duplicates) +# 集合(Set)被用來儲存...集合。 +# 跟串列(List)有點像,但集合內不會有重複的元素 empty_set = set() -# Initialize a "set()" with a bunch of values -some_set = set([1, 2, 2, 3, 4]) # some_set is now set([1, 2, 3, 4]) +# 初始化 "set()" 並給定一些值 +some_set = set([1, 2, 2, 3, 4]) # 現在 some_set 為 set([1, 2, 3, 4]),注意重複的元素只有一個會被存入 -# order is not guaranteed, even though it may sometimes look sorted -another_set = set([4, 3, 2, 2, 1]) # another_set is now set([1, 2, 3, 4]) +# 一樣,不保證順序,就算真的有照順序排也只是你運氣好 +another_set = set([4, 3, 2, 2, 1]) # another_set 現在為 set([1, 2, 3, 4]) -# Since Python 2.7, {} can be used to declare a set +# 從 Python 2.7 開始,可以使用大括號 {} 來宣告Set filled_set = {1, 2, 2, 3, 4} # => {1, 2, 3, 4} -# Add more items to a set +# 加入更多元素進入Set filled_set.add(5) # filled_set is now {1, 2, 3, 4, 5} -# Do set intersection with & +# 用 & 來對兩個集合取交集 other_set = {3, 4, 5, 6} filled_set & other_set # => {3, 4, 5} -# Do set union with | +# 用 | 來對兩個集合取聯集 filled_set | other_set # => {1, 2, 3, 4, 5, 6} -# Do set difference with - +# 用 - 來將第二個集合內有的元素移出第一個集合 {1, 2, 3, 4} - {2, 3, 5} # => {1, 4} -# Do set symmetric difference with ^ +# 用 ^ 來對兩個集合取差集 {1, 2, 3, 4} ^ {2, 3, 5} # => {1, 4, 5} -# Check if set on the left is a superset of set on the right +# 檢查左邊是否為右邊的母集 {1, 2} >= {1, 2, 3} # => False -# Check if set on the left is a subset of set on the right +# 檢查左邊是否為右邊的子集 {1, 2} <= {1, 2, 3} # => True -# Check for existence in a set with in +# 用 in 來檢查某元素是否存在於集合內 2 in filled_set # => True 10 in filled_set # => False #################################################### -## 3. Control Flow +## 3. 控制流程 #################################################### -# Let's just make a variable +# 首先,先宣告一個變數 some_var = 5 -# Here is an if statement. Indentation is significant in python! -# prints "some_var is smaller than 10" +# 這邊是 if 判斷式。注意,縮排對Python是很重要的。 +# 下面應該會印出 "some_var is smaller than 10" if some_var > 10: print "some_var is totally bigger than 10." -elif some_var < 10: # This elif clause is optional. +elif some_var < 10: # elif 可有可無 print "some_var is smaller than 10." -else: # This is optional too. +else: # else 也可有可無 print "some_var is indeed 10." """ -For loops iterate over lists -prints: +For 迴圈會遞迴整的List +下面的程式碼會輸出: dog is a mammal cat is a mammal mouse is a mammal """ for animal in ["dog", "cat", "mouse"]: - # You can use {0} to interpolate formatted strings. (See above.) + # 你可以用{0}來組合0出格式化字串 (見上面.) print "{0} is a mammal".format(animal) """ -"range(number)" returns a list of numbers -from zero to the given number -prints: +"range(number)" 回傳一個包含從0到給定值的數字List, +下面的程式碼會輸出: 0 1 2 @@ -395,9 +397,9 @@ for i in range(4): print i """ -"range(lower, upper)" returns a list of numbers -from the lower number to the upper number -prints: +"range(lower, upper)" 回傳一個包含從給定的下限 +到給定的上限的數字List +下面的程式碼會輸出: 4 5 6 @@ -407,8 +409,8 @@ for i in range(4, 8): print i """ -While loops go until a condition is no longer met. -prints: +While迴圈會執行到條件不成立為止 +下面的程式碼會輸出: 0 1 2 @@ -417,62 +419,62 @@ prints: x = 0 while x < 4: print x - x += 1 # Shorthand for x = x + 1 + x += 1 # x = x + 1 的簡寫 -# Handle exceptions with a try/except block +# 用try/except處理例外 -# Works on Python 2.6 and up: +# 適用Python 2.6及以上版本 try: - # Use "raise" to raise an error + # 用 "raise" 來發起例外 raise IndexError("This is an index error") except IndexError as e: - pass # Pass is just a no-op. Usually you would do recovery here. + pass # 毫無反應,就只是個什麼都沒做的pass。通常這邊會讓你做對例外的處理 except (TypeError, NameError): - pass # Multiple exceptions can be handled together, if required. -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 + pass # 有需要的話,多種例外可以一起處理 +else: # else 可有可無,但必須寫在所有的except後 + print "All good!" # 只有在try的時候沒有產生任何except才會被執行 +finally: # 不管什麼情況下一定會被執行 print "We can clean up resources here" -# Instead of try/finally to cleanup resources you can use a with statement +# 除了try/finally以外,你可以用 with 來簡單的處理清理動作 with open("myfile.txt") as f: for line in f: print line #################################################### -## 4. Functions +## 4. 函式 #################################################### -# Use "def" to create new functions +# 用 "def" 來建立新函式 def add(x, y): print "x is {0} and y is {1}".format(x, y) - return x + y # Return values with a return statement + return x + y # 用 "return" 來回傳值 -# Calling functions with parameters -add(5, 6) # => prints out "x is 5 and y is 6" and returns 11 +# 用參數來呼叫韓式 +add(5, 6) # => 輸出 "x is 5 and y is 6" 並回傳 11 -# Another way to call functions is with keyword arguments -add(y=6, x=5) # Keyword arguments can arrive in any order. +# 你也可以寫上參數名稱來呼叫函式 +add(y=6, x=5) # 這種狀況下,兩個參數的順序並不影響執行 -# 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 * +# 你可以定義接受多個變數的函式,這些變數是按照順序排序的 +# 如果不加*的話會被解讀為tuple def varargs(*args): return args 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排序的 +# 如果不加**的話會被解讀為dictionary def keyword_args(**kwargs): return kwargs -# Let's call it to see what happens +# 呼叫看看會發生什麼事吧 keyword_args(big="foot", loch="ness") # => {"big": "foot", "loch": "ness"} -# You can do both at once, if you like +# 如果你想要,你也可以兩個同時用 def all_the_args(*args, **kwargs): print args print kwargs @@ -482,39 +484,40 @@ all_the_args(1, 2, a=3, b=4) prints: {"a": 3, "b": 4} """ -# When calling functions, you can do the opposite of args/kwargs! -# Use * to expand positional args and use ** to expand keyword args. +# 呼叫函式時,你可以做反向的操作 +# 用 * 將變數展開為順序排序的變數 +# 用 ** 將變數展開為Keyword排序的變數 args = (1, 2, 3, 4) kwargs = {"a": 3, "b": 4} -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) +all_the_args(*args) # 等同於 foo(1, 2, 3, 4) +all_the_args(**kwargs) # 等同於 foo(a=3, b=4) +all_the_args(*args, **kwargs) # 等同於 foo(1, 2, 3, 4, a=3, b=4) -# you can pass args and kwargs along to other functions that take args/kwargs -# by expanding them with * and ** respectively +# 你可以把args跟kwargs傳到下一個函式內 +# 分別用 * 跟 ** 將它展開就可以了 def pass_all_the_args(*args, **kwargs): all_the_args(*args, **kwargs) print varargs(*args) print keyword_args(**kwargs) -# Function Scope +# 函式範圍 x = 5 def set_x(num): - # Local var x not the same as global variable x + # 區域變數 x 和全域變數 x 不是同一個東西 x = num # => 43 print x # => 43 def set_global_x(num): global x print x # => 5 - x = num # global var x is now set to 6 + x = num # 全域變數 x 在set_global_x(6)被設定為 6 print x # => 6 set_x(43) set_global_x(6) -# Python has first class functions +# Python有一級函式 def create_adder(x): def adder(y): return x + y @@ -523,23 +526,23 @@ def create_adder(x): add_10 = create_adder(10) add_10(3) # => 13 -# There are also anonymous functions +# 也有匿名函式 (lambda x: x > 2)(3) # => True (lambda x, y: x ** 2 + y ** 2)(2, 1) # => 5 -# There are built-in higher order functions +# 還有內建的高階函式 map(add_10, [1, 2, 3]) # => [11, 12, 13] map(max, [1, 2, 3], [4, 2, 1]) # => [4, 2, 3] filter(lambda x: x > 5, [3, 4, 5, 6, 7]) # => [6, 7] -# We can use list comprehensions for nice maps and filters +# 我們可以用List列表的方式對map和filter等高階函式做更有趣的應用 [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] #################################################### -## 5. Classes +## 5. 類別 #################################################### # We subclass from object to get a class. From e2b93f579cbcbb58612081b46f4460cd0255edb3 Mon Sep 17 00:00:00 2001 From: Hinet60613 Date: Mon, 2 Nov 2015 02:18:21 +0800 Subject: [PATCH 226/457] Finish translation of Sec. 6 --- zh-tw/python-tw.html.markdown | 44 +++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/zh-tw/python-tw.html.markdown b/zh-tw/python-tw.html.markdown index 073c5e91..d113f90c 100644 --- a/zh-tw/python-tw.html.markdown +++ b/zh-tw/python-tw.html.markdown @@ -545,25 +545,25 @@ filter(lambda x: x > 5, [3, 4, 5, 6, 7]) # => [6, 7] ## 5. 類別 #################################################### -# We subclass from object to get a class. +# 我們可以由object繼承出一個新的類別 class Human(object): - # A class attribute. It is shared by all instances of this class + # 類別的參數,被所有這個類別的實體所共用 species = "H. sapiens" - # Basic initializer, this is called when this class is instantiated. - # Note that the double leading and trailing underscores denote objects - # or attributes that are used by python but that live in user-controlled - # namespaces. You should not invent such names on your own. + # 基礎建構函式,當class被實體化的時候會被呼叫 + # 注意前後的雙底線代表物件 + # 還有被python用,但實際上是在使用者控制的命名 + # 空間內的參數。你不應該自己宣告這樣的名稱。 def __init__(self, name): - # Assign the argument to the instance's name attribute + # 將函式引入的參數 name 指定給實體的 name 參數 self.name = name - # Initialize property + # 初始化屬性 self.age = 0 - # An instance method. All methods take "self" as the first argument + # 一個實體的方法(method)。 所有的method都以self為第一個參數 def say(self, msg): return "{0}: {1}".format(self.name, msg) @@ -626,41 +626,41 @@ i.age # => raises an AttributeError #################################################### -## 6. Modules +## 6. 模組 #################################################### -# You can import modules +# 你可以引入模組來做使用 import math print math.sqrt(16) # => 4 + # math.sqrt()為取根號 -# You can get specific functions from a module +# 你可以只從模組取出特定幾個函式 from math import ceil, floor print ceil(3.7) # => 4.0 print floor(3.7) # => 3.0 -# You can import all functions from a module. -# Warning: this is not recommended +# 你可以將所有的函式從模組中引入 +# 注意:不建議這麼做 from math import * -# You can shorten module names +# 你可以用 as 簡寫模組名稱 import math as m math.sqrt(16) == m.sqrt(16) # => True -# you can also test that the functions are equivalent +# 你也可以測試函示是否相等 from math import sqrt math.sqrt == m.sqrt == sqrt # => True -# Python modules are just ordinary python files. You -# can write your own, and import them. The name of the -# module is the same as the name of the file. +# Python的模組就只是一般的Python檔。 +# 你可以自己的模組自己寫、自己的模組自己引入 +# 模組的名稱和檔案名稱一樣 -# You can find out which functions and attributes -# defines a module. +# 你可以用dir()來查看有哪些可用函式和屬性 import math dir(math) #################################################### -## 7. Advanced +## 7. 進階 #################################################### # Generators help you make lazy code From 3544a43d117d7b63de2c3443250270d92d00dce9 Mon Sep 17 00:00:00 2001 From: Hinet60613 Date: Mon, 2 Nov 2015 02:27:42 +0800 Subject: [PATCH 227/457] Finish Sec. 7 translation. --- zh-tw/python-tw.html.markdown | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/zh-tw/python-tw.html.markdown b/zh-tw/python-tw.html.markdown index d113f90c..797fc6ed 100644 --- a/zh-tw/python-tw.html.markdown +++ b/zh-tw/python-tw.html.markdown @@ -663,34 +663,30 @@ dir(math) ## 7. 進階 #################################################### -# Generators help you make lazy code +# 產生器(Generator)可以讓你寫更懶惰的程式碼 def double_numbers(iterable): for i in iterable: yield i + i -# A generator creates values on the fly. -# Instead of generating and returning all values at once it creates one in each -# iteration. This means values bigger than 15 wont be processed in -# double_numbers. -# Note xrange is a generator that does the same thing range does. -# Creating a list 1-900000000 would take lot of time and space to be made. -# xrange creates an xrange generator object instead of creating the entire list -# like range does. -# We use a trailing underscore in variable names when we want to use a name that -# would normally collide with a python keyword +# 產生器可以讓你即時的產生值 +# 不是全部產生完之後再一次回傳,產生器會在每一個遞迴時 +# 產生值。 這也意味著大於15的值不會在double_numbers中產生。 +# 這邊,xrange()做的事情和range()一樣 +# 建立一個 1-900000000 的List會消耗很多時間和記憶體空間 +# xrange() 建立一個產生器物件,而不是如range()建立整個List +# 我們用底線來避免可能和python的關鍵字重複的名稱 xrange_ = xrange(1, 900000000) -# will double all numbers until a result >=30 found +# 下面的程式碼會把所有的值乘以兩倍,直到出現大於30的值 for i in double_numbers(xrange_): print i if i >= 30: break -# Decorators -# in this example beg wraps say -# Beg will call say. If say_please is True then it will change the returned -# message +# 裝飾子 +# 在這個範例中,beg會綁在say上 +# Beg會呼叫say。 如果say_please為True的話,它會更改回傳的訊息 from functools import wraps @@ -715,9 +711,9 @@ print say() # Can you buy me a beer? print say(say_please=True) # Can you buy me a beer? Please! I am poor :( ``` -## Ready For More? +## 準備好學更多了嗎? -### Free Online +### 線上免費資源 * [Automate the Boring Stuff with Python](https://automatetheboringstuff.com) * [Learn Python The Hard Way](http://learnpythonthehardway.org/book/) @@ -728,7 +724,7 @@ print say(say_please=True) # Can you buy me a beer? Please! I am poor :( * [A Crash Course in Python for Scientists](http://nbviewer.ipython.org/5920182) * [First Steps With Python](https://realpython.com/learn/python-first-steps/) -### Dead Tree +### 或買本書? * [Programming Python](http://www.amazon.com/gp/product/0596158106/ref=as_li_qf_sp_asin_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0596158106&linkCode=as2&tag=homebits04-20) * [Dive Into Python](http://www.amazon.com/gp/product/1441413022/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1441413022&linkCode=as2&tag=homebits04-20) From 2ecf370ce4e8b6644863e92652f9b63717ab3e6e Mon Sep 17 00:00:00 2001 From: Hinet60613 Date: Mon, 2 Nov 2015 02:32:25 +0800 Subject: [PATCH 228/457] Sec. 6 translated. All sections translated. Hooray. --- zh-tw/python-tw.html.markdown | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/zh-tw/python-tw.html.markdown b/zh-tw/python-tw.html.markdown index 797fc6ed..10b4669c 100644 --- a/zh-tw/python-tw.html.markdown +++ b/zh-tw/python-tw.html.markdown @@ -567,60 +567,59 @@ class Human(object): def say(self, msg): return "{0}: {1}".format(self.name, msg) - # A class method is shared among all instances - # They are called with the calling class as the first argument + # 一個類別方法會被所有的實體所共用 + # 他們會以類別為第一參數的方式被呼叫 @classmethod def get_species(cls): return cls.species - # A static method is called without a class or instance reference + # 靜態方法 @staticmethod def grunt(): return "*grunt*" - # A property is just like a getter. - # It turns the method age() into an read-only attribute - # of the same name. + # 屬性就像是用getter取值一樣 + # 它將方法 age() 轉為同名的、只能讀取的屬性 @property def age(self): return self._age - # This allows the property to be set + # 這樣寫的話可以讓屬性被寫入新的值 @age.setter def age(self, age): self._age = age - # This allows the property to be deleted + # 這樣寫的話允許屬性被刪除 @age.deleter def age(self): del self._age -# Instantiate a class +# 將類別實體化 i = Human(name="Ian") print i.say("hi") # prints out "Ian: hi" j = Human("Joel") print j.say("hello") # prints out "Joel: hello" -# Call our class method +# 呼叫類別方法 i.get_species() # => "H. sapiens" -# Change the shared attribute +# 更改共用的屬性 Human.species = "H. neanderthalensis" i.get_species() # => "H. neanderthalensis" j.get_species() # => "H. neanderthalensis" -# Call the static method +# 呼叫靜態方法 Human.grunt() # => "*grunt*" -# Update the property +# 更新屬性 i.age = 42 -# Get the property +# 取得屬性 i.age # => 42 -# Delete the property +# 移除屬性 del i.age i.age # => raises an AttributeError From 8d879735365461d817ccd75d0cae1be9d361197b Mon Sep 17 00:00:00 2001 From: CY Lim Date: Mon, 2 Nov 2015 11:23:59 +1100 Subject: [PATCH 229/457] 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 230/457] 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 231/457] 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 232/457] 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 233/457] 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 234/457] 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 235/457] 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 236/457] 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 237/457] 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 238/457] 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 239/457] 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 240/457] 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 a25d4db0bcfb9325f69f68a2532df6fd88f4e78d Mon Sep 17 00:00:00 2001 From: rainjay Date: Tue, 3 Nov 2015 11:09:19 +0800 Subject: [PATCH 241/457] fix typo --- zh-tw/python-tw.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zh-tw/python-tw.html.markdown b/zh-tw/python-tw.html.markdown index 10b4669c..c4706c43 100644 --- a/zh-tw/python-tw.html.markdown +++ b/zh-tw/python-tw.html.markdown @@ -450,7 +450,7 @@ def add(x, y): print "x is {0} and y is {1}".format(x, y) return x + y # 用 "return" 來回傳值 -# 用參數來呼叫韓式 +# 用參數來呼叫函式 add(5, 6) # => 輸出 "x is 5 and y is 6" 並回傳 11 # 你也可以寫上參數名稱來呼叫函式 From ae26df01957eb870401494b2f0a993920c7da665 Mon Sep 17 00:00:00 2001 From: WinChris Date: Tue, 3 Nov 2015 09:42:26 +0100 Subject: [PATCH 242/457] 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 243/457] [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 244/457] [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 245/457] [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 246/457] 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 247/457] 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 248/457] 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 249/457] 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 250/457] 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 251/457] 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 252/457] 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 253/457] [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 254/457] 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 255/457] 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 256/457] 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 257/457] 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 258/457] - 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 259/457] - 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 260/457] 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-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)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% 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 261/457] - 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 262/457] [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(TiC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ATCH 263/457] 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 264/457] 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 265/457] -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 266/457] 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 267/457] 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 268/457] 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 269/457] [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 270/457] 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 271/457] 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 272/457] 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 273/457] =?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 274/457] 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 275/457] =?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 276/457] 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 277/457] [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 278/457] [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 279/457] "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 280/457] 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 281/457] 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 282/457] 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 283/457] 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 284/457] $! 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 285/457] 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 286/457] 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 287/457] 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 288/457] 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 289/457] 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 290/457] 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 291/457] 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 292/457] 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 293/457] 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 294/457] 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 295/457] - 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 92a736f5e06473d454f197b8017dc542ba8c404c Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Mon, 23 Nov 2015 16:02:00 -0500 Subject: [PATCH 296/457] Added solidity --- solidity.html.markdown | 381 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 381 insertions(+) create mode 100644 solidity.html.markdown diff --git a/solidity.html.markdown b/solidity.html.markdown new file mode 100644 index 00000000..6409828a --- /dev/null +++ b/solidity.html.markdown @@ -0,0 +1,381 @@ +--- +language: Solidity +filename: learnSolidity.sol +contributors: + - ["Nemil Dalal", "https://www.nemil.com"] +--- + +Solidity is a statically typed, contract programming language for [Ethereum](https://www.ethereum.org/) that has similarities to Javascript and C. Like an object in object-oriented languages, each contract contains state variables, functions, and common data types. Contract-specific features include modifier (guard) clauses, event notifiers, and custom variables. + +Solidity lets you program on Ethereum, a blockchain-based virtual machine that allows the creation and computation of smart contracts, without needing centralized or trusted parties. + +As Solidity and Ethereum are under active development, experimental or beta features are explicitly marked, and subject to change. Pull requests welcome. + +```javascript +// Let's start with a simple Bank contract, before diving into to the key components of the language + +// Start with a Natspec comment (the three slashes) that can be used +// for documentation - and as descriptive data for UI elements +/// @title A simple deposit/withdrawal bank built on Bitcoin + +// All contracts are declared and named (in CamelCase) +contract AcmeBank { + // Declare state variables outside a function, + // these are persistent throughout the life of the contract + + // a dictionary that maps addresses to balances + mapping (address -> uint) balances; + + // the 'public' makes 'owner' externally readable by users or contracts + // (but not writeable), the 'constant' means this value to be + // changed after initialization + address public constant owner; + + // Constructor, can receive one or many variables here + function AcmeBank() { + // msg is a default variable that provides both the + // contract messager's address and amount + owner = msg.address; + // the owner has no additional rights, we're setting it for + // illustrative purposes + } + + function deposit(uint balance) { + balances[msg.sender] += msg.value; // no need for "this." or "self." in front of the state variable + + return balances[msg.sender]; + } + + function withdraw(uint withdrawAmount) returns (uint remainingBalance) { + if(balances[msg.sender] >= withdrawAmount) { + balances[msg.sender] -= withdrawAmount; + balances[msg.sender].send(withdrawAmount); + + return balances[msg.sender]; + } + } + + // The 'constant' prevents the function from editing state variables + function balance() constant { + return balances[msg.sender]; + } + + // Fallback function + // This function is called if invalid data is sent or ether without data; + // Added so that ether sent to this contract is reverted if the contract fails + // otherwise, the sender loses their money; you should add this in most contracts + function () { throw; } +} +// End example + +// Now let's go through the basics of Solidity + +// 1. DATA TYPES +// uint is the data type typically used for currency (there are no doubles +// or floats) and for dates +uint x; +int const a = 8; // int of 256 bits, cannot be changed after instantiation +uint8 b; +int64 c; +// int256 is same as int +// For both int and uint, you can explicitly set space in steps of 8, +// e.g., int8, int16 +uint248 e; + +// Type casting +int x = int(b) + +bool b = true; // or do 'var b = true;' for inferred typing + +// Addresses - holds 20 byte/160 bit Ethereum addresses to another contract +// ('Contract Account)') or person/external entity ('External Account') +address public owner; // Add 'public' field to indicate publicly/externally accessible, a getter is automatically created, but NOT a setter + +// All addresses can be sent ether in the following way: +owner.send(SOME_BALANCE); // returns false on failure +owner.balance; // the balance of the owner + +// Bytes are provided from 1 to 32 +byte a; // byte is same as bytes1 +bytes32 b; + +// Dynamically sized +bytes m; // A special array, same as byte[] (but packed tightly) +// same as bytes, but does not allow length or index access (for now) +string n = 'hello'; + +// Type inference +// var does inferred typing based on first assignment, +// can't be used in functions parameters +var a = true; +// there are edge cases where inference leads to a value being set (e.g., an uint 8) +// that is different from what the user wanted (uint16), so use carefully + +// by default, all values are set to 0 on instantiation + +// Delete can be called on most types, and will set the values to 0 +uint x = 5; +delete(x); // x is now 0 + +// 2. DATA STRUCTURES +// Arrays +bytes32[] names; +uint newLength = names.push("John"); // adding returns new length of the array +// Length +names.length; // get length +names.length = 1; // lengths can also be set, unlike many other languages + +// Dictionaries (any type to any other type) +mapping (string -> uint) public balances; +balances["john"] = 1; +console.log(balances[jill]); // is 0, all non-set key values return zeroes +// The 'public' lets you do the following from another contract +contractName.balances("john"); // returns 1 +// The 'public' keyword here created a getter (but not setter) that behaves like the following: +function balances(address _account) returns (uint balance) { + return balances[_account]; +} + +// To delete +delete(balances["John"]); +delete(balances); // deletes all elements + +// Unlike languages like Javascript, you cannot iterate through all elements in +// a map, without knowing the source keys + +// Structs and enums + struct Bank { // note the capital + address owner; + uint balance; + } +Bank b = Bank({ + owner: msg.sender, + balance: 5 +}); +delete(b); // set all values to 0, except any mappings + +// Enums +enum State { Created, Locked, Inactive }; +State public state; // Declare variable from enum +state = State.Created; + +// 3. Variables of note +// storage - A persistent storage hash (does not need to be declared) +storage['abc'] = 'def'; // maps 256 bit words to 256 bit words + +// tx - This transaction +tx.origin // address, sender of the transaction +tx.gasprice // uint, gas price of the transaction + +// msg - The current message received by the contract +msg.sender; // address, The address of the sender +msg.value; // uint, The amount of gas provided to this contract in wei +msg.data // bytes, complete call data + +// balance of the current contract (both contract and external accounts +// have balances) - often used at the end of a contracts life to send the +// remaining balance to a party +this.balance +// block +now // uint, current time, alias for block.timestamp +block.number // uint, current block number +block.difficulty // uint, current block difficulty +block.blockhash(1) // returns bytes32, only provides for most recent 256 block + +// 4. FUNCTIONS AND MORE +// A. Functions +// Simple function +function increment(uint x) returns (uint) { + x += 1; + return x; +} + +// Functions can return many arguments, and by specifying the returned arguments +// you don't need to explicity return +function increment(uint x, uint y) returns (uint x, uint y) { + x += 1; + y += 1; +} +// This function would have been called like this, and assigned to a tuple +uint (a,b) = increment(1,1); + +// The 'constant' indicates and ensures that a function does not/cannot change the persistent variables +uint y; + +function increment(uint x) constant returns (uint x) { + x += 1; + y += 1; // this line would fail + // as y is a state variable, and can't be changed in a constant function +} + +// There are a few 'function visibility specifiers' that can be placed where 'constant' +// is, which include: +// internal (can only be called by an internal function, not one external to the contract) +// public - visibile externally and internally +// private - only visible in the current contract + +// Functions are hoisted (so you can call a function, even if it is declared later) - and you can assign a function to a variable +function a() { + var z = b; + b(); +} + +function b() { + +} + +// B. Events +// Events are an easy way to notify external listeners that something changed +// You typically decalre them after your contract parameters +event Sent(address from, address to, uint amount); + +// You then call it in a function, when you want to trigger it +sent(from, to, amount); + +// For an external party (a contract or external entity), to watch +// for an event, you write the following: +Coin.Sent().watch({}, '', function(error, result) { + if (!error) { + console.log("Coin transfer: " + result.args.amount + + " coins were sent from " + result.args.from + + " to " + result.args.to + "."); + console.log("Balances now:\n" + + "Sender: " + Coin.balances.call(result.args.from) + + "Receiver: " + Coin.balances.call(result.args.to)); + } +} +// This is a common paradigm for one contract to depend on another (e.g., a +// contract that depends on the current exchange rate provided by another +// contract) + +// C. Modifiers +// Modifiers let you validate inputs to functions +// The '_' (underscore) must be included, and is an indicator that the +// function being called should be placed there +modifier onlyBefore(uint _time) { if (now >= _time) throw; _ } + +// You can then append it right after the function declaration +function test() + onlyBefore() +{ + +} + +// 5. BRANCHING AND LOOPS + +// All basic logic blocks work - including if/else, for, while, break, continue, return +// switch is not provided +// Syntax is the same as javascript, but there is no type conversion from +// non-boolean to boolean + +// 6. CALLING AN EXTERNAL CONTRACT + +contract infoFeed { + function info() returns (uint ret) { return 42; } +} + +contract Consumer { + InfoFeed feed; // create a variable that will point to a contract on the blockchain + function setFeed(address addr) { + // Link to the contract by creating on the address + feed = InfoFeed(addr); + } + function callFeed() { + // T final parentheses call the contract, optionally adding + // custom value or gas numbers + feed.info.value(10).gas(800)(); + } +} + +// 7. CONTRACT DESIGN PATTERNS + +// A. Obfuscation +// Remember that all variables are publicly viewable on the blockchain, so +// anything that needs some privacy needs to be obfuscated (e.g., hashed) + +// B. Throwing +// Throwing +throw; // throwing is easily done, and reverts unused money to the sender +// You can't currently catch + +// A common design pattern is: +if (!addr.send(123)) { + throw; +} + +// C. Suicide +// Suicide +suicide(SOME_ADDRESS); // suicide the current contract, sending funds to the address (often the creator) + +// D. Storage optimization +// Reading and writing can be expensive, as data needs to be stored in the +// blockchain forever - this encourages smart ways to use memory (eventually, +// compilation may better handle this, but for now there are benefits to +// planning your data structures) + +// *** EXAMPLE: Let's do a more complex example *** +// [TODO: Decide what a more complex example looks like, needs a few // characteristics: +// - has a 'constant' state variable +// - has a state machine (uses modifier) +// - sends money to an address +// - gets information from another contract (we'll show code for both contracts) +// - Shows inheritance +// - show variables being passed in on instantiation (and guard code to throw if variables not provided) +// Ideas: +// - crowdfunding? +// - Peer to peer insurance +// ] + +// *** END EXAMPLE *** + +// Some final points +// 7. NATIVE FUNCTIONS + +// Currency units +// By default, currency is defined using wei, the smallest unit of Ether +uint minAmount = 1 wei; +uint a = 1 finney; // 1 ether = 1000 finney +// There are a number of other units, see: http://ether.fund/tool/converter + +// Time units +1 == 1 second +1 minutes == 60 seconds + + +// You typically multiply a variable times the unit, as these units are not +// directly stored in a variable +uint x = 5; +(x * 1 days); // 5 days + +// Be careful about leap seconds and leap years when using equality statements for time (instead, prefer greater than/less than) + +// Cryptography +// All strings passed are concatenated before the hash is run +sha3("ab", "cd"); +ripemd160("abc"); +sha256("def"); + +// These are natspec comments, when a user is asked to confirm a transaction +/// +/** */ + +// 8. COMMON MISTAKES +// A few common mistakes +// You cannot restrict a human or computer from reading the content of +// your transaction or a transaction's state + +// All data to the start of time is stored in the blockchain, so you and +// anyone can observe all previous data states + +// 9. STYLE NOTES +// Use 4 spaces for indentation +// (Python's PEP8 is used as the baseline style guide, including its general philosophy) +``` + +## Additional resources +- [Solidity Docs](https://ethereum.github.io/solidity/docs/home/) +- [Solidity Style Guide](https://ethereum.github.io/solidity//docs/style-guide/): Ethereum's style guide is heavily derived from Python's [pep8](https://www.python.org/dev/peps/pep-0008/) style guide. +- [Browser-based Solidity Editor](http://chriseth.github.io/browser-solidity/) +- [Gitter Chat room](https://gitter.im/ethereum/go-ethereum) + +Feel free to send a pull request with any edits - or email nemild -/at-/ gmail \ No newline at end of file From d5bcbceb21954d0f8739fb841fc511aa32c2bcc6 Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Mon, 23 Nov 2015 16:07:17 -0500 Subject: [PATCH 297/457] Fixed withdrawal check --- solidity.html.markdown | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index 6409828a..79debed6 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -49,7 +49,10 @@ contract AcmeBank { function withdraw(uint withdrawAmount) returns (uint remainingBalance) { if(balances[msg.sender] >= withdrawAmount) { balances[msg.sender] -= withdrawAmount; - balances[msg.sender].send(withdrawAmount); + + if (!balances[msg.sender].send(withdrawAmount)) { + balances[msg.sender] += withdrawAmount; + } return balances[msg.sender]; } From 08f3ee3687fc18286fdb3825f0fc1fd74c086798 Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Mon, 23 Nov 2015 16:39:05 -0500 Subject: [PATCH 298/457] Added remove function --- solidity.html.markdown | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index 79debed6..bcbdec5f 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -35,15 +35,13 @@ contract AcmeBank { function AcmeBank() { // msg is a default variable that provides both the // contract messager's address and amount - owner = msg.address; - // the owner has no additional rights, we're setting it for - // illustrative purposes + owner = msg.address; // msg.address refers to the address of the contract creator } function deposit(uint balance) { balances[msg.sender] += msg.value; // no need for "this." or "self." in front of the state variable - return balances[msg.sender]; + return balances[msg.sender]; // msg.sender refers to the contract caller } function withdraw(uint withdrawAmount) returns (uint remainingBalance) { @@ -58,6 +56,13 @@ contract AcmeBank { } } + // It's good practice to have a remove function, which disables this contract + function remove () { + if(msg.sender == owner) { // Only let the contract creator do this + suicide(owner); // suicide makes this contract inactive, and returns funds to the owner + } + } + // The 'constant' prevents the function from editing state variables function balance() constant { return balances[msg.sender]; From 1f4738cbc75f789992270c3926cf9cdd30c4674a Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Tue, 24 Nov 2015 00:09:10 -0500 Subject: [PATCH 299/457] Several fixes per Andreas's feedback --- solidity.html.markdown | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index bcbdec5f..88ccd817 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -14,28 +14,30 @@ As Solidity and Ethereum are under active development, experimental or beta feat ```javascript // Let's start with a simple Bank contract, before diving into to the key components of the language +// START EXAMPLE // Start with a Natspec comment (the three slashes) that can be used // for documentation - and as descriptive data for UI elements /// @title A simple deposit/withdrawal bank built on Bitcoin // All contracts are declared and named (in CamelCase) +// They are similar to 'class' in other languages (and allow capabilities like inheritance) contract AcmeBank { // Declare state variables outside a function, // these are persistent throughout the life of the contract // a dictionary that maps addresses to balances - mapping (address -> uint) balances; + mapping (address => uint) balances; // the 'public' makes 'owner' externally readable by users or contracts // (but not writeable), the 'constant' means this value to be // changed after initialization - address public constant owner; + address public owner; // Constructor, can receive one or many variables here function AcmeBank() { // msg is a default variable that provides both the // contract messager's address and amount - owner = msg.address; // msg.address refers to the address of the contract creator + owner = msg.sender; // msg.sender refers to the address of the contract creator } function deposit(uint balance) { @@ -48,7 +50,7 @@ contract AcmeBank { if(balances[msg.sender] >= withdrawAmount) { balances[msg.sender] -= withdrawAmount; - if (!balances[msg.sender].send(withdrawAmount)) { + if (!msg.sender.send(withdrawAmount)) { balances[msg.sender] += withdrawAmount; } @@ -56,7 +58,7 @@ contract AcmeBank { } } - // It's good practice to have a remove function, which disables this contract + // It's good practice to have a remove function, which disables this contract - but does mean that users have to trust the owner function remove () { if(msg.sender == owner) { // Only let the contract creator do this suicide(owner); // suicide makes this contract inactive, and returns funds to the owner @@ -74,7 +76,7 @@ contract AcmeBank { // otherwise, the sender loses their money; you should add this in most contracts function () { throw; } } -// End example +// END EXAMPLE // Now let's go through the basics of Solidity @@ -82,7 +84,7 @@ contract AcmeBank { // uint is the data type typically used for currency (there are no doubles // or floats) and for dates uint x; -int const a = 8; // int of 256 bits, cannot be changed after instantiation +int constant a = 8; // int of 256 bits, cannot be changed after instantiation uint8 b; int64 c; // int256 is same as int @@ -134,7 +136,7 @@ names.length; // get length names.length = 1; // lengths can also be set, unlike many other languages // Dictionaries (any type to any other type) -mapping (string -> uint) public balances; +mapping (string => uint) public balances; balances["john"] = 1; console.log(balances[jill]); // is 0, all non-set key values return zeroes // The 'public' lets you do the following from another contract @@ -322,13 +324,14 @@ suicide(SOME_ADDRESS); // suicide the current contract, sending funds to the add // planning your data structures) // *** EXAMPLE: Let's do a more complex example *** -// [TODO: Decide what a more complex example looks like, needs a few // characteristics: +// [TODO: Decide what a more complex example looks like, needs a few characteristics: // - has a 'constant' state variable // - has a state machine (uses modifier) // - sends money to an address // - gets information from another contract (we'll show code for both contracts) // - Shows inheritance // - show variables being passed in on instantiation (and guard code to throw if variables not provided) +// - Shows the swapping out of a contract // Ideas: // - crowdfunding? // - Peer to peer insurance @@ -375,7 +378,9 @@ sha256("def"); // All data to the start of time is stored in the blockchain, so you and // anyone can observe all previous data states -// 9. STYLE NOTES +// 9. TESTING + +// 10. STYLE NOTES // Use 4 spaces for indentation // (Python's PEP8 is used as the baseline style guide, including its general philosophy) ``` From 083eb1c4a5ef1da2249ad9640bc2f62cf9f95af0 Mon Sep 17 00:00:00 2001 From: Laoujin Date: Fri, 27 Nov 2015 00:19:06 +0100 Subject: [PATCH 300/457] [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 301/457] [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 302/457] [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 303/457] [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 304/457] [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 305/457] [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 306/457] 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 307/457] 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 308/457] 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 309/457] [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 310/457] 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 700f3e7a1cb6ef5b905eac7ec3fe3aa2e713c079 Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Mon, 30 Nov 2015 15:45:03 -0500 Subject: [PATCH 311/457] Many minor updates --- solidity.html.markdown | 226 ++++++++++++++++++++++++++--------------- 1 file changed, 145 insertions(+), 81 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index 88ccd817..0fa1fddc 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -14,7 +14,7 @@ As Solidity and Ethereum are under active development, experimental or beta feat ```javascript // Let's start with a simple Bank contract, before diving into to the key components of the language -// START EXAMPLE +// ** START EXAMPLE ** // Start with a Natspec comment (the three slashes) that can be used // for documentation - and as descriptive data for UI elements /// @title A simple deposit/withdrawal bank built on Bitcoin @@ -22,31 +22,30 @@ As Solidity and Ethereum are under active development, experimental or beta feat // All contracts are declared and named (in CamelCase) // They are similar to 'class' in other languages (and allow capabilities like inheritance) contract AcmeBank { - // Declare state variables outside a function, + // Declare state variables outside a function, // these are persistent throughout the life of the contract // a dictionary that maps addresses to balances - mapping (address => uint) balances; + mapping (address => uint) balances; + + // the 'public' makes 'owner' externally readable by users or contracts + // (but not writeable) - + address public owner; - // the 'public' makes 'owner' externally readable by users or contracts - // (but not writeable), the 'constant' means this value to be - // changed after initialization - address public owner; - // Constructor, can receive one or many variables here function AcmeBank() { - // msg is a default variable that provides both the + // msg is a default variable that provides both the // contract messager's address and amount owner = msg.sender; // msg.sender refers to the address of the contract creator } - - function deposit(uint balance) { + + function deposit(uint balance) public { balances[msg.sender] += msg.value; // no need for "this." or "self." in front of the state variable return balances[msg.sender]; // msg.sender refers to the contract caller } - function withdraw(uint withdrawAmount) returns (uint remainingBalance) { + function withdraw(uint withdrawAmount) public returns (uint remainingBalance) { if(balances[msg.sender] >= withdrawAmount) { balances[msg.sender] -= withdrawAmount; @@ -58,8 +57,9 @@ contract AcmeBank { } } - // It's good practice to have a remove function, which disables this contract - but does mean that users have to trust the owner - function remove () { + // It's good practice to have a remove function, which disables this + // contract - but does mean that users have to trust the owner + function remove() { if(msg.sender == owner) { // Only let the contract creator do this suicide(owner); // suicide makes this contract inactive, and returns funds to the owner } @@ -71,29 +71,35 @@ contract AcmeBank { } // Fallback function - // This function is called if invalid data is sent or ether without data; + // The fallback function is called if none of the other functions matches the given function identifier. + // It is often meant to be called when invalid data is sent or ether without data. // Added so that ether sent to this contract is reverted if the contract fails // otherwise, the sender loses their money; you should add this in most contracts function () { throw; } } -// END EXAMPLE +// ** END EXAMPLE ** // Now let's go through the basics of Solidity -// 1. DATA TYPES +// 1. DATA TYPES AND ASSOCIATED METHOD // uint is the data type typically used for currency (there are no doubles // or floats) and for dates -uint x; -int constant a = 8; // int of 256 bits, cannot be changed after instantiation +uint x; + + +// with 'constant', the compiler replaces each occurence with the acutal value +// int of 256 bits, cannot be changed after instantiation +int constant a = 8; +int256 constant a = 8; // same effect as line above, here the 256 is explict + +// For both int and uint, you can explicitly set space in steps of 8 +// e.g., int8, int16 uint8 b; int64 c; -// int256 is same as int -// For both int and uint, you can explicitly set space in steps of 8, -// e.g., int8, int16 uint248 e; // Type casting -int x = int(b) +int x = int(b); bool b = true; // or do 'var b = true;' for inferred typing @@ -115,21 +121,22 @@ bytes m; // A special array, same as byte[] (but packed tightly) string n = 'hello'; // Type inference -// var does inferred typing based on first assignment, +// var does inferred typing based on first assignment, // can't be used in functions parameters var a = true; -// there are edge cases where inference leads to a value being set (e.g., an uint 8) +// there are edge cases where inference leads to a value being set (e.g., an uint 8) // that is different from what the user wanted (uint16), so use carefully // by default, all values are set to 0 on instantiation -// Delete can be called on most types, and will set the values to 0 +// Delete can be called on most types, and will set the values to 0 by assignment uint x = 5; delete(x); // x is now 0 // 2. DATA STRUCTURES // Arrays -bytes32[] names; +bytes32[5] nicknames; // static array +bytes32[] names; // dynamic array uint newLength = names.push("John"); // adding returns new length of the array // Length names.length; // get length @@ -153,13 +160,13 @@ delete(balances); // deletes all elements // Unlike languages like Javascript, you cannot iterate through all elements in // a map, without knowing the source keys -// Structs and enums +// Structs and enums struct Bank { // note the capital address owner; uint balance; } Bank b = Bank({ - owner: msg.sender, + owner: msg.sender, balance: 5 }); delete(b); // set all values to 0, except any mappings @@ -168,29 +175,39 @@ delete(b); // set all values to 0, except any mappings enum State { Created, Locked, Inactive }; State public state; // Declare variable from enum state = State.Created; +// enums can be explicitly converted to ints + +// Data locations: Memory vs. storage - all complex types (arrays, structs) have a data location +// 'memory' does not persist, 'storage' does +// Default is 'storage' for local and state variables; 'memory' for function parameters // 3. Variables of note -// storage - A persistent storage hash (does not need to be declared) -storage['abc'] = 'def'; // maps 256 bit words to 256 bit words +// ** this ** +this; // the address of the current contract +// 'balance' often used at the end of a contracts life to send the +// remaining balance to a party +this.balance; +this.someFunction(); // calls a function externally (via a message call, not via an internal jump) -// tx - This transaction -tx.origin // address, sender of the transaction -tx.gasprice // uint, gas price of the transaction - -// msg - The current message received by the contract +// ** msg - The current message received by the contract ** ** msg.sender; // address, The address of the sender msg.value; // uint, The amount of gas provided to this contract in wei -msg.data // bytes, complete call data +msg.data; // bytes, complete call data +msg.gas; // remaining gas -// balance of the current contract (both contract and external accounts -// have balances) - often used at the end of a contracts life to send the -// remaining balance to a party -this.balance -// block +// ** tx - This transaction ** +tx.origin; // address, sender of the transaction +tx.gasprice; // uint, gas price of the transaction + +// ** block - Information about the current block ** now // uint, current time, alias for block.timestamp -block.number // uint, current block number -block.difficulty // uint, current block difficulty -block.blockhash(1) // returns bytes32, only provides for most recent 256 block +block.number; // uint, current block number +block.difficulty; // uint, current block difficulty +block.blockhash(1); // returns bytes32, only provides for most recent 256 blocks +block.gasLimit(); + +// ** storage - A persistent storage hash (does not need to be declared) ** +storage['abc'] = 'def'; // maps 256 bit words to 256 bit words // 4. FUNCTIONS AND MORE // A. Functions @@ -236,13 +253,13 @@ function b() { // B. Events // Events are an easy way to notify external listeners that something changed -// You typically decalre them after your contract parameters +// You typically declare them after your contract parameters event Sent(address from, address to, uint amount); // You then call it in a function, when you want to trigger it sent(from, to, amount); -// For an external party (a contract or external entity), to watch +// For an external party (a contract or external entity), to watch // for an event, you write the following: Coin.Sent().watch({}, '', function(error, result) { if (!error) { @@ -254,53 +271,89 @@ Coin.Sent().watch({}, '', function(error, result) { "Receiver: " + Coin.balances.call(result.args.to)); } } -// This is a common paradigm for one contract to depend on another (e.g., a +// This is a common paradigm for one contract to depend on another (e.g., a // contract that depends on the current exchange rate provided by another // contract) // C. Modifiers -// Modifiers let you validate inputs to functions -// The '_' (underscore) must be included, and is an indicator that the +// Modifiers let you validate inputs to functions such as a minimal balance or user authentication +// It's similar to a guard clause in other languages + +// The '_' (underscore) must be included as the last line in the function body, and is an indicator that the // function being called should be placed there modifier onlyBefore(uint _time) { if (now >= _time) throw; _ } // You can then append it right after the function declaration -function test() - onlyBefore() -{ - +function changeOwner(newOwner) + onlyBefore(someTime) + { + owner = newOwner; } // 5. BRANCHING AND LOOPS // All basic logic blocks work - including if/else, for, while, break, continue, return // switch is not provided -// Syntax is the same as javascript, but there is no type conversion from -// non-boolean to boolean -// 6. CALLING AN EXTERNAL CONTRACT +// Syntax is the same as javascript, but there is no type conversion from +// non-boolean to boolean, so comparison operators must be used to get the boolean value +// 6. OBJECTS/CONTRACTS + +// A. Calling an external contract contract infoFeed { function info() returns (uint ret) { return 42; } } contract Consumer { InfoFeed feed; // create a variable that will point to a contract on the blockchain - function setFeed(address addr) { + + // Set feed to an existing contract + function setFeed(address addr) { // Link to the contract by creating on the address - feed = InfoFeed(addr); + feed = InfoFeed(addr); } - function callFeed() { - // T final parentheses call the contract, optionally adding + + // Set feed based to a new instance of the contract + function createNewFeed() { + feed = new InfoFeed(); + } + + function callFeed() { + // T final parentheses call the contract, optionally adding // custom value or gas numbers feed.info.value(10).gas(800)(); } } +// B. Inheritance + +// Order matters, last inherited contract (i.e., 'def') can override parts of the previously +// inherited contracts +contact MyContract is abc, def("a custom argument to def") { + +// Override function + + function z() { + if (msg.sender == owner) { + def.z(); // call overridden function + } + } + + }; + +// C. Import + +import "filename"; +import "github.com/ethereum/dapp-bin/library/iterable_mapping.sol"; + +// Importing is under active development and will change +// Importing cannot currently be done at the command line + // 7. CONTRACT DESIGN PATTERNS // A. Obfuscation -// Remember that all variables are publicly viewable on the blockchain, so +// Remember that all variables are publicly viewable on the blockchain, so // anything that needs some privacy needs to be obfuscated (e.g., hashed) // B. Throwing @@ -317,26 +370,34 @@ if (!addr.send(123)) { // Suicide suicide(SOME_ADDRESS); // suicide the current contract, sending funds to the address (often the creator) +// This is a common pattern that lets the owner end the contract +function remove() { + if(msg.sender == owner) { // Only let the contract creator do this + suicide(owner); // suicide makes this contract inactive, and returns funds to the owner + } +} + // D. Storage optimization -// Reading and writing can be expensive, as data needs to be stored in the -// blockchain forever - this encourages smart ways to use memory (eventually, -// compilation may better handle this, but for now there are benefits to +// Reading and writing can be expensive, as data needs to be stored in the +// blockchain forever - this encourages smart ways to use memory (eventually, +// compilation may better handle this, but for now there are benefits to // planning your data structures) // *** EXAMPLE: Let's do a more complex example *** + +// ** START EXAMPLE ** // [TODO: Decide what a more complex example looks like, needs a few characteristics: // - has a 'constant' state variable -// - has a state machine (uses modifier) +// - has a state machine (and uses modifier) // - sends money to an address // - gets information from another contract (we'll show code for both contracts) // - Shows inheritance // - show variables being passed in on instantiation (and guard code to throw if variables not provided) -// - Shows the swapping out of a contract +// - Shows the swapping out of a contract address // Ideas: // - crowdfunding? // - Peer to peer insurance // ] - // *** END EXAMPLE *** // Some final points @@ -353,7 +414,7 @@ uint a = 1 finney; // 1 ether = 1000 finney 1 minutes == 60 seconds -// You typically multiply a variable times the unit, as these units are not +// You typically multiply a variable times the unit, as these units are not // directly stored in a variable uint x = 5; (x * 1 days); // 5 days @@ -366,22 +427,22 @@ sha3("ab", "cd"); ripemd160("abc"); sha256("def"); -// These are natspec comments, when a user is asked to confirm a transaction -/// -/** */ +// 8. COMMON MISTAKES/MISCONCEPTIONS +// A few common mistakes and misconceptions: -// 8. COMMON MISTAKES -// A few common mistakes -// You cannot restrict a human or computer from reading the content of +// A. You cannot restrict a human or computer from reading the content of // your transaction or a transaction's state -// All data to the start of time is stored in the blockchain, so you and -// anyone can observe all previous data states +// All data to the start of time is stored in the blockchain, so you and +// anyone can observe all previous data stats -// 9. TESTING +// When you don't specify public on a variable, you are indicating that other *contracts* can't +// read the data - but any person can still read the data -// 10. STYLE NOTES -// Use 4 spaces for indentation +// TODO + +// 9. STYLE NOTES +// Use 4 spaces for indentation // (Python's PEP8 is used as the baseline style guide, including its general philosophy) ``` @@ -391,4 +452,7 @@ sha256("def"); - [Browser-based Solidity Editor](http://chriseth.github.io/browser-solidity/) - [Gitter Chat room](https://gitter.im/ethereum/go-ethereum) -Feel free to send a pull request with any edits - or email nemild -/at-/ gmail \ No newline at end of file +## Information purposefully excluded +- Libraries + +Feel free to send a pull request with any edits - or email nemild -/at-/ gmail From 3d19a951926f52b7cafca301919233f4cda513ff Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 30 Nov 2015 12:48:13 -0800 Subject: [PATCH 312/457] [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 ec6172fc5e904c65e672ca22bbc6102a94a60ec9 Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Mon, 30 Nov 2015 15:48:47 -0500 Subject: [PATCH 313/457] Formatting --- solidity.html.markdown | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index 0fa1fddc..2adfc00b 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -81,12 +81,12 @@ contract AcmeBank { // Now let's go through the basics of Solidity -// 1. DATA TYPES AND ASSOCIATED METHOD + +// 1. DATA TYPES AND ASSOCIATED METHODS // uint is the data type typically used for currency (there are no doubles // or floats) and for dates uint x; - // with 'constant', the compiler replaces each occurence with the acutal value // int of 256 bits, cannot be changed after instantiation int constant a = 8; @@ -133,6 +133,7 @@ var a = true; uint x = 5; delete(x); // x is now 0 + // 2. DATA STRUCTURES // Arrays bytes32[5] nicknames; // static array @@ -181,6 +182,7 @@ state = State.Created; // 'memory' does not persist, 'storage' does // Default is 'storage' for local and state variables; 'memory' for function parameters + // 3. Variables of note // ** this ** this; // the address of the current contract @@ -209,6 +211,7 @@ block.gasLimit(); // ** storage - A persistent storage hash (does not need to be declared) ** storage['abc'] = 'def'; // maps 256 bit words to 256 bit words + // 4. FUNCTIONS AND MORE // A. Functions // Simple function @@ -290,6 +293,7 @@ function changeOwner(newOwner) owner = newOwner; } + // 5. BRANCHING AND LOOPS // All basic logic blocks work - including if/else, for, while, break, continue, return @@ -298,6 +302,7 @@ function changeOwner(newOwner) // Syntax is the same as javascript, but there is no type conversion from // non-boolean to boolean, so comparison operators must be used to get the boolean value + // 6. OBJECTS/CONTRACTS // A. Calling an external contract @@ -350,6 +355,7 @@ import "github.com/ethereum/dapp-bin/library/iterable_mapping.sol"; // Importing is under active development and will change // Importing cannot currently be done at the command line + // 7. CONTRACT DESIGN PATTERNS // A. Obfuscation @@ -383,6 +389,8 @@ function remove() { // compilation may better handle this, but for now there are benefits to // planning your data structures) + + // *** EXAMPLE: Let's do a more complex example *** // ** START EXAMPLE ** @@ -400,7 +408,7 @@ function remove() { // ] // *** END EXAMPLE *** -// Some final points + // 7. NATIVE FUNCTIONS // Currency units @@ -427,6 +435,7 @@ sha3("ab", "cd"); ripemd160("abc"); sha256("def"); + // 8. COMMON MISTAKES/MISCONCEPTIONS // A few common mistakes and misconceptions: @@ -441,6 +450,7 @@ sha256("def"); // TODO + // 9. STYLE NOTES // Use 4 spaces for indentation // (Python's PEP8 is used as the baseline style guide, including its general philosophy) From 4b7d7e3d2e86e6e2d5b95b518864ecd89392d7c0 Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Mon, 30 Nov 2015 16:01:51 -0500 Subject: [PATCH 314/457] Spelling and grammar --- solidity.html.markdown | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index 2adfc00b..3e47f080 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -72,7 +72,7 @@ contract AcmeBank { // Fallback function // The fallback function is called if none of the other functions matches the given function identifier. - // It is often meant to be called when invalid data is sent or ether without data. + // Typically, called when invalid data is sent to the contract or ether without data. // Added so that ether sent to this contract is reverted if the contract fails // otherwise, the sender loses their money; you should add this in most contracts function () { throw; } @@ -87,10 +87,10 @@ contract AcmeBank { // or floats) and for dates uint x; -// with 'constant', the compiler replaces each occurence with the acutal value +// with 'constant', the compiler replaces each occurrence with the actual value // int of 256 bits, cannot be changed after instantiation int constant a = 8; -int256 constant a = 8; // same effect as line above, here the 256 is explict +int256 constant a = 8; // same effect as line above, here the 256 is explicit // For both int and uint, you can explicitly set space in steps of 8 // e.g., int8, int16 @@ -221,7 +221,7 @@ function increment(uint x) returns (uint) { } // Functions can return many arguments, and by specifying the returned arguments -// you don't need to explicity return +// you don't need to explicitly return function increment(uint x, uint y) returns (uint x, uint y) { x += 1; y += 1; @@ -241,7 +241,7 @@ function increment(uint x) constant returns (uint x) { // There are a few 'function visibility specifiers' that can be placed where 'constant' // is, which include: // internal (can only be called by an internal function, not one external to the contract) -// public - visibile externally and internally +// public - visible externally and internally // private - only visible in the current contract // Functions are hoisted (so you can call a function, even if it is declared later) - and you can assign a function to a variable From 8ef890b0de22d9fd14572f4ac171a238ea4f3f20 Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Mon, 30 Nov 2015 16:14:26 -0500 Subject: [PATCH 315/457] Added sample contracts --- solidity.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/solidity.html.markdown b/solidity.html.markdown index 3e47f080..2b461a95 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -462,6 +462,10 @@ sha256("def"); - [Browser-based Solidity Editor](http://chriseth.github.io/browser-solidity/) - [Gitter Chat room](https://gitter.im/ethereum/go-ethereum) +## Sample contracts +- [Solidity Baby Step Contracts](https://github.com/fivedogit/solidity-baby-steps/tree/master/contracts) +- [Consensys Contracts](https://github.com/ConsenSys/dapp-store-contracts) + ## Information purposefully excluded - Libraries From add8f68f1acdceca1b9e09d6458627c515e73047 Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Mon, 30 Nov 2015 16:51:53 -0500 Subject: [PATCH 316/457] Add exposition around example bank --- solidity.html.markdown | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index 2b461a95..77648e51 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -13,6 +13,10 @@ As Solidity and Ethereum are under active development, experimental or beta feat ```javascript // Let's start with a simple Bank contract, before diving into to the key components of the language +// This bank has three main capabilities: +// - deposit +// - withdrawal +// - check balance // ** START EXAMPLE ** // Start with a Natspec comment (the three slashes) that can be used @@ -57,14 +61,6 @@ contract AcmeBank { } } - // It's good practice to have a remove function, which disables this - // contract - but does mean that users have to trust the owner - function remove() { - if(msg.sender == owner) { // Only let the contract creator do this - suicide(owner); // suicide makes this contract inactive, and returns funds to the owner - } - } - // The 'constant' prevents the function from editing state variables function balance() constant { return balances[msg.sender]; @@ -406,6 +402,14 @@ function remove() { // - crowdfunding? // - Peer to peer insurance // ] + // It's good practice to have a remove function, which disables this + // contract - but does mean that users have to trust the owner + // For a decentralized bank without a trusted part + function remove() { + if(msg.sender == owner) { // Only let the contract creator do this + suicide(owner); // suicide makes this contract inactive, and returns funds to the owner + } + } // *** END EXAMPLE *** From 541c278de4b253090b27a1ef126f5ed27e050f7c Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Mon, 30 Nov 2015 17:23:41 -0500 Subject: [PATCH 317/457] Minor updates --- solidity.html.markdown | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index 77648e51..298b01f3 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -30,10 +30,13 @@ contract AcmeBank { // these are persistent throughout the life of the contract // a dictionary that maps addresses to balances - mapping (address => uint) balances; + // the private means that other contracts can't see balances + // but the data is still available to all other parties on the + // blockchain + mapping (address => uint) private balances; // the 'public' makes 'owner' externally readable by users or contracts - // (but not writeable) - + // (but not writeable) address public owner; // Constructor, can receive one or many variables here @@ -125,9 +128,10 @@ var a = true; // by default, all values are set to 0 on instantiation -// Delete can be called on most types, and will set the values to 0 by assignment +// Delete can be called on most types +// (it does NOT destroy the value, but rather sets the value to 0 by assignment) uint x = 5; -delete(x); // x is now 0 +delete x; // x is now 0 // 2. DATA STRUCTURES @@ -151,8 +155,8 @@ function balances(address _account) returns (uint balance) { } // To delete -delete(balances["John"]); -delete(balances); // deletes all elements +delete balances["John"]; +delete balances; // deletes all elements // Unlike languages like Javascript, you cannot iterate through all elements in // a map, without knowing the source keys @@ -166,7 +170,7 @@ Bank b = Bank({ owner: msg.sender, balance: 5 }); -delete(b); // set all values to 0, except any mappings +delete b; // set all variables in struct to 0, except any mappings // Enums enum State { Created, Locked, Inactive }; @@ -226,6 +230,7 @@ function increment(uint x, uint y) returns (uint x, uint y) { uint (a,b) = increment(1,1); // The 'constant' indicates and ensures that a function does not/cannot change the persistent variables +// Constant function execute locally, not on the blockchain uint y; function increment(uint x) constant returns (uint x) { @@ -469,6 +474,7 @@ sha256("def"); ## Sample contracts - [Solidity Baby Step Contracts](https://github.com/fivedogit/solidity-baby-steps/tree/master/contracts) - [Consensys Contracts](https://github.com/ConsenSys/dapp-store-contracts) +- [State of Dapps](http://dapps.ethercasts.com/) ## Information purposefully excluded - Libraries From ccb05ba98a5b411029e8d7c1e7ea2cd7d87bced4 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 1 Dec 2015 20:37:23 +0700 Subject: [PATCH 318/457] 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 319/457] 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 320/457] 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 321/457] 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 b9cde57bc7efdfd9b9ba8e5fdbe9932c11562d0d Mon Sep 17 00:00:00 2001 From: Anton Pastukhoff Date: Thu, 3 Dec 2015 17:04:28 +0500 Subject: [PATCH 322/457] Update d-ru.html.markdown fixed typo --- ru-ru/d-ru.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ru-ru/d-ru.html.markdown b/ru-ru/d-ru.html.markdown index cbd5b127..ecd6c44c 100644 --- a/ru-ru/d-ru.html.markdown +++ b/ru-ru/d-ru.html.markdown @@ -17,7 +17,7 @@ D - это С++, сделанный правильно. комментарий */ /+ - // вложенные кометарии + // вложенные комментарии /* еще вложенные комментарии */ From 410cc03b09870be6da4931725120b44f93b3bcfc Mon Sep 17 00:00:00 2001 From: Robb Shecter Date: Thu, 3 Dec 2015 14:27:24 -0800 Subject: [PATCH 323/457] 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 324/457] 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 ad19e8803a4ebc21f16d3407cf64f368b0745597 Mon Sep 17 00:00:00 2001 From: Laoujin Date: Sat, 5 Dec 2015 15:18:15 +0100 Subject: [PATCH 325/457] [PowerShell/en]: didn't recognize code blocks --- powershell.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/powershell.html.markdown b/powershell.html.markdown index 4bc1ab39..8920d254 100644 --- a/powershell.html.markdown +++ b/powershell.html.markdown @@ -18,6 +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: + ``` Get-ExecutionPolicy -List Set-ExecutionPolicy AllSigned @@ -33,6 +34,7 @@ $PSVersionTable ``` Getting help: + ``` # Find commands Get-Command about_* # alias: gcm @@ -49,6 +51,7 @@ Update-Help # Run as admin ``` The tutorial starts here: + ``` # As you already figured, comments start with # @@ -292,6 +295,7 @@ $Shortcut.Save() Configuring your shell + ``` # $Profile is the full path for your `Microsoft.PowerShell_profile.ps1` # All code there will be executed when the PS session starts From 73fbc7f75512ac61493e4f82f0fc5108229124f3 Mon Sep 17 00:00:00 2001 From: Hinet60613 Date: Sun, 6 Dec 2015 00:00:07 +0800 Subject: [PATCH 326/457] Rename file by adding -tw suffix. --- zh-tw/python-tw.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zh-tw/python-tw.html.markdown b/zh-tw/python-tw.html.markdown index c4706c43..472b39ab 100644 --- a/zh-tw/python-tw.html.markdown +++ b/zh-tw/python-tw.html.markdown @@ -7,7 +7,7 @@ contributors: - ["evuez", "http://github.com/evuez"] translators: - ["Michael Yeh", "https://hinet60613.github.io/"] -filename: learnpython.py +filename: learnpython-tw.py lang: zh-tw --- From d75d8e133a5d7d2e23c7afc1ea16ec68db61cff7 Mon Sep 17 00:00:00 2001 From: Max Goldstein Date: Tue, 8 Dec 2015 15:06:37 -0500 Subject: [PATCH 327/457] 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! From 2f85645c9f988663c2f584fb23392d873fc3c8e9 Mon Sep 17 00:00:00 2001 From: Anton Davydov Date: Wed, 9 Dec 2015 00:03:06 +0300 Subject: [PATCH 328/457] [common-lisp/en] Fix code in examples --- common-lisp.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common-lisp.html.markdown b/common-lisp.html.markdown index 2b1f5de4..9a23bc26 100644 --- a/common-lisp.html.markdown +++ b/common-lisp.html.markdown @@ -339,7 +339,7 @@ nil ; for false - and the empty list ;; The () in the above is the list of arguments for the function (defun hello (name) - (format nil "Hello, ~a " name)) + (format nil "Hello, ~a" name)) (hello "Steve") ; => "Hello, Steve" @@ -430,7 +430,7 @@ nil ; for false - and the empty list (defun walker (n) (if (zerop n) :walked - (walker (1- n)))) + (walker (- n 1)))) (walker 5) ; => :walked From fb4f346686e49658d3d74f6656b20138649cfedd Mon Sep 17 00:00:00 2001 From: we-build-dreams Date: Thu, 10 Dec 2015 12:21:21 +0000 Subject: [PATCH 329/457] Update elm.html.markdown only typos --- elm.html.markdown | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/elm.html.markdown b/elm.html.markdown index 8c191509..f8564c4b 100644 --- a/elm.html.markdown +++ b/elm.html.markdown @@ -76,13 +76,13 @@ 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} +{ x = 3, y = 7 } -- Access a field with a dot and the field name. -{ x = 3, y = 7}.x -- 3 +{ x = 3, y = 7 }.x -- 3 -- Or with an accessor fuction, a dot and then the field name. -.y { x = 3, y = 7} -- 7 +.y { x = 3, y = 7 } -- 7 -- Update the fields of a record. (It must have the fields already.) { person | @@ -126,7 +126,7 @@ case List.head aList of multiply a b = a * b --- Apply (call) a function by passing it arguments (no commas necessay). +-- Apply (call) a function by passing it arguments (no commas necessary). multiply 7 6 -- 42 -- Partially apply a function by passing only some of its arguments. @@ -168,7 +168,7 @@ fib n = else fib (n - 1) + fib (n - 2) -List.map fib [0..8] -- [1, 1, 2, 3, 5, 8,13, 21, 34] +List.map fib [0..8] -- [1, 1, 2, 3, 5, 8, 13, 21, 34] listLength aList = case aList of From 38f2fb9a0bbd478bbbb4ccce0b33d1dcd34aa63a Mon Sep 17 00:00:00 2001 From: MichalMartinek Date: Thu, 10 Dec 2015 22:45:40 +0100 Subject: [PATCH 330/457] Update sass.html.markdown --- cs-cz/sass.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cs-cz/sass.html.markdown b/cs-cz/sass.html.markdown index e890debe..0d2fca64 100644 --- a/cs-cz/sass.html.markdown +++ b/cs-cz/sass.html.markdown @@ -1,12 +1,12 @@ --- language: sass -filename: learnsass.scss +filename: learnsass-cz.scss contributors: - ["Laura Kyle", "https://github.com/LauraNK"] - ["Sean Corrales", "https://github.com/droidenator"] translators: - ["Michal Martinek", "https://github.com/MichalMartinek"] - +lang: cs-cz --- Sass je rozšíření jazyka CSS, který přidává nové vlastnosti jako proměnné, zanořování, mixiny a další. From 8bc9ebe08d792f560939db1e39077c800d15497b Mon Sep 17 00:00:00 2001 From: Mario Martinez Date: Fri, 11 Dec 2015 11:01:23 -0600 Subject: [PATCH 331/457] Updated to sdkman instead of GVM for installing groovy --- groovy.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/groovy.html.markdown b/groovy.html.markdown index 8fb1b346..37e3b20c 100644 --- a/groovy.html.markdown +++ b/groovy.html.markdown @@ -13,8 +13,8 @@ Groovy - A dynamic language for the Java platform [Read more here.](http://groov /* Set yourself up: - 1) Install GVM - http://gvmtool.net/ - 2) Install Groovy: gvm install groovy + 1) Install SDKMAN - http://sdkman.io/ + 2) Install Groovy: sdk install groovy 3) Start the groovy console by typing: groovyConsole */ From 8d7085893535825ea6879e3f29ee0eb614a16f9b Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Fri, 11 Dec 2015 13:07:01 -0500 Subject: [PATCH 332/457] Few minor fixes --- solidity.html.markdown | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index 298b01f3..7f925918 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -5,9 +5,9 @@ contributors: - ["Nemil Dalal", "https://www.nemil.com"] --- -Solidity is a statically typed, contract programming language for [Ethereum](https://www.ethereum.org/) that has similarities to Javascript and C. Like an object in object-oriented languages, each contract contains state variables, functions, and common data types. Contract-specific features include modifier (guard) clauses, event notifiers, and custom variables. +Solidity lets you program on [Ethereum](https://www.ethereum.org/), a blockchain-based virtual machine that allows the creation and computation of smart contracts, without needing centralized or trusted parties. -Solidity lets you program on Ethereum, a blockchain-based virtual machine that allows the creation and computation of smart contracts, without needing centralized or trusted parties. +Solidity is a statically typed, contract programming language that has similarities to Javascript and C. Like an object in object-oriented languages, each contract contains state variables, functions, and common data types. Contract-specific features include modifier (guard) clauses, event notifiers, and custom variables. As Solidity and Ethereum are under active development, experimental or beta features are explicitly marked, and subject to change. Pull requests welcome. @@ -46,7 +46,7 @@ contract AcmeBank { owner = msg.sender; // msg.sender refers to the address of the contract creator } - function deposit(uint balance) public { + function deposit(uint balance) public returns (uint) { balances[msg.sender] += msg.value; // no need for "this." or "self." in front of the state variable return balances[msg.sender]; // msg.sender refers to the contract caller @@ -65,7 +65,7 @@ contract AcmeBank { } // The 'constant' prevents the function from editing state variables - function balance() constant { + function balance() constant returns (uint) { return balances[msg.sender]; } @@ -90,6 +90,7 @@ uint x; // int of 256 bits, cannot be changed after instantiation int constant a = 8; int256 constant a = 8; // same effect as line above, here the 256 is explicit +uint constant VERSION_ID = 0x123A1; // A hex constant // For both int and uint, you can explicitly set space in steps of 8 // e.g., int8, int16 @@ -285,12 +286,14 @@ Coin.Sent().watch({}, '', function(error, result) { // The '_' (underscore) must be included as the last line in the function body, and is an indicator that the // function being called should be placed there -modifier onlyBefore(uint _time) { if (now >= _time) throw; _ } +modifier onlyAfter(uint _time) { if (now <= _time) throw; _ } +modifier onlyOwner { if (msg.sender == owner) _ } // You can then append it right after the function declaration function changeOwner(newOwner) - onlyBefore(someTime) - { +onlyAfter(someTime) +onlyOwner() +{ owner = newOwner; } @@ -298,7 +301,7 @@ function changeOwner(newOwner) // 5. BRANCHING AND LOOPS // All basic logic blocks work - including if/else, for, while, break, continue, return -// switch is not provided +// Unlike other languages, the 'switch' statement is NOT provided // Syntax is the same as javascript, but there is no type conversion from // non-boolean to boolean, so comparison operators must be used to get the boolean value @@ -377,7 +380,7 @@ if (!addr.send(123)) { // Suicide suicide(SOME_ADDRESS); // suicide the current contract, sending funds to the address (often the creator) -// This is a common pattern that lets the owner end the contract +// This is a common contract pattern that lets the owner end the contract, and receive remaining funds function remove() { if(msg.sender == owner) { // Only let the contract creator do this suicide(owner); // suicide makes this contract inactive, and returns funds to the owner @@ -391,7 +394,6 @@ function remove() { // planning your data structures) - // *** EXAMPLE: Let's do a more complex example *** // ** START EXAMPLE ** @@ -472,6 +474,7 @@ sha256("def"); - [Gitter Chat room](https://gitter.im/ethereum/go-ethereum) ## Sample contracts +- [Dapp Bin](https://github.com/ethereum/dapp-bin) - [Solidity Baby Step Contracts](https://github.com/fivedogit/solidity-baby-steps/tree/master/contracts) - [Consensys Contracts](https://github.com/ConsenSys/dapp-store-contracts) - [State of Dapps](http://dapps.ethercasts.com/) From f854fe1111186a9b8ba36c8d6ed057461f376b35 Mon Sep 17 00:00:00 2001 From: Anton Pastukhoff Date: Sat, 12 Dec 2015 14:43:56 +0500 Subject: [PATCH 333/457] Update d-ru.html.markdown --- ru-ru/d-ru.html.markdown | 138 ++++++++++++++++++++++----------------- 1 file changed, 78 insertions(+), 60 deletions(-) diff --git a/ru-ru/d-ru.html.markdown b/ru-ru/d-ru.html.markdown index ecd6c44c..0a8726c9 100644 --- a/ru-ru/d-ru.html.markdown +++ b/ru-ru/d-ru.html.markdown @@ -1,16 +1,17 @@ ---- +/*--- language: d filename: learnd-ru.d contributors: - ["Anton Pastukhov", "http://dprogramming.ru/"] - ["Robert Brights-Gray", "http://lhs-blog.info/"] + - ["Andre Polykanine", "http://oire.me/"] lang: ru-ru --- D - современный компилируемый язык общего назначения с Си-подобным синтаксисом, который сочетает удобство, продуманный дизайн и высокую производительность. D - это С++, сделанный правильно. -```d +```d */ // Welcome to D! Это однострочный комментарий /* многострочный @@ -53,7 +54,7 @@ void main() int a; // объявление переменной типа int (32 бита) float b = 12.34; // тип с плавающей точкой -double с = 56.78; // тип с плавающей точкой (64 бита) +double c = 56.78; // тип с плавающей точкой (64 бита) /* Численные типы в D, за исключением типов с плавающей точкой и типов @@ -63,15 +64,17 @@ double с = 56.78; // тип с плавающей точкой (64 бита) uint d = 10; ulong e = 11; bool b = true; // логический тип char d = 'd'; // UTF-символ, 8 бит. D поддерживает UTF "из коробки" -wchar = 'é'; // символ UTF-16 +wchar e = 'é'; // символ UTF-16 dchar f; // и даже UTF-32, если он вам зачем-то понадобится string s = "для строк есть отдельный тип, это не просто массив char-ов из Си"; wstring ws = "поскольку у нас есть wchar, должен быть и wstring"; dstring ds = "...и dstring, конечно"; +string кириллица = "Имена переменных должны быть в Unicode, но не обязательно на латинице."; + typeof(a) b = 6; // typeof возвращает тип своего выражения. - // В результате, b имеет такой же тип как и a + // В результате, b имеет такой же тип, как и a // Тип переменной, помеченной ключевым словом auto, // присваивается компилятором исходя из значения этой переменной @@ -84,11 +87,11 @@ int[] arr2 = [1, 2, 3, 4]; // динамический массив int[string] aa = ["key1": 5, "key2": 6]; // ассоциативный массив /* - Cтроки и массивы в D — встроенные типы. Для их использования не нужно + Строки и массивы в D — встроенные типы. Для их использования не нужно подключать ни внешние, ни даже стандартную библиотеку, хотя в последней есть множество дополнительных инструментов для работы с ними. */ -immutalbe int ia = 10; // неизменяемый тип, +immutable int ia = 10; // неизменяемый тип, // обозначается ключевым словом immutable ia += 1; // — вызовет ошибку на этапе компиляции @@ -100,7 +103,7 @@ enum myConsts = { Const1, Const2, Const3 }; writeln("Имя типа : ", int.stringof); // int writeln("Размер в байтах : ", int.sizeof); // 4 writeln("Минимальное значение : ", int.min); // -2147483648 -writeln("Максимальное значениеe : ", int.max); // 2147483647 +writeln("Максимальное значение : ", int.max); // 2147483647 writeln("Начальное значение : ", int.init); // 0. Это значение, // присвоенное по умолчанию @@ -111,17 +114,13 @@ writeln("Начальное значение : ", int.init); // 0. Эт /*** Приведение типов ***/ -// Простейший вариант -int i; -double j = double(i) / 2; - // to!(имя типа)(выражение) - для большинства конверсий import std.conv : to; // функция "to" - часть стандартной библиотеки, а не языка double d = -1.75; short s = to!short(d); // s = -1 /* - cast - если вы знаете, что делаете. Кроме того, это единственный способ + cast - если вы знаете, что делаете. Кроме того, это единственный способ преобразования типов-указателей в "обычные" и наоборот */ void* v; @@ -129,7 +128,7 @@ int* p = cast(int*)v; // Для собственного удобства можно создавать псевдонимы // для различных встроенных объектов -alias int newInt; // теперь можно обращаться к int так, как будто бы это newInt +alias int newInt; // теперь можно обращаться к newInt так, как будто бы это int newInt a = 5; alias newInt = int; // так тоже допустимо @@ -203,6 +202,25 @@ switch (a) { break; } +// в D есть констукция "final switch". Она не может содержать секцию "defaul" +// и применяется, когда все перечисляемые в switch варианты должны быть +// обработаны явным образом + +int dieValue = 1; +final switch (dieValue) { + case 1: + writeln("You won"); + break; + + case 2, 3, 4, 5: + writeln("It's a draw"); + break; + + case 6: + writeln("I won"); + break; +} + // while while (a > 10) { // .. @@ -245,31 +263,33 @@ foreach (c; "hello") { foreach (number; 10..15) { writeln(number); // численные интервалы можно указывать явным образом + // этот цикл выведет значения с 10 по 15, но не 15, + // поскольку диапазон не включает в себя верхнюю границу } // foreach_reverse - в обратную сторону -auto container = [ 1, 2, 3 ]; +auto container = [1, 2, 3]; foreach_reverse (element; container) { writefln("%s ", element); // 3, 2, 1 } // foreach в массивах и им подобных структурах не меняет сами структуры -int[] a = [1,2,3,4,5]; +int[] a = [1, 2 ,3 ,4 ,5]; foreach (elem; array) { elem *= 2; // сам массив останется неизменным } -writeln(a); // вывод: [1,2,3,4,5] Т.е изменений нет +writeln(a); // вывод: [1, 2, 3, 4, 5] Т.е изменений нет // добавление ref приведет к тому, что массив будет изменяться foreach (ref elem; array) { - elem *= 2; // сам массив останется неизменным + elem *= 2; } -writeln(a); // [2,4,6,8,10] +writeln(a); // [2, 4, 6, 8, 10] -// foreach умеет расчитывать индексы элементов -int[] a = [1,2,3,4,5]; +// foreach умеет рассчитывать индексы элементов +int[] a = [1, 2, 3, 4, 5]; foreach (ind, elem; array) { writeln(ind, " ", elem); // через ind - доступен индекс элемента, // а через elem - сам элемент @@ -288,7 +308,7 @@ int test(int argument) { } -// В D используется унифицированныйй синтаксис вызова функций +// В D используется единый синтаксис вызова функций // (UFCS, Uniform Function Call Syntax), поэтому так тоже можно: int var = 42.test(); @@ -299,11 +319,11 @@ int var2 = 42.test; int var3 = 42.test.test; /* - Аргументы в функцию передаются по значению (т. е. функция работает не с + Аргументы в функцию передаются по значению (т.е. функция работает не с оригинальными значениями, переданными ей, а с их локальными копиями. Исключение составляют объекты классов, которые передаются по ссылке. Кроме того, любой параметр можно передать в функцию по ссылке с помощью - ключевого слова ref + ключевого слова "ref" */ int var = 10; @@ -318,7 +338,7 @@ void fn2(ref int arg) { fn1(var); // var все еще = 10 fn2(var); // теперь var = 11 -// Возвращаемое значение тоже может быть auto, +// Возвращаемое значение тоже может быть auto, // если его можно "угадать" из контекста auto add(int x, int y) { return x + y; @@ -373,13 +393,13 @@ printFloat(a); // использование таких функций - сам // без посредства глобальных переменных или массивов uint remMod(uint a, uint b, out uint modulus) { - uint remainder = a / b; + uint remainder = a / b; modulus = a % b; return remainder; } uint modulus; // пока в этой переменной ноль -uint rem = remMod(5,2,modulus); // наша "хитрая" функция, и теперь, +uint rem = remMod(5, 2, modulus); // наша "хитрая" функция, и теперь // в modulus - остаток от деления writeln(rem, " ", modulus); // вывод: 2 1 @@ -400,9 +420,9 @@ struct MyStruct { MyStruct str1; // Объявление переменной с типом MyStruct str1.a = 10; // Обращение к полю str1.b = 20; -auto result = str1.multiply(); -MyStruct str2 = {4, 8} // Объявление + инициальзация в стиле Си -auto str3 = MyStruct(5, 10); // Объявление + инициальзация в стиле D +auto result = str1.multiply(); +MyStruct str2 = {4, 8} // Объявление + инициализация в стиле Си +auto str3 = MyStruct(5, 10); // Объявление + инициализация в стиле D // области видимости полей и методов - 3 способа задания @@ -420,7 +440,7 @@ struct MyStruct2 { } /* в дополнение к знакомым public, private и protected, в D есть еще - область видимости "package". Поля и методы с этим атрибутам будут + область видимости "package". Поля и методы с этим атрибутом будут доступны изо всех модулей, включенных в "пакет" (package), но не за его пределами. package - это "папка", в которой может храниться несколько модулей. Например, в "import.std.stdio", "std" - это @@ -428,8 +448,8 @@ struct MyStruct2 { */ package: string d; - - /* помимо этого, имеется еще один модификатор - export, который позволяет + + /* помимо этого, имеется еще один модификатор - export, который позволяет использовать объявленный с ним идентификатор даже вне самой программы ! */ export: @@ -442,10 +462,10 @@ struct MyStruct3 { // в этом случае пустой конструктор добавляется компилятором writeln("Hello, world!"); } - - - // а вот это конструкция, одна из интересных идиом и представлет собой - // конструктор копирования, т.е конструктор возвращающий копию структуры. + + + // а вот это конструкция - одна из интересных идиом и представляет собой + // конструктор копирования, т.е конструктор, возвращающий копию структуры. // Работает только в структурах. this(this) { @@ -488,7 +508,7 @@ class Outer { int foo() { - return m; // можно обращаться к полям "родительского" класса + return m; // можно обращаться к полям "внешнего" класса } } } @@ -497,10 +517,10 @@ class Outer class Base { int a = 1; float b = 2.34; - - - // это статический метод, т.е метод который можно вызывать обращаясь - // классу напрямую, а не через создание экземпляра объекта + + + // это статический метод, т.е метод который можно вызывать, обращаясь + // к классу напрямую, а не через создание экземпляра объекта static void multiply(int x, int y) { writeln(x * y); @@ -511,13 +531,13 @@ Base.multiply(2, 5); // используем статический метод. class Derived : Base { string c = "Поле класса - наследника"; - - + + // override означает то, что наследник предоставит свою реализацию метода, // переопределив метод базового класса override static void multiply(int x, int y) { - super.multiply(x, y); // super - это ссылка на класс-предок или базовый класс + super.multiply(x, y); // super - это ссылка на класс-предок, или базовый класс writeln(x * y * 2); } } @@ -538,7 +558,7 @@ class Derived : FC { // это вызовет ошибку float b; } -// Абстрактный класс не можен быть истанциирован, но может иметь наследников +// Абстрактный класс не может быть истанциирован, но может иметь наследников abstract class AC { int a; } @@ -547,8 +567,8 @@ auto ac = new AC(); // это вызовет ошибку class Implementation : AC { float b; - - // final перед методом нефинального класса означает запрет возможности + + // final перед методом нефинального класса означает запрет возможности // переопределения метода final void test() { @@ -560,7 +580,7 @@ auto impl = new Implementation(); // ОК -/*** Микшины (mixins) ***/ +/*** Примеси (mixins) ***/ // В D можно вставлять код как строку, если эта строка известна на этапе // компиляции. Например: @@ -583,8 +603,8 @@ void main() { /*** Шаблоны ***/ /* - Шаблон функции. Эта функция принимает аргументы разеых типов, которые - подсталяются вместо T на этапе компиляции. "T" - это не специальный + Шаблон функции. Эта функция принимает аргументы разных типов, которые + подставляются вместо T на этапе компиляции. "T" - это не специальный символ, а просто буква. Вместо "T" может быть любое слово, кроме ключевого. */ void print(T)(T value) { @@ -633,8 +653,8 @@ class Stack(T) void main() { /* - восклицательный знак - признак шаблона В данном случае мы создаем - класс и указывем, что "шаблонное" поле будет иметь тип string + восклицательный знак - признак шаблона. В данном случае мы создаем + класс и указываем, что "шаблонное" поле будет иметь тип string */ auto stack = new Stack!string; @@ -660,9 +680,7 @@ void main() { несколько единообразных функций, определяющих, _как_ мы получаем доступ к элементам контейнера, вместо того, чтобы описывать внутреннее устройство этого контейнера. Сложно? На самом деле не очень. -*/ -/* Простейший вид диапазона - Input Range. Для того, чтобы превратить любой контейнер в Input Range, достаточно реализовать для него 3 метода: - empty - проверяет, пуст ли контейнер @@ -706,8 +724,8 @@ struct StudentRange void main(){ auto school = School([ - Student("Mike", 1), - Student("John", 2) , + Student("Mike", 1), + Student("John", 2) , Student("Dan", 3) ]); auto range = StudentRange(school); @@ -730,6 +748,6 @@ void main(){ ``` ## Что дальше? -[Официальный сайт](http://dlang.org/) -[Онлайн-книга](http://ddili.org/ders/d.en/) -[Официальная вики](http://wiki.dlang.org/) +- [Официальный сайт](http://dlang.org/) +- [Онлайн-книга](http://ddili.org/ders/d.en/) +- [Официальная вики](http://wiki.dlang.org/) From 5e6a0269b32bccca6872075dfd2b6be031236874 Mon Sep 17 00:00:00 2001 From: Anton Pastukhoff Date: Sat, 12 Dec 2015 14:44:12 +0500 Subject: [PATCH 334/457] Update d-ru.html.markdown --- ru-ru/d-ru.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ru-ru/d-ru.html.markdown b/ru-ru/d-ru.html.markdown index 0a8726c9..645eceeb 100644 --- a/ru-ru/d-ru.html.markdown +++ b/ru-ru/d-ru.html.markdown @@ -1,4 +1,4 @@ -/*--- +--- language: d filename: learnd-ru.d contributors: @@ -11,7 +11,7 @@ D - современный компилируемый язык общего на который сочетает удобство, продуманный дизайн и высокую производительность. D - это С++, сделанный правильно. -```d */ +```d // Welcome to D! Это однострочный комментарий /* многострочный From 3663b10bfab490e65f22a345e98d352ef93876e8 Mon Sep 17 00:00:00 2001 From: Anton Pastukhoff Date: Sat, 12 Dec 2015 14:46:10 +0500 Subject: [PATCH 335/457] Update d-ru.html.markdown --- ru-ru/d-ru.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ru-ru/d-ru.html.markdown b/ru-ru/d-ru.html.markdown index 645eceeb..fad5c69b 100644 --- a/ru-ru/d-ru.html.markdown +++ b/ru-ru/d-ru.html.markdown @@ -263,7 +263,7 @@ foreach (c; "hello") { foreach (number; 10..15) { writeln(number); // численные интервалы можно указывать явным образом - // этот цикл выведет значения с 10 по 15, но не 15, + // этот цикл выведет значения с 10 по 14, но не 15, // поскольку диапазон не включает в себя верхнюю границу } From 7b8929f0cc477fe5db4e189c4ce3d6a7fdbdc3fd Mon Sep 17 00:00:00 2001 From: Anton Pastukhoff Date: Sat, 12 Dec 2015 14:47:02 +0500 Subject: [PATCH 336/457] Update d-ru.html.markdown --- ru-ru/d-ru.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ru-ru/d-ru.html.markdown b/ru-ru/d-ru.html.markdown index fad5c69b..8f4233fd 100644 --- a/ru-ru/d-ru.html.markdown +++ b/ru-ru/d-ru.html.markdown @@ -713,7 +713,7 @@ struct StudentRange return students.length == 0; } - ref Student front() { + Student front() { return students[0]; } From fd26c8ddfb6d4bfa969b323a2e98ce1b74bc8127 Mon Sep 17 00:00:00 2001 From: John Rocamora Date: Sat, 12 Dec 2015 17:51:23 -0500 Subject: [PATCH 337/457] Added missing semicolon --- c++.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c++.html.markdown b/c++.html.markdown index 6b452b1b..f4aa2f5a 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -149,7 +149,7 @@ namespace First { namespace Second { void foo() { - printf("This is Second::foo\n") + printf("This is Second::foo\n"); } } From 4aca8f16dfec1a9341648b0ff1724ada01cdc2b0 Mon Sep 17 00:00:00 2001 From: Max Goldstein Date: Sun, 13 Dec 2015 13:29:50 -0500 Subject: [PATCH 338/457] [elm/en] Minor copyediting --- elm.html.markdown | 68 +++++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/elm.html.markdown b/elm.html.markdown index 8c191509..67a0006d 100644 --- a/elm.html.markdown +++ b/elm.html.markdown @@ -38,11 +38,10 @@ not False -- True 1 < 10 -- True -- Strings and characters -"This is a string." -'a' -- character -'You cant use single quotes for strings.' -- error! +"This is a string because it uses double quotes." +'a' -- characters in single quotes --- Strings can be appended +-- Strings can be appended. "Hello " ++ "world!" -- "Hello world!" {-- Lists, Tuples, and Records --} @@ -53,10 +52,10 @@ not False -- True -- The second example can also be written with two dots. [1..5] --- Append lists just like strings +-- Append lists just like strings. [1..5] ++ [6..10] == [1..10] -- True --- To add one item, use "cons" +-- 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 @@ -64,6 +63,7 @@ not False -- True List.head [1..5] -- Just 1 List.tail [1..5] -- Just [2, 3, 4, 5] List.head [] -- Nothing +-- List.functionName means the function lives in the List module. -- Every element in a tuple can be a different type, but a tuple has a -- fixed length. @@ -74,23 +74,24 @@ List.head [] -- Nothing 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. +-- Records are like tuples but the fields have names. The order of fields +-- doesn't matter. Notice that record values use equals signs, not colons. { 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. +-- Or with an accessor fuction, which is a dot and the field name on its own. .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 } +-- Update multiple fields at once, using the current values. +{ particle | + position = particle.position + particle.velocity, + velocity = particle.velocity + particle.acceleration } {-- Control Flow --} @@ -111,11 +112,15 @@ else -- Use case statements to pattern match on different possibilities. case aList of [] -> "matches the empty list" + [x]-> "matches a list of exactly one item, " ++ toString x x::xs -> "matches a list of at least one item whose head is " ++ toString x +-- Pattern matches go in order. If we put [x] last, it would never match because +-- x::xs also matches (xs would be the empty list). Matches do not "fall through". +-- Pattern match on a Maybe. case List.head aList of Just x -> "The head is " ++ toString x - Nothing -> "The list was empty" + Nothing -> "The list was empty." {-- Functions --} @@ -151,8 +156,8 @@ area (width, height) = area (6, 7) -- 42 --- Use curly brackets to pattern match record field names --- Use let to define intermediate values +-- Use curly brackets to pattern match record field names. +-- Use let to define intermediate values. volume {width, height, depth} = let area = width * height @@ -161,7 +166,7 @@ volume {width, height, depth} = volume { width = 3, height = 2, depth = 7 } -- 42 --- Functions can be recursive +-- Functions can be recursive. fib n = if n < 2 then 1 @@ -170,12 +175,13 @@ fib n = List.map fib [0..8] -- [1, 1, 2, 3, 5, 8,13, 21, 34] +-- Another recursive function (use List.length in real code). listLength aList = case aList of [] -> 0 x::xs -> 1 + listLength xs --- Function application happens before any infix operation +-- Function calls happen before any infix operator. Parens indicate precedence. 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. @@ -191,7 +197,7 @@ cos (degrees 30) ^ 2 + sin (degrees 30) ^ 2 -- 1 True : Bool -- Functions have types too. Read -> as "goes to". Think of the rightmost type --- as the type of the return value. +-- as the type of the return value, and the others as arguments. not : Bool -> Bool round : Float -> Int @@ -226,7 +232,7 @@ type alias Point3D = { x : Float, y : Float, z : Float } otherOrigin : Point3D otherOrigin = Point3D 0 0 0 --- But it's still the same type, you can equate them +-- But it's still the same type, so you can equate them. origin == otherOrigin -- True -- By contrast, defining a union type creates a type that didn't exist before. @@ -236,14 +242,15 @@ 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) +-- "The type tree of a is a leaf, or a node of a, tree of a, and tree of a." -- You can pattern match union tags. The uppercase tags must be matched exactly. -- The lowercase variables will match anything. Underscore also matches @@ -260,21 +267,20 @@ leftmostElement tree = {-- 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. +-- The core libraries are organized into modules, as are any third-party +-- libraries you may use. For large projects, you can define your own modules. -- 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 +-- By default, everything is exported. You can specify exports explicity. +module Name (MyType, myValue) 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 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 @@ -318,6 +324,8 @@ $ elm repl -- Install a new package, and record it in elm-package.json. $ elm package install evancz/elm-html +-- See what changed between versions of a package. +$ elm package diff evancz/elm-html 3.0.0 4.0.2 -- Elm's package manager enforces semantic versioning, so minor version bumps -- will never break your build! ``` @@ -335,12 +343,14 @@ Here are some useful resources. * 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) + * [Maybe](http://package.elm-lang.org/packages/elm-lang/core/latest/Maybe) and its cousin [Result](http://package.elm-lang.org/packages/elm-lang/core/latest/Result), commonly used for missing values or error handling + * Data structures like [List](http://package.elm-lang.org/packages/elm-lang/core/latest/List), [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 Architecture](https://github.com/evancz/elm-architecture-tutorial#the-elm-architecture). An essay by Elm's creator 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. +* [Scope in Elm](https://github.com/elm-guides/elm-for-js/blob/master/Scope.md#scope-in-elm) and [How to Read a Type Annotation](https://github.com/elm-guides/elm-for-js/blob/master/How%20to%20Read%20a%20Type%20Annotation.md#how-to-read-a-type-annotation). More community guides on the basics of Elm, written for JavaScript developers. Go out and write some Elm! From 0b8a0526249264c7ac34069adf3159f2b72771a8 Mon Sep 17 00:00:00 2001 From: Dan Book Date: Sun, 13 Dec 2015 18:03:47 -0500 Subject: [PATCH 339/457] Add info on references, modules, and objects These topics are central to modern usage of Perl. --- perl.html.markdown | 132 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 125 insertions(+), 7 deletions(-) diff --git a/perl.html.markdown b/perl.html.markdown index 1b86f410..85f3974e 100644 --- a/perl.html.markdown +++ b/perl.html.markdown @@ -5,6 +5,7 @@ language: perl filename: learnperl.pl contributors: - ["Korjavin Ivan", "http://github.com/korjavin"] + - ["Dan Book", "http://github.com/Grinnz"] --- Perl 5 is a highly capable, feature-rich programming language with over 25 years of development. @@ -14,7 +15,6 @@ Perl 5 runs on over 100 platforms from portables to mainframes and is suitable f ```perl # Single line comments start with a number sign. - #### Perl variable types # Variables begin with a sigil, which is a symbol showing the type. @@ -37,7 +37,9 @@ my @animals = ("camel", "llama", "owl"); my @numbers = (23, 42, 69); my @mixed = ("camel", 42, 1.23); - +# Array elements are accessed using square brackets, with a $ to indicate +# one value will be returned. +my $second = $animals[1]; ## Hashes # A hash represents a set of key/value pairs: @@ -50,11 +52,39 @@ my %fruit_color = ( apple => "red", banana => "yellow", ); + +# Hash elements are accessed using curly braces, again with the $ sigil. +my $color = $fruit_color{apple}; + # Scalars, arrays and hashes are documented more fully in perldata. # (perldoc perldata). -# More complex data types can be constructed using references, which allow you -# to build lists and hashes within lists and hashes. +#### References + +# More complex data types can be constructed using references, which allow +# you to build arrays and hashes within arrays and hashes. + +my $array_ref = \@array; +my $hash_ref = \%hash; +my @array_of_arrays = (\@array1, \@array2, \@array3); + +# You can also create anonymous arrays or hashes, returning a reference: + +my $fruits = ["apple", "banana"]; +my $colors = {apple => "red", banana => "yellow"}; + +# References can be dereferenced by prefixing the appropriate sigil. + +my @fruits_array = @$fruits; +my %colors_hash = %$colors; + +# As a shortcut, the arrow operator can be used to dereference and access a +# single value. + +my $first = $array_ref->[0]; +my $value = $hash_ref->{banana}; + +# See perlreftut and perlref for more in-depth documentation on references. #### Conditional and looping constructs @@ -105,6 +135,9 @@ for (@elements) { # the Perlish post-condition way again print for @elements; +# iterating through the keys and values of a referenced hash +print $hash_ref->{$_} for keys %$hash_ref; + #### Regular expressions # Perl's regular expression support is both broad and deep, and is the subject @@ -151,11 +184,96 @@ sub logger { # Now we can use the subroutine just as any other built-in function: logger("We have a logger subroutine!"); + +#### Modules + +# A module is a set of Perl code, usually subroutines, which can be used in +# other Perl code. It is usually stored in a file with the extension .pm so +# that Perl can find it. + +package MyModule; + +sub trim { + my $string = shift; + $string =~ s/^\s+//; + $string =~ s/\s+$//; + return $string; +} + +1; + +# From elsewhere: + +use MyModule; +MyModule::trim($string); + +# The Exporter module can help with making subroutines exportable, so they +# can be used like this: + +use MyModule 'trim'; +trim($string); + +# Many Perl modules can be downloaded from CPAN (http://www.cpan.org/) and +# provide a range of features to help you avoid reinventing the wheel. A +# number of popular modules like Exporter are included with the Perl +# distribution itself. See perlmod for more details on modules in Perl. + +#### Objects + +# Objects in Perl are just references that know which class (package) they +# belong to, so that methods (subroutines) called on it can be found there. +# The bless function is used in constructors (usually new) to set this up. +# However, you never need to call it yourself if you use a module like Moose +# or Moo (see below). + +package MyCounter; + +sub new { + my $class = shift; + my $self = {count => 0}; + return bless $self, $class; +} + +sub count { + my $self = shift; + return $self->{count}; +} + +sub increment { + my $self = shift; + $self->{count}++; +} + +1; + +# Methods can be called on a class or object instance with the arrow operator. + +my $counter = MyCounter->new; +print $counter->count, "\n"; # 0 +$counter->increment; +print $counter->count, "\n"; # 1 + +# The modules Moose and Moo from CPAN can help you set up your object classes. +# They provide a constructor and simple syntax for declaring attributes. This +# class can be used equivalently to the one above. + +package MyCounter; +use Moo; + +has 'count' => (is => 'rwp', default => 0, init_arg => undef); + +sub increment { + my $self = shift; + $self->_set_count($self->count + 1); +} + +1; + +# Object-oriented programming is covered more thoroughly in perlootut, and its +# low-level implementation in Perl is covered in perlobj. ``` -#### Using Perl modules - -Perl modules provide a range of features to help you avoid reinventing the wheel, and can be downloaded from CPAN (http://www.cpan.org/). A number of popular modules are included with the Perl distribution itself. +#### FAQ perlfaq contains questions and answers related to many common tasks, and often provides suggestions for good CPAN modules to use. From 35b3c490ce06fb94b8b51bd7f5ceb1638401fb1a Mon Sep 17 00:00:00 2001 From: Dan Book Date: Sun, 13 Dec 2015 19:22:29 -0500 Subject: [PATCH 340/457] Add blurb about strict and warnings --- perl.html.markdown | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/perl.html.markdown b/perl.html.markdown index 85f3974e..ab71a6ab 100644 --- a/perl.html.markdown +++ b/perl.html.markdown @@ -15,6 +15,16 @@ Perl 5 runs on over 100 platforms from portables to mainframes and is suitable f ```perl # Single line comments start with a number sign. +#### Strict and warnings + +use strict; +use warnings; + +# All perl scripts and modules should include these lines. Strict causes +# compilation to fail in cases like misspelled variable names, and warnings +# will print warning messages in case of common pitfalls like concatenating +# to an undefined value. + #### Perl variable types # Variables begin with a sigil, which is a symbol showing the type. From 88af462c699b9f48310a9624bb6bbe94b7101af1 Mon Sep 17 00:00:00 2001 From: Dan Book Date: Sun, 13 Dec 2015 19:39:37 -0500 Subject: [PATCH 341/457] use strict and warnings in example modules --- perl.html.markdown | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/perl.html.markdown b/perl.html.markdown index ab71a6ab..d919e00e 100644 --- a/perl.html.markdown +++ b/perl.html.markdown @@ -202,6 +202,8 @@ logger("We have a logger subroutine!"); # that Perl can find it. package MyModule; +use strict; +use warnings; sub trim { my $string = shift; @@ -237,6 +239,8 @@ trim($string); # or Moo (see below). package MyCounter; +use strict; +use warnings; sub new { my $class = shift; @@ -268,7 +272,7 @@ print $counter->count, "\n"; # 1 # class can be used equivalently to the one above. package MyCounter; -use Moo; +use Moo; # imports strict and warnings has 'count' => (is => 'rwp', default => 0, init_arg => undef); From 16d879d712878e2d1aa262dc1218b6543aec99c9 Mon Sep 17 00:00:00 2001 From: Dan Book Date: Sun, 13 Dec 2015 19:51:57 -0500 Subject: [PATCH 342/457] add missing use line --- perl.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/perl.html.markdown b/perl.html.markdown index d919e00e..61e8cd0e 100644 --- a/perl.html.markdown +++ b/perl.html.markdown @@ -262,6 +262,7 @@ sub increment { # Methods can be called on a class or object instance with the arrow operator. +use MyCounter; my $counter = MyCounter->new; print $counter->count, "\n"; # 0 $counter->increment; From 16cc4d464e135560c5d9f1495b6d9cd871e7182d Mon Sep 17 00:00:00 2001 From: Mark Green Date: Wed, 16 Dec 2015 16:47:32 +0000 Subject: [PATCH 343/457] Add a Factor tutorial --- factor.html | 182 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 factor.html diff --git a/factor.html b/factor.html new file mode 100644 index 00000000..a0726420 --- /dev/null +++ b/factor.html @@ -0,0 +1,182 @@ +--- +language: factor +contributors: + - ["hyphz", "http://github.com/hyphz/"] +filename: learnfactor.factor +--- + +Factor is a modern stack-based language, based on Forth, created by Slava Pestov. + +Code in this file can be typed into Factor, but not directly imported because the vocabulary and import header would make the beginning thoroughly confusing. + +``` +! This is a comment + +! Like Forth, all programming is done by manipulating the stack. +! Stating a literal value pushes it onto the stack. +5 2 3 56 76 23 65 ! No output, but stack is printed out in interactive mode + +! Those numbers get added to the stack, from left to right. +! .s prints out the stack non-destructively. +.s ! 5 2 3 56 76 23 65 + +! Arithmetic works by manipulating data on the stack. +5 4 + ! No output + +! `.` pops the top result from the stack and prints it. +. ! 9 + +! More examples of arithmetic: +6 7 * . ! 42 +1360 23 - . ! 1337 +12 12 / . ! 1 +13 2 mod . ! 1 + +99 neg . ! -99 +-99 abs . ! 99 +52 23 max . ! 52 +52 23 min . ! 23 + +! A number of words are provided to manipulate the stack, collectively known as shuffle words. + +3 dup - ! duplicate the top item (1st now equals 2nd): 3 - 3 +2 5 swap / ! swap the top with the second element: 5 / 2 +4 0 drop 2 / ! remove the top item (dont print to screen): 4 / 2 +1 2 3 nip .s ! remove the second item (similar to drop): 1 3 +1 2 clear .s ! wipe out the entire stack +1 2 3 4 over .s ! duplicate the second item to the top: 1 2 3 4 3 +1 2 3 4 2 pick .s ! duplicate the third item to the top: 1 2 3 4 2 3 + +! Creating Words +! The `:` word sets Factor into compile mode until it sees the `;` word. +: square ( n -- n ) dup * ; ! No output +5 square . ! 25 + +! We can view what a word does too. +! \ suppresses evaluation of a word and pushes its identifier on the stack instead. +\ square see ! : square ( n -- n ) dup * ; + +! After the name of the word to create, the declaration between brackets gives the stack effect. +! We can use whatever names we like inside the declaration: +: weirdsquare ( camel -- llama ) dup * ; + +! Provided their count matches the word's stack effect: +: doubledup ( a -- b ) dup dup ; ! Error: Stack effect declaration is wrong +: doubledup ( a -- a a a ) dup dup ; ! Ok +: weirddoubledup ( i -- am a fish ) dup dup ; ! Also Ok + +! Where Factor differs from Forth is in the use of quotations. +! A quotation is a block of code that is pushed on the stack as a value. +! [ starts quotation mode; ] ends it. +[ 2 + ] ! Quotation that adds 2 is left on the stack +4 swap call . ! 6 + +! And thus, higher order words. TONS of higher order words. +2 3 [ 2 + ] dip .s ! Pop top stack value, run quotation, push it back: 4 3 +3 4 [ + ] keep .s ! Copy top stack value, run quotation, push the copy: 7 4 +1 [ 2 + ] [ 3 + ] bi .s ! Run each quotation on the top value, push both results: 3 4 +4 3 1 [ + ] [ + ] bi .s ! Quotations in a bi can pull values from deeper on the stack: 4 5 ( 1+3 1+4 ) +1 2 [ 2 + ] bi@ .s ! Run the quotation on first and second values +2 [ + ] curry ! Inject the given value at the start of the quotation: [ 2 + ] is left on the stack + +! Conditionals +! Any value is true except the built-in value f. +! A built-in value t does exist, but its use isn't essential. +! Conditionals are higher order words as with the combinators above. + +5 [ "Five is true" . ] when ! Five is true +0 [ "Zero is true" . ] when ! Zero is true +f [ "F is true" . ] when ! No output +f [ "F is false" . ] unless ! F is false +2 [ "Two is true" . ] [ "Two is false" . ] if ! Two is true + +! By default the conditionals consume the value under test, but starred variants +! leave it alone if it's true: + +5 [ . ] when* ! 5 +f [ . ] when* ! No output, empty stack, f is consumed because it's false + + +! Loops +! You've guessed it.. these are higher order words too. + +5 [ . ] each-integer ! 0 1 2 3 4 +4 3 2 1 0 5 [ + . ] each-integer ! 0 2 4 6 8 +5 [ "Hello" . ] times ! Hello Hello Hello Hello Hello + +! Here's a list: +{ 2 4 6 8 } ! Goes on the stack as one item + +! Loop through the list: +{ 2 4 6 8 } [ 1 + . ] each ! Prints 3 5 7 9 +{ 2 4 6 8 } [ 1 + ] map ! Leaves { 3 5 7 9 } on stack + +! Loop reducing or building lists: +{ 1 2 3 4 5 } [ 2 mod 0 = ] filter ! Keeps only list members for which quotation yields true: { 2 4 } +{ 2 4 6 8 } 0 [ + ] reduce . ! Like "fold" in functional languages: prints 20 (0+2+4+6+8) +{ 2 4 6 8 } 0 [ + ] accumulate . . ! Like reduce but keeps the intermediate values in a list: prints { 0 2 6 12 } then 20 +1 5 [ 2 * dup ] replicate . ! Loops the quotation 5 times and collects the results in a list: { 2 4 8 16 32 } +1 [ dup 100 < ] [ 2 * dup ] produce ! Loops the second quotation until the first returns false and collects the results: { 2 4 8 16 32 64 128 } + +! If all else fails, a general purpose while loop: +1 [ dup 10 < ] [ "Hello" . 1 + ] while ! Prints "Hello" 10 times + ! Yes, it's hard to read + ! That's what all those variant loops are for + +! Variables +! Usually Factor programs are expected to keep all data on the stack. +! Using named variables makes refactoring harder (and it's called Factor for a reason) +! Global variables, if you must: + +SYMBOL: name ! Creates name as an identifying word +"Bob" name set-global ! No output +name get-global . ! "Bob" + +! Named local variables are considered an extension but are available +! In a quotation.. +[| m n ! Quotation captures top two stack values into m and n + | m n + ] ! Read them + +! Or in a word.. +:: lword ( -- ) ! Note double colon to invoke lexical variable extension + 2 :> c ! Declares immutable variable c to hold 2 + c . ; ! Print it out + +! In a word declared this way, the input side of the stack declaration +! becomes meaningful and gives the variable names stack values are captured into +:: double ( a -- result ) a 2 * ; + +! Variables are declared mutable by ending their name with a shriek +:: mword2 ( a! -- x y ) ! Capture top of stack in mutable variable a + a ! Push a + a 2 * a! ! Multiply a by 2 and store result back in a + a ; ! Push new value of a +5 mword2 ! Stack: 5 10 + +! Lists and Sequences +! We saw above how to push a list onto the stack + +0 { 1 2 3 4 } nth ! Access a particular member of a list: 1 +10 { 1 2 3 4 } nth ! Error: sequence index out of bounds +1 { 1 2 3 4 } ?nth ! Same as nth if index is in bounds: 2 +10 { 1 2 3 4 } ?nth ! No error if out of bounds: f + +{ "at" "the" "beginning" } "Append" prefix ! { "Append" "at" "the" "beginning" } +{ "Append" "at" "the" } "end" suffix ! { "Append" "at" "the" "end" } +"in" 1 { "Insert" "the" "middle" } insert-nth ! { "Insert" "in" "the" "middle" } +"Concat" "enate" append ! "Concatenate" - strings are sequences too +"Concatenate" "Reverse " prepend ! "Reverse Concatenate" +{ "Concatenate " "seq " "of " "seqs" } concat ! "Concatenate seq of seqs" +{ "Connect" "subseqs" "with" "separators" } " " join ! "Connect subseqs with separators" + +! And if you want to get meta, quotations are sequences and can be dismantled.. +0 [ 2 + ] nth ! 2 +1 [ 2 + ] nth ! + +[ 2 + ] \ - suffix ! Quotation [ 2 + - ] + + +``` + +##Ready For More? + +* [Factor Documentation](http://docs.factorcode.org/content/article-help.home.html) From b19714080a8ac76c027851e9b4c80372def81f7b Mon Sep 17 00:00:00 2001 From: Hinet60613 Date: Thu, 17 Dec 2015 01:48:19 +0800 Subject: [PATCH 344/457] Fix some typo and non-fluency. --- zh-tw/python-tw.html.markdown | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/zh-tw/python-tw.html.markdown b/zh-tw/python-tw.html.markdown index 472b39ab..f8602769 100644 --- a/zh-tw/python-tw.html.markdown +++ b/zh-tw/python-tw.html.markdown @@ -69,11 +69,11 @@ from __future__ import division # 指數 (x的y次方) 2**4 # => 16 -# 括號即先乘除後加減 +# 用括號改變運算順序 (1 + 3) * 2 # => 8 # 布林運算 -# 注意 "and" 和 "or" 的大小寫 +# 注意 "and" 和 "or" 要用小寫 True and False #=> False False or True #=> True @@ -178,7 +178,7 @@ some_var = 5 # 方便好用 lower_case_with_underscores some_var # => 5 -# 存取沒有被賦值的變數會造成例外 +# 對沒有被賦值的變數取值會造成例外 # 請參考錯誤流程部分做例外處理 some_other_var # 造成 NameError @@ -191,15 +191,15 @@ li = [] # 你可以預先填好串列內容 other_li = [4, 5, 6] -# 用append()在串列後新增東西 append +# 用append()在串列後新增東西 li.append(1) # 此時 li 內容為 [1] li.append(2) # 此時 li 內容為 [1, 2] li.append(4) # 此時 li 內容為 [1, 2, 4] li.append(3) # 此時 li 內容為 [1, 2, 4, 3] # 用pop()移除串列尾端的元素 -li.pop() # => 3 and li is now [1, 2, 4] +li.pop() # => 3 ,此時 li 內容為 [1, 2, 4] # 然後再塞回去 -li.append(3) # li is now [1, 2, 4, 3] again. +li.append(3) # 此時 li 內容再次為 [1, 2, 4, 3] # 你可以像存取陣列一樣的存取串列 li[0] # => 1 @@ -272,7 +272,7 @@ d, e, f = 4, 5, 6 # 也可以不寫括號 # 如果不加括號,預設會產生tuple g = 4, 5, 6 # => (4, 5, 6) # 你看,交換兩個值很簡單吧 -e, d = d, e # d is now 5 and e is now 4 +e, d = d, e # 此時 d 的值為 5 且 e 的值為 4 # 字典(Dictionary)用來儲存映射關係 @@ -289,7 +289,7 @@ filled_dict.keys() # => ["three", "two", "one"] # 你的執行結果可能與上面不同 # 譯註: 只能保證所有的key都有出現,但不保證順序 -# 用 "valuess()" 將所有的Value輸出到一個List中 +# 用 "values()" 將所有的Value輸出到一個List中 filled_dict.values() # => [3, 2, 1] # 註: 同上,不保證順序 @@ -457,16 +457,14 @@ add(5, 6) # => 輸出 "x is 5 and y is 6" 並回傳 11 add(y=6, x=5) # 這種狀況下,兩個參數的順序並不影響執行 -# 你可以定義接受多個變數的函式,這些變數是按照順序排序的 -# 如果不加*的話會被解讀為tuple +# 你可以定義接受多個變數的函式,用*來表示參數tuple def varargs(*args): return args varargs(1, 2, 3) # => (1, 2, 3) -# 你可以定義接受多個變數的函式,這些變數是按照keyword排序的 -# 如果不加**的話會被解讀為dictionary +# 你可以定義接受多個變數的函式,用**來表示參數dictionary def keyword_args(**kwargs): return kwargs @@ -555,6 +553,7 @@ class Human(object): # 注意前後的雙底線代表物件 # 還有被python用,但實際上是在使用者控制的命名 # 空間內的參數。你不應該自己宣告這樣的名稱。 + # 注意前後的雙底線代表此物件或屬性雖然在使用者控制的命名空間內,但是被python使用 def __init__(self, name): # 將函式引入的參數 name 指定給實體的 name 參數 self.name = name From 4b4024b49581d0f80aa3ce815b726bac1af99ef7 Mon Sep 17 00:00:00 2001 From: Hinet60613 Date: Thu, 17 Dec 2015 01:51:19 +0800 Subject: [PATCH 345/457] Fix typo --- zh-tw/python-tw.html.markdown | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/zh-tw/python-tw.html.markdown b/zh-tw/python-tw.html.markdown index f8602769..553181d8 100644 --- a/zh-tw/python-tw.html.markdown +++ b/zh-tw/python-tw.html.markdown @@ -550,10 +550,8 @@ class Human(object): species = "H. sapiens" # 基礎建構函式,當class被實體化的時候會被呼叫 - # 注意前後的雙底線代表物件 - # 還有被python用,但實際上是在使用者控制的命名 - # 空間內的參數。你不應該自己宣告這樣的名稱。 - # 注意前後的雙底線代表此物件或屬性雖然在使用者控制的命名空間內,但是被python使用 + # 注意前後的雙底線 + # 代表此物件或屬性雖然在使用者控制的命名空間內,但是被python使用 def __init__(self, name): # 將函式引入的參數 name 指定給實體的 name 參數 self.name = name From 299d064ecf7598144e49ef336e0abd00ccc4ae16 Mon Sep 17 00:00:00 2001 From: sarthfrey Date: Wed, 16 Dec 2015 16:41:07 -0500 Subject: [PATCH 346/457] Added Python Resources --- python.html.markdown | 1 + python3.html.markdown | 1 + 2 files changed, 2 insertions(+) diff --git a/python.html.markdown b/python.html.markdown index d8f18e9b..1d6c0a19 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -726,6 +726,7 @@ print say(say_please=True) # Can you buy me a beer? Please! I am poor :( * [Python Module of the Week](http://pymotw.com/2/) * [A Crash Course in Python for Scientists](http://nbviewer.ipython.org/5920182) * [First Steps With Python](https://realpython.com/learn/python-first-steps/) +* [LearnPython](http://www.learnpython.org/) ### Dead Tree diff --git a/python3.html.markdown b/python3.html.markdown index 8cc03320..f8c22047 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -780,6 +780,7 @@ print(say(say_please=True)) # Can you buy me a beer? Please! I am poor :( * [A curated list of awesome Python frameworks, libraries and software](https://github.com/vinta/awesome-python) * [30 Python Language Features and Tricks You May Not Know About](http://sahandsaba.com/thirty-python-language-features-and-tricks-you-may-not-know.html) * [Official Style Guide for Python](https://www.python.org/dev/peps/pep-0008/) +* [Python 3 Computer Science Circles](http://cscircles.cemc.uwaterloo.ca/) ### Dead Tree From da5ace143bd2a1fdfb73d8d56774968c787a7ae2 Mon Sep 17 00:00:00 2001 From: Max Goldstein Date: Wed, 16 Dec 2015 19:55:33 -0500 Subject: [PATCH 347/457] Mention unit; line breaks for style --- elm.html.markdown | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/elm.html.markdown b/elm.html.markdown index f395e85b..944ab770 100644 --- a/elm.html.markdown +++ b/elm.html.markdown @@ -74,6 +74,10 @@ List.head [] -- Nothing fst ("elm", 42) -- "elm" snd ("elm", 42) -- 42 +-- The empty tuple, or "unit", is sometimes used as a placeholder. +-- It is the only value of its type, also called "Unit". +() + -- Records are like tuples but the fields have names. The order of fields -- doesn't matter. Notice that record values use equals signs, not colons. { x = 3, y = 7 } @@ -116,6 +120,7 @@ case aList of x::xs -> "matches a list of at least one item whose head is " ++ toString x -- Pattern matches go in order. If we put [x] last, it would never match because -- x::xs also matches (xs would be the empty list). Matches do not "fall through". +-- The compiler will alert you to missing or extra cases. -- Pattern match on a Maybe. case List.head aList of @@ -226,11 +231,13 @@ 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 } +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 +otherOrigin = + Point3D 0 0 0 -- But it's still the same type, so you can equate them. origin == otherOrigin -- True @@ -238,23 +245,27 @@ 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 +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 +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 +root = + Node 7 Leaf Leaf -- Union types (and type aliases) can use type variables. -type Tree a = Leaf | Node a (Tree a) (Tree a) --- "The type tree of a is a leaf, or a node of a, tree of a, and tree of a." +type Tree a = + Leaf | Node a (Tree a) (Tree a) +-- "The type tree-of-a is a leaf, or a node of a, tree-of-a, and tree-of-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. +-- Pattern match union tags. The uppercase tags will 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 From ecf5050e07747f4cc33a57ea11513a7ab3f66285 Mon Sep 17 00:00:00 2001 From: Chris Warrick Date: Thu, 17 Dec 2015 16:54:53 +0100 Subject: [PATCH 348/457] Remove incorrect list indentation in perl-pl --- pl-pl/perl-pl.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pl-pl/perl-pl.html.markdown b/pl-pl/perl-pl.html.markdown index 9e8ade5b..029ca006 100644 --- a/pl-pl/perl-pl.html.markdown +++ b/pl-pl/perl-pl.html.markdown @@ -163,7 +163,7 @@ z repozytorium CPAN do zrealizowania konkretnego zadania. #### Do doczytania - - [perl-tutorial](http://perl-tutorial.org/) - - [Naucz się Perla na www.perl.com](http://www.perl.org/learn.html) - - [perldoc](http://perldoc.perl.org/) - - wbudowane w Perla: `perldoc perlintro` \ No newline at end of file + - [perl-tutorial](http://perl-tutorial.org/) + - [Naucz się Perla na www.perl.com](http://www.perl.org/learn.html) + - [perldoc](http://perldoc.perl.org/) + - wbudowane w Perla: `perldoc perlintro` From 442479a3c87d41fe1abf6ad344bb8733ef924fc8 Mon Sep 17 00:00:00 2001 From: Ondrej Simek Date: Thu, 17 Dec 2015 21:30:03 +0100 Subject: [PATCH 349/457] [markdown/cz] Fix missing 'lang' in front matter --- cs-cz/markdown.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/cs-cz/markdown.html.markdown b/cs-cz/markdown.html.markdown index 637f0ab6..4cba38b4 100644 --- a/cs-cz/markdown.html.markdown +++ b/cs-cz/markdown.html.markdown @@ -5,6 +5,7 @@ contributors: translators: - ["Michal Martinek", "https://github.com/MichalMartinek"] filename: markdown.md +lang: cs-cz --- Markdown byl vytvořen Johnem Gruberem v roce 2004. Je zamýšlen jako lehce čitelná From d0527c0428698c325a55ee046d0897c4e70a6ccc Mon Sep 17 00:00:00 2001 From: Mark Green Date: Fri, 18 Dec 2015 01:17:08 +0000 Subject: [PATCH 350/457] Wolfram Language tutorial --- wolfram.md | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 wolfram.md diff --git a/wolfram.md b/wolfram.md new file mode 100644 index 00000000..4514006d --- /dev/null +++ b/wolfram.md @@ -0,0 +1,137 @@ +--- +language: wolfram +contributors: + - ["hyphz", "http://github.com/hyphz/"] +filename: learnwolfram.nb +--- + +The Wolfram Language is the underlying language originally used in Mathematica, but now available for use in multiple contexts. + +Wolfram Language has several interfaces: +* The command line kernel interface on Raspberry Pi (just called _The Wolfram Language_) which runs interactively and can't produce graphical input. +* _Mathematica_ which is a rich text/maths editor with interactive Wolfram built in: pressing shift+Return on a "code cell" creates an output cell with the result, which is not dynamic +* _Wolfram Workbench_ which is Eclipse interfaced to the Wolfram Language backend + +The code in this example can be typed in to any interface and edited with Wolfram Workbench. Loading directly into Mathematica may be awkward because the file contains no cell formatting information (which would make the file a huge mess to read as text) - it can be viewed/edited but may require some setting up. + +``` +(* This is a comment *) + +(* In Mathematica instead of using these comments you can create a text cell + and annotate your code with nicely typeset text and images *) + +(* Typing an expression returns the result *) +2*2 (* 4 *) +5+8 (* 13 *) + +(* Function Call *) +(* Note, function names (and everything else) are case sensitive *) +Sin[Pi/2] (* 1 *) + +(* Alternate Syntaxes for Function Call with one parameter *) +Sin@(Pi/2) (* 1 *) +(Pi/2) // Sin (* 1 *) + +(* Every syntax in WL has some equivalent as a function call *) +Times[2, 2] (* 4 *) +Plus[5, 8] (* 13 *) + +(* Using a variable for the first time defines it and makes it global *) +x = 5 (* 5 *) +x == 5 (* True, C-style assignment and equality testing *) +x (* 5 *) +x = x + 5 (* 10 *) +x (* 10 *) +Set[x, 20] (* I wasn't kidding when I said EVERYTHING has a function equivalent *) +x (* 20 *) + +(* Because WL is based on a computer algebra system, *) +(* using undefined variables is fine, they just obstruct evaluation *) +cow + 5 (* 5 + cow, cow is undefined so can't evaluate further *) +cow + 5 + 10 (* 15 + cow, it'll evaluate what it can *) +% (* 15 + cow, % fetches the last return *) +% - cow (* 15, undefined variable cow cancelled out *) +moo = cow + 5 (* Beware, moo now holds an expression, not a number! *) + +(* Defining a function *) +Double[x_] := x * 2 (* Note := to prevent immediate evaluation of the RHS + And _ after x to indicate no pattern matching constraints *) +Double[10] (* 20 *) +Double[Sin[Pi/2]] (* 2 *) +Double @ Sin @ (Pi/2) (* 2, @-syntax avoids queues of close brackets *) +(Pi/2) // Sin // Double(* 2, //-syntax lists functions in execution order *) + +(* For imperative-style programming use ; to separate statements *) +(* Discards any output from LHS and runs RHS *) +MyFirst[] := (Print@"Hello"; Print@"World") (* Note outer parens are critical + ;'s precedence is lower than := *) +MyFirst[] (* Hello World *) + +(* C-Style For Loop *) +PrintTo[x_] := For[y=0, y 2, "Red" -> 1|> (* Create an association *) +myHash[["Green"]] (* 2, use it *) +myHash[["Green"]] := 5 (* 5, update it *) +myHash[["Puce"]] := 3.5 (* 3.5, extend it *) +KeyDropFrom[myHash, "Green"] (* Wipes out key Green *) +Keys[myHash] (* {Red} *) +Values[myHash] (* {1} *) + +(* And you can't do any demo of Wolfram without showing this off *) +Manipulate[y^2, {y, 0, 20}] (* Return a reactive user interface that displays y^2 + and allows y to be adjusted between 0-20 with a slider. + Only works on graphical frontends *) +``` + +##Ready For More? + +* [Wolfram Language Documentation Center](http://reference.wolfram.com/language/) From dc97e779bce838ea4f1d1e51a20d78b253048406 Mon Sep 17 00:00:00 2001 From: Eric McCormick Date: Fri, 18 Dec 2015 09:35:15 -0600 Subject: [PATCH 351/457] replaced < and > in pre block the pre block was already inside a pre/code block in the rendered page, making it harder to read --- coldfusion.html.markdown | 48 +++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/coldfusion.html.markdown b/coldfusion.html.markdown index d49ad254..482612fe 100644 --- a/coldfusion.html.markdown +++ b/coldfusion.html.markdown @@ -233,40 +233,38 @@ ColdFusion started as a tag-based language. Almost all functionality is availabl 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>
-
+ + + + From e7d5e2878841aae872b293127f47e4a4d211475b Mon Sep 17 00:00:00 2001 From: Ale46 Date: Sat, 19 Dec 2015 17:09:57 +0100 Subject: [PATCH 352/457] fix typos/mistakes --- it-it/python-it.html.markdown | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/it-it/python-it.html.markdown b/it-it/python-it.html.markdown index 49bbab08..3a4099e7 100644 --- a/it-it/python-it.html.markdown +++ b/it-it/python-it.html.markdown @@ -44,7 +44,7 @@ Python 2.x. Per Python 3.x, dai un'occhiata a [Python 3 tutorial](http://learnxi # restituito in automatico il risultato intero. 5 / 2 # => 2 -# Per le divisioni con la virgbola abbiamo bisogno di parlare delle variabili floats. +# Per le divisioni con la virgola abbiamo bisogno di parlare delle variabili floats. 2.0 # Questo è un float 11.0 / 4.0 # => 2.75 ahhh...molto meglio @@ -118,7 +118,7 @@ not False # => True # Un nuovo modo per fomattare le stringhe è il metodo format. # Questo metodo è quello consigliato "{0} possono essere {1}".format("le stringhe", "formattate") -# Puoi usare della parole chiave se non vuoi contare +# Puoi usare delle parole chiave se non vuoi contare "{nome} vuole mangiare {cibo}".format(nome="Bob", cibo="lasagna") # None è un oggetto @@ -202,7 +202,7 @@ li[::-1] # => [3, 4, 2, 1] del li[2] # li è ora [1, 2, 3] # Puoi sommare le liste li + altra_li # => [1, 2, 3, 4, 5, 6] -# Nota: i valori per li ed _altri_li non sono modificati. +# Nota: i valori per li ed altra_li non sono modificati. # Concatena liste con "extend()" li.extend(altra_li) # Ora li è [1, 2, 3, 4, 5, 6] @@ -288,7 +288,7 @@ filled_set = {1, 2, 2, 3, 4} # => {1, 2, 3, 4} # Aggiungere elementi ad un set filled_set.add(5) # filled_set è ora {1, 2, 3, 4, 5} -# Fai interazioni su un set con & +# Fai intersezioni su un set con & other_set = {3, 4, 5, 6} filled_set & other_set # => {3, 4, 5} @@ -378,8 +378,8 @@ except IndexError as e: pass # Pass è solo una non-operazione. Solitamente vorrai fare un recupero. except (TypeError, NameError): pass # Eccezioni multiple possono essere gestite tutte insieme, se necessario. -else: # Optional clause to the try/except block. Must follow all except blocks - print "All good!" # Viene eseguita solo se il codice dentro try non genera eccezioni +else: # Clausola opzionale al blocco try/except. Deve seguire tutti i blocchi except + print "Tutto ok!" # Viene eseguita solo se il codice dentro try non genera eccezioni finally: # Eseguito sempre print "Possiamo liberare risorse qui" @@ -405,7 +405,7 @@ aggiungi(y=6, x=5) # Le parole chiave come argomenti possono arrivare in ogni # Puoi definire funzioni che accettano un numero variabile di argomenti posizionali -# che verranno interpretati come come tuple se non usi il * +# che verranno interpretati come tuple se non usi il * def varargs(*args): return args @@ -495,7 +495,7 @@ class Human(object): species = "H. sapiens" # Costruttore base, richiamato quando la classe viene inizializzata. - # Si noti che il doppio leading e l'underscore finali denotano oggetti + # Si noti che il doppio leading e gli underscore finali denotano oggetti # o attributi che sono usati da python ma che vivono nello spazio dei nome controllato # dall'utente. Non dovresti usare nomi di questo genere. def __init__(self, name): @@ -575,7 +575,7 @@ dir(math) ## 7. Avanzate #################################################### -# Generators help you make lazy code +# I generatori ti aiutano a fare codice pigro def double_numbers(iterable): for i in iterable: yield i + i @@ -611,7 +611,7 @@ def beg(target_function): def wrapper(*args, **kwargs): msg, say_please = target_function(*args, **kwargs) if say_please: - return "{} {}".format(msg, "Please! I am poor :(") + return "{} {}".format(msg, "Per favore! Sono povero :(") return msg return wrapper @@ -619,17 +619,17 @@ def beg(target_function): @beg def say(say_please=False): - msg = "Can you buy me a beer?" + msg = "Puoi comprarmi una birra?" return msg, say_please -print say() # Can you buy me a beer? -print say(say_please=True) # Can you buy me a beer? Please! I am poor :( +print say() # Puoi comprarmi una birra? +print say(say_please=True) # Puoi comprarmi una birra? Per favore! Sono povero :( ``` -## Ready For More? +## Pronto per qualcosa di più? -### Free Online +### Gratis Online * [Automate the Boring Stuff with Python](https://automatetheboringstuff.com) * [Learn Python The Hard Way](http://learnpythonthehardway.org/book/) @@ -640,7 +640,7 @@ print say(say_please=True) # Can you buy me a beer? Please! I am poor :( * [A Crash Course in Python for Scientists](http://nbviewer.ipython.org/5920182) * [First Steps With Python](https://realpython.com/learn/python-first-steps/) -### Dead Tree +### Libri cartacei * [Programming Python](http://www.amazon.com/gp/product/0596158106/ref=as_li_qf_sp_asin_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0596158106&linkCode=as2&tag=homebits04-20) * [Dive Into Python](http://www.amazon.com/gp/product/1441413022/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1441413022&linkCode=as2&tag=homebits04-20) From 7560ea819965604099a3ed1dbf4e2fa8919e929b Mon Sep 17 00:00:00 2001 From: George Gognadze Date: Thu, 24 Dec 2015 23:24:09 +0400 Subject: [PATCH 353/457] typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit some type mistakes. It is: syntaxtically It should be: syntactically It is: iLoveC Better: ILoveC It is: passed to ≈the function It should be: passed to the function It is: error It should be: Error --- c.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/c.html.markdown b/c.html.markdown index 8226ddef..d92d2ee6 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -239,7 +239,7 @@ int main (int argc, char** argv) z = (e > f) ? e : f; // => 10 "if e > f return e, else return f." // Increment and decrement operators: - char *s = "iLoveC"; + char *s = "ILoveC"; int j = 0; s[j++]; // => "i". Returns the j-th item of s THEN increments value of j. j = 0; @@ -321,7 +321,7 @@ int main (int argc, char** argv) break; default: // if `some_integral_expression` didn't match any of the labels - fputs("error!\n", stderr); + fputs("Error!\n", stderr); exit(-1); break; } @@ -497,7 +497,7 @@ int add_two_ints(int x1, int x2) /* Functions are call by value. When a function is called, the arguments passed to -≈the function are copies of the original arguments (except arrays). Anything you +the function are copies of the original arguments (except arrays). Anything you do to the arguments in the function do not change the value of the original argument where the function was called. @@ -726,7 +726,7 @@ 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" +Header files are syntactically 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. From 5556d6e839796e06179afec99443bf0a63a23afa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leo=20B=C3=A4rring?= Date: Sat, 26 Dec 2015 20:15:51 +0100 Subject: [PATCH 354/457] changed code output to as stated in comments The comments state that Foo::Bar::inc in the package variable example should increase $Foo::Bar::n and then print it. This did not happen, as `say ++$n;` was placed outside the block of the sub Foo::Bar::inc. The commit puts `say ++$n;` inside the block of Foo::Bar::inc. --- perl6.html.markdown | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/perl6.html.markdown b/perl6.html.markdown index 1829f964..1457999a 100644 --- a/perl6.html.markdown +++ b/perl6.html.markdown @@ -803,9 +803,8 @@ module Foo::Bar { my sub unavailable { # `my sub` is the default say "Can't access me from outside, I'm my !"; } + say ++$n; # increment the package variable and output its value } - - say ++$n; # lexically-scoped variables are still available } say $Foo::Bar::n; #=> 1 Foo::Bar::inc; #=> 2 From e31dc8b5a7937d25a681747d05b6227d63849c6d Mon Sep 17 00:00:00 2001 From: Owen Rodda Date: Sun, 27 Dec 2015 16:29:52 -0500 Subject: [PATCH 355/457] Fix #2040 --- perl6.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl6.html.markdown b/perl6.html.markdown index 1829f964..323bc0b3 100644 --- a/perl6.html.markdown +++ b/perl6.html.markdown @@ -103,7 +103,7 @@ sub say-hello-to(Str $name) { # You can provide the type of an argument ## It can also have optional arguments: sub with-optional($arg?) { # the "?" marks the argument optional - say "I might return `(Any)` (Perl's "null"-like value) if I don't have + say "I might return `(Any)` (Perl's 'null'-like value) if I don't have an argument passed, or I'll return my argument"; $arg; } From 4a3538d60c156cf82598dfd06d2ae4f7e0c4404f Mon Sep 17 00:00:00 2001 From: Pranit Bauva Date: Mon, 28 Dec 2015 21:43:09 +0530 Subject: [PATCH 356/457] Add different array declaration syntax --- julia.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/julia.html.markdown b/julia.html.markdown index ef3ea244..2810555e 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -151,12 +151,16 @@ a = Int64[] # => 0-element Int64 Array # 1-dimensional array literals can be written with comma-separated values. b = [4, 5, 6] # => 3-element Int64 Array: [4, 5, 6] +b = [4; 5; 6] # => 3-element Int64 Array: [4, 5, 6] b[1] # => 4 b[end] # => 6 # 2-dimentional arrays use space-separated values and semicolon-separated rows. matrix = [1 2; 3 4] # => 2x2 Int64 Array: [1 2; 3 4] +# Arrays of a particular Type +b = Int8[4, 5, 6] # => 3-element Int8 Array: [4, 5, 6] + # Add stuff to the end of a list with push! and append! push!(a,1) # => [1] push!(a,2) # => [1,2] From 6749790c8d08aa5aaa06fd0501fd6bdd012ee29b Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Mon, 28 Dec 2015 17:11:00 -0500 Subject: [PATCH 357/457] Many edits --- solidity.html.markdown | 739 ++++++++++++++++++++++++++++------------- 1 file changed, 499 insertions(+), 240 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index 7f925918..a6620986 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -5,134 +5,194 @@ contributors: - ["Nemil Dalal", "https://www.nemil.com"] --- -Solidity lets you program on [Ethereum](https://www.ethereum.org/), a blockchain-based virtual machine that allows the creation and computation of smart contracts, without needing centralized or trusted parties. +Solidity lets you program on [Ethereum](https://www.ethereum.org/), a +blockchain-based virtual machine that allows the creation and +computation of smart contracts, without needing centralized or trusted parties. -Solidity is a statically typed, contract programming language that has similarities to Javascript and C. Like an object in object-oriented languages, each contract contains state variables, functions, and common data types. Contract-specific features include modifier (guard) clauses, event notifiers, and custom variables. +Solidity is a statically typed, contract programming language that has +similarities to Javascript and C. Like objects in OOP, each contract contains +state variables, functions, and common data types. Contract-specific features +include modifier (guard) clauses, event notifiers for listeners, and custom +global variables. -As Solidity and Ethereum are under active development, experimental or beta features are explicitly marked, and subject to change. Pull requests welcome. +Some Ethereum contract examples include crowdfunding, voting, and blind auctions. + +As Solidity and Ethereum are under active development, experimental or beta +features are explicitly marked, and subject to change. Pull requests welcome. ```javascript -// Let's start with a simple Bank contract, before diving into to the key components of the language -// This bank has three main capabilities: -// - deposit -// - withdrawal -// - check balance +// First, a simple Bank contract +// Allows deposits, withdrawals, and balance checks -// ** START EXAMPLE ** -// Start with a Natspec comment (the three slashes) that can be used -// for documentation - and as descriptive data for UI elements -/// @title A simple deposit/withdrawal bank built on Bitcoin +// simple_bank.sol (note .sol extension) +/* **** START EXAMPLE **** */ -// All contracts are declared and named (in CamelCase) -// They are similar to 'class' in other languages (and allow capabilities like inheritance) -contract AcmeBank { - // Declare state variables outside a function, - // these are persistent throughout the life of the contract +// Start with Natspec comment (the three slashes) +// used for documentation - and as descriptive data for UI elements/actions - // a dictionary that maps addresses to balances - // the private means that other contracts can't see balances - // but the data is still available to all other parties on the - // blockchain +/// @title SimpleBank +/// @author nemild + +/* 'contract' has similarities to 'class' in other languages (class variables, +inheritance, etc.) */ +contract SimpleBank { // CamelCase + // Declare state variables outside function, persist through life of contract + + // dictionary that maps addresses to balances mapping (address => uint) private balances; - // the 'public' makes 'owner' externally readable by users or contracts - // (but not writeable) + // "private" means that other contracts can't directly query balances + // but data is still viewable to other parties on blockchain + address public owner; + // 'public' makes externally readable (not writeable) by users or contracts - // Constructor, can receive one or many variables here + // Events - publicize actions to external listeners + event DepositMade(address accountAddress, uint amount); + + // Constructor, can receive one or many variables here; only one allowed function AcmeBank() { - // msg is a default variable that provides both the - // contract messager's address and amount - owner = msg.sender; // msg.sender refers to the address of the contract creator + // msg provides contract messager's address and amount + // msg.sender is contract caller (address of contract creator) + owner = msg.sender; } - function deposit(uint balance) public returns (uint) { - balances[msg.sender] += msg.value; // no need for "this." or "self." in front of the state variable + /// @notice Deposit ether into bank + /// @return The balance of the user after the deposit is made + function deposit() public returns (uint) { + balances[msg.sender] += msg.value; + // no "this." or "self." required with state variable + // all values initialized to 0 by default - return balances[msg.sender]; // msg.sender refers to the contract caller - } - - function withdraw(uint withdrawAmount) public returns (uint remainingBalance) { - if(balances[msg.sender] >= withdrawAmount) { - balances[msg.sender] -= withdrawAmount; - - if (!msg.sender.send(withdrawAmount)) { - balances[msg.sender] += withdrawAmount; - } + DepositMade(msg.sender, msg.value); // fire event return balances[msg.sender]; + } + + /// @notice Withdraw ether from bank + /// @dev This does not return any excess ether sent to it + /// @param withdrawAmount amount you want to withdraw + /// @return The balance remaining for the user + function withdraw(uint withdrawAmount) public returns (uint remainingBal) { + if(balances[msg.sender] >= withdrawAmount) { + balances[msg.sender] -= withdrawAmount; + + if (!msg.sender.send(withdrawAmount)) { + balances[msg.sender] += withdrawAmount; // to be safe + } + + return balances[msg.sender]; } } - // The 'constant' prevents the function from editing state variables + /// @notice Get balance + /// @return The balance of the user + // 'constant' prevents function from editing state variables; + // allows function to run locally/off blockchain function balance() constant returns (uint) { - return balances[msg.sender]; + return balances[msg.sender]; } - // Fallback function - // The fallback function is called if none of the other functions matches the given function identifier. - // Typically, called when invalid data is sent to the contract or ether without data. - // Added so that ether sent to this contract is reverted if the contract fails - // otherwise, the sender loses their money; you should add this in most contracts - function () { throw; } + // Fallback function - Called if other functions don't match call or + // sent ether without data + // Typically, called when invalid data is sent + // Added so ether sent to this contract is reverted if the contract fails + // otherwise, the sender's money is transferred to contract + function () { + throw; // throw reverts state to before call + } } // ** END EXAMPLE ** -// Now let's go through the basics of Solidity +// Now, the basics of Solidity // 1. DATA TYPES AND ASSOCIATED METHODS -// uint is the data type typically used for currency (there are no doubles -// or floats) and for dates +// uint used for currency amount (there are no doubles +// or floats) and for dates (in unix time) uint x; -// with 'constant', the compiler replaces each occurrence with the actual value // int of 256 bits, cannot be changed after instantiation int constant a = 8; + +// with 'constant', compiler replaces each occurrence with actual value int256 constant a = 8; // same effect as line above, here the 256 is explicit uint constant VERSION_ID = 0x123A1; // A hex constant -// For both int and uint, you can explicitly set space in steps of 8 -// e.g., int8, int16 +// Be careful that you don't overflow, and protect against attacks that do + +// For int and uint, can explicitly set space in steps of 8 up to 256 +// e.g., int8, int16, int24 uint8 b; int64 c; uint248 e; +// No random functions built in, use other contracts for randomness + // Type casting int x = int(b); bool b = true; // or do 'var b = true;' for inferred typing -// Addresses - holds 20 byte/160 bit Ethereum addresses to another contract -// ('Contract Account)') or person/external entity ('External Account') -address public owner; // Add 'public' field to indicate publicly/externally accessible, a getter is automatically created, but NOT a setter +// Addresses - holds 20 byte/160 bit Ethereum addresses +// No arithmetic allowed +address public owner; -// All addresses can be sent ether in the following way: +// Types of accounts: +// Contract account: address set on create (func of creator address, num transactions sent) +// External Account: (person/external entity): address created from public key + +// Add 'public' field to indicate publicly/externally accessible +// a getter is automatically created, but NOT a setter + +// All addresses can be sent ether owner.send(SOME_BALANCE); // returns false on failure -owner.balance; // the balance of the owner +if (owner.send) {} // typically wrap in 'if', as contract addresses have +// functions have executed on send and can fail -// Bytes are provided from 1 to 32 +// can override send by defining your own + +// Can check balance +owner.balance; // the balance of the owner (user or contract) + + +// Bytes available from 1 to 32 byte a; // byte is same as bytes1 -bytes32 b; +bytes2 b; +bytes32 c; + +// Dynamically sized bytes +bytes m; // A special array, same as byte[] array (but packed tightly) +// More expensive than byte1-byte32, so use those when possible -// Dynamically sized -bytes m; // A special array, same as byte[] (but packed tightly) // same as bytes, but does not allow length or index access (for now) -string n = 'hello'; +string n = "hello"; // stored in UTF8, note double quotes, not single +// string utility functions to be added in future +// prefer bytes32/bytes, as UTF8 uses more storage -// Type inference +// Type inferrence // var does inferred typing based on first assignment, // can't be used in functions parameters var a = true; -// there are edge cases where inference leads to a value being set (e.g., an uint 8) -// that is different from what the user wanted (uint16), so use carefully +// use carefully, inference may provide wrong type +// e.g., an int8, when a counter needs to be int16 + +// var can be used to assign function to variable +function a(uint x) returns (uint) { + return x * 2; +} +var f = a; +f(22); // call // by default, all values are set to 0 on instantiation // Delete can be called on most types -// (it does NOT destroy the value, but rather sets the value to 0 by assignment) +// (does NOT destroy value, but sets value to 0, the initial value) uint x = 5; -delete x; // x is now 0 + + +// Destructuring/Tuples +(x, y) = (2, 7); // assign/swap multiple value // 2. DATA STRUCTURES @@ -142,74 +202,97 @@ bytes32[] names; // dynamic array uint newLength = names.push("John"); // adding returns new length of the array // Length names.length; // get length -names.length = 1; // lengths can also be set, unlike many other languages +names.length = 1; // lengths can be set (for dynamic arrays in storage only) + +// multidimensional array +uint x[][5]; // arr with 5 dynamic array elements (opp order of most languages) // Dictionaries (any type to any other type) mapping (string => uint) public balances; -balances["john"] = 1; -console.log(balances[jill]); // is 0, all non-set key values return zeroes -// The 'public' lets you do the following from another contract -contractName.balances("john"); // returns 1 -// The 'public' keyword here created a getter (but not setter) that behaves like the following: +balances["charles"] = 1; +console.log(balances["ada"]); // is 0, all non-set key values return zeroes +// 'public' allows following from another contract +contractName.balances("claude"); // returns 1 +// 'public' created a getter (but not setter) like the following: function balances(address _account) returns (uint balance) { - return balances[_account]; + return balances[_account]; } +// Nested mappings +mapping (address => mapping (address => uint) balances) public custodians; + // To delete delete balances["John"]; -delete balances; // deletes all elements +delete balances; // sets all elements to 0 -// Unlike languages like Javascript, you cannot iterate through all elements in -// a map, without knowing the source keys +// Unlike other languages, CANNOT iterate through all elements in +// mapping, without knowing source keys - can build data structure +// on top to do this // Structs and enums - struct Bank { // note the capital - address owner; - uint balance; - } +struct Bank { + address owner; + uint balance; +} Bank b = Bank({ - owner: msg.sender, - balance: 5 + owner: msg.sender, + balance: 5 }); -delete b; // set all variables in struct to 0, except any mappings +// or +Bank c = Bank(msg.sender, 5); + +c.amount = 5; // set to new value +delete b; +// sets to initial value, set all variables in struct to 0, except mappings // Enums -enum State { Created, Locked, Inactive }; +enum State { Created, Locked, Inactive }; // often used for state machine State public state; // Declare variable from enum state = State.Created; // enums can be explicitly converted to ints +uint createdState = uint(State.Created); // 0 -// Data locations: Memory vs. storage - all complex types (arrays, structs) have a data location +// Data locations: Memory vs. storage vs. stack - all complex types (arrays, +// structs) have a data location // 'memory' does not persist, 'storage' does -// Default is 'storage' for local and state variables; 'memory' for function parameters +// Default is 'storage' for local and state variables; 'memory' for func params +// stack holds small local variables + +// for most types, can explicitly set which data location to use -// 3. Variables of note +// 3. Simple operators +// Comparisons, bit operators and arithmetic operators are provided +// exponentiation: ** +// exclusive or: ^ +// bitwise negation: ~ + + +// 4. Global Variables of note // ** this ** -this; // the address of the current contract -// 'balance' often used at the end of a contracts life to send the -// remaining balance to a party +this; // address of contract +// often used at end of contract life to send remaining balance to party this.balance; -this.someFunction(); // calls a function externally (via a message call, not via an internal jump) +this.someFunction(); // calls func externally via call, not via internal jump -// ** msg - The current message received by the contract ** ** -msg.sender; // address, The address of the sender -msg.value; // uint, The amount of gas provided to this contract in wei +// ** msg - Current message received by the contract ** ** +msg.sender; // address of sender +msg.value; // amount of gas provided to this contract in wei msg.data; // bytes, complete call data msg.gas; // remaining gas // ** tx - This transaction ** -tx.origin; // address, sender of the transaction -tx.gasprice; // uint, gas price of the transaction +tx.origin; // address of sender of the transaction +tx.gasprice; // gas price of the transaction -// ** block - Information about the current block ** -now // uint, current time, alias for block.timestamp -block.number; // uint, current block number -block.difficulty; // uint, current block difficulty -block.blockhash(1); // returns bytes32, only provides for most recent 256 blocks +// ** block - Information about current block ** +now // current time (approximately), alias for block.timestamp (uses Unix time) +block.number; // current block number +block.difficulty; // current block difficulty +block.blockhash(1); // returns bytes32, only works for most recent 256 blocks block.gasLimit(); -// ** storage - A persistent storage hash (does not need to be declared) ** +// ** storage - Persistent storage hash ** storage['abc'] = 'def'; // maps 256 bit words to 256 bit words @@ -217,55 +300,61 @@ storage['abc'] = 'def'; // maps 256 bit words to 256 bit words // A. Functions // Simple function function increment(uint x) returns (uint) { - x += 1; - return x; + x += 1; + return x; } -// Functions can return many arguments, and by specifying the returned arguments -// you don't need to explicitly return +// Functions can return many arguments, and by specifying returned arguments +// name don't need to explicitly return function increment(uint x, uint y) returns (uint x, uint y) { - x += 1; - y += 1; + x += 1; + y += 1; } -// This function would have been called like this, and assigned to a tuple +// Call previous functon uint (a,b) = increment(1,1); -// The 'constant' indicates and ensures that a function does not/cannot change the persistent variables -// Constant function execute locally, not on the blockchain +// 'constant' indicates that function does not/cannot change persistent vars +// Constant function execute locally, not on blockchain uint y; function increment(uint x) constant returns (uint x) { - x += 1; - y += 1; // this line would fail - // as y is a state variable, and can't be changed in a constant function + x += 1; + y += 1; // this line would fail + // y is a state variable, and can't be changed in a constant function } -// There are a few 'function visibility specifiers' that can be placed where 'constant' -// is, which include: -// internal (can only be called by an internal function, not one external to the contract) -// public - visible externally and internally +// 'Function Visibility specifiers' +// These can be placed where 'constant' is, including: +// public - visible externally and internally (default) +// external // private - only visible in the current contract +// internal - only visible in current contract, and those deriving from it -// Functions are hoisted (so you can call a function, even if it is declared later) - and you can assign a function to a variable +// Functions hoisted - and can assign a function to a variable function a() { - var z = b; - b(); + var z = b; + b(); } function b() { } + +// Prefer loops to recursion (max call stack depth is 1024) + // B. Events -// Events are an easy way to notify external listeners that something changed -// You typically declare them after your contract parameters -event Sent(address from, address to, uint amount); +// Events are notify external parties; easy to search and +// access events from outside blockchain (with lightweight clients) +// typically declare after contract parameters -// You then call it in a function, when you want to trigger it -sent(from, to, amount); +// Declare +event Sent(address from, address to, uint amount); // note capital first letter -// For an external party (a contract or external entity), to watch -// for an event, you write the following: +// Call +Sent(from, to, amount); + +// For an external party (a contract or external entity), to watch: Coin.Sent().watch({}, '', function(error, result) { if (!error) { console.log("Coin transfer: " + result.args.amount + @@ -276,195 +365,356 @@ Coin.Sent().watch({}, '', function(error, result) { "Receiver: " + Coin.balances.call(result.args.to)); } } -// This is a common paradigm for one contract to depend on another (e.g., a -// contract that depends on the current exchange rate provided by another -// contract) +// Common paradigm for one contract to depend on another (e.g., a +// contract that depends on current exchange rate provided by another) // C. Modifiers -// Modifiers let you validate inputs to functions such as a minimal balance or user authentication -// It's similar to a guard clause in other languages +// Modifiers validate inputs to functions such as minimal balance or user auth; +// similar to guard clause in other languages -// The '_' (underscore) must be included as the last line in the function body, and is an indicator that the +// '_' (underscore) often included as last line in body, and indicates // function being called should be placed there modifier onlyAfter(uint _time) { if (now <= _time) throw; _ } modifier onlyOwner { if (msg.sender == owner) _ } +// commonly used with state machines +modifier onlyIfState (State currState) { if (currState != State.A) _ } -// You can then append it right after the function declaration +// Append right after function declaration function changeOwner(newOwner) onlyAfter(someTime) onlyOwner() +onlyIfState(State.A) { - owner = newOwner; + owner = newOwner; +} + +// underscore can be included before end of body, +// but explicitly returning will skip, so use carefully +modifier checkValue(uint amount) { + _ + if (msg.value > amount) { + msg.sender.send(amount - msg.value); + } } -// 5. BRANCHING AND LOOPS +// 6. BRANCHING AND LOOPS -// All basic logic blocks work - including if/else, for, while, break, continue, return -// Unlike other languages, the 'switch' statement is NOT provided +// All basic logic blocks work - including if/else, for, while, break, continue +// return - but no switch -// Syntax is the same as javascript, but there is no type conversion from -// non-boolean to boolean, so comparison operators must be used to get the boolean value +// Syntax same as javascript, but no type conversion from non-boolean +// to boolean (comparison operators must be used to get the boolean val) -// 6. OBJECTS/CONTRACTS +// 7. OBJECTS/CONTRACTS -// A. Calling an external contract +// A. Calling external contract contract infoFeed { - function info() returns (uint ret) { return 42; } + function info() returns (uint ret) { return 42; } } contract Consumer { - InfoFeed feed; // create a variable that will point to a contract on the blockchain + InfoFeed feed; // points to contract on blockchain - // Set feed to an existing contract - function setFeed(address addr) { - // Link to the contract by creating on the address - feed = InfoFeed(addr); - } + // Set feed to existing contract instance + function setFeed(address addr) { + // automatically cast, be careful; constructor is not called + feed = InfoFeed(addr); + } - // Set feed based to a new instance of the contract - function createNewFeed() { - feed = new InfoFeed(); - } + // Set feed to new instance of contract + function createNewFeed() { + feed = new InfoFeed(); // constructor called + } - function callFeed() { - // T final parentheses call the contract, optionally adding - // custom value or gas numbers - feed.info.value(10).gas(800)(); - } + function callFeed() { + // final parentheses call contract, can optionally add + // custom ether value or gas + feed.info.value(10).gas(800)(); + } } // B. Inheritance -// Order matters, last inherited contract (i.e., 'def') can override parts of the previously -// inherited contracts -contact MyContract is abc, def("a custom argument to def") { +// Order matters, last inherited contract (i.e., 'def') can override parts of +// previously inherited contracts +contract MyContract is abc, def("a custom argument to def") { // Override function - - function z() { - if (msg.sender == owner) { - def.z(); // call overridden function + function z() { + if (msg.sender == owner) { + def.z(); // call overridden function from def + super.z(); // call immediate parent overriden function + } } - } +} - }; +// abstract function +function someAbstractFunction(uint x); +// cannot be compiled, so used in base/abstract contracts +// that are then implemented // C. Import import "filename"; import "github.com/ethereum/dapp-bin/library/iterable_mapping.sol"; -// Importing is under active development and will change -// Importing cannot currently be done at the command line +// Importing under active development +// Cannot currently be done at command line + +// 8. OTHER KEYWORDS + +// A. Throwing +// Throwing +throw; // reverts unused money to sender, state is reverted +// Can't currently catch + +// Common design pattern is: +if (!addr.send(123)) { + throw; +} + +// B. Selfdestruct +// selfdestruct current contract, sending funds to address (often creator) +selfdestruct(SOME_ADDRESS); + +// removes storage/code from current/future blocks +// helps thin clients, but previous data persists in blockchain + +// Common pattern, lets owner end the contract and receive remaining funds +function remove() { + if(msg.sender == creator) { // Only let the contract creator do this + selfdestruct(creator); // Makes contract inactive, returns funds + } +} + +// May want to deactivate contract manually, rather than selfdestruct +// (ether sent to selfdestructed contract is lost) -// 7. CONTRACT DESIGN PATTERNS +// 9. CONTRACT DESIGN NOTES // A. Obfuscation -// Remember that all variables are publicly viewable on the blockchain, so -// anything that needs some privacy needs to be obfuscated (e.g., hashed) +// Remember all variables are publicly viewable on blockchain, so +// anything that needs privacy needs to be obfuscated (e.g., hashed) -// B. Throwing -// Throwing -throw; // throwing is easily done, and reverts unused money to the sender -// You can't currently catch +// Steps: 1. Commit to something, 2. Reveal commitment +sha3("some_bid_amount", "some secret"); // commit -// A common design pattern is: -if (!addr.send(123)) { - throw; -} +// call contract's reveal function showing bid plus secret that hashes to SHA3 +reveal(100, "mySecret"); -// C. Suicide -// Suicide -suicide(SOME_ADDRESS); // suicide the current contract, sending funds to the address (often the creator) +// B. Storage optimization +// Writing to blockchain can be expensive, as data stored forever encourages +// smart ways to use memory (eventually, compilation will be better, but for now +// benefits to planning data structures - and storing min amount in blockchain) -// This is a common contract pattern that lets the owner end the contract, and receive remaining funds -function remove() { - if(msg.sender == owner) { // Only let the contract creator do this - suicide(owner); // suicide makes this contract inactive, and returns funds to the owner - } -} +// Cost can often be high for items like multidimensional arrays +// (cost is for storing data - not declaring unfilled variables) -// D. Storage optimization -// Reading and writing can be expensive, as data needs to be stored in the -// blockchain forever - this encourages smart ways to use memory (eventually, -// compilation may better handle this, but for now there are benefits to -// planning your data structures) +// C. Cannot restrict human or computer from reading contents of +// transaction or transaction's state +// When 'private' specified, indicating that other *contracts* can't read +// the data directly - any other party can still read the data in blockchain -// *** EXAMPLE: Let's do a more complex example *** +// D. All data to start of time is stored in blockchain, so +// anyone can observe all previous data and changes +// E. Cron +// Contracts must be manually called to handle time-based scheduling; can create +// external code to do, or provide incentives (ether) for others to do for you + +// F. State machines +// see example below for State enum and inState modifier + +// *** EXAMPLE: A crowdfunding example (broadly similar to Kickstarter) *** // ** START EXAMPLE ** -// [TODO: Decide what a more complex example looks like, needs a few characteristics: -// - has a 'constant' state variable -// - has a state machine (and uses modifier) -// - sends money to an address -// - gets information from another contract (we'll show code for both contracts) -// - Shows inheritance -// - show variables being passed in on instantiation (and guard code to throw if variables not provided) -// - Shows the swapping out of a contract address -// Ideas: -// - crowdfunding? -// - Peer to peer insurance -// ] - // It's good practice to have a remove function, which disables this - // contract - but does mean that users have to trust the owner - // For a decentralized bank without a trusted part - function remove() { - if(msg.sender == owner) { // Only let the contract creator do this - suicide(owner); // suicide makes this contract inactive, and returns funds to the owner - } + +// CrowdFunder.sol + +/// @title CrowdFunder +/// @author nemild +contract CrowdFunder { + // Variables set on create by creator + address public creator; + address public fundRecipient; // creator may be different than recipient + uint public minimumToRaise; // required to tip, else everyone gets refund + string campaignUrl; + + // Data structures + enum State { + Fundraising, + ExpiredRefundPending, + Successful, + ExpiredRefundComplete + } + struct Contribution { + uint amount; + address contributor; } -// *** END EXAMPLE *** + // State variables + State public state = State.Fundraising; // initialize on create + uint public totalRaised; + uint public raiseBy; + Contribution[] contributions; -// 7. NATIVE FUNCTIONS + event fundingReceived(address addr, uint amount, uint currentTotal); + event allRefundsSent(); + event winnerPaid(address winnerAddress); + + modifier inState(State _state) { + if (state != _state) throw; + _ + } + + modifier isCreator() { + if (msg.sender != creator) throw; + _ + } + + modifier atEndOfLifecycle() { + if(state != State.ExpiredRefundComplete && state != State.Successful) { + throw; + } + } + + function CrowdFunder( + uint timeInHoursForFundraising, + string _campaignUrl, + address _fundRecipient, + uint _minimumToRaise) + { + creator = msg.sender; + fundRecipient = _fundRecipient; + campaignUrl = _campaignUrl; + minimumToRaise = _minimumToRaise; + raiseBy = now + (timeInHoursForFundraising * 1 hours); + } + + function contribute() + public + inState(State.Fundraising) + { + contributions.push( + Contribution({ + amount: msg.value, + contributor: msg.sender + }) // use array, so can iterate + ); + totalRaised += msg.value; + + fundingReceived(msg.sender, msg.value, totalRaised); + + checkIfFundingCompleteOrExpired(); + } + + function checkIfFundingCompleteOrExpired() { + if (totalRaised > minimumToRaise) { + state = State.Successful; + payOut(); + + // could incentivize sender who initiated state change here + } else if ( now > raiseBy ) { + state = State.ExpiredRefundPending; + refundAll(); + } + } + + function payOut() + public + inState(State.Successful) + { + if(!fundRecipient.send(this.balance)) { + throw; + } + + winnerPaid(fundRecipient); + } + + function refundAll() + public + inState(State.ExpiredRefundPending) + { + uint length = contributions.length; + for (uint i = 0; i < length; i++) { + if(!contributions[i].contributor.send(contributions[i].amount)) { + throw; + } + } + + allRefundsSent(); + state = State.ExpiredRefundComplete; + } + + function removeContract() + public + isCreator() + atEndOfLifecycle() + { + selfdestruct(msg.sender); + } + + function () { throw; } +} +// ** END EXAMPLE ** + +// 10. OTHER NATIVE FUNCTIONS // Currency units -// By default, currency is defined using wei, the smallest unit of Ether +// Currency is defined using wei, smallest unit of Ether uint minAmount = 1 wei; -uint a = 1 finney; // 1 ether = 1000 finney -// There are a number of other units, see: http://ether.fund/tool/converter +uint a = 1 finney; // 1 ether == 1000 finney +// Other units, see: http://ether.fund/tool/converter // Time units 1 == 1 second 1 minutes == 60 seconds - -// You typically multiply a variable times the unit, as these units are not -// directly stored in a variable +// Can multiply a variable times unit, as units are not stored in a variable uint x = 5; (x * 1 days); // 5 days -// Be careful about leap seconds and leap years when using equality statements for time (instead, prefer greater than/less than) +// Careful about leap seconds/years with equality statements for time +// (instead, prefer greater than/less than) // Cryptography -// All strings passed are concatenated before the hash is run +// All strings passed are concatenated before hash action sha3("ab", "cd"); ripemd160("abc"); sha256("def"); +11. LOW LEVEL FUNCTIONS +// call - low level, not often used, does not provide type safety +successBoolean = someContractAddress.call('function_name', 'arg1', 'arg2'); -// 8. COMMON MISTAKES/MISCONCEPTIONS -// A few common mistakes and misconceptions: +// callcode - Code at target address executed in *context* of calling contract +// provides library functionality +someContractAddress.callcode('function_name'); -// A. You cannot restrict a human or computer from reading the content of -// your transaction or a transaction's state +// 12. STYLE NOTES +// Based on Python's PEP8 style guide -// All data to the start of time is stored in the blockchain, so you and -// anyone can observe all previous data stats +// 4 spaces for indentation +// Two lines separate contract declarations (and other top level declarations) +// Avoid extraneous spaces in parentheses +// Can omit curly braces for one line statement (if, for, etc) +// else should be placed on own line -// When you don't specify public on a variable, you are indicating that other *contracts* can't -// read the data - but any person can still read the data +// 13. NATSPEC comments - used for documentation, commenting, and external UIs +// Contract natspec - always above contract definition +/// @title Contract title +/// @author Author name -// TODO +// Function natspec +/// @notice information about what function does; shown when function to execute +/// @dev Function documentation for developer - -// 9. STYLE NOTES -// Use 4 spaces for indentation -// (Python's PEP8 is used as the baseline style guide, including its general philosophy) +// Function parameter/return value natspec +/// @param someParam Some description of what the param does +/// @return Description of the return value ``` ## Additional resources @@ -472,6 +722,8 @@ sha256("def"); - [Solidity Style Guide](https://ethereum.github.io/solidity//docs/style-guide/): Ethereum's style guide is heavily derived from Python's [pep8](https://www.python.org/dev/peps/pep-0008/) style guide. - [Browser-based Solidity Editor](http://chriseth.github.io/browser-solidity/) - [Gitter Chat room](https://gitter.im/ethereum/go-ethereum) +- [Modular design strategies for Ethereum Contracts](https://docs.erisindustries.com/tutorials/solidity/) +- Editor Snippets ([Ultisnips format](https://gist.github.com/nemild/98343ce6b16b747788bc)) ## Sample contracts - [Dapp Bin](https://github.com/ethereum/dapp-bin) @@ -481,5 +733,12 @@ sha256("def"); ## Information purposefully excluded - Libraries +- [Call keyword](http://solidity.readthedocs.org/en/latest/types.html) + +## Style +- Python's [PEP8](https://www.python.org/dev/peps/pep-0008/) is used as the baseline style guide, including its general philosophy) + +## Future To Dos +- New keywords: protected, inheritable Feel free to send a pull request with any edits - or email nemild -/at-/ gmail From 8f9f9e53e825b346c49139769b8bbfd08d0bed4e Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Mon, 28 Dec 2015 17:13:20 -0500 Subject: [PATCH 358/457] Spacing --- solidity.html.markdown | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index a6620986..7de92fce 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -463,6 +463,7 @@ import "github.com/ethereum/dapp-bin/library/iterable_mapping.sol"; // Importing under active development // Cannot currently be done at command line + // 8. OTHER KEYWORDS // A. Throwing @@ -529,6 +530,7 @@ reveal(100, "mySecret"); // F. State machines // see example below for State enum and inState modifier + // *** EXAMPLE: A crowdfunding example (broadly similar to Kickstarter) *** // ** START EXAMPLE ** @@ -661,6 +663,7 @@ contract CrowdFunder { } // ** END EXAMPLE ** + // 10. OTHER NATIVE FUNCTIONS // Currency units @@ -686,7 +689,8 @@ sha3("ab", "cd"); ripemd160("abc"); sha256("def"); -11. LOW LEVEL FUNCTIONS + +// 11. LOW LEVEL FUNCTIONS // call - low level, not often used, does not provide type safety successBoolean = someContractAddress.call('function_name', 'arg1', 'arg2'); @@ -694,6 +698,7 @@ successBoolean = someContractAddress.call('function_name', 'arg1', 'arg2'); // provides library functionality someContractAddress.callcode('function_name'); + // 12. STYLE NOTES // Based on Python's PEP8 style guide @@ -703,6 +708,7 @@ someContractAddress.callcode('function_name'); // Can omit curly braces for one line statement (if, for, etc) // else should be placed on own line + // 13. NATSPEC comments - used for documentation, commenting, and external UIs // Contract natspec - always above contract definition /// @title Contract title From 43138aef5cc6a89ec0c02db03cec61ab902acb97 Mon Sep 17 00:00:00 2001 From: ethers Date: Mon, 28 Dec 2015 16:36:48 -0800 Subject: [PATCH 359/457] fixes in withdraw() and msg --- solidity.html.markdown | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index 7de92fce..146d6e83 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -7,7 +7,7 @@ contributors: Solidity lets you program on [Ethereum](https://www.ethereum.org/), a blockchain-based virtual machine that allows the creation and -computation of smart contracts, without needing centralized or trusted parties. +execution of smart contracts, without needing centralized or trusted parties. Solidity is a statically typed, contract programming language that has similarities to Javascript and C. Like objects in OOP, each contract contains @@ -52,7 +52,7 @@ contract SimpleBank { // CamelCase // Constructor, can receive one or many variables here; only one allowed function AcmeBank() { - // msg provides contract messager's address and amount + // msg provides details about the message that's sent to the contract // msg.sender is contract caller (address of contract creator) owner = msg.sender; } @@ -77,12 +77,12 @@ contract SimpleBank { // CamelCase if(balances[msg.sender] >= withdrawAmount) { balances[msg.sender] -= withdrawAmount; - if (!msg.sender.send(withdrawAmount)) { - balances[msg.sender] += withdrawAmount; // to be safe + if (!msg.sender.send(withdrawAmount)) { + balances[msg.sender] += withdrawAmount; // to be safe + } } - - return balances[msg.sender]; - } + + return balances[msg.sender]; } /// @notice Get balance @@ -277,7 +277,7 @@ this.someFunction(); // calls func externally via call, not via internal jump // ** msg - Current message received by the contract ** ** msg.sender; // address of sender -msg.value; // amount of gas provided to this contract in wei +msg.value; // amount of ether provided to this contract in wei msg.data; // bytes, complete call data msg.gas; // remaining gas From 65cba2b1f5405d53e498bfa96a0e407423dd9a4e Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Mon, 28 Dec 2015 21:53:37 -0500 Subject: [PATCH 360/457] Fixed mapping --- solidity.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index 7de92fce..5b632c11 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -219,7 +219,7 @@ function balances(address _account) returns (uint balance) { } // Nested mappings -mapping (address => mapping (address => uint) balances) public custodians; +mapping (address => mapping (address => uint)) public custodians; // To delete delete balances["John"]; From ba3d5a6feb4a340c43b55b75516fed1d78fad9fb Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Mon, 28 Dec 2015 21:58:31 -0500 Subject: [PATCH 361/457] Added Joseph Chow as contributor --- solidity.html.markdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index 2d653bf9..b73ca0e5 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -2,7 +2,8 @@ language: Solidity filename: learnSolidity.sol contributors: - - ["Nemil Dalal", "https://www.nemil.com"] + - ["Nemil Dalal", "https://www.nemil.com"] + - ["Joseph Chow", ""] --- Solidity lets you program on [Ethereum](https://www.ethereum.org/), a @@ -81,7 +82,7 @@ contract SimpleBank { // CamelCase balances[msg.sender] += withdrawAmount; // to be safe } } - + return balances[msg.sender]; } From 58ebc87f5f4114c3610633a7cd9c4264647b2448 Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Mon, 28 Dec 2015 22:29:19 -0500 Subject: [PATCH 362/457] Minor edits --- solidity.html.markdown | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index b73ca0e5..5946c1f5 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -79,7 +79,9 @@ contract SimpleBank { // CamelCase balances[msg.sender] -= withdrawAmount; if (!msg.sender.send(withdrawAmount)) { - balances[msg.sender] += withdrawAmount; // to be safe + // to be safe, may be sending to contract that + // has overridden 'send' which may then fail + balances[msg.sender] += withdrawAmount; } } @@ -710,7 +712,9 @@ someContractAddress.callcode('function_name'); // else should be placed on own line -// 13. NATSPEC comments - used for documentation, commenting, and external UIs +// 13. NATSPEC COMENTS +// used for documentation, commenting, and external UIs + // Contract natspec - always above contract definition /// @title Contract title /// @author Author name @@ -740,7 +744,6 @@ someContractAddress.callcode('function_name'); ## Information purposefully excluded - Libraries -- [Call keyword](http://solidity.readthedocs.org/en/latest/types.html) ## Style - Python's [PEP8](https://www.python.org/dev/peps/pep-0008/) is used as the baseline style guide, including its general philosophy) From bdd8a8b0c87d58332f39facc60d6ab7d576764df Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Mon, 28 Dec 2015 22:31:48 -0500 Subject: [PATCH 363/457] Wording --- solidity.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index 5946c1f5..ebc58491 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -500,8 +500,8 @@ function remove() { // 9. CONTRACT DESIGN NOTES // A. Obfuscation -// Remember all variables are publicly viewable on blockchain, so -// anything that needs privacy needs to be obfuscated (e.g., hashed) +// All variables are publicly viewable on blockchain, so anything +// that should be totally private needs to be obfuscated (e.g., hashed w/secret) // Steps: 1. Commit to something, 2. Reveal commitment sha3("some_bid_amount", "some secret"); // commit From 24740321f478c25bb1dc651f6c95e11525a16781 Mon Sep 17 00:00:00 2001 From: ethers Date: Mon, 28 Dec 2015 23:45:58 -0800 Subject: [PATCH 364/457] update links to docs and Gitter --- solidity.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index ebc58491..911aca92 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -729,17 +729,17 @@ someContractAddress.callcode('function_name'); ``` ## Additional resources -- [Solidity Docs](https://ethereum.github.io/solidity/docs/home/) +- [Solidity Docs](https://solidity.readthedocs.org/en/latest/) - [Solidity Style Guide](https://ethereum.github.io/solidity//docs/style-guide/): Ethereum's style guide is heavily derived from Python's [pep8](https://www.python.org/dev/peps/pep-0008/) style guide. - [Browser-based Solidity Editor](http://chriseth.github.io/browser-solidity/) -- [Gitter Chat room](https://gitter.im/ethereum/go-ethereum) +- [Gitter Chat room](https://gitter.im/ethereum/solidity) - [Modular design strategies for Ethereum Contracts](https://docs.erisindustries.com/tutorials/solidity/) - Editor Snippets ([Ultisnips format](https://gist.github.com/nemild/98343ce6b16b747788bc)) ## Sample contracts - [Dapp Bin](https://github.com/ethereum/dapp-bin) - [Solidity Baby Step Contracts](https://github.com/fivedogit/solidity-baby-steps/tree/master/contracts) -- [Consensys Contracts](https://github.com/ConsenSys/dapp-store-contracts) +- [ConsenSys Contracts](https://github.com/ConsenSys/dapp-store-contracts) - [State of Dapps](http://dapps.ethercasts.com/) ## Information purposefully excluded From 00d4fa09de191b9580dd534b8b3e6e7a297fb8d7 Mon Sep 17 00:00:00 2001 From: Arnie97 Date: Tue, 29 Dec 2015 16:59:19 +0800 Subject: [PATCH 365/457] Fetch lsp typo fix from upstream --- zh-cn/tmux-cn.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zh-cn/tmux-cn.html.markdown b/zh-cn/tmux-cn.html.markdown index 00bf35f3..64781346 100644 --- a/zh-cn/tmux-cn.html.markdown +++ b/zh-cn/tmux-cn.html.markdown @@ -39,7 +39,7 @@ lang: zh-cn lsp # 列出窗格 -a # 列出所有窗格 -s # 列出会话中的所有窗格 - -t # List app panes in target + -t # 列出 target 中的所有窗格 kill-window # 关闭当前窗口 -t "#" # 关闭指定的窗口 From bf609a3a0f0ce84faa617bc5c6a51b56f3571f4f Mon Sep 17 00:00:00 2001 From: Arnie97 Date: Tue, 29 Dec 2015 17:14:18 +0800 Subject: [PATCH 366/457] Update tmux home page. Tmux has moved to github. --- tmux.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmux.html.markdown b/tmux.html.markdown index 868302a8..6763a781 100644 --- a/tmux.html.markdown +++ b/tmux.html.markdown @@ -240,7 +240,7 @@ set -g status-right "#[fg=green] | #[fg=white]#(tmux-mem-cpu-load)#[fg=green] | ### References -[Tmux | Home](http://tmux.sourceforge.net) +[Tmux | Home](http://tmux.github.io) [Tmux Manual page](http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/tmux.1?query=tmux) From fc528c92ddbdca1d0cb3a5c8f3ad477fbc115ad9 Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Tue, 29 Dec 2015 10:59:01 -0500 Subject: [PATCH 367/457] Cleaned up data types --- solidity.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index ebc58491..d84b6a68 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -117,12 +117,10 @@ uint x; // int of 256 bits, cannot be changed after instantiation int constant a = 8; - -// with 'constant', compiler replaces each occurrence with actual value int256 constant a = 8; // same effect as line above, here the 256 is explicit uint constant VERSION_ID = 0x123A1; // A hex constant +// with 'constant', compiler replaces each occurrence with actual value -// Be careful that you don't overflow, and protect against attacks that do // For int and uint, can explicitly set space in steps of 8 up to 256 // e.g., int8, int16, int24 @@ -130,6 +128,8 @@ uint8 b; int64 c; uint248 e; +// Be careful that you don't overflow, and protect against attacks that do + // No random functions built in, use other contracts for randomness // Type casting From 7e4a42d0b8cec4c0e2a6b90ad261c7755afe1136 Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Tue, 29 Dec 2015 11:10:39 -0500 Subject: [PATCH 368/457] Reorganizing later sections --- solidity.html.markdown | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index 8c416be3..6705dde9 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -501,7 +501,7 @@ function remove() { // A. Obfuscation // All variables are publicly viewable on blockchain, so anything -// that should be totally private needs to be obfuscated (e.g., hashed w/secret) +// that is private needs to be obfuscated (e.g., hashed w/secret) // Steps: 1. Commit to something, 2. Reveal commitment sha3("some_bid_amount", "some secret"); // commit @@ -510,27 +510,28 @@ sha3("some_bid_amount", "some secret"); // commit reveal(100, "mySecret"); // B. Storage optimization -// Writing to blockchain can be expensive, as data stored forever encourages +// Writing to blockchain can be expensive, as data stored forever; encourages // smart ways to use memory (eventually, compilation will be better, but for now // benefits to planning data structures - and storing min amount in blockchain) // Cost can often be high for items like multidimensional arrays // (cost is for storing data - not declaring unfilled variables) -// C. Cannot restrict human or computer from reading contents of +// C. Data access in blockchain +// Cannot restrict human or computer from reading contents of // transaction or transaction's state -// When 'private' specified, indicating that other *contracts* can't read -// the data directly - any other party can still read the data in blockchain +// While 'private' prevents other *contracts* from reading data +// directly - any other party can still read data in blockchain -// D. All data to start of time is stored in blockchain, so +// All data to start of time is stored in blockchain, so // anyone can observe all previous data and changes -// E. Cron -// Contracts must be manually called to handle time-based scheduling; can create -// external code to do, or provide incentives (ether) for others to do for you +// D. Cron Job +// Contracts must be manually called to handle time-based scheduling; can create external +// code to regularly ping, or provide incentives (ether) for others to -// F. State machines +// E. State machines // see example below for State enum and inState modifier @@ -705,6 +706,7 @@ someContractAddress.callcode('function_name'); // 12. STYLE NOTES // Based on Python's PEP8 style guide +// Quick summary: // 4 spaces for indentation // Two lines separate contract declarations (and other top level declarations) // Avoid extraneous spaces in parentheses From d97c7be291b6bc3fb1477c30ac96b5b6cc36b9c4 Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Tue, 29 Dec 2015 13:05:45 -0500 Subject: [PATCH 369/457] Minor wording changes, typos --- solidity.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index 6705dde9..71a44b92 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -63,7 +63,7 @@ contract SimpleBank { // CamelCase function deposit() public returns (uint) { balances[msg.sender] += msg.value; // no "this." or "self." required with state variable - // all values initialized to 0 by default + // all values set to data type's initial value by default DepositMade(msg.sender, msg.value); // fire event @@ -289,7 +289,7 @@ tx.origin; // address of sender of the transaction tx.gasprice; // gas price of the transaction // ** block - Information about current block ** -now // current time (approximately), alias for block.timestamp (uses Unix time) +now; // current time (approximately), alias for block.timestamp (uses Unix time) block.number; // current block number block.difficulty; // current block difficulty block.blockhash(1); // returns bytes32, only works for most recent 256 blocks @@ -428,7 +428,7 @@ contract Consumer { // Set feed to new instance of contract function createNewFeed() { - feed = new InfoFeed(); // constructor called + feed = new InfoFeed(); // new instance created; constructor called } function callFeed() { From 8dd19e58eeaed93f4489ae711ef72e79135d8795 Mon Sep 17 00:00:00 2001 From: Arnie97 Date: Wed, 30 Dec 2015 18:56:24 +0800 Subject: [PATCH 370/457] Fetch tmuxinator from upstream --- zh-cn/tmux-cn.html.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zh-cn/tmux-cn.html.markdown b/zh-cn/tmux-cn.html.markdown index 64781346..540bbf23 100644 --- a/zh-cn/tmux-cn.html.markdown +++ b/zh-cn/tmux-cn.html.markdown @@ -247,3 +247,5 @@ set -g status-right "#[fg=green] | #[fg=white]#(tmux-mem-cpu-load)#[fg=green] | [Archlinux Wiki](https://wiki.archlinux.org/index.php/Tmux) [如何在 tmux 状态栏中显示 CPU / 内存占用百分比](https://stackoverflow.com/questions/11558907/is-there-a-better-way-to-display-cpu-usage-in-tmux) + +[管理复杂 tmux 会话的工具 - tmuxinator](https://github.com/tmuxinator/tmuxinator) From 9b8c680a2e2e1238f4130bc589367baf1a62119e Mon Sep 17 00:00:00 2001 From: Arnie97 Date: Wed, 30 Dec 2015 19:07:19 +0800 Subject: [PATCH 371/457] Update translations. --- zh-cn/tmux-cn.html.markdown | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/zh-cn/tmux-cn.html.markdown b/zh-cn/tmux-cn.html.markdown index 540bbf23..3b38ca6b 100644 --- a/zh-cn/tmux-cn.html.markdown +++ b/zh-cn/tmux-cn.html.markdown @@ -39,7 +39,7 @@ lang: zh-cn lsp # 列出窗格 -a # 列出所有窗格 -s # 列出会话中的所有窗格 - -t # 列出 target 中的所有窗格 + -t "#" # 列出指定窗口中的所有窗格 kill-window # 关闭当前窗口 -t "#" # 关闭指定的窗口 @@ -56,7 +56,7 @@ lang: zh-cn ### 快捷键 -通过“前缀”快捷键,可以控制一个已经连入的tmux会话。 +通过“前缀”快捷键,可以控制一个已经连入的 tmux 会话。 ``` ---------------------------------------------------------------------- @@ -66,7 +66,7 @@ lang: zh-cn ---------------------------------------------------------------------- ? # 列出所有快捷键 - : # 进入tmux的命令提示符 + : # 进入 tmux 的命令提示符 r # 强制重绘当前客户端 c # 创建一个新窗口 @@ -127,7 +127,7 @@ set-option -g status-utf8 on # 命令回滚/历史数量限制 set -g history-limit 2048 -# Index Start +# 从 1 开始编号,而不是从 0 开始 set -g base-index 1 # 启用鼠标 @@ -144,10 +144,10 @@ bind r source-file ~/.tmux.conf # 取消默认的前缀键 C-b unbind C-b -# 设置新的前缀键 +# 设置新的前缀键 ` set-option -g prefix ` -# 再次按下前缀键时,回到之前的窗口 +# 多次按下前缀键时,切换到上一个窗口 bind C-a last-window bind ` last-window @@ -159,7 +159,7 @@ bind F12 set-option -g prefix ` setw -g mode-keys vi set-option -g status-keys vi -# 使用 vim 风格的按键在窗格间移动 +# 使用 Vim 风格的按键在窗格间移动 bind h select-pane -L bind j select-pane -D bind k select-pane -U @@ -238,14 +238,14 @@ set -g status-right "#[fg=green] | #[fg=white]#(tmux-mem-cpu-load)#[fg=green] | ### 参考资料 -[Tmux 主页](http://tmux.sourceforge.net) +[Tmux 主页](http://tmux.github.io) [Tmux 手册](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) +[Archlinux Wiki](https://wiki.archlinux.org/index.php/Tmux_(简体中文)) -[如何在 tmux 状态栏中显示 CPU / 内存占用百分比](https://stackoverflow.com/questions/11558907/is-there-a-better-way-to-display-cpu-usage-in-tmux) +[如何在 tmux 状态栏中显示 CPU / 内存占用的百分比](https://stackoverflow.com/questions/11558907/is-there-a-better-way-to-display-cpu-usage-in-tmux) [管理复杂 tmux 会话的工具 - tmuxinator](https://github.com/tmuxinator/tmuxinator) From aed4bbbc36bf28a815d6751cde02b6b025452fb9 Mon Sep 17 00:00:00 2001 From: Arnie97 Date: Wed, 30 Dec 2015 21:38:18 +0800 Subject: [PATCH 372/457] Update Wiki link --- zh-cn/tmux-cn.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zh-cn/tmux-cn.html.markdown b/zh-cn/tmux-cn.html.markdown index 3b38ca6b..390fd4fc 100644 --- a/zh-cn/tmux-cn.html.markdown +++ b/zh-cn/tmux-cn.html.markdown @@ -242,7 +242,7 @@ set -g status-right "#[fg=green] | #[fg=white]#(tmux-mem-cpu-load)#[fg=green] | [Tmux 手册](http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/tmux.1?query=tmux) -[Gentoo Wiki](http://wiki.gentoo.org/wiki/Tmux) +[FreeBSDChina Wiki](https://wiki.freebsdchina.org/software/t/tmux) [Archlinux Wiki](https://wiki.archlinux.org/index.php/Tmux_(简体中文)) From 4af768019ced6c179a09180adc2b0fb9adebc1d8 Mon Sep 17 00:00:00 2001 From: Arnie97 Date: Wed, 30 Dec 2015 21:54:44 +0800 Subject: [PATCH 373/457] Add a tmux Chinese tutorial --- zh-cn/tmux-cn.html.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zh-cn/tmux-cn.html.markdown b/zh-cn/tmux-cn.html.markdown index 390fd4fc..87afa565 100644 --- a/zh-cn/tmux-cn.html.markdown +++ b/zh-cn/tmux-cn.html.markdown @@ -246,6 +246,8 @@ set -g status-right "#[fg=green] | #[fg=white]#(tmux-mem-cpu-load)#[fg=green] | [Archlinux Wiki](https://wiki.archlinux.org/index.php/Tmux_(简体中文)) +[Tmux 快速教程](http://blog.jeswang.org/blog/2013/06/24/tmux-kuai-su-jiao-cheng) + [如何在 tmux 状态栏中显示 CPU / 内存占用的百分比](https://stackoverflow.com/questions/11558907/is-there-a-better-way-to-display-cpu-usage-in-tmux) [管理复杂 tmux 会话的工具 - tmuxinator](https://github.com/tmuxinator/tmuxinator) From 8fdb648cbc691de5ff8f30c7bb5d0c29385a253c Mon Sep 17 00:00:00 2001 From: Arnie97 Date: Thu, 31 Dec 2015 15:51:09 +0800 Subject: [PATCH 374/457] Update tmux home page, again. --- tmux.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmux.html.markdown b/tmux.html.markdown index 6763a781..c9e3db6b 100644 --- a/tmux.html.markdown +++ b/tmux.html.markdown @@ -7,7 +7,7 @@ filename: LearnTmux.txt --- -[tmux](http://tmux.sourceforge.net) +[tmux](http://tmux.github.io) is a terminal multiplexer: it enables a number of terminals to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background From d56ae11e30ff85a0b8b632506abf4ec1bad1d28e Mon Sep 17 00:00:00 2001 From: Arnie97 Date: Thu, 31 Dec 2015 16:16:02 +0800 Subject: [PATCH 375/457] Finish tmux translations. --- zh-cn/tmux-cn.html.markdown | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/zh-cn/tmux-cn.html.markdown b/zh-cn/tmux-cn.html.markdown index 87afa565..cf865dce 100644 --- a/zh-cn/tmux-cn.html.markdown +++ b/zh-cn/tmux-cn.html.markdown @@ -10,9 +10,9 @@ lang: zh-cn --- -[tmux](http://tmux.sourceforge.net)是一款终端复用工具。 +[tmux](http://tmux.github.io)是一款终端复用工具。 在它的帮助下,你可以在同一个控制台上建立、访问并控制多个终端。 -你可以断开与一个tmux终端的连接,此时程序将在后台运行, +你可以断开与一个 tmux 终端的连接,此时程序将在后台运行, 当你需要时,可以随时重新连接到这个终端。 ``` @@ -70,7 +70,7 @@ lang: zh-cn r # 强制重绘当前客户端 c # 创建一个新窗口 - ! # Break the current pane out of the window. + ! # 将当前窗格从窗口中移出,成为为一个新的窗口 % # 将当前窗格分为左右两半 " # 将当前窗格分为上下两半 @@ -93,11 +93,11 @@ lang: zh-cn Left, Right M-1 到 M-5 # 排列窗格: - # 1) even-horizontal - # 2) even-vertical - # 3) main-horizontal - # 4) main-vertical - # 5) tiled + # 1) 水平等分 + # 2) 垂直等分 + # 3) 将一个窗格作为主要窗格,其他窗格水平等分 + # 4) 将一个窗格作为主要窗格,其他窗格垂直等分 + # 5) 平铺 C-Up, C-Down # 改变当前窗格的大小,每按一次增减一个单位 C-Left, C-Right From 15bd3ff223b998aad3ed2d5fc6a530adc31cb56c Mon Sep 17 00:00:00 2001 From: hyphz Date: Fri, 1 Jan 2016 01:54:11 +0000 Subject: [PATCH 376/457] Rename wolfram.md to wolfram.html.markdown --- wolfram.md => wolfram.html.markdown | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename wolfram.md => wolfram.html.markdown (100%) diff --git a/wolfram.md b/wolfram.html.markdown similarity index 100% rename from wolfram.md rename to wolfram.html.markdown From 01ab402100a08e30d6f88406a55b08b744fcb375 Mon Sep 17 00:00:00 2001 From: hyphz Date: Fri, 1 Jan 2016 01:54:45 +0000 Subject: [PATCH 377/457] Rename factor.html to factor.html.markdown --- factor.html => factor.html.markdown | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename factor.html => factor.html.markdown (100%) diff --git a/factor.html b/factor.html.markdown similarity index 100% rename from factor.html rename to factor.html.markdown From 1f0b1bfb7a8d7abe3563015bad0110d6c319208f Mon Sep 17 00:00:00 2001 From: Borislav Kosharov Date: Sat, 2 Jan 2016 18:43:19 +0200 Subject: [PATCH 378/457] fix parallelism example typo --- d.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d.html.markdown b/d.html.markdown index 6f88cf84..edb3bff5 100644 --- a/d.html.markdown +++ b/d.html.markdown @@ -254,7 +254,7 @@ void main() { // Use an index, access every array element by reference (because we're // going to change each element) and just call parallel on the array! foreach(i, ref elem; parallel(arr)) { - ref = sqrt(i + 1.0); + elem = sqrt(i + 1.0); } } ``` From bde8645cc7bb7f0a88b5d106cd0bd0b7e40886d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Migda=C5=82?= Date: Sun, 3 Jan 2016 19:45:54 +0100 Subject: [PATCH 379/457] pep8 fixes (spaces and multiline statements) in Python readability and code style matters --- pythonstatcomp.html.markdown | 99 ++++++++++++++++++++---------------- 1 file changed, 55 insertions(+), 44 deletions(-) diff --git a/pythonstatcomp.html.markdown b/pythonstatcomp.html.markdown index 78b62e33..f8d83b98 100644 --- a/pythonstatcomp.html.markdown +++ b/pythonstatcomp.html.markdown @@ -9,6 +9,8 @@ This is a tutorial on how to do some typical statistical programming tasks using ```python + + # 0. Getting set up ==== """ Get set up with IPython and pip install the following: numpy, scipy, pandas, @@ -25,17 +27,17 @@ This is a tutorial on how to do some typical statistical programming tasks using already using Python, there's a benefit to sticking with one language. """ -import requests # for HTTP requests (web scraping, APIs) +import requests # for HTTP requests (web scraping, APIs) import os # web scraping r = requests.get("https://github.com/adambard/learnxinyminutes-docs") -r.status_code # if 200, request was successful -r.text # raw page source -print(r.text) # prettily formatted +r.status_code # if 200, request was successful +r.text # raw page source +print(r.text) # prettily formatted # save the page source in a file: -os.getcwd() # check what's the working directory -f = open("learnxinyminutes.html","wb") +os.getcwd() # check what's the working directory +f = open("learnxinyminutes.html", "wb") f.write(r.text.encode("UTF-8")) f.close() @@ -44,7 +46,7 @@ fp = "https://raw.githubusercontent.com/adambard/learnxinyminutes-docs/master/" fn = "pets.csv" r = requests.get(fp + fn) print(r.text) -f = open(fn,"wb") +f = open(fn, "wb") f.write(r.text.encode("UTF-8")) f.close() @@ -58,7 +60,9 @@ f.close() you've used R, you will be familiar with the idea of the "data.frame" already. """ -import pandas as pd, numpy as np, scipy as sp +import pandas as pd +import numpy as np +import scipy as sp pets = pd.read_csv(fn) pets # name age weight species @@ -74,20 +78,20 @@ pets pets.age pets["age"] -pets.head(2) # prints first 2 rows -pets.tail(1) # prints last row +pets.head(2) # prints first 2 rows +pets.tail(1) # prints last row -pets.name[1] # 'vesuvius' -pets.species[0] # 'cat' -pets["weight"][2] # 34 +pets.name[1] # 'vesuvius' +pets.species[0] # 'cat' +pets["weight"][2] # 34 # in R, you would expect to get 3 rows doing this, but here you get 2: pets.age[0:2] # 0 3 # 1 6 -sum(pets.age)*2 # 28 -max(pets.weight) - min(pets.weight) # 20 +sum(pets.age) * 2 # 28 +max(pets.weight) - min(pets.weight) # 20 """ If you are doing some serious linear algebra and number-crunching, you may just want arrays, not DataFrames. DataFrames are ideal for combining columns @@ -96,7 +100,8 @@ max(pets.weight) - min(pets.weight) # 20 # 3. Charts ==== -import matplotlib as mpl, matplotlib.pyplot as plt +import matplotlib as mpl +import matplotlib.pyplot as plt %matplotlib inline # To do data vizualization in Python, use matplotlib @@ -105,13 +110,17 @@ plt.hist(pets.age); plt.boxplot(pets.weight); -plt.scatter(pets.age, pets.weight); plt.xlabel("age"); plt.ylabel("weight"); +plt.scatter(pets.age, pets.weight) +plt.xlabel("age") +plt.ylabel("weight"); # seaborn sits atop matplotlib and makes plots prettier import seaborn as sns -plt.scatter(pets.age, pets.weight); plt.xlabel("age"); plt.ylabel("weight"); +plt.scatter(pets.age, pets.weight) +plt.xlabel("age") +plt.ylabel("weight"); # there are also some seaborn-specific plotting functions # notice how seaborn automatically labels the x-axis on this barplot @@ -141,7 +150,7 @@ ggplot(aes(x="age",y="weight"), data=pets) + geom_point() + labs(title="pets") url = "https://raw.githubusercontent.com/e99n09/R-notes/master/data/hre.csv" r = requests.get(url) fp = "hre.csv" -f = open(fp,"wb") +f = open(fp, "wb") f.write(r.text.encode("UTF-8")) f.close() @@ -149,33 +158,33 @@ hre = pd.read_csv(fp) hre.head() """ - Ix Dynasty Name Birth Death Election 1 -0 NaN Carolingian Charles I 2 April 742 28 January 814 NaN -1 NaN Carolingian Louis I 778 20 June 840 NaN -2 NaN Carolingian Lothair I 795 29 September 855 NaN -3 NaN Carolingian Louis II 825 12 August 875 NaN -4 NaN Carolingian Charles II 13 June 823 6 October 877 NaN + 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 + 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 + Descent from whom 1 Descent how 1 Descent from whom 2 Descent how 2 +0 NaN NaN NaN NaN +1 Charles I son NaN NaN +2 Louis I son NaN NaN +3 Lothair I son NaN NaN +4 Louis I son NaN NaN """ # clean the Birth and Death columns -import re # module for regular expressions +import re # module for regular expressions -rx = re.compile(r'\d+$') # match trailing digits +rx = re.compile(r'\d+$') # match trailing digits """ This function applies the regular expression to an input column (here Birth, Death), flattens the resulting list, converts it to a Series object, and @@ -185,8 +194,9 @@ rx = re.compile(r'\d+$') # match trailing digits - http://stackoverflow.com/questions/11860476/how-to-unlist-a-python-list - http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.html """ + def extractYear(v): - return(pd.Series(reduce(lambda x,y: x+y,map(rx.findall,v),[])).astype(int)) + return(pd.Series(reduce(lambda x, y: x + y, map(rx.findall, v), [])).astype(int)) hre["BirthY"] = extractYear(hre.Birth) hre["DeathY"] = extractYear(hre.Death) @@ -199,17 +209,17 @@ sns.lmplot("BirthY", "EstAge", data=hre, hue="Dynasty", fit_reg=False); # use scipy to run a linear regression from scipy import stats -(slope,intercept,rval,pval,stderr)=stats.linregress(hre.BirthY,hre.EstAge) +(slope, intercept, rval, pval, stderr) = stats.linregress(hre.BirthY, hre.EstAge) # code source: http://wiki.scipy.org/Cookbook/LinearRegression # check the slope -slope # 0.0057672618839073328 +slope # 0.0057672618839073328 # check the R^2 value: -rval**2 # 0.020363950027333586 +rval**2 # 0.020363950027333586 # check the p-value -pval # 0.34971812581498452 +pval # 0.34971812581498452 # use seaborn to make a scatterplot and plot the linear regression trend line sns.lmplot("BirthY", "EstAge", data=hre); @@ -223,6 +233,7 @@ sns.lmplot("BirthY", "EstAge", data=hre); To see a version of the Holy Roman Emperors analysis using R, see - http://github.com/e99n09/R-notes/blob/master/holy_roman_emperors_dates.R """ + ``` If you want to learn more, get _Python for Data Analysis_ by Wes McKinney. It's a superb resource and I used it as a reference when writing this tutorial. From 746df3268afcd0307c0da434bf162632be3d53ea Mon Sep 17 00:00:00 2001 From: Bruno Volcov Date: Mon, 4 Jan 2016 17:28:36 -0200 Subject: [PATCH 380/457] remove contributors name --- ruby.html.markdown | 1 - 1 file changed, 1 deletion(-) diff --git a/ruby.html.markdown b/ruby.html.markdown index b3ef2a4d..267889b1 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -13,7 +13,6 @@ contributors: - ["Levi Bostian", "https://github.com/levibostian"] - ["Rahil Momin", "https://github.com/iamrahil"] - ["Gabriel Halley", https://github.com/ghalley] - - ["Bruno Volcov", https://github.com/volcov] --- From a5730e4ab931b8355704d35ee08acef75435bd83 Mon Sep 17 00:00:00 2001 From: bk2dcradle Date: Tue, 5 Jan 2016 13:25:56 +0530 Subject: [PATCH 381/457] Update --- c++.html.markdown | 48 +++++++---------------------------------------- 1 file changed, 7 insertions(+), 41 deletions(-) diff --git a/c++.html.markdown b/c++.html.markdown index 6033ca06..c1bacf6a 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -809,7 +809,7 @@ void doSomethingWithAFile(const std::string& filename) // object right at the location where it is invoked or passed as // an argument to a function. -// Example consider sorting a vector of pairs using the second +// For example, consider sorting a vector of pairs using the second // value of the pair vector > tester; @@ -820,7 +820,7 @@ tester.push_back(make_pair(5, 0)); // Pass a lambda expression as third argument to the sort function // sort is from the header -sort(tester.begin(), tester.end(), [](const pair &lhs, const pair &rhs) { +sort(tester.begin(), tester.end(), [](const pair& lhs, const pair& rhs) { return lhs.second < rhs.second; }); @@ -834,48 +834,22 @@ for(int i = 0; i < 3; i++){ dog_ids.push_back(i); } -int weight[3]; -weight[0] = 30, weight[1] = 50, weight[2] = 10; +int weight[3] = {30, 50, 10}; // Say you want to sort dog_ids according to the dogs' weights // So dog_ids should in the end become: [2, 0, 1] // Here's where lambda expressions come in handy -sort(dog_ids.begin(), dog_ids.end(), [weight](const int &lhs, const int &rhs) { +sort(dog_ids.begin(), dog_ids.end(), [&weight](const int &lhs, const int &rhs) { return weight[lhs] < weight[rhs]; }); -// Note we captured "weight" in the above example. +// Note we captured "weight" by reference in the above example. // lambda are really useful for the case of structs // You can use lambda expressions instead of overloading // the "<" operator -struct dog{ - int weight, age; -}dogs[3]; - -dogs[0].weight = 30, dogs[0].age = 4; -dogs[1].weight = 40, dogs[1].age = 10; -dogs[2].weight = 20, dogs[2].age = 9; - -// Say I want to sort the dogs array by the dogs' weights - -sort(dogs, dogs+3, [](const dog &lhs, const dog &rhs) { - return lhs.weight < rhs.weight; - }); -// dogs is now sorted according to their weight - -// Do something with the dogs - -// Now I want to sort the dogs by in descending order of their age - -sort(dogs, dogs+3, [](const dog &lhs, const dog &rhs) { - return lhs.age > rhs.age; - }); -// dogs is now sorted in descending order of their age - - /////////////////////////////// // Range For (C++11 and above) /////////////////////////////// @@ -884,24 +858,16 @@ sort(dogs, dogs+3, [](const dog &lhs, const dog &rhs) { int arr[] = {1, 10, 3}; for(int elem: arr){ - cout< Date: Tue, 5 Jan 2016 13:36:23 +0530 Subject: [PATCH 382/457] Add my Changes --- c++.html.markdown | 67 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/c++.html.markdown b/c++.html.markdown index f4aa2f5a..31dbe064 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -820,6 +820,73 @@ std::map fooMap; fooMap[Foo(1)] = 1; fooMap.find(Foo(1)); //true +/////////////////////////////////////// +// Lambda Expressions (C++11 and above) +/////////////////////////////////////// + +// lambdas are a convenient way of defining an anonymous function +// object right at the location where it is invoked or passed as +// an argument to a function. + +// For example, consider sorting a vector of pairs using the second +// value of the pair + +vector > tester; +tester.push_back(make_pair(3, 6)); +tester.push_back(make_pair(1, 9)); +tester.push_back(make_pair(5, 0)); + +// Pass a lambda expression as third argument to the sort function +// sort is from the header + +sort(tester.begin(), tester.end(), [](const pair& lhs, const pair& rhs) { + return lhs.second < rhs.second; + }); + +// Notice the syntax of the lambda expression, +// [] in the lambda is used to "capture" variables. +// For Example: + +vector dog_ids; +// number_of_dogs = 3; +for(int i = 0; i < 3; i++){ + dog_ids.push_back(i); +} + +int weight[3] = {30, 50, 10}; + +// Say you want to sort dog_ids according to the dogs' weights +// So dog_ids should in the end become: [2, 0, 1] + +// Here's where lambda expressions come in handy + +sort(dog_ids.begin(), dog_ids.end(), [&weight](const int &lhs, const int &rhs) { + return weight[lhs] < weight[rhs]; + }); +// Note we captured "weight" by reference in the above example. + +// lambda are really useful for the case of structs +// You can use lambda expressions instead of overloading +// the "<" operator + +/////////////////////////////// +// Range For (C++11 and above) +/////////////////////////////// + +// You can use a range for loop to iterate over a container +int arr[] = {1, 10, 3}; + +for(int elem: arr){ + cout << elem << endl; +} + +// You can use "auto" and not worry about the type of the elements of the container +// For example: + +for(auto elem: arr) { + // Do something with each element of arr +} + ///////////////////// // Fun stuff ///////////////////// From 0fbf289e3cbce3f2b6e830d5dcf1c8d3685a88a1 Mon Sep 17 00:00:00 2001 From: Adam Bard Date: Wed, 6 Jan 2016 03:14:04 +0800 Subject: [PATCH 383/457] Update go-fr.html.markdown --- fr-fr/go-fr.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fr-fr/go-fr.html.markdown b/fr-fr/go-fr.html.markdown index 16558e7e..9d8bef70 100644 --- a/fr-fr/go-fr.html.markdown +++ b/fr-fr/go-fr.html.markdown @@ -3,7 +3,7 @@ name: Go category: language language: Go lang: fr-fr -filename: learngo.go +filename: learngo-fr.go contributors: - ["Sonia Keys", "https://github.com/soniakeys"] - ["Christopher Bess", "https://github.com/cbess"] From e47099866bee5e5f6d2852f4e4cbf92e4d4b0053 Mon Sep 17 00:00:00 2001 From: Adam Bard Date: Wed, 6 Jan 2016 03:17:33 +0800 Subject: [PATCH 384/457] Fix formatting. --- powershell.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/powershell.html.markdown b/powershell.html.markdown index 4bc1ab39..8920d254 100644 --- a/powershell.html.markdown +++ b/powershell.html.markdown @@ -18,6 +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: + ``` Get-ExecutionPolicy -List Set-ExecutionPolicy AllSigned @@ -33,6 +34,7 @@ $PSVersionTable ``` Getting help: + ``` # Find commands Get-Command about_* # alias: gcm @@ -49,6 +51,7 @@ Update-Help # Run as admin ``` The tutorial starts here: + ``` # As you already figured, comments start with # @@ -292,6 +295,7 @@ $Shortcut.Save() Configuring your shell + ``` # $Profile is the full path for your `Microsoft.PowerShell_profile.ps1` # All code there will be executed when the PS session starts From 1d65107a8fd74e67b2b9fe7e2e503a04d0db4df0 Mon Sep 17 00:00:00 2001 From: Adam Bard Date: Wed, 6 Jan 2016 04:13:33 +0800 Subject: [PATCH 385/457] Update latex-es.html.markdown --- es-es/latex-es.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/es-es/latex-es.html.markdown b/es-es/latex-es.html.markdown index 6743ad80..aff3c603 100644 --- a/es-es/latex-es.html.markdown +++ b/es-es/latex-es.html.markdown @@ -1,5 +1,6 @@ --- language: latex +lang: es-es contributors: - ["Chaitanya Krishna Ande", "http://icymist.github.io"] - ["Colton Kohnke", "http://github.com/voltnor"] From e6866f5a26dab28d2d1b5628fbb18139c36a5139 Mon Sep 17 00:00:00 2001 From: bk2dcradle Date: Fri, 8 Jan 2016 01:21:38 +0530 Subject: [PATCH 386/457] More Fixes --- c++.html.markdown | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/c++.html.markdown b/c++.html.markdown index 31dbe064..44cad665 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -840,16 +840,22 @@ tester.push_back(make_pair(5, 0)); // sort is from the header sort(tester.begin(), tester.end(), [](const pair& lhs, const pair& rhs) { - return lhs.second < rhs.second; - }); + return lhs.second < rhs.second; + }); // Notice the syntax of the lambda expression, -// [] in the lambda is used to "capture" variables. -// For Example: +// [] in the lambda is used to "capture" variables +// The "Capture List" defines what from the outside of the lambda should be available inside the function body and how. +// It can be either: +// 1. a value : [x] +// 2. a reference : [&x] +// 3. any variable currently in scope by reference [&] +// 4. same as 3, but by value [=] +// Example: vector dog_ids; // number_of_dogs = 3; -for(int i = 0; i < 3; i++){ +for(int i = 0; i < 3; i++) { dog_ids.push_back(i); } @@ -861,13 +867,10 @@ int weight[3] = {30, 50, 10}; // Here's where lambda expressions come in handy sort(dog_ids.begin(), dog_ids.end(), [&weight](const int &lhs, const int &rhs) { - return weight[lhs] < weight[rhs]; - }); + return weight[lhs] < weight[rhs]; + }); // Note we captured "weight" by reference in the above example. - -// lambda are really useful for the case of structs -// You can use lambda expressions instead of overloading -// the "<" operator +// More on Lambdas in C++ : http://stackoverflow.com/questions/7627098/what-is-a-lambda-expression-in-c11 /////////////////////////////// // Range For (C++11 and above) From cc31c2f0c5032b723a1d57c971580121be07bf7f Mon Sep 17 00:00:00 2001 From: Jacob Ward Date: Thu, 7 Jan 2016 22:08:17 -0700 Subject: [PATCH 387/457] Fix typo referenced in Issue #2075 --- perl6.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl6.html.markdown b/perl6.html.markdown index 6633b322..5082a433 100644 --- a/perl6.html.markdown +++ b/perl6.html.markdown @@ -1329,7 +1329,7 @@ so 'ayc' ~~ / a [ b | y ] c /; # `True`. Obviously enough ... -### Extra: the MAIN subroutime +### Extra: the MAIN subroutine # The `MAIN` subroutine is called when you run a Perl 6 file directly. # It's very powerful, because Perl 6 actually parses the arguments # and pass them as such to the sub. It also handles named argument (`--foo`) From 8ad537a9ba9889234a63c5a38caeab3e225856e4 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 8 Jan 2016 14:35:16 +0800 Subject: [PATCH 388/457] unfuck markdown doc --- cs-cz/markdown.html.markdown | 1 + markdown.html.markdown | 52 +++++++++++++++++++++++------------- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/cs-cz/markdown.html.markdown b/cs-cz/markdown.html.markdown index 637f0ab6..363af5e9 100644 --- a/cs-cz/markdown.html.markdown +++ b/cs-cz/markdown.html.markdown @@ -1,5 +1,6 @@ --- language: markdown +lang: cs-cz contributors: - ["Dan Turkel", "http://danturkel.com/"] translators: diff --git a/markdown.html.markdown b/markdown.html.markdown index 8961c995..05eeecbe 100644 --- a/markdown.html.markdown +++ b/markdown.html.markdown @@ -26,6 +26,7 @@ specific to a certain parser. ## HTML Elements Markdown is a superset of HTML, so any HTML file is valid Markdown. + ```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 \`\`\` @@ -212,6 +216,7 @@ highlighting of the language you specify after the \`\`\` Horizontal rules (`
`) are easily added with three or more asterisks or hyphens, with or without spaces. + ```markdown *** --- @@ -228,58 +233,64 @@ the text to display in hard brackets [] followed by the url in parentheses () [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!" -``` +Markdown also supports reference style links. + +
[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!"
+ 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. There is also "implicit naming" which lets you use the link text as the id. -```markdown -[This][] is a link. -[this]: http://thisisalink.com/ -``` +
[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" -``` +
![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\*. @@ -288,6 +299,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. + ```markdown Your computer crashed? Try sending a Ctrl+Alt+Del @@ -296,6 +308,7 @@ Your computer crashed? Try sending a Tables are only available in Github Flavored Markdown and are slightly cumbersome, but if you really want it: + ```markdown | Col1 | Col2 | Col3 | | :----------- | :------: | ------------: | @@ -309,5 +322,6 @@ 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 e4e737c37125ed831b8f4d24d2d4953814ef9722 Mon Sep 17 00:00:00 2001 From: Laoujin Date: Fri, 8 Jan 2016 19:50:57 +0100 Subject: [PATCH 389/457] [PowerShell/en]: fixed typos/layout. Added some extra aliases/info. --- powershell.html.markdown | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/powershell.html.markdown b/powershell.html.markdown index 8920d254..fc944b85 100644 --- a/powershell.html.markdown +++ b/powershell.html.markdown @@ -247,10 +247,12 @@ function New-Website() { [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') # Note that .NET functions MUST be called with parentheses -# while PS functions CANNOT be called with parentheses +# while PS functions CANNOT be called with parentheses. +# If you do call a cmdlet/PS function with parentheses, +# it is the same as passing a single parameter list $writer = New-Object System.IO.StreamWriter($path, $true) $writer.Write([Environment]::NewLine) -$write.Dispose() +$writer.Dispose() ### IO # Reading a value from input: @@ -268,12 +270,14 @@ Get-Command ConvertTo-*,ConvertFrom-* # 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 +# Aliases are: pushd and popd # Unblock a directory after download Get-ChildItem -Recurse | Unblock-File @@ -308,6 +312,7 @@ if (-not (Test-Path $Profile)) { ``` Interesting Projects + * [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!) @@ -318,6 +323,7 @@ Interesting Projects * [PowerShell Community Extensions](http://pscx.codeplex.com/) (Dead) Not covered + * WMI: Windows Management Intrumentation (Get-CimInstance) * Multitasking: Start-Job -scriptBlock {...}, * Code Signing From 759a6a29aa02d53098d571999e175b4bd03a3052 Mon Sep 17 00:00:00 2001 From: ditam Date: Fri, 8 Jan 2016 21:09:47 +0100 Subject: [PATCH 390/457] add language label --- hu-hu/yaml-hu.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/hu-hu/yaml-hu.html.markdown b/hu-hu/yaml-hu.html.markdown index aca6cd37..37ce4cb2 100644 --- a/hu-hu/yaml-hu.html.markdown +++ b/hu-hu/yaml-hu.html.markdown @@ -5,6 +5,7 @@ contributors: - ["Adam Brenecki", "https://github.com/adambrenecki"] translators: - ["Tamás Diószegi", "https://github.com/ditam"] +lang: hu-hu --- A YAML egy adat sorosító nyelv, amit úgy terveztek, hogy közvetlenül is From 15a7e7ace2e61470c5b0de667d33d06a1223ba46 Mon Sep 17 00:00:00 2001 From: SWalls Date: Sun, 10 Jan 2016 17:22:32 -0700 Subject: [PATCH 391/457] Changed a to b in comment about list assignment, and pluralized 'variable'. --- python3.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python3.html.markdown b/python3.html.markdown index 8cc03320..31b5bbe1 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -97,13 +97,13 @@ 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 variables 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 = [1, 2, 3, 4] # Point b 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 From f94dea8379b5e7a28990eac371f9c9cca19ab472 Mon Sep 17 00:00:00 2001 From: Matteo Baglini Date: Tue, 12 Jan 2016 00:32:03 +0100 Subject: [PATCH 392/457] Use proper string comparison syntax --- bash.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bash.html.markdown b/bash.html.markdown index 211d2944..bd2d5984 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -83,7 +83,7 @@ echo Hello, $Name! # We have the usual if structure: # use 'man test' for more info about conditionals -if [ $Name -ne $USER ] +if [ $Name != $USER ] then echo "Your name isn't your username" else @@ -91,12 +91,12 @@ else fi # NOTE: if $Name is empty, bash sees the above condition as: -if [ -ne $USER ] +if [ != $USER ] # which is invalid syntax # so the "safe" way to use potentially empty variables in bash is: -if [ "$Name" -ne $USER ] ... +if [ "$Name" != $USER ] ... # which, when $Name is empty, is seen by bash as: -if [ "" -ne $USER ] ... +if [ "" != $USER ] ... # which works as expected # There is also conditional execution From 8ecf73a086b41a33058211f7a415b771bb04f79d Mon Sep 17 00:00:00 2001 From: Paul Brewczynski Date: Wed, 13 Jan 2016 10:01:46 +0100 Subject: [PATCH 393/457] Updated documentation syntax As Xcode switched to Markdown syntax, I've updated it. --- swift.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/swift.html.markdown b/swift.html.markdown index e6bf1621..c54f8e00 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -221,9 +221,9 @@ A greet operation - 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. +- Parameter name : A name +- Parameter 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)." From b41a699099ff3d6d770775dc73ab47466f498454 Mon Sep 17 00:00:00 2001 From: Tomy Date: Thu, 14 Jan 2016 00:01:47 +0900 Subject: [PATCH 394/457] translate until line 100 --- ja-jp/php.html.markdown | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/ja-jp/php.html.markdown b/ja-jp/php.html.markdown index 4448a1f5..0cea2041 100644 --- a/ja-jp/php.html.markdown +++ b/ja-jp/php.html.markdown @@ -39,61 +39,62 @@ Hello World Again! * 型と変数について */ -// Variables begin with the $ symbol. -// A valid variable name starts with a letter or underscore, -// followed by any number of letters, numbers, or underscores. +// 変数は"$"マークで始まります +// 有効な変数名にするには、文字またはアンダースコア(_)で始めて, +// その後はどんな数字でも、文字でも、アンダースコアで続けても構いません -// Boolean values are case-insensitive +//ブーリアン値は大文字、小文字問いません $boolean = true; // or TRUE or True $boolean = false; // or FALSE or False -// Integers +// 数値 $int1 = 12; // => 12 $int2 = -12; // => -12 -$int3 = 012; // => 10 (a leading 0 denotes an octal number) -$int4 = 0x0F; // => 15 (a leading 0x denotes a hex literal) +$int3 = 012; // => 10 (先頭の0は8進法を示す) +$int4 = 0x0F; // => 15 (先頭の0xは16進法を示す) -// Floats (aka doubles) +// floats(浮動小数) (別名double) $float = 1.234; $float = 1.2e3; $float = 7E-10; -// Delete variable +// 変数の削除 unset($int1); -// Arithmetic +// 計算式 $sum = 1 + 1; // 2 $difference = 2 - 1; // 1 $product = 2 * 2; // 4 $quotient = 2 / 1; // 2 -// Shorthand arithmetic +// 式の省略 $number = 0; -$number += 1; // Increment $number by 1 -echo $number++; // Prints 1 (increments after evaluation) -echo ++$number; // Prints 3 (increments before evaluation) -$number /= $float; // Divide and assign the quotient to $number +$number += 1; // $numberに1加算Increment $number by 1 +echo $number++; // 1 がプリントされる(式の評価の後に加算される) +echo ++$number; // 3 がプリントされる(式の評価の前に加算される) +$number /= $float; // 割り算した結果の商を$numberに割り当てる -// Strings should be enclosed in single quotes; +// 文字列はシングルクォートで囲むのが望ましいです $sgl_quotes = '$String'; // => '$String' -// Avoid using double quotes except to embed other variables +// 文字列中に、他の変数を埋め込みたい場合以外は、ダブルクォートを使用するのはやめましょう $dbl_quotes = "This is a $sgl_quotes."; // => 'This is a $String.' // Special characters are only escaped in double quotes +// 特殊文字はダブルクォートによってのみ、エスケープされます $escaped = "This contains a \t tab character."; $unescaped = 'This just contains a slash and a t: \t'; -// Enclose a variable in curly braces if needed +// 必要があれば、変数を波括弧で囲みます $money = "I have $${number} in the bank."; -// Since PHP 5.3, nowdocs can be used for uninterpolated multi-liners +// PHP 5.3から、nowdocs形式が変数の挿入をしない複数行の文字列の定義に使用できます $nowdoc = <<<'END' Multi line string END; -// Heredocs will do string interpolation +// ヒアドキュメント形式なら、文字列中に変数の挿入を行えます。 $heredoc = << Date: Wed, 13 Jan 2016 23:50:24 -0500 Subject: [PATCH 395/457] Created the first asciidoc tutorial --- asciidoc.markdown | 66 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 asciidoc.markdown diff --git a/asciidoc.markdown b/asciidoc.markdown new file mode 100644 index 00000000..d6cfeca0 --- /dev/null +++ b/asciidoc.markdown @@ -0,0 +1,66 @@ +--- +language: asciidoc +contributors: + - ["Ryan Mavilia", "http://unoriginality.rocks/:] +filename: asciidoc.md +--- + +AsciiDoc is a markup language similar to Markdown and it can be used for anything from books to blogs. Created in 2002 by Stuart Rackham the language is simple but it allows for a great amount of customization. + +Document Header + +Headers are optional and can't contain blank lines. It must be offset from content by at least one blank line. + +Title Only + +```asciidoc += Document Title + +First sentence of document. +``` + +Title and Author + +```asciidoc += Document Title +First Last + +Start of this document. +``` + +Multiple Authors +```asciidoc += Document Title +John Doe ; Jane Doe; Black Beard + +Start of a doc with multiple authors. +``` + +Revision Line (requires an author line) +```asciidoc += Doc Title V1 +Potato Man +v1.0, 2016-01-13 + +This article about chips is going to be fun. +``` + +Section Titles + +```asciidoc += Level 0 (may only be used in document's header) + +== Level 1

+ +=== Level 2

+ +==== Level 3

+ +===== Level 4

+ +====== Level 5
+ +======= Level 6 + +``` + From e7f1108b20a1fa5f7946ae205852751bed48b40d Mon Sep 17 00:00:00 2001 From: Tomy Date: Thu, 14 Jan 2016 21:15:25 +0900 Subject: [PATCH 396/457] translate 100 to 150 lines --- ja-jp/php.html.markdown | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/ja-jp/php.html.markdown b/ja-jp/php.html.markdown index 0cea2041..c01e2ba0 100644 --- a/ja-jp/php.html.markdown +++ b/ja-jp/php.html.markdown @@ -100,53 +100,54 @@ Multi line $sgl_quotes END; -// String concatenation is done with . +// 文字列の連結は . で行います echo 'This string ' . 'is concatenated'; -// Strings can be passed in as parameters to echo +// 別々のパラメータとしてechoに渡すこともできます echo 'Multiple', 'Parameters', 'Valid'; /******************************** - * Constants + * 定数 */ -// A constant is defined by using define() -// and can never be changed during runtime! +// 定数は define() を使って定義します +// また、実行中は変更することができないので注意が必要です! -// a valid constant name starts with a letter or underscore, -// 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; /******************************** - * Arrays + * 配列 */ -// All arrays in PHP are associative arrays (hashmaps), +// PHPの配列はすべて連想配列です -// Associative arrays, known as hashmaps in some languages. +// 連想配列は、他の言語ではハッシュ(ハッシュマップ)として知られています -// Works with all PHP versions +// すべてのバージョンのPHPで動作します $associative = array('One' => 1, 'Two' => 2, 'Three' => 3); -// PHP 5.4 introduced a new syntax +// PHP 5.4 から、新しいシンタックスが導入されました $associative = ['One' => 1, 'Two' => 2, 'Three' => 3]; -echo $associative['One']; // prints 1 +echo $associative['One']; // 1とプリントされます -// List literals implicitly assign integer keys +// キーを指定しないシンプルな配列にも、自動的に数値キーが振られます $array = ['One', 'Two', 'Three']; echo $array[0]; // => "One" -// Add an element to the end of an array +// 配列の最後に要素を追加する $array[] = 'Four'; -// or +// または、次のようにも書けます array_push($array, 'Five'); -// Remove element from array +// 配列から要素を削除 unset($array[3]); /******************************** From e8c0c436c9aad0f3902a4e0826bf72de49bde12b Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Thu, 14 Jan 2016 10:17:51 -0500 Subject: [PATCH 397/457] Added observer pattern, per barkthin's feedback --- solidity.html.markdown | 45 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index 71a44b92..3a5e8ff5 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -506,7 +506,8 @@ function remove() { // Steps: 1. Commit to something, 2. Reveal commitment sha3("some_bid_amount", "some secret"); // commit -// call contract's reveal function showing bid plus secret that hashes to SHA3 +// call contract's reveal function in the future +// showing bid plus secret that hashes to SHA3 reveal(100, "mySecret"); // B. Storage optimization @@ -531,7 +532,45 @@ reveal(100, "mySecret"); // Contracts must be manually called to handle time-based scheduling; can create external // code to regularly ping, or provide incentives (ether) for others to -// E. State machines +// E. Observer Pattern +// An Observer Pattern lets you register as a subscriber and +// register a function which is called by the oracle (note, the oracle pays +// for this action to be run) +// Some similarities to subscription in Pub/sub + +// This is an abstract contract, both client and server classes import +// the client should implement +contract SomeOracleCallback { + function oracleCallback(int _value, uint _time, bytes32 info) external; +} + +contract SomeOracle { + SomeOracleCallback[] callbacks; // array of all subscribers + + // Register subscriber + function addSubscriber(SomeOracleCallback a) { + callbacks.push(a); + } + + function notify(value, time, info) private { + for(uint i = 0;i < callbacks.length; i++) { + // all called subscribers must implement the oracleCallback + callbacks[i].oracleCallback(value, time, info); + } + } + + function doSomething() public { + // Code to do something + + // Notify all subscribers + notify(_value, _time, _info); + } +} + +// Now, your client contract can addSubscriber by importing SampleOracleCallback +// and registering with Sample Oracle + +// F. State machines // see example below for State enum and inState modifier @@ -748,7 +787,7 @@ someContractAddress.callcode('function_name'); - Libraries ## Style -- Python's [PEP8](https://www.python.org/dev/peps/pep-0008/) is used as the baseline style guide, including its general philosophy) +- Python's [PEP8](https://www.python.org/dev/peps/pep-0008/) is used as the baseline style guide, including its general philosophy ## Future To Dos - New keywords: protected, inheritable From 1c1944acb480d9c463c59136eba5ffa19f376fdc Mon Sep 17 00:00:00 2001 From: Paul Brewczynski Date: Thu, 14 Jan 2016 19:11:45 +0100 Subject: [PATCH 398/457] Updated comment on documentation of Swift functions Documentation syntax is no longer reStructuredText, It's "Swift-flavored version of Markdown" http://nshipster.com/swift-documentation/ --- swift.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift.html.markdown b/swift.html.markdown index c54f8e00..46996526 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -213,7 +213,7 @@ default: // required (in order to cover all possible input) // Functions are a first-class type, meaning they can be nested // in functions and can be passed around -// Function with Swift header docs (format as reStructedText) +// Function with Swift header docs (format as Swift-modified Markdown syntax) /** A greet operation From 810108ee73a6acc882155ec7ff1bc07983ced05e Mon Sep 17 00:00:00 2001 From: Nemil Dalal Date: Thu, 14 Jan 2016 14:01:45 -0500 Subject: [PATCH 399/457] Fixed error in name --- solidity.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solidity.html.markdown b/solidity.html.markdown index 3a5e8ff5..a511bbb3 100644 --- a/solidity.html.markdown +++ b/solidity.html.markdown @@ -567,8 +567,8 @@ contract SomeOracle { } } -// Now, your client contract can addSubscriber by importing SampleOracleCallback -// and registering with Sample Oracle +// Now, your client contract can addSubscriber by importing SomeOracleCallback +// and registering with Some Oracle // F. State machines // see example below for State enum and inState modifier From b5bdff8f9eca5385dcd76c42cd19b17e58307584 Mon Sep 17 00:00:00 2001 From: Tomy Date: Sat, 16 Jan 2016 00:07:29 +0900 Subject: [PATCH 400/457] translate to 328 --- ja-jp/php.html.markdown | 85 +++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 41 deletions(-) diff --git a/ja-jp/php.html.markdown b/ja-jp/php.html.markdown index c01e2ba0..22c0561c 100644 --- a/ja-jp/php.html.markdown +++ b/ja-jp/php.html.markdown @@ -151,37 +151,39 @@ array_push($array, 'Five'); unset($array[3]); /******************************** - * Output + * 出力 */ echo('Hello World!'); -// Prints Hello World! to stdout. +// 標準出力にHello World! とプリントします +// 標準出力はブラウザーで実行していればWebページに出力されます // Stdout is the web page if running in a browser. -print('Hello World!'); // The same as echo +print('Hello World!'); // echoの結果と同じです +// echo は言語自体の構成要素であり、括弧なしで呼び出せます // echo is actually a language construct, so you can drop the parentheses. echo 'Hello World!'; -print 'Hello World!'; // So is print +print 'Hello World!'; // printも同様です $paragraph = 'paragraph'; -echo 100; // Echo scalar variables directly -echo $paragraph; // or variables +echo 100; // スカラー数値を直接出力します +echo $paragraph; // 変数も使用できます -// If short open tags are configured, or your PHP version is -// 5.4.0 or greater, you can use the short echo syntax +// PHPタグの短縮型が設定されているか、使用しているPHPのバージョンが +// 5.4.0 以上であれば、短縮echoシンタックスを使用できます ?>

2 echo $z; // => 2 @@ -189,23 +191,23 @@ $y = 0; echo $x; // => 2 echo $z; // => 0 -// Dumps type and value of variable to stdout -var_dump($z); // prints int(0) +// 変数の型と値を標準出力へダンプします +var_dump($z); // int(0) と出力されます -// Prints variable to stdout in human-readable format +// 人間が読めるフォーマットで変数を標準出力にプリントします print_r($array); // prints: Array ( [0] => One [1] => Two [2] => Three ) /******************************** - * Logic + * ロジック */ $a = 0; $b = '0'; $c = '1'; $d = '1'; -// assert throws a warning if its argument is not true +// assertは引数がfalseの場合、Exceptionを投げます -// These comparisons will always be true, even if the types aren't the same. +//これらの比較は型が違ったとしても、常に真です。 assert($a == $b); // equality assert($c != $a); // inequality assert($c <> $a); // alternative inequality @@ -214,32 +216,33 @@ assert($c > $b); assert($a <= $b); assert($c >= $d); -// The following will only be true if the values match and are the same type. +// 次の比較は値が等しく、かつ同じ型である場合のみ真です assert($c === $d); assert($a !== $d); assert(1 === '1'); assert(1 !== '1'); -// spaceship operator since PHP 7 +// spaceship演算子はPHP7から使用可能です $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 +echo $a <=> $a; // 等しいので0になります +echo $a <=> $b; // $a < $b なので -1 です +echo $b <=> $a; // $b > $a なので 1 です -// Variables can be converted between types, depending on their usage. +// 変数は使用するコンテキストによって、変換されます $integer = 1; echo $integer + $integer; // => 2 $string = '1'; -echo $string + $string; // => 2 (strings are coerced to integers) +echo $string + $string; // => 2 (文字列は強制的に数値として処理されます) $string = 'one'; echo $string + $string; // => 0 -// Outputs 0 because the + operator cannot cast the string 'one' to a number +// '+'演算子は文字列'one'を数値にキャストできないので、0と出力されます +// 型のキャスティングによって、変数を指定したもう一つの型として扱うことができます // Type casting can be used to treat a variable as another type $boolean = (boolean) 1; // => true @@ -247,15 +250,15 @@ $boolean = (boolean) 1; // => true $zero = 0; $boolean = (boolean) $zero; // => false -// There are also dedicated functions for casting most types +// 型をキャストするため専用の関数も存在します $integer = 5; $string = strval($integer); -$var = null; // Null value +$var = null; // Null値 /******************************** - * Control Structures + * 制御構造 */ if (true) { @@ -274,15 +277,15 @@ if (false) { print 'Does'; } -// ternary operator +// 参考演算子 print (false ? 'Does not get printed' : 'Does'); -// ternary shortcut operator since PHP 5.3 -// equivalent of "$x ? $x : 'Does'"" +// PHP 5.3から、三項演算子の短縮形が使用できます +// $x ? $x : 'Does'と同義です $x = false; print($x ?: 'Does'); -// null coalesce operator since php 7 +// null合体演算子はPHP 7から使用できます $a = null; $b = 'Does print'; echo $a ?? 'a is not set'; // prints 'a is not set' @@ -300,29 +303,29 @@ if ($x === '0') { -// This alternative syntax is useful for templates: +// :を用いる別の構文はテンプレートで有用です ?> -This is displayed if the test is truthy. +この部分はifが真のとき表示されます -This is displayed otherwise. +それ以外の場合は、この部分が表示されます Date: Sat, 16 Jan 2016 19:30:25 +0100 Subject: [PATCH 401/457] [Swift/en] Deleted semicolon to be consistent - Small Fix this line let weak = "keyword"; let override = "another keyword" // statements can be separated by a semi-colon show off semicolon use. But after that semicolon is not used, so I removed inconsistency. --- swift.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift.html.markdown b/swift.html.markdown index 46996526..46768375 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -392,7 +392,7 @@ testTryStuff() public class Shape { public func getArea() -> Int { - return 0; + return 0 } } From b8784faf28ffcda0bc8b5a122a7845ebc6b3432d Mon Sep 17 00:00:00 2001 From: Tomy Date: Sun, 17 Jan 2016 13:04:25 +0900 Subject: [PATCH 402/457] translate to 487 --- ja-jp/php.html.markdown | 64 +++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/ja-jp/php.html.markdown b/ja-jp/php.html.markdown index 22c0561c..96d45f08 100644 --- a/ja-jp/php.html.markdown +++ b/ja-jp/php.html.markdown @@ -328,7 +328,7 @@ switch ($x) { //デフォルトで何かを実行します } -// While, do...while and for loops are probably familiar +// while, do, forの構文は、おそらく他の言語とも共通なものです $i = 0; while ($i < 5) { echo $i++; @@ -351,14 +351,14 @@ echo "\n"; $wheels = ['bicycle' => 2, 'car' => 4]; -// Foreach loops can iterate over arrays +//Foreachループによって、 配列を反復処理できます foreach ($wheels as $wheel_count) { echo $wheel_count; } // Prints "24" echo "\n"; -// You can iterate over the keys as well as the values +// 値と同じ様に、keyも反復処理できます foreach ($wheels as $vehicle => $wheel_count) { echo "A $vehicle has $wheel_count wheels"; } @@ -382,20 +382,20 @@ for ($i = 0; $i < 5; $i++) { /******************************** - * Functions + * 関数 */ -// Define a function with "function": +// 関数を"function"で定義します function my_function () { return 'Hello'; } echo my_function(); // => "Hello" -// A valid function name starts with a letter or underscore, followed by any -// number of letters, numbers, or underscores. +// 有効な関数名は、文字またはアンダースコアで始めます。それ以降は +// どれだけ長い文字、数値、アンダースコアを続けても構いません -function add ($x, $y = 1) { // $y is optional and defaults to 1 +function add ($x, $y = 1) { // $yはオプショナルな値であり、デフォルトで 1 です $result = $x + $y; return $result; } @@ -403,10 +403,10 @@ function add ($x, $y = 1) { // $y is optional and defaults to 1 echo add(4); // => 5 echo add(4, 2); // => 6 -// $result is not accessible outside the function -// print $result; // Gives a warning. +// $result には、関数の外からアクセス出来ません +// print $result; // エラーになります -// Since PHP 5.3 you can declare anonymous functions; +// PHP 5.3 から、無名関数が使えます $inc = function ($x) { return $x + 1; }; @@ -417,9 +417,9 @@ function foo ($x, $y, $z) { echo "$x - $y - $z"; } -// Functions can return functions +// 関数は、関数を返すことができます function bar ($x, $y) { - // Use 'use' to bring in outside variables + // 関数外の変数を利用したいときは、'use'を使います return function ($z) use ($x, $y) { foo($x, $y, $z); }; @@ -428,14 +428,15 @@ function bar ($x, $y) { $bar = bar('A', 'B'); $bar('C'); // Prints "A - B - C" -// You can call named functions using strings +// 文字列を使って、定義済みの関数を呼び出すことができます $function_name = 'add'; echo $function_name(1, 2); // => 3 -// Useful for programatically determining which function to run. -// Or, use call_user_func(callable $callback [, $parameter [, ... ]]); + +// プログラミング中に、動的に動かす関数を決める場合に便利です。 +// もしくは、call_user_func(callable $callback [, $parameter [, ... ]]) を使っても同じことができます -// You can get the all the parameters passed to a function +// 特に指定しなくても、渡された引数を受け取ることもできます function parameters() { $numargs = func_num_args(); if ($numargs > 0) { @@ -450,38 +451,39 @@ function parameters() { parameters('Hello', 'World'); // Hello | 0 - Hello | 1 - World | /******************************** - * Includes + * ファイルの読み込み */ Date: Sun, 17 Jan 2016 16:18:48 +0900 Subject: [PATCH 403/457] translate all --- ja-jp/php.html.markdown | 118 +++++++++++++++++++++------------------- 1 file changed, 61 insertions(+), 57 deletions(-) diff --git a/ja-jp/php.html.markdown b/ja-jp/php.html.markdown index 96d45f08..a5b48120 100644 --- a/ja-jp/php.html.markdown +++ b/ja-jp/php.html.markdown @@ -487,51 +487,52 @@ $value = include 'my-include.php'; /* */ /******************************** - * Classes + * クラス */ -// Classes are defined with the class keyword +// クラスはclassキーワードで定義します class MyClass { - const MY_CONST = 'value'; // A constant + const MY_CONST = 'value'; // クラス定数です static $staticVar = 'static'; - // Static variables and their visibility + // スタティック変数とアクセス制限 public static $publicStaticVar = 'publicStatic'; - // Accessible within the class only + // クラス内でのみアクセス可能 private static $privateStaticVar = 'privateStatic'; - // Accessible from the class and subclasses + // そのクラスと子クラスで参照可能 protected static $protectedStaticVar = 'protectedStatic'; - // Properties must declare their visibility + // プロパティはアクセス制限を宣言する必要があります public $property = 'public'; public $instanceProp; - protected $prot = 'protected'; // Accessible from the class and subclasses - private $priv = 'private'; // Accessible within the class only + protected $prot = 'protected'; // そのクラスと子クラスで参照可能 + private $priv = 'private'; // クラス内でのみアクセス可能 - // Create a constructor with __construct + // __constructでコンストラクターを生成します public function __construct($instanceProp) { - // Access instance variables with $this + // $thisでインスタンス変数にアクセスします $this->instanceProp = $instanceProp; } - // Methods are declared as functions inside a class + // メソッドはクラス内で関数として定義されます public function myMethod() { print 'MyClass'; } - //final keyword would make a function unoverridable + // finalキーワードは関数の上書きを禁止します final function youCannotOverrideMe() { } /* - * Declaring class properties or methods as static makes them accessible without - * needing an instantiation of the class. A property declared as static can not - * be accessed with an instantiated class object (though a static method can). + * クラスプロパティまたはメソッドをstaticとして作成すれば、 + * クラスをインスタンス化(newすること)しなくてもアクセスできます。 + * プロパティをstaticとして定義すると、 + * インスタンス化されたクラスオブジェクトを通してのアクセスはできなくなります。 */ public static function myStaticMethod() @@ -540,23 +541,23 @@ class MyClass } } -// Class constants can always be accessed statically +// クラス定数は、いつでも静的にアクセスできます。 echo MyClass::MY_CONST; // Outputs 'value'; echo MyClass::$staticVar; // Outputs 'static'; MyClass::myStaticMethod(); // Outputs 'I am static'; -// Instantiate classes using new +// クラスをインスタンス化するには、newを使います。 $my_class = new MyClass('An instance property'); -// The parentheses are optional if not passing in an argument. +// 括弧はもし引数を渡す必要がなければ省略可能です。 -// Access class members using -> +// ->を使ってクラスのメンバにアクセスします。 echo $my_class->property; // => "public" echo $my_class->instanceProp; // => "An instance property" $my_class->myMethod(); // => "MyClass" -// Extend classes using "extends" +// extendsを使用してクラスを継承します。 class MyOtherClass extends MyClass { function printProtectedProperty() @@ -564,7 +565,7 @@ class MyOtherClass extends MyClass echo $this->prot; } - // Override a method + // メソッドを上書きします。 function myMethod() { parent::myMethod(); @@ -580,7 +581,7 @@ final class YouCannotExtendMe { } -// You can use "magic methods" to create getters and setters +// 「マジックメソッド」を使ってゲッターとセッターを生成できます。 class MyMapClass { private $property; @@ -597,12 +598,12 @@ class MyMapClass } $x = new MyMapClass(); -echo $x->property; // Will use the __get() method -$x->property = 'Something'; // Will use the __set() method +echo $x->property; // __get() メソッドを使用します +$x->property = 'Something'; // __set() メソッドを使用します -// Classes can be abstract (using the abstract keyword) or -// implement interfaces (using the implements keyword). -// An interface is declared with the interface keyword. +// クラスは抽象クラスにもできます(abstractキーワードを使用します)し、 +// インターフェースを実装することもできます(implementsキーワードを使用します)。 +// インターフェースはinterfaceキーワードで定義します。 interface InterfaceOne { @@ -614,7 +615,7 @@ interface InterfaceTwo public function doSomethingElse(); } -// interfaces can be extended +// インターフェースは継承することができます interface InterfaceThree extends InterfaceTwo { public function doAnotherContract(); @@ -639,7 +640,7 @@ class MyConcreteClass extends MyAbstractClass implements InterfaceTwo } -// Classes can implement more than one interface +// クラスは1つ以上のインターフェースを実装できます。 class SomeOtherClass implements InterfaceOne, InterfaceTwo { public function doSomething() @@ -655,10 +656,10 @@ class SomeOtherClass implements InterfaceOne, InterfaceTwo /******************************** - * Traits + * トレイト */ -// Traits are available from PHP 5.4.0 and are declared using "trait" +// トレイトはPHP 5.4.0 以上で使用可能で、traitキーワードで定義します。 trait MyTrait { @@ -678,39 +679,40 @@ $cls->myTraitMethod(); // Prints "I have MyTrait" /******************************** - * Namespaces + * 名前空間 */ -// This section is separate, because a namespace declaration -// must be the first statement in a file. Let's pretend that is not the case +// このセクションは名前空間の定義はファイルの先頭で宣言される必要があるため、 +// 独立しています。 +// そのケースには当てはまらないふりをして続けましょう。 Date: Sun, 17 Jan 2016 16:21:04 +0900 Subject: [PATCH 404/457] fix typo --- ja-jp/php.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ja-jp/php.html.markdown b/ja-jp/php.html.markdown index a5b48120..b07dfb2f 100644 --- a/ja-jp/php.html.markdown +++ b/ja-jp/php.html.markdown @@ -277,7 +277,7 @@ if (false) { print 'Does'; } -// 参考演算子 +// 三項演算子 print (false ? 'Does not get printed' : 'Does'); // PHP 5.3から、三項演算子の短縮形が使用できます From 0bd64705a8096ed1ad808653bd88f1372533dd47 Mon Sep 17 00:00:00 2001 From: Ryan Mavilia Date: Sun, 17 Jan 2016 03:55:54 -0500 Subject: [PATCH 405/457] Update asciidoc.markdown --- asciidoc.markdown | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/asciidoc.markdown b/asciidoc.markdown index d6cfeca0..b98d0fa9 100644 --- a/asciidoc.markdown +++ b/asciidoc.markdown @@ -45,22 +45,22 @@ v1.0, 2016-01-13 This article about chips is going to be fun. ``` -Section Titles +Section Titles ```asciidoc = Level 0 (may only be used in document's header) -== Level 1

+== Same as

-=== Level 2

+=== Same as

-==== Level 3

+==== Same as

-===== Level 4

+===== Same as
-====== Level 5
+====== Same as
-======= Level 6 +======= Same as ``` From b253b8e4cba10dc28023e613498473f78e3a17ad Mon Sep 17 00:00:00 2001 From: Ryan Mavilia Date: Sun, 17 Jan 2016 04:04:41 -0500 Subject: [PATCH 406/457] Rename asciidoc.markdown to asciidoc.html.markdown --- asciidoc.markdown => asciidoc.html.markdown | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename asciidoc.markdown => asciidoc.html.markdown (100%) diff --git a/asciidoc.markdown b/asciidoc.html.markdown similarity index 100% rename from asciidoc.markdown rename to asciidoc.html.markdown From e91cb98abedd979f67acdc08dd7cb81b75f317cc Mon Sep 17 00:00:00 2001 From: Cedric HT Date: Sun, 17 Jan 2016 19:38:14 +0100 Subject: [PATCH 407/457] Translated Wolfram tutorial to french --- fr-fr/wolfram-fr.html.markdown | 166 +++++++++++++++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 fr-fr/wolfram-fr.html.markdown diff --git a/fr-fr/wolfram-fr.html.markdown b/fr-fr/wolfram-fr.html.markdown new file mode 100644 index 00000000..d297bd74 --- /dev/null +++ b/fr-fr/wolfram-fr.html.markdown @@ -0,0 +1,166 @@ +--- +language: wolfram +contributors: + - ["hyphz", "http://github.com/hyphz/"] + - ["altaris", "http://github.com/altaris/"] +filename: learnwolfram.nb +--- + +Le langage Wolfram est utilisé dans les programmes suivants : +* La ligne de commandes interactive noyau du Raspberry Pi, mais elle ne peut pas +gérer des éléments graphiques. +* _Mathematica_, un éditeur de texte riche spécialisé pour les mathématiques : +appuyer sur `Shift + Entrée` dans une cellule de code crée un nouvelle cellule +contenant le résultat. +* _Wolfram Wokbench_, une variante d'Eclipse spécialisée pour le langage +Wolfram. + +Ce code d'exemple peut être utilisé et modifié dans ces logiciels. Cependant, le +copier-coller directement dans Mathematica peut causer des problèmes de +formatage, car il ne contient aucune information de mise en page. + +``` +(* Ceci est un commentaire *) + +(* Dans Mathematica, au lieu d'utiliser ces commentaires, vous pouvez créer des + cellules de texte et insérer de jolies images *) + +(* Saisissez une opération et appuyez sur Shift + Entrée pour obtenir le + résultat *) +2*2 (* 4 *) +5+8 (* 13 *) + +(* Appels de fonction *) +(* Le langage Wolfram est sensible à la casse *) +Sin[Pi/2] (* 1 *) + +(* Syntaxe alternative pour les appels de fonction à 1 paramètre *) +Sin@(Pi/2) (* 1 *) +(Pi/2) // Sin (* 1 *) + +(* Dans le langage Wolfram, toutes les expressions sont en réalité des appels de + fonction *) +Times[2, 2] (* 4 *) +Plus[5, 8] (* 13 *) + +(* Utiliser une variable pour la première fois la déclare globalement *) +x = 5 (* 5 *) +x == 5 (* True, l'assignation et le test d'égalité est écrit comme + dans le C *) +x (* 5 *) +x = x + 5 (* 10 *) +x (* 10 *) +Set[x, 20] (* TOUT est un appel de fonction, TOUUUUUUUUT *) +x (* 20 *) + +(* Le langage Wolfram effectue des manipulations symboliques, donc utiliser des + variables non déclarées n'est pas illégal *) +cow + 5 (* 5 + cow, comme cow n'est pas déclarée, l'évaluation + s'arrête là *) +cow + 5 + 10 (* 15 + cow, on évalue ce qu'on peut... *) +% (* 15 + cow, % représente le dernier résultat *) +% - cow (* 15, les variables non déclarées peuvent quand même + s'annuler *) +moo = cow + 5 (* Attention : moo est ici une expression et non un nombre *) + +(* Déclaration d'une fonction *) +Double[x_] := x * 2 (* Le symbole := empêche l'évaluation immédiate du terme + à droite *) +Double[10] (* 20 *) +Double[Sin[Pi/2]] (* 2 *) +Double @ Sin @ (Pi/2) (* 2, Utiliser @ évite les paquets de crochets + fermants si moches *) +(Pi/2) // Sin // Double(* 2, Utiliser // permet d'écrire les fonctions dans + l'ordre d'appel *) + +(* Pour la programmation impérative, utiliser ; pour séparer les expressions *) +MyFirst[] := (Print@"Hello"; Print@"World") (* Les parenthèses sont nécessaires + car ; est prioritaire sur := *) +MyFirst[] (* Hello World *) + +(* Boucles For à la C *) +PrintTo[x_] := For[y=0, y 2, "Red" -> 1|> (* Crée une table associative *) +myHash[["Green"]] (* 2, l'utilise *) +myHash[["Green"]] := 5 (* 5, la modifie *) +myHash[["Puce"]] := 3.5 (* 3.5, l'étend *) +KeyDropFrom[myHash, "Green"] (* Supprime la clé "Green" *) +Keys[myHash] (* {Red} *) +Values[myHash] (* {1} *) + +(* Pour finir, toute bonne démonstration du langage Wolfram contient un + Manipulate ! *) +Manipulate[y^2, {y, 0, 20}] (* Crée une interface graphique interactive qui + affiche y^2, permettant à l'utilisateur de + modifier la valeur de y grâce à un contrôle + allant de 0 à 20. Ne fonctionne que si le + logiciel utilisé gère les éléments graphique. *) +``` + +## Envie d'aller plus loin ? + +* [Documentation du langage Wolfram (en anglais)] +(http://reference.wolfram.com/language/) \ No newline at end of file From c70f53aabea745d4450aa51abdc33aa1ac51bdd2 Mon Sep 17 00:00:00 2001 From: Cedric HT Date: Sun, 17 Jan 2016 21:53:21 +0100 Subject: [PATCH 408/457] Translated make tutorial to french --- fr-fr/make-fr.html.markdown | 266 ++++++++++++++++++++++++++++++++++++ 1 file changed, 266 insertions(+) create mode 100644 fr-fr/make-fr.html.markdown diff --git a/fr-fr/make-fr.html.markdown b/fr-fr/make-fr.html.markdown new file mode 100644 index 00000000..8643ba45 --- /dev/null +++ b/fr-fr/make-fr.html.markdown @@ -0,0 +1,266 @@ +--- +language: make +contributors: + - ["Robert Steed", "https://github.com/robochat"] + - ["altaris", "https://github.com/altaris"] +filename: Makefile +--- + +Un makefile est un fichier qui définit un ensemble de règles liées entre elles +pour créer une ou plusieurs cibles. L'idée est d'effectuer le moins de travail +possible afin de mettre à jour la ou les cibles en fonction des dépendances. + +Écrit en un week-end par Stuart Feldman en 1976, le make et les +makefiles sont encore très utilisés (principalement dans les systèmes Unix), +malgré la concurrence et les critiques faites à son égard. + +Le programme make a plusieurs variantes. Dans ce tutoriel, nous utiliserons +l'implémentation standard : GNU make. + +```make + +# Ceci est un commentaire. + +# Un makefile devrait être nommé "Makefile" (avec ou sans la +# majuscule). Il peut alors être exécuté par `make `. +# Ce nommage n'est toutefois pas obligatoire : utiliser +# `make -f "fichier" `. + +# ATTENTION : l'indentation est quant à elle obligatoire, et se fait avec des +# tabulations, pas avec des espaces ! + +#----------------------------------------------------------------------- +# Les basiques +#----------------------------------------------------------------------- + +# Une règle. Elle ne sera exécutée que si fichier0.txt n'existe pas. +file0.txt: + echo "truc" > fichier0.txt + # Même les commentaires sont transférés dans le terminal. + +# Cette règle ne sera exécutée que si fichier0.txt est plus récent que +# fichier1.txt. +file1.txt: fichier0.txt + cat fichier0.txt > fichier1.txt + # Utiliser les même guillemets que dans un terminal. + @cat fichier0.txt >> fichier1.txt + # @ empêche l'affichage de la sortie texte d'une commande. + -@echo 'hello' + # - signifie que la règle devrait continuer à être exécutée si cette + # commande échoue. + +# Un règle peut avoir plusieurs cibles et plusieurs dépendances. +file2.txt fichier3.txt: fichier0.txt fichier1.txt + touch fichier2.txt + touch fichier3.txt + +# Make affichera un avertissement si le makefile comporte plusieurs règles pour +# une même cible. Cependant les règles vides ne comptent pas, et peuvent être +# utilisées pour ajouter des dépendances plus facilement. + +#----------------------------------------------------------------------- +# Fausses règles +#----------------------------------------------------------------------- + +# Une fausse règle est un règle qui ne correspond pas à un fichier. +# Par définition, elle ne peut pas être à jour, et donc make l’exécutera à +# chaque demande. +all: maker process + +# La déclaration des règles peut être faite dans n'importe quel ordre. +maker: + touch ex0.txt ex1.txt + +# On peut transformer une règle en fausse règle grâce à la cible spéciale +# suivante : +.PHONY: all maker process + +# Un règle dépendante d'une fausse règle sera toujours exécutée. +ex0.txt ex1.txt: maker + +# Voici quelques exemples fréquents de fausses règles : all, make, clean, +# install... + +#----------------------------------------------------------------------- +# Variables automatiques et wildcards +#----------------------------------------------------------------------- + +# Utilise un wildcard pour des noms de fichier +process: fichier*.txt + @echo $^ # $^ est une variable contenant la liste des dépendances de la + # cible actuelle. + @echo $@ # $@ est le nom de la cible actuelle. En cas de cibles + # multiples, $@ est le nom de la cible ayant causé l'exécution + # de cette règle. + @echo $< # $< contient la première dépendance. + @echo $? # $? contient la liste des dépendances qui ne sont pas à jour. + @echo $+ # $+ contient la liste des dépendances avec d'éventuels + # duplicatas, contrairement à $^. + @echo $| # $| contient la liste des cibles ayant préséance sur la cible + # actuelle. + +# Même si la définition de la règle est scindée en plusieurs morceaux, $^ +# listera toutes les dépendances indiquées. +process: ex1.txt fichier0.txt +# Ici, fichier0.txt est un duplicata dans $+. + +#----------------------------------------------------------------------- +# Pattern matching +#----------------------------------------------------------------------- + +# En utilisant le pattern matching, on peut par exemple créer des règles pour +# convertir les fichiers d'un certain format dans un autre. +%.png: %.svg + inkscape --export-png $^ + +# Make exécute une règle même si le fichier correspondant est situé dans un sous +# dossier. En cas de conflit, la règle avec la meilleure correspondance est +# choisie. +small/%.png: %.svg + inkscape --export-png --export-dpi 30 $^ + +# Dans ce type de conflit (même cible, même dépendances), make exécutera la +# dernière règle déclarée... +%.png: %.svg + @echo cette règle est choisie + +# Dans ce type de conflit (même cible mais pas les mêmes dépendances), make +# exécutera la première règle pouvant être exécutée. +%.png: %.ps + @echo cette règle n\'est pas choisie si *.svg et *.ps sont présents + +# Make a des règles pré établies. Par exemple, il sait comment créer la cible +# *.o à partir de *.c. + +# Les makefiles plus vieux utilisent un matching par extension de fichier. +.png.ps: + @echo cette règle est similaire à une règle par pattern matching + +# Utiliser cette syntaxe pour déclarer une règle comme règle avec matching par +# extension de fichier. +.SUFFIXES: .png + +#----------------------------------------------------------------------- +# Variables, ou macros +#----------------------------------------------------------------------- + +# Les variables sont des chaînes de caractères. + +variable = Ted +variable2="Sarah" + +echo: + @echo $(variable) + @echo ${variable2} + @echo $variable # Cette syntaxe signifie $(n)ame et non pas $(variable) ! + @echo $(variable3) # Les variables non déclarées valent "" (chaîne vide). + +# Les variables sont déclarées de 4 manières, de la plus grande priorité à la +# plus faible : +# 1 : dans la ligne de commande qui invoque make, +# 2 : dans le makefile, +# 3 : dans les variables d’environnement du terminal qui invoque make, +# 4 : les variables prédéfinies. + +# Assigne la variable si une variable d’environnement du même nom n'existe pas +# déjà. +variable4 ?= Jean + +# Empêche cette variable d'être modifiée par la ligne de commande. +override variable5 = David + +# Concatène à une variable (avec un espace avant). +variable4 +=gris + +# Assignations de variable pour les règles correspondant à un pattern +# (spécifique à GNU make). +*.png: variable2 = Sara # Pour toutes les règles correspondant à *.png, et tous + # leurs descendants, la variable variable2 vaudra + # "Sara". +# Si le jeux des dépendances et descendances devient vraiment trop compliqué, +# des inconsistances peuvent survenir. + +# Certaines variables sont prédéfinies par make : +affiche_predefinies: + echo $(CC) + echo ${CXX} + echo $(FC) + echo ${CFLAGS} + echo $(CPPFLAGS) + echo ${CXXFLAGS} + echo $(LDFLAGS) + echo ${LDLIBS} + +#----------------------------------------------------------------------- +# Variables : le retour +#----------------------------------------------------------------------- + +# Les variables sont évaluées à chaque instance, ce qui peut être coûteux en +# calculs. Pour parer à ce problème, il existe dans GNU make une seconde +# manière d'assigner des variables pour qu'elles ne soient évaluées qu'une seule +# fois seulement. + +var := wesh +var2 ::= $(var) mec # := et ::= sont équivalents. + +# Ces variables sont évaluées procéduralement (i.e. dans leur ordre +# d'apparition), contrairement au règles par exemple ! + +# Ceci ne fonctionne pas. +var3 ::= $(var4) et fais de beaux rêves +var4 ::= bonne nuit + +#----------------------------------------------------------------------- +# Fonctions +#----------------------------------------------------------------------- + +# Make a une multitude de fonctions. La syntaxe générale est +# $(fonction arg0,arg1,arg2...). + +# Quelques exemples : + +fichiers_source = $(wildcard *.c */*.c) +fichiers_objet = $(patsubst %.c,%.o,$(fichiers_source)) + +ls: * src/* + @echo $(filter %.txt, $^) + @echo $(notdir $^) + @echo $(join $(dir $^),$(notdir $^)) + +#----------------------------------------------------------------------- +# Directives +#----------------------------------------------------------------------- + +# Inclut d'autres makefiles. +include meuh.mk + +# Branchements conditionnels. +sport = tennis +report: +ifeq ($(sport),tennis) # Il y a aussi ifneq. + @echo 'jeu, set et match' +else + @echo "C'est pas ici Wimbledon ?" +endif + +truc = true +ifdef $(truc) # Il y a aussi ifndef. + machin = 'salut' +endif +``` + +## Quelques références + +### En français + ++ [Introduction à Makefile (developpez.com)] +(http://gl.developpez.com/tutoriel/outil/makefile/), ++ [Compilez sous GNU/Linux ! (openclassrooms)] +(https://openclassrooms.com/courses/compilez-sous-gnu-linux). + +### En anglais + ++ [Documentation de GNU make](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). \ No newline at end of file From 5c4eba5ef34593a0c6425da64f6a0d7688fca3d2 Mon Sep 17 00:00:00 2001 From: Cedric HT Date: Sun, 17 Jan 2016 21:54:51 +0100 Subject: [PATCH 409/457] Removed tabs in header --- fr-fr/make-fr.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fr-fr/make-fr.html.markdown b/fr-fr/make-fr.html.markdown index 8643ba45..405c47cd 100644 --- a/fr-fr/make-fr.html.markdown +++ b/fr-fr/make-fr.html.markdown @@ -1,8 +1,8 @@ --- language: make contributors: - - ["Robert Steed", "https://github.com/robochat"] - - ["altaris", "https://github.com/altaris"] + - ["Robert Steed", "https://github.com/robochat"] + - ["altaris", "https://github.com/altaris"] filename: Makefile --- From a4e4b76afdb538fa577db8823bb7349ff7872722 Mon Sep 17 00:00:00 2001 From: Cedric HT Date: Mon, 18 Jan 2016 12:07:20 +0100 Subject: [PATCH 410/457] Corrections to make-fr ... according to pull request comments: - completed header; - some typos; - finished translating target names. --- fr-fr/make-fr.html.markdown | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/fr-fr/make-fr.html.markdown b/fr-fr/make-fr.html.markdown index 405c47cd..b8255ce7 100644 --- a/fr-fr/make-fr.html.markdown +++ b/fr-fr/make-fr.html.markdown @@ -3,7 +3,8 @@ language: make contributors: - ["Robert Steed", "https://github.com/robochat"] - ["altaris", "https://github.com/altaris"] -filename: Makefile +filename: Makefile-fr +lang: fr-fr --- Un makefile est un fichier qui définit un ensemble de règles liées entre elles @@ -34,23 +35,23 @@ l'implémentation standard : GNU make. #----------------------------------------------------------------------- # Une règle. Elle ne sera exécutée que si fichier0.txt n'existe pas. -file0.txt: +fichier0.txt: echo "truc" > fichier0.txt # Même les commentaires sont transférés dans le terminal. # Cette règle ne sera exécutée que si fichier0.txt est plus récent que # fichier1.txt. -file1.txt: fichier0.txt +fichier1.txt: fichier0.txt cat fichier0.txt > fichier1.txt - # Utiliser les même guillemets que dans un terminal. + # Utiliser la même syntaxe que dans un terminal. @cat fichier0.txt >> fichier1.txt # @ empêche l'affichage de la sortie texte d'une commande. -@echo 'hello' - # - signifie que la règle devrait continuer à être exécutée si cette - # commande échoue. + # - signifie que la règle devrait continuer à s'exécuter si cette commande + # échoue. -# Un règle peut avoir plusieurs cibles et plusieurs dépendances. -file2.txt fichier3.txt: fichier0.txt fichier1.txt +# Une règle peut avoir plusieurs cibles et plusieurs dépendances. +fichier2.txt fichier3.txt: fichier0.txt fichier1.txt touch fichier2.txt touch fichier3.txt @@ -62,7 +63,7 @@ file2.txt fichier3.txt: fichier0.txt fichier1.txt # Fausses règles #----------------------------------------------------------------------- -# Une fausse règle est un règle qui ne correspond pas à un fichier. +# Une fausse règle est une règle qui ne correspond pas à un fichier. # Par définition, elle ne peut pas être à jour, et donc make l’exécutera à # chaque demande. all: maker process @@ -75,7 +76,7 @@ maker: # suivante : .PHONY: all maker process -# Un règle dépendante d'une fausse règle sera toujours exécutée. +# Une règle dépendante d'une fausse règle sera toujours exécutée. ex0.txt ex1.txt: maker # Voici quelques exemples fréquents de fausses règles : all, make, clean, From 8cff05396eeb7059904c52c3c2e62440d6c975b6 Mon Sep 17 00:00:00 2001 From: Cedric HT Date: Mon, 18 Jan 2016 12:16:37 +0100 Subject: [PATCH 411/457] Corrected header Added myself as translator. --- fr-fr/make-fr.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fr-fr/make-fr.html.markdown b/fr-fr/make-fr.html.markdown index b8255ce7..993eccba 100644 --- a/fr-fr/make-fr.html.markdown +++ b/fr-fr/make-fr.html.markdown @@ -2,6 +2,7 @@ language: make contributors: - ["Robert Steed", "https://github.com/robochat"] +translators: - ["altaris", "https://github.com/altaris"] filename: Makefile-fr lang: fr-fr @@ -264,4 +265,4 @@ endif + [Documentation de GNU make](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). \ No newline at end of file +[ex28](http://c.learncodethehardway.org/book/ex28.html). From db99c9966ce21789dfa4d6618998ea288756d0ae Mon Sep 17 00:00:00 2001 From: Cedric HT Date: Mon, 18 Jan 2016 12:17:50 +0100 Subject: [PATCH 412/457] Corrected header - Added muself as translator; - set lang field; - corrected filename field. --- fr-fr/wolfram-fr.html.markdown | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fr-fr/wolfram-fr.html.markdown b/fr-fr/wolfram-fr.html.markdown index d297bd74..3a69e1d8 100644 --- a/fr-fr/wolfram-fr.html.markdown +++ b/fr-fr/wolfram-fr.html.markdown @@ -2,8 +2,10 @@ language: wolfram contributors: - ["hyphz", "http://github.com/hyphz/"] +translators: - ["altaris", "http://github.com/altaris/"] -filename: learnwolfram.nb +filename: learnwolfram-fr.nb +lang: fr-fr --- Le langage Wolfram est utilisé dans les programmes suivants : @@ -163,4 +165,4 @@ Manipulate[y^2, {y, 0, 20}] (* Crée une interface graphique interactive qui ## Envie d'aller plus loin ? * [Documentation du langage Wolfram (en anglais)] -(http://reference.wolfram.com/language/) \ No newline at end of file +(http://reference.wolfram.com/language/) From ee88bcd13cf4b89843dde2cf530b832d314d1da7 Mon Sep 17 00:00:00 2001 From: Ahmad Zafrullah Date: Tue, 19 Jan 2016 11:07:22 +0800 Subject: [PATCH 413/457] [xml/id-id] update changes --- id-id/xml-id.html.markdown | 79 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 4 deletions(-) diff --git a/id-id/xml-id.html.markdown b/id-id/xml-id.html.markdown index 8b8d72ae..fedba711 100644 --- a/id-id/xml-id.html.markdown +++ b/id-id/xml-id.html.markdown @@ -5,19 +5,76 @@ contributors: - ["João Farias", "https://github.com/JoaoGFarias"] translators: - ["Rizky Luthfianto", "https://github.com/rilut"] + - ["Ahmad Zafrullah", "https://github.com/23Pstars"] lang: id-id --- -XML adalah bahasa markup yang dirancang untuk menyimpan dan mengirim data. +XML adalah bahasa markup yang dirancang untuk menyimpan dan mengirim data. XML mudah dibaca oleh manusia dan mesin. Tidak seperti HTML, XML tidak menentukan bagaimana menampilkan atau format data, hanya membawanya. -* Sintaks XML +Terdapat perbedaan antara **konten** dan **markup**. Singkatnya, konten dapat berupa apapun dan markup adalah sebagai penentu. + +## Definisi dan Pendahuluan + +Dokumen XML pada dasarnya disusun oleh *elemen* yang dapat memiliki *atribut* untuk menjelaskan elemen tersebut dan dapat memiliki beberapa konten tekstual atau beberapa elemen sebagai anak-nya. Setiap dokumen XML hendaknya memiliki satu elemen akar, yang menjadi induk dari semua elemen dalam dokumen XML. + +Pengurai XML dirancang menjadi sangat ketat, dan akan berhenti melakukan penguraian terhadap dokumen yang cacat. Oleh karena itu semua dokumen XML harus mengikuti [Aturan Sintaks XML](http://www.w3schools.com/xml/xml_syntax.asp). ```xml - + + + + + + +Konten + + + + + + + + + + + + + + + + + + + + + + + Teks + + + + + + + Teks + + +Teks +``` + + +## Dokumen XML + +```xml + Everyday Italian @@ -65,7 +122,7 @@ Tidak seperti HTML, XML tidak menentukan bagaimana menampilkan atau format data, ``` -* Dokumen yang well-formated & Validasi +## Dokumen yang well-formated & Validasi Sebuah dokumen XML disebut well-formated jika sintaksisnya benar. Namun, juga mungkin untuk mendefinisikan lebih banyak batasan dalam dokumen, @@ -128,3 +185,17 @@ Dengan alat ini, Anda dapat memeriksa data XML di luar logika aplikasi. ``` +## Kompatibilitas DTD dan Definisi Skema XML + +Dukungan untuk DTD dapat ditemukan dimana-mana karena sudah sangat lama. Namun sayangnya, fitur XML terkini seperti *namespaces* tidak didukung oleh DTD. XML Xchema Definitions (XSDs) bertujuan untuk mengganti DTD dalam mendefinisikan tatabahasa dokumen XML. + +## Sumber + +* [Validasi dokumen XML](http://www.xmlvalidation.com) + +## Bacaan lainnya + +* [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 0fe63187a9d61a0daa789ff59fc130b5dc678a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric?= Date: Tue, 19 Jan 2016 11:53:13 +0100 Subject: [PATCH 414/457] Corrected typos in wolfram-fr --- fr-fr/wolfram-fr.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fr-fr/wolfram-fr.html.markdown b/fr-fr/wolfram-fr.html.markdown index 3a69e1d8..b9fe986f 100644 --- a/fr-fr/wolfram-fr.html.markdown +++ b/fr-fr/wolfram-fr.html.markdown @@ -110,7 +110,7 @@ BetterPrintTo[x_] := Module[{y}, (For[y=0, y Date: Tue, 19 Jan 2016 12:36:33 +0100 Subject: [PATCH 415/457] More typos --- fr-fr/make-fr.html.markdown | 110 ++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/fr-fr/make-fr.html.markdown b/fr-fr/make-fr.html.markdown index 993eccba..b404e1a1 100644 --- a/fr-fr/make-fr.html.markdown +++ b/fr-fr/make-fr.html.markdown @@ -37,24 +37,24 @@ l'implémentation standard : GNU make. # Une règle. Elle ne sera exécutée que si fichier0.txt n'existe pas. fichier0.txt: - echo "truc" > fichier0.txt - # Même les commentaires sont transférés dans le terminal. + echo "truc" > fichier0.txt + # Même les commentaires sont transférés dans le terminal. # Cette règle ne sera exécutée que si fichier0.txt est plus récent que # fichier1.txt. fichier1.txt: fichier0.txt - cat fichier0.txt > fichier1.txt - # Utiliser la même syntaxe que dans un terminal. - @cat fichier0.txt >> fichier1.txt - # @ empêche l'affichage de la sortie texte d'une commande. - -@echo 'hello' - # - signifie que la règle devrait continuer à s'exécuter si cette commande - # échoue. + cat fichier0.txt > fichier1.txt + # Utiliser la même syntaxe que dans un terminal. + @cat fichier0.txt >> fichier1.txt + # @ empêche l'affichage de la sortie texte d'une commande. + -@echo 'hello' + # - signifie que la règle devrait continuer à s'exécuter si cette commande + # échoue. # Une règle peut avoir plusieurs cibles et plusieurs dépendances. fichier2.txt fichier3.txt: fichier0.txt fichier1.txt - touch fichier2.txt - touch fichier3.txt + touch fichier2.txt + touch fichier3.txt # Make affichera un avertissement si le makefile comporte plusieurs règles pour # une même cible. Cependant les règles vides ne comptent pas, et peuvent être @@ -71,7 +71,7 @@ all: maker process # La déclaration des règles peut être faite dans n'importe quel ordre. maker: - touch ex0.txt ex1.txt + touch ex0.txt ex1.txt # On peut transformer une règle en fausse règle grâce à la cible spéciale # suivante : @@ -89,17 +89,17 @@ ex0.txt ex1.txt: maker # Utilise un wildcard pour des noms de fichier process: fichier*.txt - @echo $^ # $^ est une variable contenant la liste des dépendances de la - # cible actuelle. - @echo $@ # $@ est le nom de la cible actuelle. En cas de cibles - # multiples, $@ est le nom de la cible ayant causé l'exécution - # de cette règle. - @echo $< # $< contient la première dépendance. - @echo $? # $? contient la liste des dépendances qui ne sont pas à jour. - @echo $+ # $+ contient la liste des dépendances avec d'éventuels - # duplicatas, contrairement à $^. - @echo $| # $| contient la liste des cibles ayant préséance sur la cible - # actuelle. + @echo $^ # $^ est une variable contenant la liste des dépendances de la + # cible actuelle. + @echo $@ # $@ est le nom de la cible actuelle. En cas de cibles + # multiples, $@ est le nom de la cible ayant causé l'exécution + # de cette règle. + @echo $< # $< contient la première dépendance. + @echo $? # $? contient la liste des dépendances qui ne sont pas à jour. + @echo $+ # $+ contient la liste des dépendances avec d'éventuels + # duplicatas, contrairement à $^. + @echo $| # $| contient la liste des cibles ayant préséance sur la cible + # actuelle. # Même si la définition de la règle est scindée en plusieurs morceaux, $^ # listera toutes les dépendances indiquées. @@ -113,33 +113,33 @@ process: ex1.txt fichier0.txt # En utilisant le pattern matching, on peut par exemple créer des règles pour # convertir les fichiers d'un certain format dans un autre. %.png: %.svg - inkscape --export-png $^ + inkscape --export-png $^ # Make exécute une règle même si le fichier correspondant est situé dans un sous # dossier. En cas de conflit, la règle avec la meilleure correspondance est # choisie. small/%.png: %.svg - inkscape --export-png --export-dpi 30 $^ + inkscape --export-png --export-dpi 30 $^ # Dans ce type de conflit (même cible, même dépendances), make exécutera la # dernière règle déclarée... %.png: %.svg - @echo cette règle est choisie + @echo cette règle est choisie # Dans ce type de conflit (même cible mais pas les mêmes dépendances), make # exécutera la première règle pouvant être exécutée. %.png: %.ps - @echo cette règle n\'est pas choisie si *.svg et *.ps sont présents + @echo cette règle n\'est pas choisie si *.svg et *.ps sont présents # Make a des règles pré établies. Par exemple, il sait comment créer la cible # *.o à partir de *.c. # Les makefiles plus vieux utilisent un matching par extension de fichier. .png.ps: - @echo cette règle est similaire à une règle par pattern matching + @echo cette règle est similaire à une règle par pattern matching -# Utiliser cette syntaxe pour déclarer une règle comme règle avec matching par -# extension de fichier. +# Utiliser cette règle spéciale pour déclarer une règle comme ayant un +# matching par extension de fichier. .SUFFIXES: .png #----------------------------------------------------------------------- @@ -152,10 +152,10 @@ variable = Ted variable2="Sarah" echo: - @echo $(variable) - @echo ${variable2} - @echo $variable # Cette syntaxe signifie $(n)ame et non pas $(variable) ! - @echo $(variable3) # Les variables non déclarées valent "" (chaîne vide). + @echo $(variable) + @echo ${variable2} + @echo $variable # Cette syntaxe signifie $(n)ame et non pas $(variable) ! + @echo $(variable3) # Les variables non déclarées valent "" (chaîne vide). # Les variables sont déclarées de 4 manières, de la plus grande priorité à la # plus faible : @@ -177,21 +177,21 @@ variable4 +=gris # Assignations de variable pour les règles correspondant à un pattern # (spécifique à GNU make). *.png: variable2 = Sara # Pour toutes les règles correspondant à *.png, et tous - # leurs descendants, la variable variable2 vaudra - # "Sara". + # leurs descendants, la variable variable2 vaudra + # "Sara". # Si le jeux des dépendances et descendances devient vraiment trop compliqué, -# des inconsistances peuvent survenir. +# des incohérences peuvent survenir. # Certaines variables sont prédéfinies par make : affiche_predefinies: - echo $(CC) - echo ${CXX} - echo $(FC) - echo ${CFLAGS} - echo $(CPPFLAGS) - echo ${CXXFLAGS} - echo $(LDFLAGS) - echo ${LDLIBS} + echo $(CC) + echo ${CXX} + echo $(FC) + echo ${CFLAGS} + echo $(CPPFLAGS) + echo ${CXXFLAGS} + echo $(LDFLAGS) + echo ${LDLIBS} #----------------------------------------------------------------------- # Variables : le retour @@ -202,11 +202,11 @@ affiche_predefinies: # manière d'assigner des variables pour qu'elles ne soient évaluées qu'une seule # fois seulement. -var := wesh -var2 ::= $(var) mec # := et ::= sont équivalents. +var := A B C +var2 ::= $(var) D E F # := et ::= sont équivalents. # Ces variables sont évaluées procéduralement (i.e. dans leur ordre -# d'apparition), contrairement au règles par exemple ! +# d'apparition), contrairement aux règles par exemple ! # Ceci ne fonctionne pas. var3 ::= $(var4) et fais de beaux rêves @@ -225,9 +225,9 @@ fichiers_source = $(wildcard *.c */*.c) fichiers_objet = $(patsubst %.c,%.o,$(fichiers_source)) ls: * src/* - @echo $(filter %.txt, $^) - @echo $(notdir $^) - @echo $(join $(dir $^),$(notdir $^)) + @echo $(filter %.txt, $^) + @echo $(notdir $^) + @echo $(join $(dir $^),$(notdir $^)) #----------------------------------------------------------------------- # Directives @@ -240,14 +240,14 @@ include meuh.mk sport = tennis report: ifeq ($(sport),tennis) # Il y a aussi ifneq. - @echo 'jeu, set et match' + @echo 'jeu, set et match' else - @echo "C'est pas ici Wimbledon ?" + @echo "C'est pas ici Wimbledon ?" endif truc = true -ifdef $(truc) # Il y a aussi ifndef. - machin = 'salut' +ifdef $(truc) # Il y a aussi ifndef. + machin = 'salut' endif ``` From 43c93e3449c2b82bf71529a901034b38077cbcc1 Mon Sep 17 00:00:00 2001 From: Cedric HT Date: Tue, 19 Jan 2016 12:38:39 +0100 Subject: [PATCH 416/457] Changed indentation to tabs They were converted to spaces by error in previous commit. oups. --- fr-fr/make-fr.html.markdown | 100 ++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/fr-fr/make-fr.html.markdown b/fr-fr/make-fr.html.markdown index b404e1a1..5a1e03e7 100644 --- a/fr-fr/make-fr.html.markdown +++ b/fr-fr/make-fr.html.markdown @@ -1,9 +1,9 @@ --- language: make contributors: - - ["Robert Steed", "https://github.com/robochat"] + - ["Robert Steed", "https://github.com/robochat"] translators: - - ["altaris", "https://github.com/altaris"] + - ["altaris", "https://github.com/altaris"] filename: Makefile-fr lang: fr-fr --- @@ -37,24 +37,24 @@ l'implémentation standard : GNU make. # Une règle. Elle ne sera exécutée que si fichier0.txt n'existe pas. fichier0.txt: - echo "truc" > fichier0.txt - # Même les commentaires sont transférés dans le terminal. + echo "truc" > fichier0.txt + # Même les commentaires sont transférés dans le terminal. # Cette règle ne sera exécutée que si fichier0.txt est plus récent que # fichier1.txt. fichier1.txt: fichier0.txt - cat fichier0.txt > fichier1.txt - # Utiliser la même syntaxe que dans un terminal. - @cat fichier0.txt >> fichier1.txt - # @ empêche l'affichage de la sortie texte d'une commande. - -@echo 'hello' - # - signifie que la règle devrait continuer à s'exécuter si cette commande - # échoue. + cat fichier0.txt > fichier1.txt + # Utiliser la même syntaxe que dans un terminal. + @cat fichier0.txt >> fichier1.txt + # @ empêche l'affichage de la sortie texte d'une commande. + -@echo 'hello' + # - signifie que la règle devrait continuer à s'exécuter si cette commande + # échoue. # Une règle peut avoir plusieurs cibles et plusieurs dépendances. fichier2.txt fichier3.txt: fichier0.txt fichier1.txt - touch fichier2.txt - touch fichier3.txt + touch fichier2.txt + touch fichier3.txt # Make affichera un avertissement si le makefile comporte plusieurs règles pour # une même cible. Cependant les règles vides ne comptent pas, et peuvent être @@ -71,7 +71,7 @@ all: maker process # La déclaration des règles peut être faite dans n'importe quel ordre. maker: - touch ex0.txt ex1.txt + touch ex0.txt ex1.txt # On peut transformer une règle en fausse règle grâce à la cible spéciale # suivante : @@ -89,17 +89,17 @@ ex0.txt ex1.txt: maker # Utilise un wildcard pour des noms de fichier process: fichier*.txt - @echo $^ # $^ est une variable contenant la liste des dépendances de la - # cible actuelle. - @echo $@ # $@ est le nom de la cible actuelle. En cas de cibles - # multiples, $@ est le nom de la cible ayant causé l'exécution - # de cette règle. - @echo $< # $< contient la première dépendance. - @echo $? # $? contient la liste des dépendances qui ne sont pas à jour. - @echo $+ # $+ contient la liste des dépendances avec d'éventuels - # duplicatas, contrairement à $^. - @echo $| # $| contient la liste des cibles ayant préséance sur la cible - # actuelle. + @echo $^ # $^ est une variable contenant la liste des dépendances de la + # cible actuelle. + @echo $@ # $@ est le nom de la cible actuelle. En cas de cibles + # multiples, $@ est le nom de la cible ayant causé l'exécution + # de cette règle. + @echo $< # $< contient la première dépendance. + @echo $? # $? contient la liste des dépendances qui ne sont pas à jour. + @echo $+ # $+ contient la liste des dépendances avec d'éventuels + # duplicatas, contrairement à $^. + @echo $| # $| contient la liste des cibles ayant préséance sur la cible + # actuelle. # Même si la définition de la règle est scindée en plusieurs morceaux, $^ # listera toutes les dépendances indiquées. @@ -113,30 +113,30 @@ process: ex1.txt fichier0.txt # En utilisant le pattern matching, on peut par exemple créer des règles pour # convertir les fichiers d'un certain format dans un autre. %.png: %.svg - inkscape --export-png $^ + inkscape --export-png $^ # Make exécute une règle même si le fichier correspondant est situé dans un sous # dossier. En cas de conflit, la règle avec la meilleure correspondance est # choisie. small/%.png: %.svg - inkscape --export-png --export-dpi 30 $^ + inkscape --export-png --export-dpi 30 $^ # Dans ce type de conflit (même cible, même dépendances), make exécutera la # dernière règle déclarée... %.png: %.svg - @echo cette règle est choisie + @echo cette règle est choisie # Dans ce type de conflit (même cible mais pas les mêmes dépendances), make # exécutera la première règle pouvant être exécutée. %.png: %.ps - @echo cette règle n\'est pas choisie si *.svg et *.ps sont présents + @echo cette règle n\'est pas choisie si *.svg et *.ps sont présents # Make a des règles pré établies. Par exemple, il sait comment créer la cible # *.o à partir de *.c. # Les makefiles plus vieux utilisent un matching par extension de fichier. .png.ps: - @echo cette règle est similaire à une règle par pattern matching + @echo cette règle est similaire à une règle par pattern matching # Utiliser cette règle spéciale pour déclarer une règle comme ayant un # matching par extension de fichier. @@ -152,10 +152,10 @@ variable = Ted variable2="Sarah" echo: - @echo $(variable) - @echo ${variable2} - @echo $variable # Cette syntaxe signifie $(n)ame et non pas $(variable) ! - @echo $(variable3) # Les variables non déclarées valent "" (chaîne vide). + @echo $(variable) + @echo ${variable2} + @echo $variable # Cette syntaxe signifie $(n)ame et non pas $(variable) ! + @echo $(variable3) # Les variables non déclarées valent "" (chaîne vide). # Les variables sont déclarées de 4 manières, de la plus grande priorité à la # plus faible : @@ -177,21 +177,21 @@ variable4 +=gris # Assignations de variable pour les règles correspondant à un pattern # (spécifique à GNU make). *.png: variable2 = Sara # Pour toutes les règles correspondant à *.png, et tous - # leurs descendants, la variable variable2 vaudra - # "Sara". + # leurs descendants, la variable variable2 vaudra + # "Sara". # Si le jeux des dépendances et descendances devient vraiment trop compliqué, # des incohérences peuvent survenir. # Certaines variables sont prédéfinies par make : affiche_predefinies: - echo $(CC) - echo ${CXX} - echo $(FC) - echo ${CFLAGS} - echo $(CPPFLAGS) - echo ${CXXFLAGS} - echo $(LDFLAGS) - echo ${LDLIBS} + echo $(CC) + echo ${CXX} + echo $(FC) + echo ${CFLAGS} + echo $(CPPFLAGS) + echo ${CXXFLAGS} + echo $(LDFLAGS) + echo ${LDLIBS} #----------------------------------------------------------------------- # Variables : le retour @@ -225,9 +225,9 @@ fichiers_source = $(wildcard *.c */*.c) fichiers_objet = $(patsubst %.c,%.o,$(fichiers_source)) ls: * src/* - @echo $(filter %.txt, $^) - @echo $(notdir $^) - @echo $(join $(dir $^),$(notdir $^)) + @echo $(filter %.txt, $^) + @echo $(notdir $^) + @echo $(join $(dir $^),$(notdir $^)) #----------------------------------------------------------------------- # Directives @@ -240,14 +240,14 @@ include meuh.mk sport = tennis report: ifeq ($(sport),tennis) # Il y a aussi ifneq. - @echo 'jeu, set et match' + @echo 'jeu, set et match' else - @echo "C'est pas ici Wimbledon ?" + @echo "C'est pas ici Wimbledon ?" endif truc = true ifdef $(truc) # Il y a aussi ifndef. - machin = 'salut' + machin = 'salut' endif ``` From e3346920d211f19ac651fc6c1618db35f81067ff Mon Sep 17 00:00:00 2001 From: krikmo <616c6c@gmail.com> Date: Tue, 19 Jan 2016 20:54:37 -0200 Subject: [PATCH 417/457] [javascript pt-br]: Use articles translated to portuguese --- pt-br/javascript-pt.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pt-br/javascript-pt.html.markdown b/pt-br/javascript-pt.html.markdown index 6424214e..59c6890e 100644 --- a/pt-br/javascript-pt.html.markdown +++ b/pt-br/javascript-pt.html.markdown @@ -519,13 +519,13 @@ if (Object.create === undefined){ // Não o sobrescreve se já existir ## Leitura Adicional O [Mozilla Developer -Network](https://developer.mozilla.org/en-US/docs/Web/JavaScript) dispõe de uma +Network](https://developer.mozilla.org/pt-BR/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. [Uma re-introdução do JavaScript pela MDN] -(https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript) +(https://developer.mozilla.org/pt-BR/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 @@ -542,5 +542,5 @@ profundo de todas as partes do JavaScript. / livro de referência. 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) +nesse site e do [Tutorial de JS](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/A_re-introduction_to_JavaScript) da Mozilla Developer Network. From 39825e459f11f8c59d0f39afa6418ad1332ec3a4 Mon Sep 17 00:00:00 2001 From: Hanlei Qin Date: Wed, 20 Jan 2016 22:59:48 +0800 Subject: [PATCH 418/457] Update lua-cn.html.markdown local variables will better. --- zh-cn/lua-cn.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zh-cn/lua-cn.html.markdown b/zh-cn/lua-cn.html.markdown index 098d0ab5..fc0375f5 100644 --- a/zh-cn/lua-cn.html.markdown +++ b/zh-cn/lua-cn.html.markdown @@ -210,7 +210,7 @@ f2 = {a = 2, b = 3} metafraction = {} function metafraction.__add(f1, f2) - sum = {} + local sum = {} sum.b = f1.b * f2.b sum.a = f1.a * f2.b + f2.a * f1.b return sum @@ -273,7 +273,7 @@ eatenBy = myFavs.animal -- 可以工作!感谢元表 Dog = {} -- 1. function Dog:new() -- 2. - newObj = {sound = 'woof'} -- 3. + local newObj = {sound = 'woof'} -- 3. self.__index = self -- 4. return setmetatable(newObj, self) -- 5. end @@ -307,7 +307,7 @@ mrDog:makeSound() -- 'I say woof' -- 8. LoudDog = Dog:new() -- 1. function LoudDog:makeSound() - s = self.sound .. ' ' -- 2. + local s = self.sound .. ' ' -- 2. print(s .. s .. s) end From 5edee6c0d2afac2ab2690af4da1ebb88f06d2ca4 Mon Sep 17 00:00:00 2001 From: Oliver Vartiainen Date: Wed, 20 Jan 2016 22:15:20 +0200 Subject: [PATCH 419/457] Translate Ruby docs to Finnish --- fi-fi/ruby-fi.html.markdown | 607 ++++++++++++++++++++++++++++++++++++ 1 file changed, 607 insertions(+) create mode 100644 fi-fi/ruby-fi.html.markdown diff --git a/fi-fi/ruby-fi.html.markdown b/fi-fi/ruby-fi.html.markdown new file mode 100644 index 00000000..b4f7583d --- /dev/null +++ b/fi-fi/ruby-fi.html.markdown @@ -0,0 +1,607 @@ +--- +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"] + - ["Jake Faris", "https://github.com/farisj"] +translators: + - ["Oliver Vartiainen", "https://github.com/firoxer"] +--- + +```ruby +# Tässä yhden rivin kommentti + +=begin +Tässä usean rivin kommentti +Näitä ei kylläkään käytetä +Joten käytetään vastedes vain yksirivisiä +=end + +# Tärkeintä on muistaa, että Rubyssa kaikki pohjautuu olioihin. + +# Luvutkin ovat olioita: + +3.class #=> Fixnum + +3.to_s #=> "3" + +# Peruslaskutoimituksia: +1 + 1 #=> 2 +8 - 1 #=> 7 +10 * 2 #=> 20 +35 / 5 #=> 7 +2**5 #=> 32 +5 % 3 #=> 2 + +# Bittioperaatioita: +3 & 5 #=> 1 +3 | 5 #=> 7 +3 ^ 5 #=> 6 + +# Laskutoimitukset ovat vain syntaksisokeria lukuolion laskumetodin kutsulle: +1.+(3) #=> 4 +10.* 5 #=> 50 + +# Erityisarvotkin ovat olioita: + +nil # vastaa joidenkin kielten "null"-arvoa +true # tosi +false # epätosi + +nil.class #=> NilClass +true.class #=> TrueClass +false.class #=> FalseClass + +# Samanvertaisuuden testaus: +1 == 1 #=> true +2 == 1 #=> false + +# ...ja sama eriarvoisuudelle: +1 != 1 #=> false +2 != 1 #=> true + +# "nil" ja "false" ovat ainoat epätodet arvot; kaikki muu ymmärretään todeksi: +!nil #=> true +!false #=> true +!0 #=> false + +# Lisää vertailuoperaatioita: +1 < 10 #=> true +1 > 10 #=> false +2 <= 2 #=> true +2 >= 2 #=> true + +# Kahdensuuntainen vertailuoperaattori: +1 <=> 10 #=> -1 +10 <=> 1 #=> 1 +1 <=> 1 #=> 0 + +# Logiikkaoperaattorit: +true && false #=> false +true || false #=> true +!true #=> false + +# Merkkipohjaisten logiikkaoperaattorien vaihtoehtona on sanalliset muodot, +# joilla on hyvin matala presedenssi. Niillä voi muokata ohjelman kulkua +# esimerkiksi väitelausekkeita ketjuttaen. + +# Metodia `do_something_else` kutsutaan vain, jos `do_something` onnistuu: +do_something() and do_something_else() +# Metodia `log_error` kutsutaan vain, jos `do_something` epäonnistuu: +do_something() or log_error() + +# Merkkijonot ovat olioita: + +'Tässä on merkkijono'.class #=> String +"Rajaavat lainausmerkit voivat olla yksin- tai kaksinkertaisia".class #=> String + +täyte = 'sisällyttää muita merkkijonoja' +"Kaksinkertaisilla lainausmerkeillä voi #{täyte}" +#=> "Kaksinkertaisilla lainausmerkeillä voi sisällyttää muita merkkijonoja" + +# Yksinkertaisia lainausmerkkejä kannattaa silti suosia, sillä kaksinkertaiset +# merkit saattavat aiheuttaa turhia kielensisäisiä tarkistuksia. + +# Merkkijonoja voi yhdistellä toisiinsa: +'hello ' + 'world' #=> "hello world" + +# ...mutta luvut vaativat ensin tyyppimuunnoksen: +'hello ' + 3 #=> TypeError: can't convert Fixnum into String +'hello ' + 3.to_s #=> "hello 3" + +# Merkkijonoja voi soveltaa laskutoimituksiin... odotettavin seurauksin: +'hello ' * 3 #=> "hello hello hello " + +# Merkkijonoa voi jatkaa toisella: +'hello' << ' world' #=> "hello world" + +# Tulosteen luonti kera rivinvaihdon: +puts "I'm printing!" +#=> I'm printing! +#=> nil + +# ...ja ilman rivinvaihtoa: +print "I'm printing!" +#=> I'm printing! => nil + +# Muuttujien määrittely: +x = 25 #=> 25 +x #=> 25 + +# Arvon asettaminen palauttaa arvon itsensä, joten usean muuttujan arvon +# yhtäaikainen määrittely käy vaivatta: +x = y = 10 #=> 10 +x #=> 10 +y #=> 10 + +# Muuttujien sanaerottimena käytetään alaviivaa: +snake_case = true + +# Lisäksi Rubyssa suositaan ytimekkäitä nimiä: +path_to_project_root = '/good/name/' +path = '/bad/name/' + +# Symbolit + +# Symbolit ovat muuttumattomia, uudelleenkäytettäviä vakioita. +# Niitä käytetään merkkijonojen sijaan, kun tarkoitus on viitata arvoon, +# jolla on tietty, pysyvä merkitys: + +:pending.class #=> Symbol + +status = :pending + +status == :pending #=> true + +status == 'pending' #=> false + +status == :approved #=> false + +# Taulukot + +# Tässä taulukko: +array = [1, 2, 3, 4, 5] #=> [1, 2, 3, 4, 5] + +# Taulukko saa koostua erityyppisistä arvoista: +[1, 'hello', false] #=> [1, "hello", false] + +# Taulukon alkioihin voi viitata järjestysnumerolla nollasta alkaen: +array[0] #=> 1 +array.first #=> 1 +array[12] #=> nil + +# Kuten laskutoimituksissa nähty syntaksisokeri on myös taulukon alkioiden haku +# pohjimmiltaan vain taulukko-olioon kuuluvan "[]"-metodin kutsu: +array.[] 0 #=> 1 +array.[] 12 #=> nil + +# Haku käy myös lopustapäin: +array[-1] #=> 5 +array.last #=> 5 + +# Alitaulukon haku käy indeksiparilla... +array[2, 3] #=> [3, 4, 5] + +# ...tai määrittelemällä väli: +array[1..3] #=> [2, 3, 4] + +# Taulukon voi kääntää: +a=[1,2,3] +a.reverse! #=> [3,2,1] + +# Ja sitä voi jatkaa näin... +array << 6 #=> [1, 2, 3, 4, 5, 6] + +# ...tai näin: +array.push(6) #=> [1, 2, 3, 4, 5, 6] + +# Alkion olemassaolon tarkistus: +array.include?(1) #=> true + +# Hashit eli assosiaatiotaulut ovat Rubyn tärkein avain-/arvoparirakenne. +# Hash luodaan aaltosulkeilla: +hash = { 'color' => 'green', 'number' => 5 } + +hash.keys #=> ['color', 'number'] + +# Hash toimii erityisen nopeasti, kun haetaan arvoa avaimen perusteella: +hash['color'] #=> 'green' +hash['number'] #=> 5 + +# Jos hashistä ei löyty avainta vastaavaa arvoa, palautetaan nil-arvo: +hash['nothing here'] #=> nil + +# Symbolihashin määrittelylle on oma syntaksinsa (alkaen Rubyn versiosta 1.9): +new_hash = { defcon: 3, action: true } +new_hash.keys #=> [:defcon, :action] + +# Hashin avaimen ja arvon olemassaolon tarkistus: +new_hash.key?(:defcon) #=> true +new_hash.value?(3) #=> true + +# Vinkki! Sekä taulukot että hashit sisältävät Enumerable-moduulin, +# johon kuuluu useita hyödyllisiä iterointimetodeja kuten .each, .map, +# .reduce ja .count + +# Rakenteita + +if true + 'if statement' +elsif false + 'else if, optional' +else + 'else, also optional' +end + +for counter in 1..5 + puts "iteration #{counter}" +end +#=> iteration 1 +#=> iteration 2 +#=> iteration 3 +#=> iteration 4 +#=> iteration 5 + +# HUOMAA, että for-rakennetta kannattaa välttää, sillä Rubyssa suosittu +# each-metodi ajaa saman asian idiomaattisemmin. Each-metodi ottaa ainoana +# argumenttinaan lohkon. Lohkot toimivat pitkälti samoin kuin muiden kielten +# anonyymit funktiot, lambdat tai sulkeumat. + +# Lukuvälit vastaavat each-metodiin, jolloin sille annettu lohko ajetaan +# kerran jokaiselle välin kokonaisluvulle. +# Lukuvälin each-rakenne lohkoineen näyttää tältä: + +(1..5).each do |counter| + puts "iteration #{counter}" +end +#=> iteration 1 +#=> iteration 2 +#=> iteration 3 +#=> iteration 4 +#=> iteration 5 + +# Lohkoa ympäröivät do/end-avainsanat voi korvata myös aaltosulkeilla: +(1..5).each { |counter| puts "iteration #{counter}" } + +# Lukuvälien lisäksi myös tietorakenteita voidaan iteroida each-metodilla: +array.each do |element| + puts "#{element} is part of the array" +end +hash.each do |key, value| + puts "#{key} is #{value}" +end + +# Taulukoita voi iteroida metodilla each_with_index, jolloin lohko saa +# argumenteikseen sekä alkion että indeksin: +array.each_with_index do |element, index| + puts "#{element} is number #{index} in the array" +end + +counter = 1 +while counter <= 5 do + puts "iteration #{counter}" + counter += 1 +end +#=> iteration 1 +#=> iteration 2 +#=> iteration 3 +#=> iteration 4 +#=> iteration 5 + +# Each-metodin lisäksi Rubyssa on useita muita iterointimetodeja kuten +# "map" ja "reduce". Näistä "map" kutsuttuna taulukolla ottaa argumentikseen +# lohkon, suorittaa sen kerran jokaiselle rakenteen jäsenelle, ja lopuksi +# palauttaa uuden taulukon, jonka jäsenet ovat lohkon suorituksen tuloksia. + +array = [1, 2, 3, 4, 5] +doubled = array.map do |element| + element * 2 +end +puts doubled +#=> [2,4,6,8,10] +puts array +#=> [1,2,3,4,5] + +# Case-rakenne siirtää ohjelman kulun yhdelle monista määritellyistä poluista: + +grade = 'B' + +case grade +when 'A' + puts 'Way to go kiddo' +when 'B' + puts 'Better luck next time' +when 'C' + puts 'You can do better' +when 'D' + puts 'Scraping through' +when 'F' + puts 'You failed!' +else + puts 'Alternative grading system, eh?' +end +#=> "Better luck next time" + +# Case-rakenteessa voidaan hyödyntää lukuvälejä: +grade = 82 +case grade +when 90..100 + puts 'Hooray!' +when 80...90 + puts 'OK job' +else + puts 'You failed!' +end +#=> "OK job" + +# Virheidenkäsittely: +begin + # Seuraava koodinpätkä aiheuttaa NoMemoryError-poikkeuksen + raise NoMemoryError, 'You ran out of memory.' +rescue NoMemoryError => exception_variable + puts 'NoMemoryError was raised', exception_variable +rescue RuntimeError => other_exception_variable + puts 'RuntimeError was raised now' +else + puts 'This runs if no exceptions were thrown at all' +ensure + puts 'This code always runs no matter what' +end + +# Ylimmän näkyvyysalueen metodi näyttää itsenäiseltä funktiolta: +def double(x) + x * 2 +end + +# Funktiot (ja lohkot) palauttavat implisiittisesti +# viimeiseksi ajamansa lausekkeen arvon: +double(2) #=> 4 + +# Metodikutsun argumentteja ympäröivät kaarisulkeet voi jättää pois, +# kunhan koodi ei muutu monitulkintaiseksi: + +double 3 #=> 6 + +double double 3 #=> 12 + +def sum(x, y) + x + y +end + +# Argumentit erotetaan pilkuilla: + +sum 3, 4 #=> 7 + +sum sum(3, 4), 5 #=> 12 + +# Kaikilla metodeilla on implisiittinen lohkoparametri, +# joka voidaan suorittaa yield-avainsanalla: + +def surround + puts '{' + yield + puts '}' +end + +surround { puts 'hello world' } + +# { +# hello world +# } + +# Metodille annetun lohkon voi nimetä parametrilistassa &-merkin avulla, +# minkä jälkeen se suoritetaan call-metodilla: +def guests(&block) + block.call 'some_argument' +end + +# Metodille voi antaa vaihtelevan määrän muuttujia. Ne siirretään taulukkoon, +# jolle annetaan parametrilistassa nimi \*-merkin avulla +def guests(*array) + array.each { |guest| puts guest } +end + +# Luokan määritys aloitetaan class-avainsanalla: + +class Human + + # Tässä luokkamuuttuja, joka on yhteinen kaikille luokan olioille: + @@species = 'H. sapiens' + + # Alustusmetodin määrittely: + def initialize(name, age = 0) + # name-oliomuuttujan arvon asetus metodille annetun name-muuttujan mukaan: + @name = name + + # Jos tätä metodia kutsuessa jätetään toinen argumentti (age) antamatta, + # saa se parametriluettelossa määritetyn arvon 0: + @age = age + end + + # Tyypillinen oliomuuttujan arvon asettava metodi: + def name=(name) + @name = name + end + + # Tyypillinen oliomuuttujan arvon palauttava metodi: + def name + @name + end + + # Edelliset kaksi metodia voi ilmaista idiomaattisemmin myös näin: + attr_accessor :name + + # Lisäksi arvon palauttavan ja asettavan metodin voi määritellä erikseen: + attr_reader :name + attr_writer :name + + # Luokkametodeissa käytetään avainsanaa self erotuksena oliometodeista. + # Luokkametodia voi kutsua vain luokalla itsellään, ei olioilla: + def self.say(msg) + puts msg + end + + def species + @@species + end +end + +# Olion luonti: + +jim = Human.new('Jim Halpert') + +dwight = Human.new('Dwight K. Schrute') + +# Olion metodien kutsuja: +jim.species #=> "H. sapiens" +jim.name #=> "Jim Halpert" +jim.name = "Jim Halpert II" #=> "Jim Halpert II" +jim.name #=> "Jim Halpert II" +dwight.species #=> "H. sapiens" +dwight.name #=> "Dwight K. Schrute" + +# Luokkametodin kutsu: +Human.say('Hi') #=> "Hi" + +# Muuttujan näkyvyysalueen voi määritellä etuliitteellä. + +# $-alkuiset muuttujat ovat globaaleja: +$var = "I'm a global var" +defined? $var #=> "global-variable" + +# @-alkuiset muuttujat kuuluvat oliolle, +# jonka näkyvyysalueella määrittely tehdään: +@var = "I'm an instance var" +defined? @var #=> "instance-variable" + +# @@-alkuiset muuttujat kuuluvat vastaavasti näkyvyysalueensa luokalle: +@@var = "I'm a class var" +defined? @@var #=> "class variable" + +# Isolla alkukirjaimella nimetyt muuttujat ovatkin vakioita: +Var = "I'm a constant" +defined? Var #=> "constant" + +# Kuten odottaa saattaa, myös luokat itsessään ovat olioita. +# Siksi niille voi määritellä muuttujia, jotka ovat yhteisiä kaikille +# luokan ilmentymille ja perillisille. + +# Tavallisen luokan määrittely: + +class Human + @@foo = 0 + + def self.foo + @@foo + end + + def self.foo=(value) + @@foo = value + end +end + +# Perillisluokan määrittely: + +class Worker < Human +end + +Human.foo # 0 +Worker.foo # 0 + +Human.foo = 2 # 2 +Worker.foo # 2 + +# Oliomuuttuja on kuitenkin olion oma eikä periydy: + +class Human + @bar = 0 + + def self.bar + @bar + end + + def self.bar=(value) + @bar = value + end +end + +class Doctor < Human +end + +Human.bar # 0 +Doctor.bar # nil + +module ModuleExample + def foo + 'foo' + end +end + +# Moduulien lisääminen luokkaan "include"-avainsanalla siirtää moduulin metodit +# luokan ilmentymille, kun taas "extend" avainsana siirtää metodit +# luokalle itselleen: + +class Person + include ModuleExample +end + +class Book + extend ModuleExample +end + +Person.foo # => NoMethodError: undefined method `foo' for Person:Class +Person.new.foo # => 'foo' +Book.foo # => 'foo' +Book.new.foo # => NoMethodError: undefined method `foo' + +# Callback-tyyppiset metodit suoritetaan moduulia sisällyttäessä: + +module ConcernExample + 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 Something + include ConcernExample +end + +Something.bar # => 'bar' +Something.qux # => NoMethodError: undefined method `qux' +Something.new.bar # => NoMethodError: undefined method `bar' +Something.new.qux # => 'qux' +``` + +## Lisämateriaalia englanniksi + +- [Learn Ruby by Example with Challenges](http://www.learneroo.com/modules/61/nodes/338) - Selaimessa tehtäviä harjoituksia tämän dokumentin hengessä +- [An Interactive Tutorial for Ruby](https://rubymonk.com/) +- [Official Documentation](http://www.ruby-doc.org/core-2.1.1/) - Virallinen dokumentaatio +- [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/) - Vanhempi, mutta [ilmainen painos](http://ruby-doc.com/docs/ProgrammingRuby/) on luettavissa netissä +- [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide) - Yhteisön luoma Ruby-tyyliopas +- [Try Ruby](http://tryruby.org) - Rubyn perusteet interaktiivisesti From f39e2fcab76fa0d111195c3b4660b87a101f2032 Mon Sep 17 00:00:00 2001 From: qinhanlei Date: Thu, 21 Jan 2016 16:55:20 +0800 Subject: [PATCH 420/457] synchronized with EN version. --- zh-cn/lua-cn.html.markdown | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/zh-cn/lua-cn.html.markdown b/zh-cn/lua-cn.html.markdown index fc0375f5..a0acce05 100644 --- a/zh-cn/lua-cn.html.markdown +++ b/zh-cn/lua-cn.html.markdown @@ -91,10 +91,10 @@ until num == 0 -- 2. 函数。 ---------------------------------------------------- -function fib(n) - if n < 2 then return 1 end - return fib(n - 2) + fib(n - 1) -end +function fib(n) + if n < 2 then return n end + return fib(n - 2) + fib(n - 1) +end -- 支持闭包及匿名函数: function adder(x) @@ -129,9 +129,11 @@ function f(x) return x * x end f = function (x) return x * x end -- 这些也是等价的: -local function g(x) return math.sin(x) end -local g; g = function (x) return math.sin(x) end --- 'local g'使得g可以自引用。 +local function g(x) return math.sin(x) end +local g; g = function (x) return math.sin(x) end +-- 以上均因'local g',使得g可以自引用。 +local g = function(x) return math.sin(x) end +-- 等价于 local function g(x)..., 但函数体中g不可自引用 -- 顺便提下,三角函数以弧度为单位。 @@ -328,7 +330,7 @@ seymour:makeSound() -- 'woof woof woof' -- 4. -- 如果有必要,子类也可以有new(),与基类相似: function LoudDog:new() - newObj = {} + local newObj = {} -- 初始化newObj self.__index = self return setmetatable(newObj, self) @@ -340,7 +342,9 @@ end --[[ 我把这部分给注释了,这样脚本剩下的部分可以运行 +``` +```lua -- 假设文件mod.lua的内容类似这样: local M = {} @@ -411,4 +415,9 @@ lua-users.org上的[Lua简明参考](http://lua-users.org/files/wiki_insecure/us * io library * os library +顺便说一下,整个文件是可运行的Lua; +保存为 learn-cn.lua 用命令 `lua learn.lua` 启动吧! + +本文首次撰写于 [tylerneylon.com](http://tylerneylon.com) 同时也有 github gist 版. + 使用Lua,欢乐常在! From def04721be506f1c7ff5ddf407f2333999570a89 Mon Sep 17 00:00:00 2001 From: Mark Green Date: Fri, 22 Jan 2016 00:54:44 +0000 Subject: [PATCH 421/457] Add a try at an Inform 7 tutorial. Obscure, but really interesting. --- inform7.html.markdown | 195 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 inform7.html.markdown diff --git a/inform7.html.markdown b/inform7.html.markdown new file mode 100644 index 00000000..7f1da0e0 --- /dev/null +++ b/inform7.html.markdown @@ -0,0 +1,195 @@ +--- +language: Inform7 +contributors: + - ["Hyphz", "http://github.com/hyphz/"] +filename: LearnInform.Inform +--- +Inform 7 is a natural language based language created by Graham Nelson and Emily Short for writing text adventures, but also potentially usable for other text based applications, especially data backed ones. + +``` +"LearnInform" by Hyphz + +[This is a comment.] + +[Inform 7 is a language designed for building text adventures. +It can be used for other purposes too, although the default +library builds a text adventure. Inform 7 is object oriented.] + +[This creates a class by subclassing. "Value" is the universal subclass, +but "object" is the most basic that behaves like an OO object.] +A datablock is a kind of object. + +[Classes can have properties.] +A datablock can be broken. [This creates a boolean property.] +A datablock is usually not broken. [This sets its default value.] +A datablock can be big or small. [This creates an enumerated property.] +A datablock is usually small. [This sets its default value.] +A datablock has a number called the sequence number. [This creates a typed property.] +A datablock has some text called the name. ["Some text" means a string.] +A datablock has a datablock called the chain. [Declared classes become types.] + +[This creates a global named instance.] +Block1 is a datablock. +The sequence number of Block1 is 1. +The name of Block1 is "Block One." + +[Functions and procedures are defined as "phrases".] +To do the thing everyone does with their first program: + say "Hello World.". [Full stop indicates the end, indent indicates the scope.] + +To dump (the block - a datablock): [That's how we create a parameter.] + say the sequence number of the block; + say the name of the block; + if the block is broken, say "(Broken)". + +To toggle (the block - a datablock): + if the block is broken: [Conditional.] + now the block is not broken; [Updating a property.] + else: + now the block is broken. + +[Multiple parameters.] +To fix (the broken block - a datablock) using (the repair block - a datablock): + if the broken block is not broken, stop; [Comma for a non indented single command.] + if the repair block is broken, stop; + now the sequence number of the broken block is the sequence number of the repair block; + now the broken block is not broken. + +[Because of its text adventure origins, Inform 7 doesn't generally allow objects +to be created dynamically, although there's a language extension that enables it.] +Block2 is a datablock. +Block2 is broken. +The sequence number of Block2 is 2. +The name of Block2 is "Block two." + +To demonstrate calling a phrase with two parameters: + Let the second block be block2; [Local pointer variable.] + fix the second block using Block1; + say the sequence number of the second block. [1.] + +[Lists.] +To show how to use list types: + let the list be a list of datablocks; + add Block1 to the list; + add Block2 to the list; + say the list; ["Block1 and Block2"] + [Membership.] + if Block1 is listed in the list: + say "Block1 is there."; + [Loop.] + repeat with the block running through the list: + dump the block; [1 Block One. 1 Block Two.] + [Remember block two's sequence number was changed above.] + let X be entry 2 of the list; [Counting starts at 1.] + dump X; ["1 Block two."] + remove X from the list; + say the list. [Block1] + +[Here's how we define a function and do arithmetic.] + +To decide which number is the sum of all numbers up to (X - a number) (this is summing up): + let the total so far be a number; + repeat with the current number running from 1 to X: + now the total so far is the total so far + the current number; + decide on the total so far. [This is the return statement.] + +[ We have higher order functions too. ] + +To demonstrate a higher order function: + say summing up applied to {1, 2, 3, 4}. + +To decide which number is the result of applying (phrase - phrase A -> A) twice to (B - a value of kind A): + let b1 be phrase applied to B; + let b2 be phrase applied to b1; + decide on b2. + +To demonstrate defining a higher order function: + let X be 5; + say the result of applying summing up twice to X. + +[ Rulebooks allow a number of functions which apply to the same type under different conditions to be stacked. ] + +Datablock validation rules is a datablock based rulebook. + +A datablock validation rule for a broken datablock: rule fails. +A datablock validation rule for a datablock (called the block): + dump the block; + rule succeeds. + +To demonstrate invoking a rulebook: + follow datablock validation rules for Block1; + follow datablock validation rules for Block2. + +[ Objects can also have relations, which resemble those in a relational database. ] +A dog is a kind of thing. +Rover is a dog. +The kennel is a container. [This is a built in base class.] +Rover is in the kennel. [This creates an inbuilt relation called "containment".] + +[We can create relations by declaring their type.] + +Guide dog ownership relates one dog to one person. [One-to-one.] +Property ownership relates various things to one person. [Many-to-one.] +Friendship relates various people to various people. [Many-to-many.] + +[To actually use them we must assign verbs or prepositions to them.] + +The verb to own means the property ownership relation. +The verb to be the guide dog of means the guide dog ownership relation. +The verb to be guided by means the reversed guide dog ownership relation. +The verb to be friends with means the friendship relation. + +Edward is a person. A person can be blind. Edward is blind. +Edward is guided by Rover. +Benny is a person. Edward is friends with Benny. + +To demonstrate looking something up with a relation: + repeat with the dog running through things that are the guide dog of Edward: + say the dog; + repeat with the friend running through things that are friends with Edward: + say the friend. + +[We can also define relations that exist procedurally.] + +Helpfulness relates a person (called the helper) to a person (called the helpee) when the helpee is blind and the helper is not blind. +The verb to be helpful to means the helpfulness relation. +To demonstrate using a procedural relation: + repeat with the helper running through people that are helpful to Edward: + say the helper. + + +[ Interface to the text adventure harness to allow the above code to be run. ] +Tutorial room is a room. +"A rather strange room full of buttons. Push them to run the exercises, or turn on the robot to run them all." +A button is a kind of thing. A button is fixed in place. + +The red button is a button in tutorial room. +Instead of pushing the red button, do the thing everyone does with their first program. +The green button is a button in tutorial room. +Instead of pushing the green button, demonstrate calling a phrase with two parameters. +The blue button is a button in tutorial room. +Instead of pushing the blue button, show how to use list types. +The cyan button is a button in tutorial room. +Instead of pushing the cyan button, say the sum of all numbers up to 5. +The purple button is a button in tutorial room. +Instead of pushing the purple button, demonstrate a higher order function. +The black button is a button in tutorial room. +Instead of pushing the black button, demonstrate defining a higher order function. +The white button is a button in tutorial room. +Instead of pushing the white button, demonstrate invoking a rulebook. +The puce button is a button in tutorial room. +Instead of pushing the puce button, demonstrate looking something up with a relation. +The orange button is a button in tutorial room. +Instead of pushing the orange button, demonstrate using a procedural relation. + +The robot is an object in tutorial room. +Instead of switching on the robot: + say "The robot begins to frantically flail its arms about."; + repeat with button running through buttons in the tutorial room: + say "The robot randomly hits [the button]."; + try pushing button. +``` + +##Ready For More? + +* [Inform 7](http://www.inform7.com/) From 4d1b90826f7625fc5fb438b3581866e2d33f7e99 Mon Sep 17 00:00:00 2001 From: Hanlei Qin Date: Fri, 22 Jan 2016 11:01:28 +0800 Subject: [PATCH 422/457] Update lua-cn.html.markdown change link to Markdown style. --- zh-cn/lua-cn.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zh-cn/lua-cn.html.markdown b/zh-cn/lua-cn.html.markdown index a0acce05..f7065445 100644 --- a/zh-cn/lua-cn.html.markdown +++ b/zh-cn/lua-cn.html.markdown @@ -418,6 +418,6 @@ lua-users.org上的[Lua简明参考](http://lua-users.org/files/wiki_insecure/us 顺便说一下,整个文件是可运行的Lua; 保存为 learn-cn.lua 用命令 `lua learn.lua` 启动吧! -本文首次撰写于 [tylerneylon.com](http://tylerneylon.com) 同时也有 github gist 版. +本文首次撰写于 [tylerneylon.com](http://tylerneylon.com) 同时也有 [github gist](https://gist.github.com/tylerneylon/5853042) 版. 使用Lua,欢乐常在! From a3e68ea324716f1f018888782b357812be3865a2 Mon Sep 17 00:00:00 2001 From: Cedric HT Date: Sat, 23 Jan 2016 11:31:17 +0100 Subject: [PATCH 423/457] Transleted code variables and strings to french --- fr-fr/wolfram-fr.html.markdown | 116 ++++++++++++++++----------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/fr-fr/wolfram-fr.html.markdown b/fr-fr/wolfram-fr.html.markdown index b9fe986f..ea07aae5 100644 --- a/fr-fr/wolfram-fr.html.markdown +++ b/fr-fr/wolfram-fr.html.markdown @@ -57,101 +57,101 @@ x (* 20 *) (* Le langage Wolfram effectue des manipulations symboliques, donc utiliser des variables non déclarées n'est pas illégal *) -cow + 5 (* 5 + cow, comme cow n'est pas déclarée, l'évaluation +truc + 5 (* 5 + truc, comme truc n'est pas déclarée, l'évaluation s'arrête là *) -cow + 5 + 10 (* 15 + cow, on évalue ce qu'on peut... *) -% (* 15 + cow, % représente le dernier résultat *) -% - cow (* 15, les variables non déclarées peuvent quand même +truc + 5 + 10 (* 15 + truc, on évalue ce qu'on peut... *) +% (* 15 + truc, % représente le dernier résultat *) +% - truc (* 15, les variables non déclarées peuvent quand même s'annuler *) -moo = cow + 5 (* Attention : moo est ici une expression et non un nombre *) +chose = truc + 5 (* Attention : chose est ici une expression et non un nombre *) (* Déclaration d'une fonction *) -Double[x_] := x * 2 (* Le symbole := empêche l'évaluation immédiate du terme - à droite *) -Double[10] (* 20 *) -Double[Sin[Pi/2]] (* 2 *) -Double @ Sin @ (Pi/2) (* 2, Utiliser @ évite les paquets de crochets - fermants si moches *) -(Pi/2) // Sin // Double(* 2, Utiliser // permet d'écrire les fonctions dans - l'ordre d'appel *) +Double[x_] := x * 2 (* Le symbole := empêche l'évaluation immédiate du terme + à droite *) +Double[10] (* 20 *) +Double[Sin[Pi/2]] (* 2 *) +Double @ Sin @ (Pi/2) (* 2, Utiliser @ évite les paquets de crochets + fermants si moches *) +(Pi/2) // Sin // Double (* 2, Utiliser // permet d'écrire les fonctions dans + l'ordre d'appel *) (* Pour la programmation impérative, utiliser ; pour séparer les expressions *) -MyFirst[] := (Print@"Hello"; Print@"World") (* Les parenthèses sont nécessaires - car ; est prioritaire sur := *) -MyFirst[] (* Hello World *) +Salut[] := (Print@"Hello"; Print@"World") (* Les parenthèses sont nécessaires + car ; est prioritaire sur := *) +Salut[] (* Hello World *) (* Boucles For à la C *) -PrintTo[x_] := For[y=0, y 2, "Red" -> 1|> (* Crée une table associative *) -myHash[["Green"]] (* 2, l'utilise *) -myHash[["Green"]] := 5 (* 5, la modifie *) -myHash[["Puce"]] := 3.5 (* 3.5, l'étend *) -KeyDropFrom[myHash, "Green"] (* Supprime la clé "Green" *) -Keys[myHash] (* {Red} *) -Values[myHash] (* {1} *) +table = <|"Vert" -> 2, "Rouge" -> 1|> (* Crée une table associative *) +table[["Vert"]] (* 2, l'utilise *) +table[["Vert"]] := 5 (* 5, la modifie *) +table[["Bleu"]] := 3.5 (* 3.5, l'étend *) +KeyDropFrom[table, "Vert"] (* Supprime la clé "Vert" *) +Keys[table] (* {Rouge} *) +Values[table] (* {1} *) (* Pour finir, toute bonne démonstration du langage Wolfram contient un Manipulate ! *) From 3ea060e936b4260ab57abfee6de9dabc3232d6fd Mon Sep 17 00:00:00 2001 From: Cedric HT Date: Sat, 23 Jan 2016 11:32:02 +0100 Subject: [PATCH 424/457] Corrected code results in comments In subsection on hash tables. --- fr-fr/wolfram-fr.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fr-fr/wolfram-fr.html.markdown b/fr-fr/wolfram-fr.html.markdown index ea07aae5..9cdbabcc 100644 --- a/fr-fr/wolfram-fr.html.markdown +++ b/fr-fr/wolfram-fr.html.markdown @@ -150,8 +150,8 @@ table[["Vert"]] (* 2, l'utilise *) table[["Vert"]] := 5 (* 5, la modifie *) table[["Bleu"]] := 3.5 (* 3.5, l'étend *) KeyDropFrom[table, "Vert"] (* Supprime la clé "Vert" *) -Keys[table] (* {Rouge} *) -Values[table] (* {1} *) +Keys[table] (* {Rouge, Bleu} *) +Values[table] (* {1, 3.5} *) (* Pour finir, toute bonne démonstration du langage Wolfram contient un Manipulate ! *) From 2b3d1e524d483e647fd6a193d6b17808d67af5ab Mon Sep 17 00:00:00 2001 From: Cedric HT Date: Sat, 23 Jan 2016 11:37:15 +0100 Subject: [PATCH 425/457] Some improvments in comments --- fr-fr/wolfram-fr.html.markdown | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/fr-fr/wolfram-fr.html.markdown b/fr-fr/wolfram-fr.html.markdown index 9cdbabcc..7b446259 100644 --- a/fr-fr/wolfram-fr.html.markdown +++ b/fr-fr/wolfram-fr.html.markdown @@ -33,22 +33,21 @@ formatage, car il ne contient aucune information de mise en page. 5+8 (* 13 *) (* Appels de fonction *) -(* Le langage Wolfram est sensible à la casse *) Sin[Pi/2] (* 1 *) - (* Syntaxe alternative pour les appels de fonction à 1 paramètre *) Sin@(Pi/2) (* 1 *) (Pi/2) // Sin (* 1 *) -(* Dans le langage Wolfram, toutes les expressions sont en réalité des appels de - fonction *) +(* Attention : le langage est sensible à la casse ! *) + +(* Toutes les expressions sont en réalité des appels de fonction *) Times[2, 2] (* 4 *) Plus[5, 8] (* 13 *) (* Utiliser une variable pour la première fois la déclare globalement *) x = 5 (* 5 *) x == 5 (* True, l'assignation et le test d'égalité est écrit comme - dans le C *) + en C *) x (* 5 *) x = x + 5 (* 10 *) x (* 10 *) @@ -56,7 +55,7 @@ Set[x, 20] (* TOUT est un appel de fonction, TOUUUUUUUUT *) x (* 20 *) (* Le langage Wolfram effectue des manipulations symboliques, donc utiliser des - variables non déclarées n'est pas illégal *) + variables non déclarées est légal *) truc + 5 (* 5 + truc, comme truc n'est pas déclarée, l'évaluation s'arrête là *) truc + 5 + 10 (* 15 + truc, on évalue ce qu'on peut... *) @@ -75,18 +74,18 @@ Double @ Sin @ (Pi/2) (* 2, Utiliser @ évite les paquets de crochets (Pi/2) // Sin // Double (* 2, Utiliser // permet d'écrire les fonctions dans l'ordre d'appel *) -(* Pour la programmation impérative, utiliser ; pour séparer les expressions *) +(* En programmation impérative, utiliser ; pour séparer les expressions *) Salut[] := (Print@"Hello"; Print@"World") (* Les parenthèses sont nécessaires car ; est prioritaire sur := *) Salut[] (* Hello World *) (* Boucles For à la C *) Compter[x_] := For[y=0, y Date: Mon, 25 Jan 2016 12:21:51 +0200 Subject: [PATCH 426/457] Fix file metadata --- fi-fi/ruby-fi.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fi-fi/ruby-fi.html.markdown b/fi-fi/ruby-fi.html.markdown index b4f7583d..52c60182 100644 --- a/fi-fi/ruby-fi.html.markdown +++ b/fi-fi/ruby-fi.html.markdown @@ -1,6 +1,6 @@ --- language: ruby -filename: learnruby.rb +filename: learnruby-fi.rb contributors: - ["David Underwood", "http://theflyingdeveloper.com"] - ["Joel Walden", "http://joelwalden.net"] @@ -17,6 +17,7 @@ contributors: - ["Jake Faris", "https://github.com/farisj"] translators: - ["Oliver Vartiainen", "https://github.com/firoxer"] +lang: fi-fi --- ```ruby From 39c83718b14a768ed62a6644ed633c9a032ff9f6 Mon Sep 17 00:00:00 2001 From: sarthfrey Date: Mon, 25 Jan 2016 18:34:25 -0500 Subject: [PATCH 427/457] removed merge stuff --- python.html.markdown | 3 --- 1 file changed, 3 deletions(-) diff --git a/python.html.markdown b/python.html.markdown index 70f7f73f..2e7fd8be 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -726,11 +726,8 @@ print say(say_please=True) # Can you buy me a beer? Please! I am poor :( * [Python Module of the Week](http://pymotw.com/2/) * [A Crash Course in Python for Scientists](http://nbviewer.ipython.org/5920182) * [First Steps With Python](https://realpython.com/learn/python-first-steps/) -<<<<<<< HEAD * [LearnPython](http://www.learnpython.org/) -======= * [Fullstack Python](https://www.fullstackpython.com/) ->>>>>>> adambard/master ### Dead Tree From 82cb669cd77e0b394be0161ea8c688aa78f955d6 Mon Sep 17 00:00:00 2001 From: Ryan Plant Date: Tue, 26 Jan 2016 11:44:47 +1100 Subject: [PATCH 428/457] Fix typo --- ruby.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby.html.markdown b/ruby.html.markdown index 3eed2d3c..24dd788a 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -285,7 +285,7 @@ hash.each do |key, value| puts "#{key} is #{value}" end -# If you still need and index you can use "each_with_index" and define an index +# If you still need an index you can use "each_with_index" and define an index # variable array.each_with_index do |element, index| puts "#{element} is number #{index} in the array" From 0f5c74a79f328aa1b385a2dae3389d48faa47ce5 Mon Sep 17 00:00:00 2001 From: Ryan Plant Date: Tue, 26 Jan 2016 11:52:06 +1100 Subject: [PATCH 429/457] Add note on destructuring assignment --- ruby.html.markdown | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ruby.html.markdown b/ruby.html.markdown index 24dd788a..6743de6b 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -411,6 +411,15 @@ def guests(*array) array.each { |guest| puts guest } end +# If a method returns an array, you can use destructuring assignment +def foods + ['pancake', 'sandwich', 'quesadilla'] +end +breakfast, lunch, dinner = foods +breakfast # 'pancake' +dinner # 'quesadilla' + + # Define a class with the class keyword class Human From b9c1502cab19360bda496df5a2503a198f7c4f50 Mon Sep 17 00:00:00 2001 From: Ryan Plant Date: Tue, 26 Jan 2016 11:58:46 +1100 Subject: [PATCH 430/457] Add note on method naming conventions --- ruby.html.markdown | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ruby.html.markdown b/ruby.html.markdown index 6743de6b..bdad4d06 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -419,6 +419,19 @@ breakfast, lunch, dinner = foods breakfast # 'pancake' dinner # 'quesadilla' +# By convention, all methods that return booleans end with a question mark +5.even? # false +5.odd? # true + +# And if a method ends with an exclamation mark, it does something destructive +# like mutate the receiver. Many methods have a ! version to make a change, and +# a non-! version to just return a new changed version +company_name = "Dunder Mifflin" +company_name.upcase #=> "DUNDER MIFFLIN" +company_name #=> "Dunder Mifflin" +company_name.upcase! # we're mutating company_name this time! +company_name #=> "DUNDER MIFFLIN" + # Define a class with the class keyword class Human From 236cc1c14c71e561d9ab715079f6974a86fad271 Mon Sep 17 00:00:00 2001 From: Ryan Plant Date: Tue, 26 Jan 2016 11:59:08 +1100 Subject: [PATCH 431/457] Fix formatting on comments --- ruby.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruby.html.markdown b/ruby.html.markdown index bdad4d06..adf5ce81 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -416,8 +416,8 @@ def foods ['pancake', 'sandwich', 'quesadilla'] end breakfast, lunch, dinner = foods -breakfast # 'pancake' -dinner # 'quesadilla' +breakfast #=> 'pancake' +dinner #=> 'quesadilla' # By convention, all methods that return booleans end with a question mark 5.even? # false From f60cb8316e21197e369311df91a1f9576878785d Mon Sep 17 00:00:00 2001 From: Ryan Mavilia Date: Tue, 26 Jan 2016 03:27:17 -0500 Subject: [PATCH 432/457] Added paragraphs, lists, and formatted text. --- asciidoc.html.markdown | 66 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/asciidoc.html.markdown b/asciidoc.html.markdown index b98d0fa9..4196e424 100644 --- a/asciidoc.html.markdown +++ b/asciidoc.html.markdown @@ -44,23 +44,77 @@ v1.0, 2016-01-13 This article about chips is going to be fun. ``` +Paragraphs + +```asciidoc +You don't need anything special for paragraphs. + +Add a blank line between paragraphs to seperate them. + +To create a line blank add a + +and you will recieve a line break! +``` + +Formatting Text + +```asciidoc +_underscore creates italics_ +*asterisks for bold* +*_combine for extra fun_* +`use ticks to signify monospace` +`*bolded monospace*` +``` Section Titles ```asciidoc = Level 0 (may only be used in document's header) -== Same as

+== Level 1

-=== Same as

+=== Level 2

-==== Same as

+==== Level 3

-===== Same as

+===== Level 4
-====== Same as
+====== Level 5
-======= Same as +======= Level 6 ``` +Lists + +To create a bulleted list use asterisks. +```asciidoc +* foo +* bar +* baz +``` + +To create a numbered list use periods. +```asciidoc +. item 1 +. item 2 +. item 3 +``` + +You can nest lists by adding extra asterisks or periods up to five times. +```asciidoc +* foo 1 +** foo 2 +*** foo 3 +**** foo 4 +***** foo 5 +``` +```asciidoc +. foo 1 +.. foo 2 +... foo 3 +.... foo 4 +..... foo 5 +``` + + + From 083aa4fa4c462cbd9b5f9b3c671969d7d3d6976c Mon Sep 17 00:00:00 2001 From: Ryan Mavilia Date: Tue, 26 Jan 2016 03:32:28 -0500 Subject: [PATCH 433/457] Edit my website! --- asciidoc.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asciidoc.html.markdown b/asciidoc.html.markdown index 4196e424..f9ca8e21 100644 --- a/asciidoc.html.markdown +++ b/asciidoc.html.markdown @@ -1,7 +1,7 @@ --- language: asciidoc contributors: - - ["Ryan Mavilia", "http://unoriginality.rocks/:] + - ["Ryan Mavilia", "http://unoriginality.rocks/"] filename: asciidoc.md --- From 92beb9c37ca76d9ff0ea8b8c25cfe191accb6977 Mon Sep 17 00:00:00 2001 From: Tomy Date: Tue, 26 Jan 2016 19:53:14 +0900 Subject: [PATCH 434/457] feedback --- ja-jp/{php.html.markdown => php-jp.html.markdown} | 1 + 1 file changed, 1 insertion(+) rename ja-jp/{php.html.markdown => php-jp.html.markdown} (99%) diff --git a/ja-jp/php.html.markdown b/ja-jp/php-jp.html.markdown similarity index 99% rename from ja-jp/php.html.markdown rename to ja-jp/php-jp.html.markdown index b07dfb2f..2ca17179 100644 --- a/ja-jp/php.html.markdown +++ b/ja-jp/php-jp.html.markdown @@ -6,6 +6,7 @@ contributors: translators: - ["Kazushige Tominaga", "https://github.com/kazu9su"] filename: learnphp.php +lang: ja-jp --- このドキュメントでは、 PHP 5+ について説明します。 From e48f99593eb4d4c82aba4198ccebceb8a2fb5bd9 Mon Sep 17 00:00:00 2001 From: Tomy Date: Tue, 26 Jan 2016 19:56:15 +0900 Subject: [PATCH 435/457] update filename --- ja-jp/php-jp.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ja-jp/php-jp.html.markdown b/ja-jp/php-jp.html.markdown index 2ca17179..112916f4 100644 --- a/ja-jp/php-jp.html.markdown +++ b/ja-jp/php-jp.html.markdown @@ -5,7 +5,7 @@ contributors: - ["Trismegiste", "https://github.com/Trismegiste"] translators: - ["Kazushige Tominaga", "https://github.com/kazu9su"] -filename: learnphp.php +filename: learnphp-jp.php lang: ja-jp --- From 32f18cd992b5b6988a3b37eaa533f8215d83fe2e Mon Sep 17 00:00:00 2001 From: Jaskamal Kainth Date: Thu, 28 Jan 2016 10:38:51 +0530 Subject: [PATCH 436/457] Added Tuple --- c++.html.markdown | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/c++.html.markdown b/c++.html.markdown index 44cad665..b8ab656c 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -955,6 +955,54 @@ v.push_back(Foo()); // New value is copied into the first Foo we inserted // explanation of why this works. v.swap(vector()); + +/////////////////////////////////////// +// Tuples (C++11 and above) +/////////////////////////////////////// + +#include + +// Conceptually, Tuples are similar to old data structures (C-like structs) but instead of having named data members , +// its elements are accessed by their order in the tuple. + +// We start with constructing a tuple. +// +// Packing values into tuple +auto first = make_tuple ( 10 , 'A' ) ; +const int maxN = 1e9; +int maxL = 15; +auto second = make_tuple ( maxN , maxL ) ; + +// printing elements of 'first' tuple +cout << get<0>(first) << " " << get<1>(first) << "\n"; //prints : 10 A + +// printing elements of 'second' tuple +cout << get<0>(second)<< " " << get<1>(second) << "\n"; // prints: 1000000000 15 + + +// Unpacking tuple into variables + +int first_int; +char first_char; +tie (first_int , first_char ) = first; +cout << first_int << " " << first_char << "\n"; // prints : 10 A + +// We can also create tuple like this. + +tuple third ( 11 ,'A' , 3.14141); +// tuple_size returns number of elements in a tuple (as a constexpr) + +cout << tuple_size< decltype(third)>::value << "\n"; // prints: 3 + +// tuple_cat concatenates the elements of all the tuples in the same order. + +auto concatenated_tuple = tuple_cat( first, second ,third); +// concatenated_tuple becomes = (10 , 'A' , 1e9 , 15 , 11 , 'A' , 3.14141 ) + +cout << get<0>(concatenated_tuple) << "\n"; // prints: 10 +cout << get<3>(concatenated_tuple) << "\n"; // prints: 15 +cout << get<5>(concatenated_tuple) << "\n"; // prints: 'A' + ``` Further Reading: From a931cd772de4f5debc2dc379c0e8125ef9338d13 Mon Sep 17 00:00:00 2001 From: can Date: Thu, 28 Jan 2016 16:45:24 +0800 Subject: [PATCH 437/457] Remove junk string `450635425` --- zh-cn/java-cn.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zh-cn/java-cn.html.markdown b/zh-cn/java-cn.html.markdown index a8fd2a4c..1e9c38f6 100644 --- a/zh-cn/java-cn.html.markdown +++ b/zh-cn/java-cn.html.markdown @@ -302,7 +302,7 @@ class Bicycle { // 构造函数是初始化一个对象的方式 // 以下是一个默认构造函数 - public Bi450635425cycle() { + public Bicycle() { gear = 1; cadence = 50; speed = 5; @@ -328,7 +328,7 @@ class Bicycle { return cadence; } - // void返450635425回值函数没有返回值 + // void返回值函数没有返回值 public void setCadence(int newValue) { cadence = newValue; } From c805148618f5b2679d6581ff41885abc7140fd4d Mon Sep 17 00:00:00 2001 From: Jaskamal Kainth Date: Thu, 28 Jan 2016 15:26:35 +0530 Subject: [PATCH 438/457] [C++/en] Tuples in C++ --- c++.html.markdown | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/c++.html.markdown b/c++.html.markdown index b8ab656c..594cf15f 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -966,25 +966,24 @@ v.swap(vector()); // its elements are accessed by their order in the tuple. // We start with constructing a tuple. -// // Packing values into tuple -auto first = make_tuple ( 10 , 'A' ) ; +auto first = make_tuple( 10 , 'A' ) ; const int maxN = 1e9; -int maxL = 15; -auto second = make_tuple ( maxN , maxL ) ; +const int maxL = 15; +auto second = make_tuple( maxN , maxL ) ; // printing elements of 'first' tuple cout << get<0>(first) << " " << get<1>(first) << "\n"; //prints : 10 A // printing elements of 'second' tuple -cout << get<0>(second)<< " " << get<1>(second) << "\n"; // prints: 1000000000 15 +cout << get<0>(second) << " " << get<1>(second) << "\n"; // prints: 1000000000 15 // Unpacking tuple into variables int first_int; char first_char; -tie (first_int , first_char ) = first; +tie(first_int , first_char ) = first; cout << first_int << " " << first_char << "\n"; // prints : 10 A // We can also create tuple like this. @@ -992,7 +991,7 @@ cout << first_int << " " << first_char << "\n"; // prints : 10 A tuple third ( 11 ,'A' , 3.14141); // tuple_size returns number of elements in a tuple (as a constexpr) -cout << tuple_size< decltype(third)>::value << "\n"; // prints: 3 +cout << tuple_size < decltype(third) >::value << "\n"; // prints: 3 // tuple_cat concatenates the elements of all the tuples in the same order. From 4a1a6857ce30f19f8c04dcca4571bb27f7dc36d0 Mon Sep 17 00:00:00 2001 From: Jaskamal Kainth Date: Thu, 28 Jan 2016 17:15:44 +0530 Subject: [PATCH 439/457] [C++/en] Tuple , updated --- c++.html.markdown | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/c++.html.markdown b/c++.html.markdown index 594cf15f..ea6ef034 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -967,10 +967,10 @@ v.swap(vector()); // We start with constructing a tuple. // Packing values into tuple -auto first = make_tuple( 10 , 'A' ) ; +auto first = make_tuple(10,'A') ; const int maxN = 1e9; const int maxL = 15; -auto second = make_tuple( maxN , maxL ) ; +auto second = make_tuple(maxN,maxL) ; // printing elements of 'first' tuple cout << get<0>(first) << " " << get<1>(first) << "\n"; //prints : 10 A @@ -983,12 +983,12 @@ cout << get<0>(second) << " " << get<1>(second) << "\n"; // prints: 1000000000 1 int first_int; char first_char; -tie(first_int , first_char ) = first; +tie(first_int,first_char) = first; cout << first_int << " " << first_char << "\n"; // prints : 10 A // We can also create tuple like this. -tuple third ( 11 ,'A' , 3.14141); +tuple third (11,'A',3.14141); // tuple_size returns number of elements in a tuple (as a constexpr) cout << tuple_size < decltype(third) >::value << "\n"; // prints: 3 @@ -996,7 +996,7 @@ cout << tuple_size < decltype(third) >::value << "\n"; // prints: 3 // tuple_cat concatenates the elements of all the tuples in the same order. auto concatenated_tuple = tuple_cat( first, second ,third); -// concatenated_tuple becomes = (10 , 'A' , 1e9 , 15 , 11 , 'A' , 3.14141 ) +// concatenated_tuple becomes = (10,'A',1e9,15,11,'A',3.14141) cout << get<0>(concatenated_tuple) << "\n"; // prints: 10 cout << get<3>(concatenated_tuple) << "\n"; // prints: 15 From fa2b171008061bc82cf9b35e0470eebeaecb4a26 Mon Sep 17 00:00:00 2001 From: Jaskamal Kainth Date: Thu, 28 Jan 2016 18:22:11 +0530 Subject: [PATCH 440/457] [C++/en] Tuple , Updated --- c++.html.markdown | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/c++.html.markdown b/c++.html.markdown index ea6ef034..1065b9e8 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -967,10 +967,10 @@ v.swap(vector()); // We start with constructing a tuple. // Packing values into tuple -auto first = make_tuple(10,'A') ; +auto first = make_tuple(10,'A'); const int maxN = 1e9; const int maxL = 15; -auto second = make_tuple(maxN,maxL) ; +auto second = make_tuple(maxN,maxL); // printing elements of 'first' tuple cout << get<0>(first) << " " << get<1>(first) << "\n"; //prints : 10 A @@ -978,7 +978,6 @@ cout << get<0>(first) << " " << get<1>(first) << "\n"; //prints : 10 A // printing elements of 'second' tuple cout << get<0>(second) << " " << get<1>(second) << "\n"; // prints: 1000000000 15 - // Unpacking tuple into variables int first_int; From e1016455d5e4472e7a533c8cdd6df8ae4f2e7854 Mon Sep 17 00:00:00 2001 From: ven Date: Thu, 28 Jan 2016 14:04:41 +0100 Subject: [PATCH 441/457] #2119 fixups --- c++.html.markdown | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/c++.html.markdown b/c++.html.markdown index 1065b9e8..82662b15 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -967,10 +967,10 @@ v.swap(vector()); // We start with constructing a tuple. // Packing values into tuple -auto first = make_tuple(10,'A'); +auto first = make_tuple(10, 'A'); const int maxN = 1e9; const int maxL = 15; -auto second = make_tuple(maxN,maxL); +auto second = make_tuple(maxN, maxL); // printing elements of 'first' tuple cout << get<0>(first) << " " << get<1>(first) << "\n"; //prints : 10 A @@ -982,20 +982,20 @@ cout << get<0>(second) << " " << get<1>(second) << "\n"; // prints: 1000000000 1 int first_int; char first_char; -tie(first_int,first_char) = first; +tie(first_int, first_char) = first; cout << first_int << " " << first_char << "\n"; // prints : 10 A // We can also create tuple like this. -tuple third (11,'A',3.14141); +tuple third(11, 'A', 3.14141); // tuple_size returns number of elements in a tuple (as a constexpr) -cout << tuple_size < decltype(third) >::value << "\n"; // prints: 3 +cout << tuple_size::value << "\n"; // prints: 3 // tuple_cat concatenates the elements of all the tuples in the same order. -auto concatenated_tuple = tuple_cat( first, second ,third); -// concatenated_tuple becomes = (10,'A',1e9,15,11,'A',3.14141) +auto concatenated_tuple = tuple_cat(first, second, third); +// concatenated_tuple becomes = (10, 'A', 1e9, 15, 11, 'A' ,3.14141) cout << get<0>(concatenated_tuple) << "\n"; // prints: 10 cout << get<3>(concatenated_tuple) << "\n"; // prints: 15 From 89f24b7c255686723a8e7e89a3c820fc203c0243 Mon Sep 17 00:00:00 2001 From: Ahmad Zafrullah Date: Sat, 30 Jan 2016 12:07:45 +0700 Subject: [PATCH 442/457] [php/id-id] add ID translation --- id-id/php-id.html.markdown | 851 +++++++++++++++++++++++++++++++++++++ 1 file changed, 851 insertions(+) create mode 100644 id-id/php-id.html.markdown diff --git a/id-id/php-id.html.markdown b/id-id/php-id.html.markdown new file mode 100644 index 00000000..491a190e --- /dev/null +++ b/id-id/php-id.html.markdown @@ -0,0 +1,851 @@ +--- +language: PHP +contributors: + - ["Malcolm Fell", "http://emarref.net/"] + - ["Trismegiste", "https://github.com/Trismegiste"] +filename: learnphp-id.php +translators: + - ["Ahmad Zafrullah", "https://github.com/23Pstars"] +lang: id-id +--- + +Dokumen ini menjelaskan tentang PHP5 keatas. + +```php + +Halo Dunia, lagi! + 12 +$int2 = -12; // => -12 +$int3 = 012; // => 10 (awalan 0 menandakan bilangan Oktal) +$int4 = 0x0F; // => 15 (awalan 0x menandakan bilangan Heksadesimal) +// Bilangan Biner Integer tersedia mulai dari PHP 5.4.0. +$int5 = 0b11111111; // 255 (awalan 0b menandakan bilangan Biner) + +// Nilai Floats (dikenal juga sebagai Doubles) +$float = 1.234; +$float = 1.2e3; +$float = 7E-10; + +// Menghapus variable +unset($int1); + +// Aritmatika +$jumlah = 1 + 1; // 2 +$selisih = 2 - 1; // 1 +$perkalian = 2 * 2; // 4 +$pembagian = 2 / 1; // 2 + +// Aritmatika singkat +$angka = 0; +$angka += 1; // Menjumlahkan $angka dengan 1 +echo $angka++; // Menampilkan 1 (dijumlahkan dengan 1 setelah ditampilkan) +echo ++$angka; // Menampilkan 3 (dijumlahkan dengan 1 sebelum ditampilkan) +$angka /= $float; // Membagi dan menyimpan hasil pembagian pada $angka; + +// String biasanya diawali dan ditutup dengan petik satu. +$sgl_quotes = '$String'; // => '$String' + +// Hindari menggunakan petik dua kecuali menyertakan variabel lain +$dbl_quotes = "Ini adalah $sgl_quotes."; // => 'Ini adalah $String.' + +// Karakter khusus hanya berlaku pada petik dua +$berfungsi = "Ini mengandung \t karakter tab."; +$tidak_berfungsi = 'Ini hanya mengandung garis miring dan huruf t: \t'; + +// Batasi variabel dengan kurung kurawal jika diperlukan +$uang = "Saya memiliki $${angka} di Bank."; + +// Sejak PHP 5.3, nowdocs dapat digunakan untuk tak-terinterpolasi banyak-baris +$nowdoc = <<<'END' +Banyak baris +string +END; + +// Heredocs akan melakukan interpolasi +$heredoc = << 1, 'Dua' => 2, 'Tiga' => 3); + +// Pada PHP 5.4 diperkenalkan cara penulisan (sintaks) baru +$asosiatif = ['Satu' => 1, 'Dua' => 2, 'Tiga' => 3]; + +echo $asosiatif['Satu']; // menampilkan 1 + +// Daftar literal secara tidak langsung ditentukan oleh kunci integer +$larik = ['Satu', 'Dua', 'Tiga']; +echo $larik[0]; // => "Satu" + +// Menambahkan sebuah elemen pada akhir larik +$larik[] = 'Empat'; +// atau +array_push($larik, 'Lima'); + +// Menghapus elemen dari larik +unset($larik[3]); + +/******************************** + * Keluaran + */ + +echo('Halo Dunia!'); +// Menampilkan Halo Dunia! ke "stdout". +// "stdout" adalah sebuah halaman web ketika dijalankan dalam peramban (browser). + +print('Halo Dunia!'); // Sama seperti "echo" + +// "echo" dan "print" merupakan bahasa konstruksi, jadi tanda kurung dapat dihilangkan +echo 'Halo Dunia!'; +print 'Halo Dunia!'; + +$paragraf = 'paragraf'; + +echo 100; // Menampilkan variabel skalar secara langsung +echo $paragraf; // atau sebuat variabel + +// Jika PHP tag-singkat telah dikonfigurasi, atau versi PHP yang digunakan +// adalah 5.4.0 keatas, dapat digunakan sintaks "echo" singkat + +?> +

+ 2 +echo $z; // => 2 +$y = 0; +echo $x; // => 2 +echo $z; // => 0 + +// Menampilkan tipe dan nilai dari variabel ke "stdout" +var_dump($z); // prints int(0) + +// Menampilkan variabel ke "stdout" dalam format yang mudah dibaca +print_r($larik); // menampilkan: Array ( [0] => Satu [1] => Dua [2] => Tiga ) + +/******************************** + * Logika + */ +$a = 0; +$b = '0'; +$c = '1'; +$d = '1'; + +// menegaskan lemparan sebuah peringatan jika pernyataan tidak benar + +// Perbandingan berikut akan selalu benar, meskipun memiliki tipe yang berbeda. +assert($a == $b); // kesamaan +assert($c != $a); // ketidak-samaan +assert($c <> $a); // versi lain dari ketidak-samaan +assert($a < $c); +assert($c > $b); +assert($a <= $b); +assert($c >= $d); + +// Dibawah ini hanya akan bernilai benar jika nilainya memiliki tipe yang sama. +assert($c === $d); +assert($a !== $d); +assert(1 === '1'); +assert(1 !== '1'); + +// Operator 'Spaceship' (sejak PHP 7) +// Mengembalikan 0 jika nilai pada kedua sisi adalah sama +// Mengembalikan 1 jika nilai pada sisi kiri lebih besar +// Mengembalikan -1 jika nilai pada sisi kanan lebih besar + +$a = 100; +$b = 1000; + +echo $a <=> $a; // 0 karena keduanya sama +echo $a <=> $b; // -1 karena $a < $b +echo $b <=> $a; // 1 karena $b > $a + +// Variabel dapat dikonversi menjadi tipe lain, sesuai penggunaannya. + +$integer = 1; +echo $integer + $integer; // => 2 + +$string = '1'; +echo $string + $string; // => 2 (string dipaksa menjadi integer) + +$string = 'satu'; +echo $string + $string; // => 0 +// Menghasilkan 0 karena operator (+) tidak dapat memaksa string 'satu' menjadi sebuah integer + +// Perubahan tipe dapat dimanfaatkan untuk diperlakukan sebagai tipe lainnya + +$boolean = (boolean) 1; // => true + +$nol = 0; +$boolean = (boolean) $nol; // => false + +// Terdapat juga fungsi khusus untuk melakukan perubahan terhadap beberapa tipe +$integer = 5; +$string = strval($integer); + +$var = null; // Nilai Null + + +/******************************** + * Struktur Kontrol + */ + +if (true) { + print 'Saya tampil'; +} + +if (false) { + print 'Saya tidak tampil'; +} else { + print 'Saya tampil'; +} + +if (false) { + print 'Tidak tampil'; +} elseif(true) { + print 'Tampil'; +} + +// operator ternary +print (false ? 'Tidak tampil' : 'Tampil'); + +// cara pintas operator ternary mulai dirilis sejak PHP 5.3 +// persamaan dari "$x ? $x : 'Kerjakan'" +$x = false; +print($x ?: 'Kerjakan'); + +// operator null coalesce sejak PHP 7 +$a = null; +$b = 'Ditampilkan'; +echo $a ?? 'a belum di-set'; // menampilkan 'a belum di-set' +echo $b ?? 'b belum di-set'; // menampilkan 'Ditampilkan' + + +$x = 0; +if ($x === '0') { + print 'Tidak ditampilkan'; +} elseif($x == '1') { + print 'Tidak ditampilkan'; +} else { + print 'Tampil'; +} + + +// Alternatif sintaks untuk kebutuhan templat: +?> + + +Ini ditampilkan jika pengujian benar. + +Selain tersebut ini yang akan ditampilkan. + + + 2, 'mobil' => 4]; + +// Perulangan "foreach" dapat melakukan iterasi pada larik (array) +foreach ($roda as $jumlah_roda) { + echo $jumlah_roda; +} // Menampilkan "24" + +echo "\n"; + +// Iterasi dapat dilakukan terhadap "key" (kunci) dan "value" (nilai) +foreach ($roda as $mesin => $jumlah_roda) { + echo "$mesin memiliki $jumlah_roda buah roda"; +} + +echo "\n"; + +$i = 0; +while ($i < 5) { + if ($i === 3) { + break; // Menghentikan proses perulangan + } + echo $i++; +} // Menampilkan "012" + +for ($i = 0; $i < 5; $i++) { + if ($i === 3) { + continue; // Melewati tahapan iterasi saat ini + } + echo $i; +} // Menampilkan "0124" + + +/******************************** + * Fungsi + */ + +// Fungsi didefinisikan dengan "function": +function fungsi_saya () { + return 'Halo'; +} + +echo fungsi_saya(); // => "Halo" + +// Nama fungsi yang baik dan benar diawali dengan sebuah huruf atau garis-bawah, diikuti oleh +// beberapa huruf, angka, atau garis-bawah. + +function jumlah ($x, $y = 1) { // $y merupakan opsional, jika tidak ditentukan akan bernilai 1 + $hasil = $x + $y; + return $hasil; +} + +echo jumlah(4); // => 5 +echo jumlah(4, 2); // => 6 + +// $hasil tidak dapat diakses dari luar fungsi +// print $hasil; // Akan menghasilkan sebuah "warning". + +// Sejak PHP 5.3 fungsi dapat dideklarasikan menjadi tanpa-nama (anonymous); +$inc = function ($x) { + return $x + 1; +}; + +echo $inc(2); // => 3 + +function foo ($x, $y, $z) { + echo "$x - $y - $z"; +} + +// Fungsi dapat mengembalikan fungsi juga +function bar ($x, $y) { + // Gunakan "use" untuk mengakses variabel diluar fungsi + return function ($z) use ($x, $y) { + foo($x, $y, $z); + }; +} + +$bar = bar('A', 'B'); +$bar('C'); // Menampilkan "A - B - C" + +// Fungsi uang memiliki nama dapat dipanggil berdasarkan string +$nama_fungsi = 'jumlah'; +echo $nama_fungsi(1, 2); // => 3 +// Bermanfaat untuk menentukan fungsi mana yang akan dipanggil secara dinamis. +// Atau, dapat juga menggunakan fungsi call_user_func(callable $callback [, $parameter [, ... ]]); + +// Akses semua parameter yang dikirim ke sebuah fungsi +function parameter() { + $jumlah_param = func_num_args(); + if( $jumlah_param > 0 ) { + echo func_get_arg(0) . ' | '; + } + $daftar_param = func_get_args(); + foreach( $daftar_param as $kunci => $param ) { + echo $kunci . ' - ' . $param . ' | '; + } +} + +parameter('Halo', 'Dunia'); // Halo | 0 - Halo | 1 - Dunia | + +// Sejak PHP 5.6, mendapatkan jumlah variabel yang ada pada parameter +function variabel($kata, ...$daftar) { + echo $kata . " || "; + foreach ($daftar as $item) { + echo $item . ' | '; + } +} + +variable("Pemisah", "Halo", "Dunia") // Pemisah || Halo | Dunia | + +/******************************** + * Penyertaan ("include") + */ + +PropertiInstansi = $PropertiInstansi; + } + + // Method dideklarasikan sebagai fungsi didalam kelas + public function methodSaya() + { + print 'KelasSaya'; + } + + // Perintah "final" membuat sebuah fungsi tidak dapat di-override oleh kelas turunannya + final function tidakDapatDiOverride() + { + } + +/* + * Deklarasi properti atau method pada kelas sebagai statis membuat properti atau method tersebut + * dapat diakses tanpa melakukan instansiasi kelas. Properti statis tidak dapat diakses melalui + * objek kelas yang hasil instansiasi, sedangkan method statis bisa. + */ + + public static function methodStatisSaya() + { + print 'Saya adalah statis'; + } +} + +// Konstan pada kelas dapat diakses secara statis +echo KelasSaya::NILAI_KONSTAN; // Menampilkan 'nilai' + +echo KelasSaya::$nilaiStatis; // Menampilkan 'statis' +KelasSaya::methodStatisSaya(); // Menampilkan 'Saya adalah statis' + +// Instansi kelas menggunakan perintah "new" +$kelas_saya = new KelasSaya('Sebuah properti instansiasi'); +// Tanda kurung adalah opsional jika tidak ingin menggunakan argumen. + +// Akses anggota kelas menggunakan -> +echo $kelas_saya->properti; // => "publik" +echo $kelas_saya->propertiInstansi; // => "Sebuah properti instansi" +$kelas_saya->methodSaya(); // => "KelasSaya" + +// Extend classes using "extends" +class MyOtherClass extends MyClass +{ + function printProtectedProperty() + { + echo $this->prot; + } + + // Override a method + function myMethod() + { + parent::myMethod(); + print ' > MyOtherClass'; + } +} + +$my_other_class = new MyOtherClass('Instance prop'); +$my_other_class->printProtectedProperty(); // => Prints "protected" +$my_other_class->myMethod(); // Prints "MyClass > MyOtherClass" + +final class YouCannotExtendMe +{ +} + +// You can use "magic methods" to create getters and setters +class MyMapClass +{ + private $property; + + public function __get($key) + { + return $this->$key; + } + + public function __set($key, $value) + { + $this->$key = $value; + } +} + +$x = new MyMapClass(); +echo $x->property; // Will use the __get() method +$x->property = 'Something'; // Will use the __set() method + +// Classes can be abstract (using the abstract keyword) or +// implement interfaces (using the implements keyword). +// An interface is declared with the interface keyword. + +interface InterfaceOne +{ + public function doSomething(); +} + +interface InterfaceTwo +{ + public function doSomethingElse(); +} + +// interfaces can be extended +interface InterfaceThree extends InterfaceTwo +{ + public function doAnotherContract(); +} + +abstract class MyAbstractClass implements InterfaceOne +{ + public $x = 'doSomething'; +} + +class MyConcreteClass extends MyAbstractClass implements InterfaceTwo +{ + public function doSomething() + { + echo $x; + } + + public function doSomethingElse() + { + echo 'doSomethingElse'; + } +} + + +// Classes can implement more than one interface +class SomeOtherClass implements InterfaceOne, InterfaceTwo +{ + public function doSomething() + { + echo 'doSomething'; + } + + public function doSomethingElse() + { + echo 'doSomethingElse'; + } +} + + +/******************************** + * Traits + */ + +// Traits are available from PHP 5.4.0 and are declared using "trait" + +trait MyTrait +{ + public function myTraitMethod() + { + print 'I have MyTrait'; + } +} + +class MyTraitfulClass +{ + use MyTrait; +} + +$cls = new MyTraitfulClass(); +$cls->myTraitMethod(); // Prints "I have MyTrait" + + +/******************************** + * Namespaces + */ + +// This section is separate, because a namespace declaration +// must be the first statement in a file. Let's pretend that is not the case + + Date: Sun, 31 Jan 2016 16:08:28 +0100 Subject: [PATCH 443/457] Update c++.html.markdown v.empty() queries if v is empty while v.clear() actually clears it (or rather sets size to 0). --- c++.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c++.html.markdown b/c++.html.markdown index 82662b15..a59b4db8 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -948,7 +948,7 @@ for (int i = 0; i < 10; ++i) // Following line sets size of v to 0, but destructors don't get called // and resources aren't released! -v.empty(); +v.clear(); v.push_back(Foo()); // New value is copied into the first Foo we inserted // Truly destroys all values in v. See section about temporary objects for From b7e166dc45edd2d5cc6dd271749cd49ef003b8ae Mon Sep 17 00:00:00 2001 From: Ahmad Zafrullah Date: Tue, 2 Feb 2016 07:34:19 +0700 Subject: [PATCH 444/457] [php/id-id] updates for ID translation --- id-id/php-id.html.markdown | 239 ++++++++++++++++++------------------- 1 file changed, 118 insertions(+), 121 deletions(-) diff --git a/id-id/php-id.html.markdown b/id-id/php-id.html.markdown index 491a190e..34d6e5f5 100644 --- a/id-id/php-id.html.markdown +++ b/id-id/php-id.html.markdown @@ -567,34 +567,34 @@ echo $kelas_saya->properti; // => "publik" echo $kelas_saya->propertiInstansi; // => "Sebuah properti instansi" $kelas_saya->methodSaya(); // => "KelasSaya" -// Extend classes using "extends" -class MyOtherClass extends MyClass +// Menurunkan kelas menggunakan kata kunci "extends" +class KelasSayaLainnya extends KelasSaya { - function printProtectedProperty() + function tampilkanPropertiTerlindungi() { - echo $this->prot; + echo $this->properti; } - // Override a method - function myMethod() + // "override" terhadap sebuah method + function methodSaya() { - parent::myMethod(); - print ' > MyOtherClass'; + parent::methodSaya(); + print ' > KelasSayaLainnya'; } } -$my_other_class = new MyOtherClass('Instance prop'); -$my_other_class->printProtectedProperty(); // => Prints "protected" -$my_other_class->myMethod(); // Prints "MyClass > MyOtherClass" +$kelas_saya_lainnya = new KelasSayaLainnya('Instansiasi properti'); +$kelas_saya_lainnya->tampilkanPropertiTerlindung(); // => Menampilkan "terlindungi" +$kelas_saya_lainnya->methodSaya(); // Menampilkan "KelasSaya > KelasSayaLainnya" -final class YouCannotExtendMe +final class SayaTidakBisaDiturunkan { } -// You can use "magic methods" to create getters and setters -class MyMapClass +// Gunakan method ajaib (magic method) untuk membuat fungsi "getters" dan "setters" +class PetaKelasSaya { - private $property; + private $properti; public function __get($key) { @@ -607,127 +607,125 @@ class MyMapClass } } -$x = new MyMapClass(); -echo $x->property; // Will use the __get() method -$x->property = 'Something'; // Will use the __set() method +$x = new PetaKelasSaya(); +echo $x->properti; // akan memanggil method __get() +$x->properti = 'Sesuatu'; // akan memanggil method __set(); -// Classes can be abstract (using the abstract keyword) or -// implement interfaces (using the implements keyword). -// An interface is declared with the interface keyword. +// Kelas dapat dijadikan abstrak (menggunakan kata kunci "abstract"), atau +// meng-implementasikan interfaces (menggunakan kata kunci "implements"). +// Sebuah interface dideklarasikan dengan perintah "interface". -interface InterfaceOne +interface InterfaceSatu { - public function doSomething(); + public function kerjakanSesuatu(); } -interface InterfaceTwo +interface InterfaceDua { - public function doSomethingElse(); + public function kerjakanYangLain(); } -// interfaces can be extended -interface InterfaceThree extends InterfaceTwo +// interface dapat diturunkan +interface InterfaceTiga extends InterfaceDua { - public function doAnotherContract(); + public function kerjakanYangBerbeda(); } -abstract class MyAbstractClass implements InterfaceOne +abstract class KelasAbstrakSaya implements InterfaceSatu { - public $x = 'doSomething'; + public $x = 'kerjakanSesuatu'; } -class MyConcreteClass extends MyAbstractClass implements InterfaceTwo +class KelasKongkritSaya extends KelasAbstrakSaya implements InterfaceTwo { - public function doSomething() + public function kerjakanSesuatu() { echo $x; } - public function doSomethingElse() + public function kerjakanYangLain() { - echo 'doSomethingElse'; + echo 'kerjakanYangLain'; } } - -// Classes can implement more than one interface -class SomeOtherClass implements InterfaceOne, InterfaceTwo +// Kelas dapat diimplementasikan pada banyak interface +class KelasLainnya implements InterfaceSatu, InterfaceDua { - public function doSomething() + public function kerjakanSesuatu() { - echo 'doSomething'; + echo 'kerjakanSesuatu'; } - public function doSomethingElse() + public function kerjakanYangLain() { - echo 'doSomethingElse'; + echo 'kerjakanYangLain'; } } /******************************** - * Traits + * Sifat (Traits) */ -// Traits are available from PHP 5.4.0 and are declared using "trait" +// Traits mulai tersedia sejak PHP 5.4.0 dan dideklarasikan menggunakan kata kunci "trait" -trait MyTrait +trait TraitSaya { - public function myTraitMethod() + public function methodTraitSaya() { - print 'I have MyTrait'; + print 'Saya menggunakan Trait'; } } -class MyTraitfulClass +class KelasTraitSaya { - use MyTrait; + use TraitSaya; } -$cls = new MyTraitfulClass(); -$cls->myTraitMethod(); // Prints "I have MyTrait" +$kls = new KelasTraitSaya(); +$kls->methodTraitSaya(); // menampilkan "Saya menggunakan Trait" /******************************** * Namespaces */ -// This section is separate, because a namespace declaration -// must be the first statement in a file. Let's pretend that is not the case +// Bagian ini telah dibatasi, karena deklarasi "namespace" +// karena harus ditempatkan diawal dokumen. Date: Sat, 30 Jan 2016 12:07:45 +0700 Subject: [PATCH 445/457] [php/id-id] add ID translation --- id-id/php-id.html.markdown | 851 +++++++++++++++++++++++++++++++++++++ 1 file changed, 851 insertions(+) create mode 100644 id-id/php-id.html.markdown diff --git a/id-id/php-id.html.markdown b/id-id/php-id.html.markdown new file mode 100644 index 00000000..491a190e --- /dev/null +++ b/id-id/php-id.html.markdown @@ -0,0 +1,851 @@ +--- +language: PHP +contributors: + - ["Malcolm Fell", "http://emarref.net/"] + - ["Trismegiste", "https://github.com/Trismegiste"] +filename: learnphp-id.php +translators: + - ["Ahmad Zafrullah", "https://github.com/23Pstars"] +lang: id-id +--- + +Dokumen ini menjelaskan tentang PHP5 keatas. + +```php + +Halo Dunia, lagi! + 12 +$int2 = -12; // => -12 +$int3 = 012; // => 10 (awalan 0 menandakan bilangan Oktal) +$int4 = 0x0F; // => 15 (awalan 0x menandakan bilangan Heksadesimal) +// Bilangan Biner Integer tersedia mulai dari PHP 5.4.0. +$int5 = 0b11111111; // 255 (awalan 0b menandakan bilangan Biner) + +// Nilai Floats (dikenal juga sebagai Doubles) +$float = 1.234; +$float = 1.2e3; +$float = 7E-10; + +// Menghapus variable +unset($int1); + +// Aritmatika +$jumlah = 1 + 1; // 2 +$selisih = 2 - 1; // 1 +$perkalian = 2 * 2; // 4 +$pembagian = 2 / 1; // 2 + +// Aritmatika singkat +$angka = 0; +$angka += 1; // Menjumlahkan $angka dengan 1 +echo $angka++; // Menampilkan 1 (dijumlahkan dengan 1 setelah ditampilkan) +echo ++$angka; // Menampilkan 3 (dijumlahkan dengan 1 sebelum ditampilkan) +$angka /= $float; // Membagi dan menyimpan hasil pembagian pada $angka; + +// String biasanya diawali dan ditutup dengan petik satu. +$sgl_quotes = '$String'; // => '$String' + +// Hindari menggunakan petik dua kecuali menyertakan variabel lain +$dbl_quotes = "Ini adalah $sgl_quotes."; // => 'Ini adalah $String.' + +// Karakter khusus hanya berlaku pada petik dua +$berfungsi = "Ini mengandung \t karakter tab."; +$tidak_berfungsi = 'Ini hanya mengandung garis miring dan huruf t: \t'; + +// Batasi variabel dengan kurung kurawal jika diperlukan +$uang = "Saya memiliki $${angka} di Bank."; + +// Sejak PHP 5.3, nowdocs dapat digunakan untuk tak-terinterpolasi banyak-baris +$nowdoc = <<<'END' +Banyak baris +string +END; + +// Heredocs akan melakukan interpolasi +$heredoc = << 1, 'Dua' => 2, 'Tiga' => 3); + +// Pada PHP 5.4 diperkenalkan cara penulisan (sintaks) baru +$asosiatif = ['Satu' => 1, 'Dua' => 2, 'Tiga' => 3]; + +echo $asosiatif['Satu']; // menampilkan 1 + +// Daftar literal secara tidak langsung ditentukan oleh kunci integer +$larik = ['Satu', 'Dua', 'Tiga']; +echo $larik[0]; // => "Satu" + +// Menambahkan sebuah elemen pada akhir larik +$larik[] = 'Empat'; +// atau +array_push($larik, 'Lima'); + +// Menghapus elemen dari larik +unset($larik[3]); + +/******************************** + * Keluaran + */ + +echo('Halo Dunia!'); +// Menampilkan Halo Dunia! ke "stdout". +// "stdout" adalah sebuah halaman web ketika dijalankan dalam peramban (browser). + +print('Halo Dunia!'); // Sama seperti "echo" + +// "echo" dan "print" merupakan bahasa konstruksi, jadi tanda kurung dapat dihilangkan +echo 'Halo Dunia!'; +print 'Halo Dunia!'; + +$paragraf = 'paragraf'; + +echo 100; // Menampilkan variabel skalar secara langsung +echo $paragraf; // atau sebuat variabel + +// Jika PHP tag-singkat telah dikonfigurasi, atau versi PHP yang digunakan +// adalah 5.4.0 keatas, dapat digunakan sintaks "echo" singkat + +?> +

+ 2 +echo $z; // => 2 +$y = 0; +echo $x; // => 2 +echo $z; // => 0 + +// Menampilkan tipe dan nilai dari variabel ke "stdout" +var_dump($z); // prints int(0) + +// Menampilkan variabel ke "stdout" dalam format yang mudah dibaca +print_r($larik); // menampilkan: Array ( [0] => Satu [1] => Dua [2] => Tiga ) + +/******************************** + * Logika + */ +$a = 0; +$b = '0'; +$c = '1'; +$d = '1'; + +// menegaskan lemparan sebuah peringatan jika pernyataan tidak benar + +// Perbandingan berikut akan selalu benar, meskipun memiliki tipe yang berbeda. +assert($a == $b); // kesamaan +assert($c != $a); // ketidak-samaan +assert($c <> $a); // versi lain dari ketidak-samaan +assert($a < $c); +assert($c > $b); +assert($a <= $b); +assert($c >= $d); + +// Dibawah ini hanya akan bernilai benar jika nilainya memiliki tipe yang sama. +assert($c === $d); +assert($a !== $d); +assert(1 === '1'); +assert(1 !== '1'); + +// Operator 'Spaceship' (sejak PHP 7) +// Mengembalikan 0 jika nilai pada kedua sisi adalah sama +// Mengembalikan 1 jika nilai pada sisi kiri lebih besar +// Mengembalikan -1 jika nilai pada sisi kanan lebih besar + +$a = 100; +$b = 1000; + +echo $a <=> $a; // 0 karena keduanya sama +echo $a <=> $b; // -1 karena $a < $b +echo $b <=> $a; // 1 karena $b > $a + +// Variabel dapat dikonversi menjadi tipe lain, sesuai penggunaannya. + +$integer = 1; +echo $integer + $integer; // => 2 + +$string = '1'; +echo $string + $string; // => 2 (string dipaksa menjadi integer) + +$string = 'satu'; +echo $string + $string; // => 0 +// Menghasilkan 0 karena operator (+) tidak dapat memaksa string 'satu' menjadi sebuah integer + +// Perubahan tipe dapat dimanfaatkan untuk diperlakukan sebagai tipe lainnya + +$boolean = (boolean) 1; // => true + +$nol = 0; +$boolean = (boolean) $nol; // => false + +// Terdapat juga fungsi khusus untuk melakukan perubahan terhadap beberapa tipe +$integer = 5; +$string = strval($integer); + +$var = null; // Nilai Null + + +/******************************** + * Struktur Kontrol + */ + +if (true) { + print 'Saya tampil'; +} + +if (false) { + print 'Saya tidak tampil'; +} else { + print 'Saya tampil'; +} + +if (false) { + print 'Tidak tampil'; +} elseif(true) { + print 'Tampil'; +} + +// operator ternary +print (false ? 'Tidak tampil' : 'Tampil'); + +// cara pintas operator ternary mulai dirilis sejak PHP 5.3 +// persamaan dari "$x ? $x : 'Kerjakan'" +$x = false; +print($x ?: 'Kerjakan'); + +// operator null coalesce sejak PHP 7 +$a = null; +$b = 'Ditampilkan'; +echo $a ?? 'a belum di-set'; // menampilkan 'a belum di-set' +echo $b ?? 'b belum di-set'; // menampilkan 'Ditampilkan' + + +$x = 0; +if ($x === '0') { + print 'Tidak ditampilkan'; +} elseif($x == '1') { + print 'Tidak ditampilkan'; +} else { + print 'Tampil'; +} + + +// Alternatif sintaks untuk kebutuhan templat: +?> + + +Ini ditampilkan jika pengujian benar. + +Selain tersebut ini yang akan ditampilkan. + + + 2, 'mobil' => 4]; + +// Perulangan "foreach" dapat melakukan iterasi pada larik (array) +foreach ($roda as $jumlah_roda) { + echo $jumlah_roda; +} // Menampilkan "24" + +echo "\n"; + +// Iterasi dapat dilakukan terhadap "key" (kunci) dan "value" (nilai) +foreach ($roda as $mesin => $jumlah_roda) { + echo "$mesin memiliki $jumlah_roda buah roda"; +} + +echo "\n"; + +$i = 0; +while ($i < 5) { + if ($i === 3) { + break; // Menghentikan proses perulangan + } + echo $i++; +} // Menampilkan "012" + +for ($i = 0; $i < 5; $i++) { + if ($i === 3) { + continue; // Melewati tahapan iterasi saat ini + } + echo $i; +} // Menampilkan "0124" + + +/******************************** + * Fungsi + */ + +// Fungsi didefinisikan dengan "function": +function fungsi_saya () { + return 'Halo'; +} + +echo fungsi_saya(); // => "Halo" + +// Nama fungsi yang baik dan benar diawali dengan sebuah huruf atau garis-bawah, diikuti oleh +// beberapa huruf, angka, atau garis-bawah. + +function jumlah ($x, $y = 1) { // $y merupakan opsional, jika tidak ditentukan akan bernilai 1 + $hasil = $x + $y; + return $hasil; +} + +echo jumlah(4); // => 5 +echo jumlah(4, 2); // => 6 + +// $hasil tidak dapat diakses dari luar fungsi +// print $hasil; // Akan menghasilkan sebuah "warning". + +// Sejak PHP 5.3 fungsi dapat dideklarasikan menjadi tanpa-nama (anonymous); +$inc = function ($x) { + return $x + 1; +}; + +echo $inc(2); // => 3 + +function foo ($x, $y, $z) { + echo "$x - $y - $z"; +} + +// Fungsi dapat mengembalikan fungsi juga +function bar ($x, $y) { + // Gunakan "use" untuk mengakses variabel diluar fungsi + return function ($z) use ($x, $y) { + foo($x, $y, $z); + }; +} + +$bar = bar('A', 'B'); +$bar('C'); // Menampilkan "A - B - C" + +// Fungsi uang memiliki nama dapat dipanggil berdasarkan string +$nama_fungsi = 'jumlah'; +echo $nama_fungsi(1, 2); // => 3 +// Bermanfaat untuk menentukan fungsi mana yang akan dipanggil secara dinamis. +// Atau, dapat juga menggunakan fungsi call_user_func(callable $callback [, $parameter [, ... ]]); + +// Akses semua parameter yang dikirim ke sebuah fungsi +function parameter() { + $jumlah_param = func_num_args(); + if( $jumlah_param > 0 ) { + echo func_get_arg(0) . ' | '; + } + $daftar_param = func_get_args(); + foreach( $daftar_param as $kunci => $param ) { + echo $kunci . ' - ' . $param . ' | '; + } +} + +parameter('Halo', 'Dunia'); // Halo | 0 - Halo | 1 - Dunia | + +// Sejak PHP 5.6, mendapatkan jumlah variabel yang ada pada parameter +function variabel($kata, ...$daftar) { + echo $kata . " || "; + foreach ($daftar as $item) { + echo $item . ' | '; + } +} + +variable("Pemisah", "Halo", "Dunia") // Pemisah || Halo | Dunia | + +/******************************** + * Penyertaan ("include") + */ + +PropertiInstansi = $PropertiInstansi; + } + + // Method dideklarasikan sebagai fungsi didalam kelas + public function methodSaya() + { + print 'KelasSaya'; + } + + // Perintah "final" membuat sebuah fungsi tidak dapat di-override oleh kelas turunannya + final function tidakDapatDiOverride() + { + } + +/* + * Deklarasi properti atau method pada kelas sebagai statis membuat properti atau method tersebut + * dapat diakses tanpa melakukan instansiasi kelas. Properti statis tidak dapat diakses melalui + * objek kelas yang hasil instansiasi, sedangkan method statis bisa. + */ + + public static function methodStatisSaya() + { + print 'Saya adalah statis'; + } +} + +// Konstan pada kelas dapat diakses secara statis +echo KelasSaya::NILAI_KONSTAN; // Menampilkan 'nilai' + +echo KelasSaya::$nilaiStatis; // Menampilkan 'statis' +KelasSaya::methodStatisSaya(); // Menampilkan 'Saya adalah statis' + +// Instansi kelas menggunakan perintah "new" +$kelas_saya = new KelasSaya('Sebuah properti instansiasi'); +// Tanda kurung adalah opsional jika tidak ingin menggunakan argumen. + +// Akses anggota kelas menggunakan -> +echo $kelas_saya->properti; // => "publik" +echo $kelas_saya->propertiInstansi; // => "Sebuah properti instansi" +$kelas_saya->methodSaya(); // => "KelasSaya" + +// Extend classes using "extends" +class MyOtherClass extends MyClass +{ + function printProtectedProperty() + { + echo $this->prot; + } + + // Override a method + function myMethod() + { + parent::myMethod(); + print ' > MyOtherClass'; + } +} + +$my_other_class = new MyOtherClass('Instance prop'); +$my_other_class->printProtectedProperty(); // => Prints "protected" +$my_other_class->myMethod(); // Prints "MyClass > MyOtherClass" + +final class YouCannotExtendMe +{ +} + +// You can use "magic methods" to create getters and setters +class MyMapClass +{ + private $property; + + public function __get($key) + { + return $this->$key; + } + + public function __set($key, $value) + { + $this->$key = $value; + } +} + +$x = new MyMapClass(); +echo $x->property; // Will use the __get() method +$x->property = 'Something'; // Will use the __set() method + +// Classes can be abstract (using the abstract keyword) or +// implement interfaces (using the implements keyword). +// An interface is declared with the interface keyword. + +interface InterfaceOne +{ + public function doSomething(); +} + +interface InterfaceTwo +{ + public function doSomethingElse(); +} + +// interfaces can be extended +interface InterfaceThree extends InterfaceTwo +{ + public function doAnotherContract(); +} + +abstract class MyAbstractClass implements InterfaceOne +{ + public $x = 'doSomething'; +} + +class MyConcreteClass extends MyAbstractClass implements InterfaceTwo +{ + public function doSomething() + { + echo $x; + } + + public function doSomethingElse() + { + echo 'doSomethingElse'; + } +} + + +// Classes can implement more than one interface +class SomeOtherClass implements InterfaceOne, InterfaceTwo +{ + public function doSomething() + { + echo 'doSomething'; + } + + public function doSomethingElse() + { + echo 'doSomethingElse'; + } +} + + +/******************************** + * Traits + */ + +// Traits are available from PHP 5.4.0 and are declared using "trait" + +trait MyTrait +{ + public function myTraitMethod() + { + print 'I have MyTrait'; + } +} + +class MyTraitfulClass +{ + use MyTrait; +} + +$cls = new MyTraitfulClass(); +$cls->myTraitMethod(); // Prints "I have MyTrait" + + +/******************************** + * Namespaces + */ + +// This section is separate, because a namespace declaration +// must be the first statement in a file. Let's pretend that is not the case + + Date: Tue, 2 Feb 2016 07:34:19 +0700 Subject: [PATCH 446/457] [php/id-id] updates for ID translation --- id-id/php-id.html.markdown | 239 ++++++++++++++++++------------------- 1 file changed, 118 insertions(+), 121 deletions(-) diff --git a/id-id/php-id.html.markdown b/id-id/php-id.html.markdown index 491a190e..34d6e5f5 100644 --- a/id-id/php-id.html.markdown +++ b/id-id/php-id.html.markdown @@ -567,34 +567,34 @@ echo $kelas_saya->properti; // => "publik" echo $kelas_saya->propertiInstansi; // => "Sebuah properti instansi" $kelas_saya->methodSaya(); // => "KelasSaya" -// Extend classes using "extends" -class MyOtherClass extends MyClass +// Menurunkan kelas menggunakan kata kunci "extends" +class KelasSayaLainnya extends KelasSaya { - function printProtectedProperty() + function tampilkanPropertiTerlindungi() { - echo $this->prot; + echo $this->properti; } - // Override a method - function myMethod() + // "override" terhadap sebuah method + function methodSaya() { - parent::myMethod(); - print ' > MyOtherClass'; + parent::methodSaya(); + print ' > KelasSayaLainnya'; } } -$my_other_class = new MyOtherClass('Instance prop'); -$my_other_class->printProtectedProperty(); // => Prints "protected" -$my_other_class->myMethod(); // Prints "MyClass > MyOtherClass" +$kelas_saya_lainnya = new KelasSayaLainnya('Instansiasi properti'); +$kelas_saya_lainnya->tampilkanPropertiTerlindung(); // => Menampilkan "terlindungi" +$kelas_saya_lainnya->methodSaya(); // Menampilkan "KelasSaya > KelasSayaLainnya" -final class YouCannotExtendMe +final class SayaTidakBisaDiturunkan { } -// You can use "magic methods" to create getters and setters -class MyMapClass +// Gunakan method ajaib (magic method) untuk membuat fungsi "getters" dan "setters" +class PetaKelasSaya { - private $property; + private $properti; public function __get($key) { @@ -607,127 +607,125 @@ class MyMapClass } } -$x = new MyMapClass(); -echo $x->property; // Will use the __get() method -$x->property = 'Something'; // Will use the __set() method +$x = new PetaKelasSaya(); +echo $x->properti; // akan memanggil method __get() +$x->properti = 'Sesuatu'; // akan memanggil method __set(); -// Classes can be abstract (using the abstract keyword) or -// implement interfaces (using the implements keyword). -// An interface is declared with the interface keyword. +// Kelas dapat dijadikan abstrak (menggunakan kata kunci "abstract"), atau +// meng-implementasikan interfaces (menggunakan kata kunci "implements"). +// Sebuah interface dideklarasikan dengan perintah "interface". -interface InterfaceOne +interface InterfaceSatu { - public function doSomething(); + public function kerjakanSesuatu(); } -interface InterfaceTwo +interface InterfaceDua { - public function doSomethingElse(); + public function kerjakanYangLain(); } -// interfaces can be extended -interface InterfaceThree extends InterfaceTwo +// interface dapat diturunkan +interface InterfaceTiga extends InterfaceDua { - public function doAnotherContract(); + public function kerjakanYangBerbeda(); } -abstract class MyAbstractClass implements InterfaceOne +abstract class KelasAbstrakSaya implements InterfaceSatu { - public $x = 'doSomething'; + public $x = 'kerjakanSesuatu'; } -class MyConcreteClass extends MyAbstractClass implements InterfaceTwo +class KelasKongkritSaya extends KelasAbstrakSaya implements InterfaceTwo { - public function doSomething() + public function kerjakanSesuatu() { echo $x; } - public function doSomethingElse() + public function kerjakanYangLain() { - echo 'doSomethingElse'; + echo 'kerjakanYangLain'; } } - -// Classes can implement more than one interface -class SomeOtherClass implements InterfaceOne, InterfaceTwo +// Kelas dapat diimplementasikan pada banyak interface +class KelasLainnya implements InterfaceSatu, InterfaceDua { - public function doSomething() + public function kerjakanSesuatu() { - echo 'doSomething'; + echo 'kerjakanSesuatu'; } - public function doSomethingElse() + public function kerjakanYangLain() { - echo 'doSomethingElse'; + echo 'kerjakanYangLain'; } } /******************************** - * Traits + * Sifat (Traits) */ -// Traits are available from PHP 5.4.0 and are declared using "trait" +// Traits mulai tersedia sejak PHP 5.4.0 dan dideklarasikan menggunakan kata kunci "trait" -trait MyTrait +trait TraitSaya { - public function myTraitMethod() + public function methodTraitSaya() { - print 'I have MyTrait'; + print 'Saya menggunakan Trait'; } } -class MyTraitfulClass +class KelasTraitSaya { - use MyTrait; + use TraitSaya; } -$cls = new MyTraitfulClass(); -$cls->myTraitMethod(); // Prints "I have MyTrait" +$kls = new KelasTraitSaya(); +$kls->methodTraitSaya(); // menampilkan "Saya menggunakan Trait" /******************************** * Namespaces */ -// This section is separate, because a namespace declaration -// must be the first statement in a file. Let's pretend that is not the case +// Bagian ini telah dibatasi, karena deklarasi "namespace" +// karena harus ditempatkan diawal dokumen. Date: Sat, 6 Feb 2016 00:00:12 +0530 Subject: [PATCH 447/457] Removed ! --- scala.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scala.html.markdown b/scala.html.markdown index e82c1c36..745605ed 100644 --- a/scala.html.markdown +++ b/scala.html.markdown @@ -48,7 +48,7 @@ println(10) // Printing, without forcing a new line on next print print("Hello world") print(10) -// Hello world!10 +// Hello world10 // Declaring values is done using either var or val. // val declarations are immutable, whereas vars are mutable. Immutability is From 2b2951d0e0ae4de8f212ff4f9ee8c77db8e9458d Mon Sep 17 00:00:00 2001 From: oscarb-se Date: Mon, 8 Feb 2016 02:54:41 +0100 Subject: [PATCH 448/457] Fixed statement about many classes in one file Fixed statement on line 441 to say that it is _not_ good practice to keep many classes in the same file. --- java.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java.html.markdown b/java.html.markdown index 74140120..073135c9 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -438,7 +438,7 @@ public class LearnJava { // You can include other, non-public outer-level classes in a .java file, -// but it is good practice. Instead split classes into separate files. +// but it is not good practice. Instead split classes into separate files. // Class Declaration Syntax: From 39a6ab4d7a42bc76f14cd45882275f6754e4840d Mon Sep 17 00:00:00 2001 From: Jacob Ward Date: Fri, 12 Feb 2016 08:12:51 -0700 Subject: [PATCH 449/457] fix a typo --- zfs.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zfs.html.markdown b/zfs.html.markdown index 74487e35..de8c81f0 100644 --- a/zfs.html.markdown +++ b/zfs.html.markdown @@ -9,7 +9,7 @@ filename: LearnZfs.txt [ZFS](http://open-zfs.org/wiki/Main_Page) is a rethinking of the storage stack, combining traditional file systems as well as volume -managers into one cohesive tool. ZFS has some specific teminology that sets it appart from +managers into one cohesive tool. ZFS has some specific terminology that sets it appart from more traditional storage systems, however it has a great set of features with a focus on usability for systems administrators. From 85b4e2084e625ebbdfe8899b85bc207e9e5184f6 Mon Sep 17 00:00:00 2001 From: Jacob Ward Date: Fri, 12 Feb 2016 08:15:27 -0700 Subject: [PATCH 450/457] fix a few more typos --- zfs.html.markdown | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/zfs.html.markdown b/zfs.html.markdown index de8c81f0..39ff84cd 100644 --- a/zfs.html.markdown +++ b/zfs.html.markdown @@ -9,7 +9,7 @@ filename: LearnZfs.txt [ZFS](http://open-zfs.org/wiki/Main_Page) is a rethinking of the storage stack, combining traditional file systems as well as volume -managers into one cohesive tool. ZFS has some specific terminology that sets it appart from +managers into one cohesive tool. ZFS has some specific terminology that sets it apart from more traditional storage systems, however it has a great set of features with a focus on usability for systems administrators. @@ -23,7 +23,7 @@ types of VDEV's that offer various advantages, including redundancy and speed. VDEV's offer better reliability and safety than a RAID card. It is discouraged to use a RAID setup with ZFS, as ZFS expects to directly manage the underlying disks. -Types of VDEV's +Types of VDEV's * stripe (a single disk, no redundancy) * mirror (n-way mirrors supported) * raidz @@ -39,13 +39,13 @@ increase your IOPS. ### Storage Pools ZFS uses Storage Pools as an abstraction over the lower level storage provider (VDEV), allow -you to separate the user visable file system from the physcal layout. +you to separate the user visible file system from the physical layout. ### ZFS Dataset -ZFS datasets are analagous to traditional filesystems but with many more features. They +ZFS datasets are analogous to traditional filesystems but with many more features. They provide many of ZFS's advantages. Datasets support [Copy on Write](https://en.wikipedia.org/wiki/Copy-on-write) -snapshots, quota's, compression and deduplication. +snapshots, quota's, compression and de-duplication. ### Limits @@ -68,7 +68,7 @@ Actions: List zpools ```bash -# Create a raidz zpool +# Create a raidz zpool $ zpool create bucket raidz1 gpt/zfs0 gpt/zfs1 gpt/zfs2 # List ZPools @@ -347,7 +347,7 @@ $ zfs promote tank/home/sarlalian_new ### Putting it all together -This following a script utilizing FreeBSD, jails and ZFS to automate +This following a script utilizing FreeBSD, jails and ZFS to automate provisioning a clean copy of a mysql staging database from a live replication slave. @@ -384,7 +384,7 @@ mv /jails/staging/etc/rc.conf.staging /jails/staging/etc/rc.conf.local echo "==== Starting the staging db server ====" jail -c staging -echo "==== Make sthe staging database not pull from the master ====" +echo "==== Makes the staging database not pull from the master ====" echo "STOP SLAVE;" | /usr/local/bin/mysql -u root -pmyrootpassword -h staging echo "RESET SLAVE;" | /usr/local/bin/mysql -u root -pmyrootpassword -h staging ``` From 5aa692f5f3bbfa7b79224748dcfd8ca5fba7a8bc Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 12 Feb 2016 11:42:25 -0800 Subject: [PATCH 451/457] brainfuck->bf --- brainfuck.html.markdown => bf.html.markdown | 2 +- es-es/{brainfuck-es.html.markdown => bf-es.html.markdown} | 2 +- fa-ir/{brainfuck-fa.html.markdown => bf-fa.html.markdown} | 2 +- fr-fr/{brainfuck-fr.html.markdown => bf-fr.html.markdown} | 2 +- it-it/{brainfuck-it.html.markdown => bf-it.html.markdown} | 2 +- ko-kr/{brainfuck-kr.html.markdown => bf-kr.html.markdown} | 2 +- nl-nl/{brainfuck-nl.html.markdown => bf.html.markdown} | 2 +- pl-pl/{brainfuck-pl.html.markdown => bf-pl.html.markdown} | 2 +- pt-br/{brainfuck-pt.html.markdown => bf.html.markdown} | 2 +- pt-pt/{brainfuck-pt.html.markdown => bf.html.markdown} | 0 ru-ru/{brainfuck-ru.html.markdown => bf.html.markdown} | 2 +- tr-tr/{brainfuck-tr.html.markdown => bf-tr.html.markdown} | 2 +- zh-cn/{brainfuck-cn.html.markdown => bf-cn.html.markdown} | 2 +- 13 files changed, 12 insertions(+), 12 deletions(-) rename brainfuck.html.markdown => bf.html.markdown (99%) rename es-es/{brainfuck-es.html.markdown => bf-es.html.markdown} (99%) rename fa-ir/{brainfuck-fa.html.markdown => bf-fa.html.markdown} (99%) rename fr-fr/{brainfuck-fr.html.markdown => bf-fr.html.markdown} (99%) rename it-it/{brainfuck-it.html.markdown => bf-it.html.markdown} (99%) rename ko-kr/{brainfuck-kr.html.markdown => bf-kr.html.markdown} (99%) rename nl-nl/{brainfuck-nl.html.markdown => bf.html.markdown} (99%) rename pl-pl/{brainfuck-pl.html.markdown => bf-pl.html.markdown} (99%) rename pt-br/{brainfuck-pt.html.markdown => bf.html.markdown} (99%) rename pt-pt/{brainfuck-pt.html.markdown => bf.html.markdown} (100%) rename ru-ru/{brainfuck-ru.html.markdown => bf.html.markdown} (99%) rename tr-tr/{brainfuck-tr.html.markdown => bf-tr.html.markdown} (99%) rename zh-cn/{brainfuck-cn.html.markdown => bf-cn.html.markdown} (99%) diff --git a/brainfuck.html.markdown b/bf.html.markdown similarity index 99% rename from brainfuck.html.markdown rename to bf.html.markdown index a76169c8..c8bbee61 100644 --- a/brainfuck.html.markdown +++ b/bf.html.markdown @@ -1,5 +1,5 @@ --- -language: brainfuck +language: bf contributors: - ["Prajit Ramachandran", "http://prajitr.github.io/"] - ["Mathias Bynens", "http://mathiasbynens.be/"] diff --git a/es-es/brainfuck-es.html.markdown b/es-es/bf-es.html.markdown similarity index 99% rename from es-es/brainfuck-es.html.markdown rename to es-es/bf-es.html.markdown index 550511da..c93b8c3a 100644 --- a/es-es/brainfuck-es.html.markdown +++ b/es-es/bf-es.html.markdown @@ -1,5 +1,5 @@ --- -language: brainfuck +language: bf contributors: - ["Prajit Ramachandran", "http://prajitr.github.io/"] - ["Mathias Bynens", "http://mathiasbynens.be/"] diff --git a/fa-ir/brainfuck-fa.html.markdown b/fa-ir/bf-fa.html.markdown similarity index 99% rename from fa-ir/brainfuck-fa.html.markdown rename to fa-ir/bf-fa.html.markdown index ef2bcba3..bc5d8dc4 100644 --- a/fa-ir/brainfuck-fa.html.markdown +++ b/fa-ir/bf-fa.html.markdown @@ -1,5 +1,5 @@ --- -language: brainfuck +language: bf contributors: - ["Mohammad Valipour", "https://github.com/mvalipour"] lang: fa-ir diff --git a/fr-fr/brainfuck-fr.html.markdown b/fr-fr/bf-fr.html.markdown similarity index 99% rename from fr-fr/brainfuck-fr.html.markdown rename to fr-fr/bf-fr.html.markdown index 545e407e..0fae6032 100644 --- a/fr-fr/brainfuck-fr.html.markdown +++ b/fr-fr/bf-fr.html.markdown @@ -1,5 +1,5 @@ --- -language: brainfuck +language: bf filename: learnbrainfuck-fr.bf contributors: - ["Prajit Ramachandran", "http://prajitr.github.io/"] diff --git a/it-it/brainfuck-it.html.markdown b/it-it/bf-it.html.markdown similarity index 99% rename from it-it/brainfuck-it.html.markdown rename to it-it/bf-it.html.markdown index 08d2ede9..a79710d0 100644 --- a/it-it/brainfuck-it.html.markdown +++ b/it-it/bf-it.html.markdown @@ -1,5 +1,5 @@ --- -language: brainfuck +language: bf contributors: - ["Prajit Ramachandran", "http://prajitr.github.io/"] - ["Mathias Bynens", "http://mathiasbynens.be/"] diff --git a/ko-kr/brainfuck-kr.html.markdown b/ko-kr/bf-kr.html.markdown similarity index 99% rename from ko-kr/brainfuck-kr.html.markdown rename to ko-kr/bf-kr.html.markdown index c2e4341f..3d366d7c 100644 --- a/ko-kr/brainfuck-kr.html.markdown +++ b/ko-kr/bf-kr.html.markdown @@ -1,5 +1,5 @@ --- -language: brainfuck +language: bf contributors: - ["Prajit Ramachandran", "http://prajitr.github.io/"] - ["Mathias Bynens", "http://mathiasbynens.be/"] diff --git a/nl-nl/brainfuck-nl.html.markdown b/nl-nl/bf.html.markdown similarity index 99% rename from nl-nl/brainfuck-nl.html.markdown rename to nl-nl/bf.html.markdown index 6062b24c..016e2ba2 100644 --- a/nl-nl/brainfuck-nl.html.markdown +++ b/nl-nl/bf.html.markdown @@ -1,5 +1,5 @@ --- -language: brainfuck +language: bf contributors: - ["Prajit Ramachandran", "http://prajitr.github.io/"] - ["Mathias Bynens", "http://mathiasbynens.be/"] diff --git a/pl-pl/brainfuck-pl.html.markdown b/pl-pl/bf-pl.html.markdown similarity index 99% rename from pl-pl/brainfuck-pl.html.markdown rename to pl-pl/bf-pl.html.markdown index 69d814c4..801f1a9a 100644 --- a/pl-pl/brainfuck-pl.html.markdown +++ b/pl-pl/bf-pl.html.markdown @@ -1,5 +1,5 @@ --- -language: brainfuck +language: bf contributors: - ["Prajit Ramachandran", "http://prajitr.github.io/"] - ["Mathias Bynens", "http://mathiasbynens.be/"] diff --git a/pt-br/brainfuck-pt.html.markdown b/pt-br/bf.html.markdown similarity index 99% rename from pt-br/brainfuck-pt.html.markdown rename to pt-br/bf.html.markdown index 9e4b458d..d6d7c6e9 100644 --- a/pt-br/brainfuck-pt.html.markdown +++ b/pt-br/bf.html.markdown @@ -1,5 +1,5 @@ --- -language: brainfuck +language: bf contributors: - ["Prajit Ramachandran", "http://prajitr.github.io/"] - ["Mathias Bynens", "http://mathiasbynens.be/"] diff --git a/pt-pt/brainfuck-pt.html.markdown b/pt-pt/bf.html.markdown similarity index 100% rename from pt-pt/brainfuck-pt.html.markdown rename to pt-pt/bf.html.markdown diff --git a/ru-ru/brainfuck-ru.html.markdown b/ru-ru/bf.html.markdown similarity index 99% rename from ru-ru/brainfuck-ru.html.markdown rename to ru-ru/bf.html.markdown index fcee185f..20f0fa56 100644 --- a/ru-ru/brainfuck-ru.html.markdown +++ b/ru-ru/bf.html.markdown @@ -1,5 +1,5 @@ --- -language: brainfuck +language: bf contributors: - ["Prajit Ramachandran", "http://prajitr.github.io/"] - ["Mathias Bynens", "http://mathiasbynens.be/"] diff --git a/tr-tr/brainfuck-tr.html.markdown b/tr-tr/bf-tr.html.markdown similarity index 99% rename from tr-tr/brainfuck-tr.html.markdown rename to tr-tr/bf-tr.html.markdown index bd842b17..e7015cd0 100644 --- a/tr-tr/brainfuck-tr.html.markdown +++ b/tr-tr/bf-tr.html.markdown @@ -1,5 +1,5 @@ --- -language: brainfuck +language: bf filename: brainfuck-tr contributors: - ["Prajit Ramachandran", "http://prajitr.github.io"] diff --git a/zh-cn/brainfuck-cn.html.markdown b/zh-cn/bf-cn.html.markdown similarity index 99% rename from zh-cn/brainfuck-cn.html.markdown rename to zh-cn/bf-cn.html.markdown index a6f3fa09..6cea3012 100644 --- a/zh-cn/brainfuck-cn.html.markdown +++ b/zh-cn/bf-cn.html.markdown @@ -1,5 +1,5 @@ --- -language: brainfuck +language: bf lang: zh-cn contributors: - ["Prajit Ramachandran", "http://prajitr.github.io/"] From f3b10beb01795bf7513ec8d06c9e90ab98df7a83 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 12 Feb 2016 23:04:31 -0800 Subject: [PATCH 452/457] Clean up various errors --- edn.html.markdown | 2 +- fr-fr/HTML-fr.html.markdown | 3 +- fr-fr/d.html.markdown | 12 +- fr-fr/make-fr.html.markdown | 4 +- fr-fr/objective-c-fr.html.markdown | 3 +- hu-hu/ruby-hu.html.markdown | 4 +- less.html.markdown | 2 +- nim.html.markdown | 2 +- nl-nl/amd-nl.html.markdown | 235 ----------------------------- ru-ru/d-ru.html.markdown | 3 +- ta_in/css-ta.html.markdown | 6 +- ta_in/javascript-ta.html.markdown | 4 +- ta_in/xml-ta.html.markdown | 4 +- 13 files changed, 25 insertions(+), 259 deletions(-) delete mode 100644 nl-nl/amd-nl.html.markdown diff --git a/edn.html.markdown b/edn.html.markdown index d0bdddfc..ca04df89 100644 --- a/edn.html.markdown +++ b/edn.html.markdown @@ -14,7 +14,7 @@ Clojure, there are implementations of EDN for many other languages. The main benefit of EDN over JSON and YAML is that it is extensible. We will see how it is extended later on. -```Clojure +```clojure ; Comments start with a semicolon. ; Anything after the semicolon is ignored. diff --git a/fr-fr/HTML-fr.html.markdown b/fr-fr/HTML-fr.html.markdown index fdde9107..4d2da921 100644 --- a/fr-fr/HTML-fr.html.markdown +++ b/fr-fr/HTML-fr.html.markdown @@ -5,6 +5,7 @@ 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). @@ -17,7 +18,7 @@ Comme tous les autres langages, HTML a plusieurs versions. Ici, nous allons parl Cet article porte principalement sur la syntaxe et quelques astuces. -```HTML +```html diff --git a/fr-fr/d.html.markdown b/fr-fr/d.html.markdown index d9bd9b48..bfb9f2ce 100644 --- a/fr-fr/d.html.markdown +++ b/fr-fr/d.html.markdown @@ -8,7 +8,7 @@ translators: lang: fr-fr --- -```d +```c // Commençons par un classique module hello; @@ -30,7 +30,7 @@ D est activement développé par de nombreuses personnes très intelligents, gui [Andrei Alexandrescu](https://fr.wikipedia.org/wiki/Andrei_Alexandrescu). Après cette petite introduction, jetons un coup d'oeil à quelques exemples. -```d +```c import std.stdio; void main() { @@ -75,7 +75,7 @@ On peut définir de nouveaux types avec les mots-clés `struct`, `class`, `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 +```c // Ici, 'T' est un paramètre de type. Il est similaire au de C++/C#/Java. struct LinkedList(T) { T data = null; @@ -140,7 +140,7 @@ 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 +```c // Considérons une classe paramétrée avec les types 'T' et 'U' class MyClass(T, U) { T _data; @@ -212,7 +212,7 @@ 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 +```c import std.algorithm : map, filter, reduce; import std.range : iota; // construit un intervalle excluant la dernière valeur. @@ -242,7 +242,7 @@ 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 +```c import std.stdio; import std.parallelism : parallel; import std.math : sqrt; diff --git a/fr-fr/make-fr.html.markdown b/fr-fr/make-fr.html.markdown index 5a1e03e7..48d24549 100644 --- a/fr-fr/make-fr.html.markdown +++ b/fr-fr/make-fr.html.markdown @@ -1,9 +1,9 @@ --- language: make contributors: - - ["Robert Steed", "https://github.com/robochat"] + - ["Robert Steed", "https://github.com/robochat"] translators: - - ["altaris", "https://github.com/altaris"] + - ["altaris", "https://github.com/altaris"] filename: Makefile-fr lang: fr-fr --- diff --git a/fr-fr/objective-c-fr.html.markdown b/fr-fr/objective-c-fr.html.markdown index 4e31c4bf..fbe1741e 100644 --- a/fr-fr/objective-c-fr.html.markdown +++ b/fr-fr/objective-c-fr.html.markdown @@ -1,5 +1,4 @@ --- - language: Objective-C contributors: - ["Eugene Yagrushkin", "www.about.me/yagrushkin"] @@ -9,7 +8,6 @@ translators: - ["Yannick Loriot", "https://github.com/YannickL"] filename: LearnObjectiveC-fr.m 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. @@ -519,6 +517,7 @@ __unsafe_unretained NSArray *unsafeArray; // Comme __weak, mais la variable n'es // l'objet est supprimé ``` + ## Lectures Complémentaires [La Page Wikipedia de l'Objective-C](http://fr.wikipedia.org/wiki/Objective-C) diff --git a/hu-hu/ruby-hu.html.markdown b/hu-hu/ruby-hu.html.markdown index 169f2b8e..f2fe4e5d 100644 --- a/hu-hu/ruby-hu.html.markdown +++ b/hu-hu/ruby-hu.html.markdown @@ -1,7 +1,7 @@ --- language: ruby lang: hu-hu -filenev: learnruby.rb +filename: learnruby-hu.rb contributors: - ["David Underwood", "http://theflyingdeveloper.com"] - ["Joel Walden", "http://joelwalden.net"] @@ -13,7 +13,7 @@ contributors: - ["Dzianis Dashkevich", "https://github.com/dskecse"] - ["Levi Bostian", "https://github.com/levibostian"] - ["Rahil Momin", "https://github.com/iamrahil"] - translators: +translators: - ["Zsolt Prontvai", "https://github.com/prozsolt"] --- diff --git a/less.html.markdown b/less.html.markdown index 41d66a54..7195271e 100644 --- a/less.html.markdown +++ b/less.html.markdown @@ -8,7 +8,7 @@ contributors: 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 +```css //Single line comments are removed when Less is compiled to CSS. diff --git a/nim.html.markdown b/nim.html.markdown index 79271732..4901ebfe 100644 --- a/nim.html.markdown +++ b/nim.html.markdown @@ -11,7 +11,7 @@ that gives the programmer power without compromises on runtime efficiency. Nim is efficient, expressive, and elegant. -```nimrod +```javascript var # Declare (and assign) variables, letter: char = 'n' # with or without type annotations lang = "N" & "im" diff --git a/nl-nl/amd-nl.html.markdown b/nl-nl/amd-nl.html.markdown deleted file mode 100644 index d5e0022a..00000000 --- a/nl-nl/amd-nl.html.markdown +++ /dev/null @@ -1,235 +0,0 @@ ---- -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) diff --git a/ru-ru/d-ru.html.markdown b/ru-ru/d-ru.html.markdown index 8f4233fd..162ec4c8 100644 --- a/ru-ru/d-ru.html.markdown +++ b/ru-ru/d-ru.html.markdown @@ -7,11 +7,12 @@ contributors: - ["Andre Polykanine", "http://oire.me/"] lang: ru-ru --- + D - современный компилируемый язык общего назначения с Си-подобным синтаксисом, который сочетает удобство, продуманный дизайн и высокую производительность. D - это С++, сделанный правильно. -```d +```c // Welcome to D! Это однострочный комментарий /* многострочный diff --git a/ta_in/css-ta.html.markdown b/ta_in/css-ta.html.markdown index 56f94ed0..cbe88f1e 100644 --- a/ta_in/css-ta.html.markdown +++ b/ta_in/css-ta.html.markdown @@ -7,9 +7,9 @@ contributors: - ["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 + - ["Rasendran Kirushan", "https://github.com/kirushanr"] +filename: learncss-ta.css +lang: in-ta --- diff --git a/ta_in/javascript-ta.html.markdown b/ta_in/javascript-ta.html.markdown index f0b0a36a..d3fe5a85 100644 --- a/ta_in/javascript-ta.html.markdown +++ b/ta_in/javascript-ta.html.markdown @@ -5,8 +5,8 @@ contributors: - ['Ariel Krakowski', 'http://www.learneroo.com'] translators: - ["Rasendran Kirushan", "https://github.com/kirushanr"] -filename: javascript.js -lang:in-ta +filename: javascript-ta.js +lang: in-ta --- javascript 1995 ஆம் ஆண்டு Netscape இல் பணிபுரிந்த Brendan Eich diff --git a/ta_in/xml-ta.html.markdown b/ta_in/xml-ta.html.markdown index a9bfa9cd..d782399d 100644 --- a/ta_in/xml-ta.html.markdown +++ b/ta_in/xml-ta.html.markdown @@ -1,11 +1,11 @@ --- language: xml -filename: learnxml.xml +filename: learnxml-ta.xml contributors: - ["João Farias", "https://github.com/JoaoGFarias"] translators: - ["Rasendran Kirushan", "https://github.com/kirushanr"] -lang:in-ta +lang: in-ta --- From 00e288cee1a9564e0a482a24bdf9e33170d7cd4e Mon Sep 17 00:00:00 2001 From: Jacob Ward Date: Sat, 13 Feb 2016 15:37:31 -0700 Subject: [PATCH 453/457] corrected spelling --- make.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make.html.markdown b/make.html.markdown index e8cfd2b5..bf934c58 100644 --- a/make.html.markdown +++ b/make.html.markdown @@ -11,7 +11,7 @@ target to the most recent version of the source. Famously written over a weekend by Stuart Feldman in 1976, it is still widely used (particularly on Unix) despite many competitors and criticisms. -There are many varieties of make in existance, this article assumes that +There are many varieties of make in existence, this article assumes that we are using GNU make which is the standard on Linux. ```make From 0c020f4da8563cbc9e509a63a1f03c1f53162c1c Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 14 Feb 2016 22:47:19 -0800 Subject: [PATCH 454/457] Fix up asciidoc --- asciidoc.html.markdown | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/asciidoc.html.markdown b/asciidoc.html.markdown index f9ca8e21..7f2a4374 100644 --- a/asciidoc.html.markdown +++ b/asciidoc.html.markdown @@ -13,7 +13,7 @@ Headers are optional and can't contain blank lines. It must be offset from conte Title Only -```asciidoc +``` = Document Title First sentence of document. @@ -21,7 +21,7 @@ First sentence of document. Title and Author -```asciidoc +``` = Document Title First Last @@ -29,7 +29,8 @@ Start of this document. ``` Multiple Authors -```asciidoc + +``` = Document Title John Doe ; Jane Doe; Black Beard @@ -37,16 +38,18 @@ Start of a doc with multiple authors. ``` Revision Line (requires an author line) -```asciidoc + +``` = Doc Title V1 Potato Man v1.0, 2016-01-13 This article about chips is going to be fun. ``` + Paragraphs -```asciidoc +``` You don't need anything special for paragraphs. Add a blank line between paragraphs to seperate them. @@ -57,7 +60,7 @@ and you will recieve a line break! Formatting Text -```asciidoc +``` _underscore creates italics_ *asterisks for bold* *_combine for extra fun_* @@ -67,7 +70,7 @@ _underscore creates italics_ Section Titles -```asciidoc +``` = Level 0 (may only be used in document's header) == Level 1

@@ -87,34 +90,33 @@ Section Titles Lists To create a bulleted list use asterisks. -```asciidoc + +``` * foo * bar * baz ``` To create a numbered list use periods. -```asciidoc + +``` . item 1 . item 2 . item 3 ``` You can nest lists by adding extra asterisks or periods up to five times. -```asciidoc + +``` * foo 1 ** foo 2 *** foo 3 **** foo 4 ***** foo 5 -``` -```asciidoc + . foo 1 .. foo 2 ... foo 3 .... foo 4 ..... foo 5 ``` - - - From b02cceda8b6f63ee133c5c88cd31e16fe346c4a6 Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Mon, 15 Feb 2016 10:29:42 -0800 Subject: [PATCH 455/457] new boolean[] not really required when initializing. Introducing this disrupts the flow a little bit to think, if specifying `new boolean[] ` required when intializing. --- java.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java.html.markdown b/java.html.markdown index 073135c9..50629ce1 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -175,7 +175,7 @@ public class LearnJava { // Another way to declare & initialize an array int[] y = {9000, 1000, 1337}; String names[] = {"Bob", "John", "Fred", "Juan Pedro"}; - boolean bools[] = new boolean[] {true, false, false}; + boolean bools[] = {true, false, false}; // Indexing an array - Accessing an element System.out.println("intArray @ 0: " + intArray[0]); From 1d785f8e84fd5eb0dbf6b6df28044568739684fd Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Mon, 15 Feb 2016 11:03:10 -0800 Subject: [PATCH 456/457] memoize not memorize Let's use the correct term instead of the tongue-in-cheek term denoting the same concept. --- groovy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groovy.html.markdown b/groovy.html.markdown index ea575248..94678c39 100644 --- a/groovy.html.markdown +++ b/groovy.html.markdown @@ -280,7 +280,7 @@ def clos = { print it } clos( "hi" ) /* - Groovy can memorize closure results [1][2][3] + Groovy can memoize closure results [1][2][3] */ def cl = {a, b -> sleep(3000) // simulate some time consuming processing From 1d562740f3d3b68fbb51a45f66ae6b60eee7b2de Mon Sep 17 00:00:00 2001 From: Geoff Liu Date: Mon, 15 Feb 2016 14:33:23 -0500 Subject: [PATCH 457/457] Remove a section from c++, fixes #2130 --- c++.html.markdown | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/c++.html.markdown b/c++.html.markdown index a59b4db8..a02e7e5b 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -330,7 +330,7 @@ ECarTypes GetPreferredCarType() } // As of C++11 there is an easy way to assign a type to the enum which can be -// useful in serialization of data and converting enums back-and-forth between +// useful in serialization of data and converting enums back-and-forth between // the desired type and their respective constants enum ECarTypes : uint8_t { @@ -352,7 +352,7 @@ void WritePreferredCarTypeToFile(ECarTypes InputCarType) } // On the other hand you may not want enums to be accidentally cast to an integer -// type or to other enums so it is instead possible to create an enum class which +// type or to other enums so it is instead possible to create an enum class which // won't be implicitly converted enum class ECarTypes : uint8_t { @@ -468,7 +468,7 @@ int main() { // Inheritance: // This class inherits everything public and protected from the Dog class -// as well as private but may not directly access private members/methods +// as well as private but may not directly access private members/methods // without a public or protected method for doing so class OwnedDog : public Dog { @@ -825,10 +825,10 @@ fooMap.find(Foo(1)); //true /////////////////////////////////////// // lambdas are a convenient way of defining an anonymous function -// object right at the location where it is invoked or passed as +// object right at the location where it is invoked or passed as // an argument to a function. -// For example, consider sorting a vector of pairs using the second +// For example, consider sorting a vector of pairs using the second // value of the pair vector > tester; @@ -856,7 +856,7 @@ sort(tester.begin(), tester.end(), [](const pair& lhs, const pair dog_ids; // number_of_dogs = 3; for(int i = 0; i < 3; i++) { - dog_ids.push_back(i); + dog_ids.push_back(i); } int weight[3] = {30, 50, 10}; @@ -940,29 +940,13 @@ Foo f1; f1 = f2; -// How to truly clear a container: -class Foo { ... }; -vector v; -for (int i = 0; i < 10; ++i) - v.push_back(Foo()); - -// Following line sets size of v to 0, but destructors don't get called -// and resources aren't released! -v.clear(); -v.push_back(Foo()); // New value is copied into the first Foo we inserted - -// Truly destroys all values in v. See section about temporary objects for -// explanation of why this works. -v.swap(vector()); - - /////////////////////////////////////// // Tuples (C++11 and above) /////////////////////////////////////// #include -// Conceptually, Tuples are similar to old data structures (C-like structs) but instead of having named data members , +// Conceptually, Tuples are similar to old data structures (C-like structs) but instead of having named data members , // its elements are accessed by their order in the tuple. // We start with constructing a tuple. @@ -995,7 +979,7 @@ cout << tuple_size::value << "\n"; // prints: 3 // tuple_cat concatenates the elements of all the tuples in the same order. auto concatenated_tuple = tuple_cat(first, second, third); -// concatenated_tuple becomes = (10, 'A', 1e9, 15, 11, 'A' ,3.14141) +// concatenated_tuple becomes = (10, 'A', 1e9, 15, 11, 'A' ,3.14141) cout << get<0>(concatenated_tuple) << "\n"; // prints: 10 cout << get<3>(concatenated_tuple) << "\n"; // prints: 15

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#V|S-kjHzQ`|h*z~E9bya_mT zj%a>`!z_(3Hi-}w+EMx`ncQKD%yICI;Jp#C#3&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