mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-26 00:31:39 +03:00
Merge branch 'master' of github.com:adambard/learnxinyminutes-docs
Merge changes
This commit is contained in:
commit
fe27795960
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: haskell
|
||||
language: Haskell
|
||||
lang: de-de
|
||||
contributors:
|
||||
- ["Adit Bhargava", "http://adit.io"]
|
||||
|
@ -1,8 +1,9 @@
|
||||
---
|
||||
language: julia
|
||||
language: Julia
|
||||
contributors:
|
||||
- ["Leah Hanson", "http://leahhanson.us"]
|
||||
- ["Guillermo Garza" ]
|
||||
translators:
|
||||
- ["Guillermo Garza", "http://github.com/ggarza"]
|
||||
filename: learnjulia-es.jl
|
||||
lang: es-es
|
||||
---
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: haskell
|
||||
language: Haskell
|
||||
contributors:
|
||||
- ["Adit Bhargava", "http://adit.io"]
|
||||
translators:
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: lua
|
||||
language: Lua
|
||||
filename: learnlua-fr.lua
|
||||
contributors:
|
||||
- ["Tyler Neylon", "http://tylerneylon.com/"]
|
||||
|
@ -1,12 +1,11 @@
|
||||
---
|
||||
language: Scala
|
||||
filename: learnscala.scala
|
||||
contributors:
|
||||
- ["George Petrov", "http://github.com/petrovg"]
|
||||
- ["Dominic Bou-Samra", "http://dbousamra.github.com"]
|
||||
translators:
|
||||
- ["Anne-Catherine Dehier", "https://github.com/spellart"]
|
||||
filename: learn.scala
|
||||
- ["Anne-Catherine Dehier", "https://github.com/spellart"]
|
||||
filename: learnscala-fr.scala
|
||||
lang: fr-fr
|
||||
---
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: haskell
|
||||
language: Haskell
|
||||
contributors:
|
||||
- ["Adit Bhargava", "http://adit.io"]
|
||||
---
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: julia
|
||||
language: Julia
|
||||
contributors:
|
||||
- ["Leah Hanson", "http://leahhanson.us"]
|
||||
filename: learnjulia.jl
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: lua
|
||||
language: Lua
|
||||
category: language
|
||||
contributors:
|
||||
- ["Tyler Neylon", "http://tylerneylon.com/"]
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: php
|
||||
language: PHP
|
||||
category: language
|
||||
contributors:
|
||||
- ["Malcolm Fell", "http://emarref.net/"]
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: lua
|
||||
language: Lua
|
||||
contributors:
|
||||
- ["Tyler Neylon", "http://tylerneylon.com/"]
|
||||
filename: learnlua.lua
|
||||
|
@ -64,7 +64,7 @@ say "Interpolate an array using [] : @array[]";
|
||||
|
||||
my @keys = 0, 2;
|
||||
@array[@keys] = @letters; # Assign using an array
|
||||
say @array; #=> a 2 b
|
||||
say @array; #=> a 6 b
|
||||
|
||||
# There are two more kinds of lists: Parcel and Arrays.
|
||||
# Parcels are immutable lists (you can't modify a list that's not assigned).
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: php
|
||||
language: PHP
|
||||
contributors:
|
||||
- ["Malcolm Fell", "http://emarref.net/"]
|
||||
- ["Trismegiste", "https://github.com/Trismegiste"]
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: haskell
|
||||
language: Haskell
|
||||
contributors:
|
||||
- ["Adit Bhargava", "http://adit.io"]
|
||||
translators:
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: php
|
||||
language: PHP
|
||||
contributors:
|
||||
- ["Malcolm Fell", "http://emarref.net/"]
|
||||
- ["Trismegiste", "https://github.com/Trismegiste"]
|
||||
|
@ -3,6 +3,7 @@ language: python
|
||||
contributors:
|
||||
- ["Louie Dinh", "http://ldinh.ca"]
|
||||
- ["Amin Bandali", "http://aminbandali.com"]
|
||||
- ["Andre Polykanine", "https://github.com/Oire"]
|
||||
filename: learnpython.py
|
||||
---
|
||||
|
||||
@ -54,19 +55,22 @@ to Python 2.x. Look for another tour of Python 3 soon!
|
||||
# Modulo operation
|
||||
7 % 3 # => 1
|
||||
|
||||
# Exponentiation (x to the y'th power)
|
||||
2**4 # => 16
|
||||
|
||||
# Enforce precedence with parentheses
|
||||
(1 + 3) * 2 # => 8
|
||||
|
||||
# Boolean Operators
|
||||
+# Note "and" and "or" are case-sensitive
|
||||
+True and False #=> False
|
||||
+False or True #=> True
|
||||
+
|
||||
+# Note using Bool operators with ints
|
||||
+0 and 2 #=> 0
|
||||
+-5 or 0 #=> -5
|
||||
+0 == False #=> True
|
||||
+2 == True #=> False
|
||||
# Note "and" and "or" are case-sensitive
|
||||
True and False #=> False
|
||||
False or True #=> True
|
||||
|
||||
# Note using Bool operators with ints
|
||||
0 and 2 #=> 0
|
||||
-5 or 0 #=> -5
|
||||
0 == False #=> True
|
||||
2 == True #=> False
|
||||
1 == True #=> True
|
||||
|
||||
# negate with not
|
||||
|
@ -3,6 +3,7 @@ language: python3
|
||||
contributors:
|
||||
- ["Louie Dinh", "http://pythonpracticeprojects.com"]
|
||||
- ["Steven Basart", "http://github.com/xksteven"]
|
||||
- ["Andre Polykanine", "https://github.com/Oire"]
|
||||
filename: learnpython3.py
|
||||
---
|
||||
|
||||
@ -50,6 +51,9 @@ Note: This article applies to Python 3 specifically. Check out the other tutoria
|
||||
# Modulo operation
|
||||
7 % 3 # => 1
|
||||
|
||||
# Exponentiation (x to the y'th power)
|
||||
2**4 # => 16
|
||||
|
||||
# Enforce precedence with parentheses
|
||||
(1 + 3) * 2 # => 8
|
||||
|
||||
|
104
ru-ru/coffeescript-ru.html.markdown
Normal file
104
ru-ru/coffeescript-ru.html.markdown
Normal file
@ -0,0 +1,104 @@
|
||||
---
|
||||
language: coffeescript
|
||||
contributors:
|
||||
- ["Tenor Biel", "http://github.com/L8D"]
|
||||
- ["Xavier Yao", "http://github.com/xavieryao"]
|
||||
translators:
|
||||
- ["asaskevich", "http://github.com/asaskevich"]
|
||||
filename: learncoffee-ru.coffee
|
||||
lang: ru-ru
|
||||
---
|
||||
|
||||
CoffeeScript - это небольшой язык, который компилируется один-в-один в эквивалентный код на языке JavaScript, а потому он не интерпретируется во время исполнения JavaScript кода.
|
||||
Ключевой особенностью CoffeeScript является то, что он пытается создать читабельный, качественно оформленный и плавный JavaScript код, прекрасно работающий в любой среде JavaScript.
|
||||
|
||||
Также загляните на официальный сайт [языка](http://coffeescript.org/), где можно найти весьма полное учебное пособие по CoffeeScript.
|
||||
|
||||
```coffeescript
|
||||
# CoffeeScript - язык хипстеров.
|
||||
# Язык использует самое модное из множества современных языков.
|
||||
# Эти комментарии по стилю похожи на комментарии Ruby или Python, они используют "решетку" в качестве знака комментария.
|
||||
|
||||
###
|
||||
Блоки комментариев выделяются тремя символами "решетки", в результирующем JavaScript коде они будут преобразованы в '/ * и '* /'.
|
||||
|
||||
Перед тем, как идти далее, Вам нужно понимать семантику JavaScript.
|
||||
###
|
||||
|
||||
# Присвоение:
|
||||
number = 42 #=> var number = 42;
|
||||
opposite = true #=> var opposite = true;
|
||||
|
||||
# Условия:
|
||||
number = -42 if opposite #=> if(opposite) { number = -42; }
|
||||
|
||||
# Функции:
|
||||
square = (x) -> x * x #=> var square = function(x) { return x * x; }
|
||||
|
||||
fill = (container, liquid = "coffee") ->
|
||||
"Заполняем #{container} жидкостью #{liquid}..."
|
||||
#=>var fill;
|
||||
#
|
||||
#fill = function(container, liquid) {
|
||||
# if (liquid == null) {
|
||||
# liquid = "coffee";
|
||||
# }
|
||||
# return "Заполняем " + container + " жидкостью " + liquid + "...";
|
||||
#};
|
||||
|
||||
# Списки и диапазоны:
|
||||
list = [1..5] #=> var list = [1, 2, 3, 4, 5];
|
||||
|
||||
# Объекты:
|
||||
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); }
|
||||
#}
|
||||
|
||||
# Многоточия:
|
||||
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);
|
||||
#};
|
||||
|
||||
# Проверка на существование объекта:
|
||||
alert "Так и знал!" if elvis?
|
||||
#=> if(typeof elvis !== "undefined" && elvis !== null) { alert("Так и знал!"); }
|
||||
|
||||
# Итерации по массивам:
|
||||
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);
|
||||
# }
|
||||
#}
|
||||
```
|
||||
|
||||
## На почитать
|
||||
|
||||
- [Smooth CoffeeScript](http://autotelicum.github.io/Smooth-CoffeeScript/)
|
||||
- [CoffeeScript Ristretto](https://leanpub.com/coffeescript-ristretto/read)
|
||||
- [CoffeeScript на русском](http://cidocs.ru/coffeescript/)
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: haskell
|
||||
language: Haskell
|
||||
contributors:
|
||||
- ["Adit Bhargava", "http://adit.io"]
|
||||
translators:
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: julia
|
||||
language: Julia
|
||||
contributors:
|
||||
- ["Leah Hanson", "http://leahhanson.us"]
|
||||
translators:
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: php
|
||||
language: PHP
|
||||
contributors:
|
||||
- ["Malcolm Fell", "http://emarref.net/"]
|
||||
- ["Trismegiste", "https://github.com/Trismegiste"]
|
||||
|
@ -255,8 +255,8 @@ fn main() {
|
||||
## Further reading
|
||||
|
||||
There’s a lot more to Rust—this is just the basics of Rust so you can
|
||||
understand the most important things. To learn more about Rust, read the
|
||||
[Rust tutorial](http://doc.rust-lang.org/tutorial.html) and check out the
|
||||
understand the most important things. To learn more about Rust, read [The Rust
|
||||
Guide](http://doc.rust-lang.org/guide.html) and check out the
|
||||
[/r/rust](http://reddit.com/r/rust) subreddit. The folks on the #rust channel
|
||||
on irc.mozilla.org are also always keen to help newcomers.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: php
|
||||
language: PHP
|
||||
filename: learnphp-tr.php
|
||||
contributors:
|
||||
- ["Malcolm Fell", "http://emarref.net/"]
|
||||
|
@ -566,7 +566,7 @@ typedef void (*my_fnp_type)(char *);
|
||||
'\'' // 单引号
|
||||
'\"' // 双引号
|
||||
'\xhh' // 十六进制数字. 例子: '\xb' = vertical tab
|
||||
'\ooo' // 十进制数字. 例子: '\013' = vertical tab
|
||||
'\ooo' // 八进制数字. 例子: '\013' = vertical tab
|
||||
|
||||
// 打印格式:
|
||||
"%d" // 整数
|
||||
@ -579,7 +579,7 @@ typedef void (*my_fnp_type)(char *);
|
||||
"%c" // 字母
|
||||
"%p" // 指针
|
||||
"%x" // 十六进制
|
||||
"%o" // 十进制
|
||||
"%o" // 八进制
|
||||
"%%" // 打印 %
|
||||
|
||||
///////////////////////////////////////
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: haskell
|
||||
language: Haskell
|
||||
filename: learn-haskell-zh.hs
|
||||
contributors:
|
||||
- ["Adit Bhargava", "http://adit.io"]
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: julia
|
||||
language: Julia
|
||||
filename: learn-julia-zh.jl
|
||||
contributors:
|
||||
- ["Jichao Ouyang", "http://oyanglul.us"]
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: lua
|
||||
language: Lua
|
||||
lang: zh-cn
|
||||
contributors:
|
||||
- ["Tyler Neylon", "http://tylerneylon.com/"]
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
language: php
|
||||
language: PHP
|
||||
contributors:
|
||||
- ["Malcolm Fell", "http://emarref.net/"]
|
||||
- ["Trismegiste", "https://github.com/Trismegiste"]
|
||||
|
Loading…
Reference in New Issue
Block a user