summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--bash.html.markdown68
-rw-r--r--brainfuck.html.markdown14
-rw-r--r--common-lisp.html.markdown2
-rw-r--r--csharp.html.markdown81
-rw-r--r--de-de/elixir-de.html.markdown2
-rw-r--r--es-es/clojure-es.html.markdown2
-rw-r--r--git.html.markdown2
-rw-r--r--java.html.markdown2
-rw-r--r--javascript.html.markdown4
-rw-r--r--ko-kr/brainfuck-kr.html.markdown83
-rw-r--r--lua.html.markdown2
-rw-r--r--perl.html.markdown12
-rw-r--r--pogo.html.markdown202
-rw-r--r--pt-pt/brainfuck-pt.html.markdown84
-rw-r--r--python.html.markdown44
-rw-r--r--vi-vn/git-vi.html.markdown392
-rw-r--r--vi-vn/objective-c-vi.html.markdown318
17 files changed, 1247 insertions, 67 deletions
diff --git a/bash.html.markdown b/bash.html.markdown
index 708131bd..276bc31f 100644
--- a/bash.html.markdown
+++ b/bash.html.markdown
@@ -4,6 +4,7 @@ tool: bash
contributors:
- ["Max Yankov", "https://github.com/golergka"]
- ["Darren Lin", "https://github.com/CogBear"]
+ - ["Alexandre Medeiros", "http://alemedeiros.sdf.org"]
filename: LearnBash.sh
---
@@ -35,8 +36,22 @@ VARIABLE = "Some string"
# Using the variable:
echo $VARIABLE
echo "$VARIABLE"
+echo '$VARIABLE'
# When you use the variable itself — assign it, export it, or else — you write
# its name without $. If you want to use variable's value, you should use $.
+# Note that ' (single quote) won't expand the variables!
+
+# String substitution in variables
+echo ${VARIABLE/Some/A}
+# This will substitute the first occurance of "Some" with "A"
+
+# Bultin variables:
+# There are some useful builtin variables, like
+echo "Last program return value: $?"
+echo "Script's PID: $$"
+echo "Number of arguments: $#"
+echo "Scripts arguments: $@"
+echo "Scripts arguments separeted in different variables: $1 $2..."
# Reading a value from input:
echo "What's your name?"
@@ -44,13 +59,18 @@ read NAME # Note that we didn't need to declare new variable
echo Hello, $NAME!
# We have the usual if structure:
-if true
+# use 'man test' for more info about conditionals
+if [ $NAME -ne $USER ]
then
- echo "This is expected"
+ echo "Your name is you username"
else
- echo "And this is not"
+ echo "Your name isn't you username"
fi
+# There is also conditional execution
+echo "Always executed" || echo "Only executed if first command fail"
+echo "Always executed" && echo "Only executed if first command does NOT fail"
+
# Expressions are denoted with the following format:
echo $(( 10 + 5 ))
@@ -67,12 +87,19 @@ ls -l # Lists every file and directory on a separate line
# txt files in the current directory:
ls -l | grep "\.txt"
-# Commands can be substitued within other commands using $( ):
+# You can also redirect a command output, input and error output.
+python2 hello.py < "input.in"
+python2 hello.py > "output.out"
+python2 hello.py 2> "error.err"
+# The output error will overwrite the file if it exists, if you want to
+# concatenate them, use ">>" instead.
+
+# Commands can be substituted within other commands using $( ):
# The following command displays the number of files and directories in the
# current directory.
echo "There are $(ls | wc -l) items here."
-# Bash uses a case statement that works similarily to switch in Java and C++:
+# Bash uses a case statement that works similarly to switch in Java and C++:
case "$VARIABLE" in
#List patterns for the conditions you want to meet
0) echo "There is a zero.";;
@@ -80,11 +107,36 @@ case "$VARIABLE" in
*) echo "It is not null.";;
esac
-#For loops iterate for as many arguments given:
-#The contents of var $VARIABLE is printed three times.
-for VARIABLE in x y z
+# For loops iterate for as many arguments given:
+# The contents of var $VARIABLE is printed three times.
+# Note that ` ` is equivalent to $( ) and that seq returns a sequence of size 3.
+for VARIABLE in `seq 3`
do
echo "$VARIABLE"
done
+# You can also define functions
+# Definition:
+foo ()
+{
+ echo "Arguments work just like script arguments: $@"
+ echo "And: $1 $2..."
+ echo "This is a function"
+ return 0
+}
+
+# Calling your function
+foo "My name is" $NAME
+
+# There are a lot of useful commands you should learn:
+tail -n 10 file.txt
+# prints last 10 lines of file.txt
+head -n 10 file.txt
+# prints first 10 lines of file.txt
+sort file.txt
+# sort file.txt's lines
+uniq -d file.txt
+# report or omit repeated lines, with -d it reports them
+cut -d ',' -f 1 file.txt
+# prints only the first column before the ',' character
```
diff --git a/brainfuck.html.markdown b/brainfuck.html.markdown
index 9282381f..27ac6921 100644
--- a/brainfuck.html.markdown
+++ b/brainfuck.html.markdown
@@ -53,25 +53,27 @@ until cell #1 is 0, and cell #2 holds cell #1's old value. Because we're on
cell #1 at the end of the loop, move to cell #2, and then print out the value
in ASCII.
-Also keep in mind that the spaces are purely for readibility purposes. You
+Also keep in mind that the spaces are purely for readability purposes. You
could just as easily write it as:
,[>+<-]>.
Try and figure out what this program does:
-,>,< [ > [ >+ >+ << -] >> [- << + >>] <<< -] >>
+,>,< [ > [ >+ >+ << -] >> [- << + >>] <<< -] >>
This program takes two numbers for input, and multiplies them.
The gist is it first reads in two inputs. Then it starts the outer loop,
conditioned on cell #1. Then it moves to cell #2, and starts the inner
-loop conditioned on cell #2, incrementing cell #3. However, there comes a
-problem: at the end of the inner loop, cell #2 is zero. To solve this problem,
+loop conditioned on cell #2, incrementing cell #3. However, there comes a
+problem: At the end of the inner loop, cell #2 is zero. In that case,
+inner loop won't work anymore since next time. To solve this problem,
we also increment cell #4, and then recopy cell #4 into cell #2.
+Then cell #3 is the result.
```
-And that's brainfuck. Not that hard, eh? For fun, you can write your own
-brainfuck programs, or you can write a brainfuck interpreter in another
+And that's brainfuck. Not that hard, eh? For fun, you can write your own
+brainfuck programs, or you can write a brainfuck interpreter in another
language. The interpreter is fairly simple to implement, but if you're a
masochist, try writing a brainfuck interpreter… in brainfuck.
diff --git a/common-lisp.html.markdown b/common-lisp.html.markdown
index a672b682..dda60797 100644
--- a/common-lisp.html.markdown
+++ b/common-lisp.html.markdown
@@ -377,7 +377,7 @@ nil ; for false - and the empty list
;; 4. Equality
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Common Lisp has a sophisticated equality system. A couple are covered yere.
+;; Common Lisp has a sophisticated equality system. A couple are covered here.
;; for numbers use `='
(= 3 3.0) ; => t
diff --git a/csharp.html.markdown b/csharp.html.markdown
index d3adbd01..1471b833 100644
--- a/csharp.html.markdown
+++ b/csharp.html.markdown
@@ -3,6 +3,7 @@ language: c#
contributors:
- ["Irfan Charania", "https://github.com/irfancharania"]
- ["Max Yankov", "https://github.com/golergka"]
+ - ["Melvyn Laïly", "http://x2a.yt"]
filename: LearnCSharp.cs
---
@@ -95,17 +96,25 @@ namespace Learning
// Double - Double-precision 64-bit IEEE 754 Floating Point
// Precision: 15-16 digits
double fooDouble = 123.4;
+
+ // Decimal - a 128-bits data type, with more precision than other floating-point types,
+ // suited for financial and monetary calculations
+ decimal fooDecimal = 150.3m;
- // Bool - true & false
+ // Boolean - true & false
bool fooBoolean = true;
bool barBoolean = false;
// Char - A single 16-bit Unicode character
char fooChar = 'A';
- // Strings
+ // Strings -- unlike the previous base types which are all value types,
+ // a string is a reference type. That is, you can set it to null
string fooString = "My string is here!";
Console.WriteLine(fooString);
+ // You can access each character of the string with an indexer:
+ char charFromString = fooString[1]; // 'y'
+ // Strings are immutable: you can't do fooString[1] = 'X';
// formatting
string fooFs = string.Format("Check Check, {0} {1}, {0} {1:0.0}", 1, 2);
@@ -138,14 +147,21 @@ namespace Learning
const int HOURS_I_WORK_PER_WEEK = 9001;
// Nullable types
- // any type can be made nullable by suffixing a ?
+ // any value type (i.e. not a class) can be made nullable by suffixing a ?
// <type>? <var name> = <value>
int? nullable = null;
Console.WriteLine("Nullable variable: " + nullable);
- // In order to use nullable's value, you have to use Value property or to explicitly cast it
- string? nullableString = "not null";
- Console.WriteLine("Nullable value is: " + nullableString.Value + " or: " + (string) nullableString );
+ // In order to use nullable's value, you have to use Value property
+ // or to explicitly cast it
+ DateTime? nullableDate = null;
+ // The previous line would not have compiled without the '?'
+ // because DateTime is a value type
+ // <type>? is equivalent to writing Nullable<type>
+ Nullable<DateTime> otherNullableDate = nullableDate;
+
+ nullableDate = DateTime.Now;
+ Console.WriteLine("Nullable value is: " + nullableDate.Value + " or: " + (DateTime) nullableDate );
// ?? is syntactic sugar for specifying default value
// in case variable is null
@@ -153,6 +169,8 @@ namespace Learning
Console.WriteLine("Not nullable variable: " + notNullable);
// Var - compiler will choose the most appropriate type based on value
+ // Please note that this does not remove type safety.
+ // In this case, the type of fooImplicit is known to be a bool at compile time
var fooImplicit = true;
///////////////////////////////////////////////////
@@ -201,7 +219,7 @@ namespace Learning
// Others data structures to check out:
//
// Stack/Queue
- // Dictionary
+ // Dictionary (an implementation of a hash map)
// Read-only Collections
// Tuple (.Net 4+)
@@ -235,7 +253,6 @@ namespace Learning
~ Unary bitwise complement
<< Signed left shift
>> Signed right shift
- >>> Unsigned right shift
& Bitwise AND
^ Bitwise exclusive OR
| Bitwise inclusive OR
@@ -308,6 +325,18 @@ namespace Learning
//Iterated 10 times, fooFor 0->9
}
Console.WriteLine("fooFor Value: " + fooFor);
+
+ // For Each Loop
+ // foreach loop structure => foreach(<iteratorType> <iteratorName> in <enumerable>)
+ // The foreach loop loops over any object implementing IEnumerable or IEnumerable<T>
+ // All the collection types (Array, List, Dictionary...) in the .Net framework
+ // implement one or both of these interfaces.
+ // (The ToCharArray() could be removed, because a string also implements IEnumerable)
+ foreach (char character in "Hello World".ToCharArray())
+ {
+ //Console.WriteLine(character);
+ //Iterated over all the characters in the string
+ }
// Switch Case
// A switch works with the byte, short, char, and int data types.
@@ -327,6 +356,14 @@ namespace Learning
case 3:
monthString = "March";
break;
+ // You can assign more than one case to an action
+ // But you can't add an action without a break before another case
+ // (if you want to do this, you would have to explicitly add a goto case x
+ case 6:
+ case 7:
+ case 8:
+ monthString = "Summer time!!";
+ break;
default:
monthString = "Some other month";
break;
@@ -335,7 +372,7 @@ namespace Learning
///////////////////////////////////////
- // Converting Data Types And Typcasting
+ // Converting Data Types And Typecasting
///////////////////////////////////////
// Converting data
@@ -389,7 +426,7 @@ namespace Learning
// Class Declaration Syntax:
- // <public/private/protected> class <class name>{
+ // <public/private/protected/internal> class <class name>{
// //data fields, constructors, functions all inside.
// //functions are called as methods in Java.
// }
@@ -404,17 +441,20 @@ namespace Learning
string name; // Everything is private by default: Only accessible from within this class
// Enum is a value type that consists of a set of named constants
+ // It is really just mapping a name to a value (an int, unless specified otherwise).
+ // The approved types for an enum are byte, sbyte, short, ushort, int, uint, long, or ulong.
+ // An enum can't contain the same value twice.
public enum Brand
{
AIST,
BMC,
- Electra,
+ Electra=42, //you can explicitly set a value to a name
Gitane
}
// We defined this type inside a Bicycle class, so it is a nested type
// Code outside of this class should reference this type as Bicycle.Brand
- public Brand brand; // After declaing an enum type, we can declare the field of this type
+ public Brand brand; // After declaring an enum type, we can declare the field of this type
// Static members belong to the type itself rather then specific object.
static public int bicyclesCreated = 0;
@@ -459,7 +499,7 @@ namespace Learning
// <public/private/protected> <return type> <function name>(<args>)
// classes can implement getters and setters for their fields
- // or they can implement properties
+ // or they can implement properties (this is the preferred way in C#)
// Method declaration syntax:
// <scope> <return type> <method name>(<args>)
@@ -474,13 +514,14 @@ namespace Learning
cadence = newValue;
}
- // virtual keyword indicates this method can be overridden
+ // virtual keyword indicates this method can be overridden in a derived class
public virtual void SetGear(int newValue)
{
gear = newValue;
}
- // Method parameters can have defaut values. In this case, methods can be called with these parameters omitted
+ // Method parameters can have default values.
+ // In this case, methods can be called with these parameters omitted
public void SpeedUp(int increment = 1)
{
_speed += increment;
@@ -500,6 +541,12 @@ namespace Learning
get { return _hasTassles; }
set { _hasTassles = value; }
}
+
+ // You can also define an automatic property in one line
+ // this syntax will create a backing field automatically.
+ // You can set an access modifier on either the getter or the setter (or both)
+ // to restrict its access:
+ public bool IsBroken { get; private set; }
// Properties can be auto-implemented
public int FrameSize
@@ -525,7 +572,7 @@ namespace Learning
// Methods can also be static. It can be useful for helper methods
public static bool DidWeCreateEnoughBycles()
{
- // Within a static method, we only can reference static class memebers
+ // Within a static method, we only can reference static class members
return bicyclesCreated > 9000;
} // If your class only needs static members, consider marking the class itself as static.
@@ -564,7 +611,7 @@ namespace Learning
interface IBreakable
{
- bool Broken { get; } // interfaces can contain properties as well as methods, fields & events
+ bool Broken { get; } // interfaces can contain properties as well as methods & events
}
// Class can inherit only one other class, but can implement any amount of interfaces
diff --git a/de-de/elixir-de.html.markdown b/de-de/elixir-de.html.markdown
index f77f9b0c..29d5132d 100644
--- a/de-de/elixir-de.html.markdown
+++ b/de-de/elixir-de.html.markdown
@@ -5,7 +5,7 @@ contributors:
translators:
- ["Gregor Große-Bölting", "http://www.ideen-und-soehne.de"]
filename: learnelixir-de.ex
-+lang: de-de
+lang: de-de
---
Elixir ist eine moderne, funktionale Sprache für die Erlang VM. Sie ist voll
diff --git a/es-es/clojure-es.html.markdown b/es-es/clojure-es.html.markdown
index 1ccdc50e..150d0bb2 100644
--- a/es-es/clojure-es.html.markdown
+++ b/es-es/clojure-es.html.markdown
@@ -70,7 +70,7 @@ y a menudo automáticamente.
; Si quieres crear una lista de datos, precedela con una comilla
; simple para evitar su evaluación
'(+ 1 2) ; => (+ 1 2)
-; (que es una abreviatura de (quote (+ 1 2))
+; (que es una abreviatura de (quote (+ 1 2)) )
; Puedes evaluar una lista precedida por comilla con eval
(eval '(+ 1 2)) ; => 3
diff --git a/git.html.markdown b/git.html.markdown
index abe8e3a7..4b5e466e 100644
--- a/git.html.markdown
+++ b/git.html.markdown
@@ -40,7 +40,7 @@ Version control is a system that records changes to a file, or set of files, ove
### Repository
-A set of files, directories, historical records, commits, and heads. Imagine it as a source code datastructure,
+A set of files, directories, historical records, commits, and heads. Imagine it as a source code data structure,
with the attribute that each source code "element" gives you access to its revision history, among other things.
A git repository is comprised of the .git directory & working tree.
diff --git a/java.html.markdown b/java.html.markdown
index 0dec51d1..3d0cb1d7 100644
--- a/java.html.markdown
+++ b/java.html.markdown
@@ -250,7 +250,7 @@ public class LearnJava {
// Conditional Shorthand
// You can use the '?' operator for quick assignments or logic forks.
// Reads as "If (statement) is true, use <first value>, otherwise, use <second value>"
- int foo = 5
+ int foo = 5;
String bar = (foo < 10) ? "A" : "B";
System.out.println(bar); // Prints A, because the statement is true
diff --git a/javascript.html.markdown b/javascript.html.markdown
index b15eae7c..6b6be34d 100644
--- a/javascript.html.markdown
+++ b/javascript.html.markdown
@@ -357,13 +357,13 @@ myObj.meaningOfLife; // = 43
// Constructors have a property called prototype. This is *not* the prototype of
// the constructor function itself; instead, it's the prototype that new objects
// are given when they're created with that constructor and the new keyword.
-myConstructor.prototype = {
+MyConstructor.prototype = {
myNumber: 5,
getMyNumber: function(){
return this.myNumber;
}
};
-var myNewObj2 = new myConstructor();
+var myNewObj2 = new MyConstructor();
myNewObj2.getMyNumber(); // = 5
myNewObj2.myNumber = 6
myNewObj2.getMyNumber(); // = 6
diff --git a/ko-kr/brainfuck-kr.html.markdown b/ko-kr/brainfuck-kr.html.markdown
new file mode 100644
index 00000000..661fcfea
--- /dev/null
+++ b/ko-kr/brainfuck-kr.html.markdown
@@ -0,0 +1,83 @@
+---
+language: brainfuck
+contributors:
+ - ["Prajit Ramachandran", "http://prajitr.github.io/"]
+ - ["Mathias Bynens", "http://mathiasbynens.be/"]
+translators:
+ - ["JongChan Choi", "http://0xABCDEF.com/"]
+lang: ko-kr
+---
+
+Brainfuck(f는 대문자로 적지 않습니다)은
+여덟가지 명령어만으로 튜링-완전한 최소주의 프로그래밍 언어입니다.
+
+```
+"><+-.,[]" 이외의 문자들은 무시됩니다. (쌍따옴표는 제외)
+
+브레인퍽은 30,000 칸 짜리의 0으로 초기화된 배열과,
+현재 칸을 가르키는 포인터로 표현됩니다.
+
+여덟가지의 명령어는 다음과 같습니다:
++ : 포인터가 가르키는 현재 칸의 값을 1 증가시킵니다.
+- : 포인터가 가르키는 현재 칸의 값을 1 감소시킵니다.
+> : 포인터가 다음 칸(오른쪽 칸)을 가르키도록 이동시킵니다.
+< : 포인터가 이전 칸(왼쪽 칸)을 가르키도록 이동시킵니다.
+. : 현재 칸의 값을 ASCII 문자로 출력합니다. (즉, 65 = 'A')
+, : 하나의 문자를 입력받고 그 값을 현재 칸에 대입합니다.
+[ : 현재 칸의 값이 0이면 짝이 맞는 ] 명령으로 넘어갑니다.
+ 0이 아니면 다음 명령어로 넘어갑니다.
+] : 현재 칸의 값이 0이면 다음 명령어로 넘어갑니다.
+ 0이 아니면 짝이 맞는 [ 명령으로 다시 돌아갑니다.
+
+[이랑 ]은 while 루프를 만들어냅니다. 무조건, 짝이 맞아야 합니다.
+
+몇가지 간단한 브레인퍽 프로그램을 보겠습니다.
+
+++++++ [ > ++++++++++ < - ] > +++++ .
+
+이 프로그램은 문자 'A'를 출력합니다. 처음에는, 반복할 횟수를 정하기 위한 값을
+만들기 위해 첫번째 칸의 값을 6으로 증가시킵니다. 그리고 루프로 들어가서([)
+두번째 칸으로 넘어갑니다. 루프 안에서는 두번째 칸의 값을 10 증가시키고,
+다시 첫번째 칸으로 넘어가서 값을 1 감소시킵니다. 이 루프는 여섯번 돕니다.
+(첫번째 칸의 값을 6번 감소시켜서 0이 될 때 까지는 ] 명령을 만날 때마다
+루프의 시작 지점으로 돌아갑니다)
+
+이 시점에서, 두번째 칸의 값은 60이고, 포인터는 값이 0인 첫번째 칸에 위치합니다.
+여기서 두번째 칸으로 넘어간 다음 값을 5 증가시키면 두번째 칸의 값이 65가 되고,
+65는 문자 'A'에 대응하는 아스키 코드이기 때문에, 두번째 칸의 값을 출력하면
+터미널에 'A'가 출력됩니다.
+
+, [ > + < - ] > .
+
+이 프로그램은 사용자로부터 문자 하나를 입력받아 첫번째 칸에 집어넣습니다.
+그리고 루프에 들어가서, 두번째 칸으로 넘어가 값을 한 번 증가시킨 다음,
+다시 첫번째 칸으로 넘어가서 값을 한 번 감소시킵니다.
+이는 첫번째 칸의 값이 0이 될 때까지 지속되며,
+두번째 칸은 첫번째 칸이 갖고있던 값을 가지게 됩니다.
+루프가 종료되면 포인터는 첫번째 칸을 가르키기 때문에 두번째 칸으로 넘어가고,
+해당 아스키 코드에 대응하는 문자를 출력합니다.
+
+또한 공백문자는 순전히 가독성을 위해서 작성되었다는 것을 기억하세요.
+다음과 같이 작성해도 똑같이 돌아갑니다:
+
+,[>+<-]>.
+
+한 번 돌려보고 아래의 프로그램이 실제로 무슨 일을 하는지 맞춰보세요:
+
+,>,< [ > [ >+ >+ << -] >> [- << + >>] <<< -] >>
+
+이 프로그램은 두 개의 숫자를 입력받은 뒤, 그 둘을 곱합니다.
+
+위 코드는 일단 두 번의 입력을 받고, 첫번째 칸의 값만큼 바깥 루프를 돕니다.
+그리고 루프 안에서 다시 두번째 칸의 값만큼 안쪽의 루프를 돕니다.
+그리고 그 루프에서는 세번째 칸의 값을 증가시키는데, 문제가 하나 있습니다:
+내부 루프가 한 번 끝나게 되면 두번째 칸의 값은 0이 됩니다.
+그럼 다시 바깥 루프를 돌 때에 안쪽의 루프를 돌지 않게 되는데, 이를 해결하려면
+네번째 칸의 값도 같이 증가시킨 다음, 그 값을 두번째 칸으로 옮기면 됩니다.
+그러면 세번째 칸에 곱셈의 결과가 남습니다.
+```
+
+여기까지 브레인퍽이었습니다. 참 쉽죠?
+재미삼아 브레인퍽 프로그램이나 다른 언어로 브레인퍽 인터프리터를 작성해보세요.
+인터프리터 구현은 간단한 편인데,
+사서 고생하는 것을 즐기는 편이라면 한 번 작성해보세요… 브레인퍽으로.
diff --git a/lua.html.markdown b/lua.html.markdown
index 369de908..27ce105b 100644
--- a/lua.html.markdown
+++ b/lua.html.markdown
@@ -125,7 +125,7 @@ f = function (x) return x * x end
-- And so are these:
local function g(x) return math.sin(x) end
-local g = function(x) return math.xin(x) end
+local g = function(x) return math.sin(x) end
-- Equivalent to local function g(x)..., except referring
-- to g in the function body won't work as expected.
local g; g = function (x) return math.sin(x) end
diff --git a/perl.html.markdown b/perl.html.markdown
index 18339dde..ad9155e4 100644
--- a/perl.html.markdown
+++ b/perl.html.markdown
@@ -131,19 +131,17 @@ sub logger {
# Now we can use the subroutine just as any other built-in function:
logger("We have a logger subroutine!");
-
-
```
#### 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.
+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.
perlfaq contains questions and answers related to many common tasks, and often provides suggestions for good CPAN modules to use.
#### Further Reading
- - [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`
+ - [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`
diff --git a/pogo.html.markdown b/pogo.html.markdown
new file mode 100644
index 00000000..60a83edd
--- /dev/null
+++ b/pogo.html.markdown
@@ -0,0 +1,202 @@
+---
+language: pogoscript
+contributors:
+ - ["Tim Macfarlane", "http://github.com/refractalize"]
+filename: learnPogo.pogo
+---
+
+Pogoscript is a little language that emphasises readability, DSLs and provides excellent asynchronous primitives for writing connected JavaScript applications for the browser or server.
+
+``` javascript
+// defining a variable
+water temperature = 24
+
+// re-assigning a variable after its definition
+water temperature := 26
+
+// functions allow their parameters to be placed anywhere
+temperature at (a) altitude = 32 - a / 100
+
+// longer functions are just indented
+temperature at (a) altitude :=
+ if (a < 0)
+ water temperature
+ else
+ 32 - a / 100
+
+// calling a function
+current temperature = temperature at 3200 altitude
+
+// this function constructs a new object with methods
+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` is similar to `this` in JavaScript with the
+// exception that `self` isn't redefined in each new
+// function definition
+// `self` just does what you expect
+
+// calling methods
+position (7, 2).distance from position (position (5, 1))
+
+// as in JavaScript, objects are hashes too
+position.'x' == position.x == position.('x')
+
+// arrays
+positions = [
+ position (1, 1)
+ position (1, 2)
+ position (1, 3)
+]
+
+// indexing an 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.'
+
+// that's Allen Ginsburg
+
+// interpolation
+outlook = 'amazing!'
+console.log "the weather tomorrow is going to be #(outlook)"
+
+// regular expressions
+r/(\d+)m/i
+r/(\d+) degrees/mg
+
+// operators
+true @and true
+false @or true
+@not false
+2 < 4
+2 >= 2
+2 > 1
+
+// plus all the javascript ones
+
+// to define your own
+(p1) plus (p2) =
+ position (p1.x + p2.x, p1.y + p2.y)
+
+// `plus` can be called as an operator
+position (1, 1) @plus position (0, 2)
+// or as a function
+(position (1, 1)) plus (position (0, 2))
+
+// explicit return
+(x) times (y) = return (x * y)
+
+// new
+now = @new Date ()
+
+// functions can take named optional arguments
+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/), inlcuding 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!
diff --git a/pt-pt/brainfuck-pt.html.markdown b/pt-pt/brainfuck-pt.html.markdown
new file mode 100644
index 00000000..60750de8
--- /dev/null
+++ b/pt-pt/brainfuck-pt.html.markdown
@@ -0,0 +1,84 @@
+---
+language: brainfuck
+contributors:
+ - ["Prajit Ramachandran", "http://prajitr.github.io/"]
+ - ["Mathias Bynens", "http://mathiasbynens.be/"]
+translators:
+ - ["Joao Marques", "http://github.com/mrshankly"]
+lang: pt-pt
+---
+
+Brainfuck (não capitalizado excepto no início de uma frase) é uma linguagem de
+programação Turing-completa extremamente simples com apenas 8 comandos.
+
+```
+Qualquer caractere excepto "><+-.,[]" (não contar com as aspas) é ignorado.
+
+Brainfuck é representado por um vector com 30 000 células inicializadas a zero
+e um ponteiro de dados que aponta para a célula actual.
+
+Existem 8 comandos:
++ : Incrementa o valor da célula actual em 1.
+- : Decrementa o valor da célula actual em 1.
+> : Move o ponteiro de dados para a célula seguinte (célula à direita).
+< : Move o ponteiro de dados para a célula anterior (célula à esquerda).
+. : Imprime o valor ASCII da célula actual. (ex. 65 = 'A').
+, : Lê um único caractere para a célula actual.
+[ : Se o valor da célula actual for zero, salta para o ] correspondente.
+ Caso contrário, passa para a instrução seguinte.
+] : Se o valor da célula actual for zero, passa para a instrução seguinte.
+ Caso contrário, volta para a instrução relativa ao [ correspondente.
+
+[ e ] formam um ciclo while. Obviamente, devem ser equilibrados.
+
+Vejamos alguns programas básicos de brainfuck.
+
+++++++ [ > ++++++++++ < - ] > +++++ .
+
+Este programa imprime a letra 'A'. Primeiro incrementa a célula #1 para 6.
+A célula #1 será usada num ciclo. Depois é iniciado o ciclo ([) e move-se
+o ponteiro de dados para a célula #2. Incrementa-se o valor da célula #1 10
+vezes, move-se o ponteiro de dados de volta para a célula #1, e decrementa-se
+a célula #1. Este ciclo acontece 6 vezes (são necessários 6 decrementos para
+a célula #1 chegar a 0, momento em que se salta para o ] correspondente,
+continuando com a instrução seguinte).
+
+Nesta altura encontramo-nos na célula #1, cujo valor é 0, enquanto a célula #2
+tem o valor 60. Movemos o ponteiro de dados para a célula #2, incrementa-se 5
+vezes para um valor final de 65, é então impresso o valor da célula #2. Ao valor
+65 corresponde o caractere 'A' em ASCII, 'A' é então impresso para o terminal.
+
+, [ > + < - ] > .
+
+Este programa lê um caractere e copia o seu valor para a célula #1. Um ciclo é
+iniciado. Movemos o ponteiro de dados para a célula #2, incrementamos o valor na
+célula #2, movemos o ponteiro de dados de volta para a célula #1, finalmente
+decrementamos o valor na célula #1. Isto continua até o valor na célula #1 ser
+igual a 0 e a célula #2 ter o antigo valor da célula #1. Como o ponteiro de
+dados está a apontar para a célula #1 no fim do ciclo, movemos o ponteiro para a
+célula #2 e imprimimos o valor em ASCII.
+
+Os espaços servem apenas para tornar o programa mais legível. Podemos escrever
+o mesmo programa da seguinte maneira:
+
+,[>+<-]>.
+
+Tenta descobrir o que este programa faz:
+
+,>,< [ > [ >+ >+ << -] >> [- << + >>] <<< -] >>
+
+Este programa lê dois números e multiplica-os.
+
+Basicamente o programa pede dois caracteres ao utilizador. Depois é iniciado um
+ciclo exterior controlado pelo valor da célula #1. Movemos o ponteiro de dados
+para a célula #2 e inicia-se o ciclo interior controlado pelo valor da célula
+#2, incrementando o valor da célula #3. Contudo, existe um problema, no final do
+ciclo interior a célula #2 tem o valor 0. Para resolver este problema o valor da
+célula #4 é também incrementado e copiado para a célula #2.
+```
+
+Fica então explicado brainfuck. Simples, não? Por divertimento podes escrever os
+teus próprios programas em brainfuck, ou então escrever um interpretador de
+brainfuck noutra linguagem. O interpretador é relativamente fácil de se
+implementar, mas se fores masoquista, tenta escrever um interpretador de
+brainfuck… em brainfuck.
diff --git a/python.html.markdown b/python.html.markdown
index bad9a360..08e68407 100644
--- a/python.html.markdown
+++ b/python.html.markdown
@@ -112,8 +112,10 @@ None is None #=> True
## 2. Variables and Collections
####################################################
-# Printing is pretty easy
-print "I'm Python. Nice to meet you!"
+# Python has a print function, available in versions 2.7 and 3...
+print("I'm Python. Nice to meet you!")
+# and an older print statement, in all 2.x versions but removed from 3.
+print "I'm also Python!"
# No need to declare variables before assigning to them.
@@ -224,7 +226,7 @@ filled_dict.get("four") #=> None
filled_dict.get("one", 4) #=> 1
filled_dict.get("four", 4) #=> 4
-# "setdefault()" method is a safe way to add new key-value pair into dictionary
+# "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
@@ -235,7 +237,7 @@ empty_set = set()
some_set = set([1,2,2,3,4]) # some_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}
+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}
@@ -265,11 +267,11 @@ 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."
+ print("some_var is totally bigger than 10.")
elif some_var < 10: # This elif clause is optional.
- print "some_var is smaller than 10."
+ print("some_var is smaller than 10.")
else: # This is optional too.
- print "some_var is indeed 10."
+ print("some_var is indeed 10.")
"""
@@ -281,10 +283,10 @@ prints:
"""
for animal in ["dog", "cat", "mouse"]:
# You can use % to interpolate formatted strings
- print "%s is a mammal" % animal
-
+ print("%s is a mammal" % animal)
+
"""
-"range(number)" returns a list of numbers
+"range(number)" returns a list of numbers
from zero to the given number
prints:
0
@@ -293,7 +295,7 @@ prints:
3
"""
for i in range(4):
- print i
+ print(i)
"""
While loops go until a condition is no longer met.
@@ -305,7 +307,7 @@ prints:
"""
x = 0
while x < 4:
- print x
+ print(x)
x += 1 # Shorthand for x = x + 1
# Handle exceptions with a try/except block
@@ -324,7 +326,7 @@ except IndexError as e:
# Use "def" to create new functions
def add(x, y):
- print "x is %s and y is %s" % (x, y)
+ print("x is %s and y is %s" % (x, y))
return x + y # Return values with a return statement
# Calling functions with parameters
@@ -351,8 +353,8 @@ 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
+ print(args)
+ print(kwargs)
"""
all_the_args(1, 2, a=3, b=4) prints:
(1, 2)
@@ -420,10 +422,10 @@ class Human(object):
# Instantiate a class
i = Human(name="Ian")
-print i.say("hi") # prints out "Ian: hi"
+print(i.say("hi")) # prints out "Ian: hi"
j = Human("Joel")
-print j.say("hello") #prints out "Joel: hello"
+print(j.say("hello")) #prints out "Joel: hello"
# Call our class method
i.get_species() #=> "H. sapiens"
@@ -443,12 +445,12 @@ Human.grunt() #=> "*grunt*"
# You can import modules
import math
-print math.sqrt(16) #=> 4
+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
+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
@@ -459,7 +461,7 @@ import math as m
math.sqrt(16) == m.sqrt(16) #=> True
# Python modules are just ordinary python files. You
-# can write your own, and import them. The name of the
+# 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
diff --git a/vi-vn/git-vi.html.markdown b/vi-vn/git-vi.html.markdown
new file mode 100644
index 00000000..77fec983
--- /dev/null
+++ b/vi-vn/git-vi.html.markdown
@@ -0,0 +1,392 @@
+---
+category: tool
+tool: git
+contributors:
+ - ["Jake Prather", "http://github.com/JakeHP"]
+filename: LearnGit-vi.txt
+---
+
+Git là một hệ quản lý mã nguồn và phiên bản phân tán (distributed version control and source code management system).
+
+Nó làm được điều này là do một loạt các snapshot từ đề án của bạn, and nó hoạt động
+với các snapshot đó để cung cấp cho bạn với chức năng đến phiên bản và
+quản lý mã nguồn của bạn.
+
+## Khái Niệm Versioning
+
+### Version Control là gì?
+
+Version Control là một hệ thống ghi lại những thay đổi ở một tập tin, hay một nhóm các tập tin, theo thời gian.
+
+### Centralized Versioning VS Distributed Versioning
+
+* Quản lý phiên bản tập trung (Centralized Versioning) tập trung vào việc đồng bộ hóa, theo dõi, và lưu trữ tập tin.
+* Quản lý phiên bản phân tán (Distributed Versioning) tập trung vào việc chia sẻ các thay đổi. Mỗi sự thay đổi có một mã định dạng (id) duy nhất.
+* Các hệ phân tán không có cấu trúc định sẵn. Bạn có thể thay đổi một kiểu SVN, hệ phân tán, với git.
+
+[Thông tin thêm](http://git-scm.com/book/en/Getting-Started-About-Version-Control)
+
+### Tại Sao Dùng Git?
+
+* Có thể hoạt động offline.
+* Cộng tác với nhau rất dễ dàng!
+* Phân nhánh dễ dàng!
+* Trộn (Merging)
+* Git nhanh.
+* Git linh hoạt.
+
+## Kiến Trúc Git
+
+
+### Repository
+
+Một nhóm các tập tin, thư mục, các ghi chép trong quá khứ, commit, và heads. Tưởng tượng nó như là một cấu trúc dữ liệu mã nguồn,
+với thuộc tính mà một "nhân tố" mã nguồn cho bạn quyền truy cập đến lịch sử sửa đổi, và một số thứ khác.
+
+Một git repository bao gồm thư mục .git & tree đang làm việc.
+
+### Thư mục .git (thành phần của một repository)
+
+Thư mục .git chứa tất cả các cấu hình, log, nhánh, HEAD, và hơn nữa.
+[Danh Sách Chi Tiết.](http://gitready.com/advanced/2009/03/23/whats-inside-your-git-directory.html)
+
+### Tree Đang Làm (thành phần của một repository)
+
+Đây cơ bản là các thư mục và tập tin trong repository của bạn. Nó thường được tham chiếu
+thư mục đang làm việc của bạn
+
+### Chỉ mục (thành phần của một thư mục .git)
+
+Chỉ mục của là một staging area trong git. Nó đơn giản là một lớp riêng biệt với tree đang làm việc của bạn
+từ Git repository. Điều này cho nhà phát triền nhiều lựa chọn hơn trong việc xem xét những gì được gửi đến Git
+repository.
+
+### Commit
+
+Một git commit là một snapshot của một nhóm các thay đổi, hoặc các thao tác Working Tree của bạn.
+Ví dụ, nếu bạn thêm 5 tập tin, và xóa 2 tập tin khác, những thay đổi này sẽ được chứa trong
+một commit (hoặc snapshot). Commit này có thể được đẩy đến các repo khác, hoặc không!
+
+### Nhánh
+
+Nhánh thực chất là một con trỏ đến commit mới nhất mà bạn vừa thực hiện. Khi bạn commit,
+con trỏ này sẽ cập nhật tự động và trỏ đến commit mới nhất.
+
+### HEAD và head (thành phần của thư mục .git)
+
+HEAD là một con trỏ đến nhánh hiện tại. Một repo chỉ có một HEAD *đang hoạt động*.
+head là một con trỏ đến bất kỳ commit nào. Một repo có thể có nhiều head.
+
+### Các Tài Nguyên Mang Tính Khái Niệm
+
+* [Git For Computer Scientists](http://eagain.net/articles/git-for-computer-scientists/)
+* [Git For Designers](http://hoth.entp.com/output/git_for_designers.html)
+
+
+## Các Lệnh
+
+
+### init
+
+Tạo một repo Git rỗng. Các cài đặt, thông tin lưu trữ... của Git
+được lưu ở một thư mục tên là ".git".
+
+```bash
+$ git init
+```
+
+### config
+
+Để chỉnh tùy chọn. Bất kể là cho repo, hay cho hệ thống, hay điều chỉnh
+toàn cục (global)
+
+
+
+```bash
+# In Ra & Và Gán Một Số Biến Tùy Chỉnh Cơ Bản (Toàn cục - Global)
+$ git config --global user.email
+$ git config --global user.name
+
+$ git config --global user.email "MyEmail@Zoho.com"
+$ git config --global user.name "My Name"
+```
+
+[Tìm hiểu thêm về git config.](http://git-scm.com/docs/git-config)
+
+### help
+
+Để cho bạn lối truy cập nhanh đến một chỉ dẫn cực kỳ chi tiết của từng lệnh. Hoặc chỉ để
+nhắc bạn một số cú pháp.
+
+```bash
+# Xem nhanh các lệnh có sẵn
+$ git help
+
+# Xem tất các các lệnh
+$ git help -a
+
+# Lệnh help riêng biệt - tài liệu người dùng
+# git help <command_here>
+$ git help add
+$ git help commit
+$ git help init
+```
+
+### status
+
+Để hiển thị sự khác nhau giữa tập tin index (cơ bản là repo đang làm việc) và HEAD commit
+hiện tại.
+
+
+```bash
+# Sẽ hiển thị nhánh, các tập tin chưa track (chưa commit), các thay đổi và những khác biệt khác
+$ git status
+
+# Để xem các "tid bits" về git status
+$ git help status
+```
+
+### add
+
+Để thêm các tập vào tree/thư mục/repo hiện tại. Nếu bạn không `git add` các tập tin mới đến
+tree/thư mục hiện tại, chúng sẽ không được kèm theo trong các commit!
+
+```bash
+# thêm một file vào thư mục hiện tại
+$ git add HelloWorld.java
+
+# thêm một file vào một thư mục khác
+$ git add /path/to/file/HelloWorld.c
+
+# Hỗ trợ Regular Expression!
+$ git add ./*.java
+```
+
+### branch
+
+Quản lý nhánh. Bạn có thể xem, sửa, tạo, xóa các nhánh bằng cách dùng lệnh này.
+
+```bash
+# liệt kê các nhanh đang có và ở remote
+$ git branch -a
+
+# tạo nhánh mới
+$ git branch myNewBranch
+
+# xóa một nhánh
+$ git branch -d myBranch
+
+# đặt tên lại một nhánh
+# git branch -m <oldname> <newname>
+$ git branch -m myBranchName myNewBranchName
+
+# chỉnh sủa diễn giải của một nhánh
+$ git branch myBranchName --edit-description
+```
+
+### checkout
+
+Cập nhật tất cả các file torng tree hiện tại để cho trùng khớp với phiên bản của index, hoặc tree cụ thể.
+
+```bash
+# Checkout (chuyển) một repo - mặc định là nhánh master
+$ git checkout
+# Checkout một nhánh cụ thể
+$ git checkout branchName
+# Tạo một nhánh mới và chuyển đến nó, tương tự: "git branch <name>; git checkout <name>"
+$ git checkout -b newBranch
+```
+
+### clone
+
+Nhân bản, hoặc sao chép, một repo hiện có thành một thư mục mới. Nó cũng thêm
+các nhánh có remote-tracking cho mỗi nhánh trong một repo được nhân bản, mà
+cho phép bạn push đến một nhánh remote.
+
+```bash
+# Nhân bản learnxinyminutes-docs
+$ git clone https://github.com/adambard/learnxinyminutes-docs.git
+```
+
+### commit
+
+Lưu trữ nội dung hiện tại của index trong một "commit" mới. Điều này cho phép tạo ra thay đổi và một lời nhắn (ghi chú) tạo ra bởi người dùng.
+
+```bash
+# commit với một ghi chú
+$ git commit -m "Added multiplyNumbers() function to HelloWorld.c"
+```
+
+### diff
+
+Hiển thị sự khác biệt giữa một file trong thư mục hiện tại, index và commits.
+
+```bash
+# Hiển thị sự khác biệt giữa thư mục hiện tại và index
+$ git diff
+
+# Hiển thị khác biệt giữa index và commit mới nhất.
+$ git diff --cached
+
+# Hiển thị khác biệt giữa thư mục đang làm việc và commit mới nhất
+$ git diff HEAD
+```
+
+### grep
+
+Cho phép bạn tìm kiếm nhanh một repo.
+
+Các tinh chỉnh tùy chọn:
+
+```bash
+# Cảm ơn Travis Jeffery vì những lệnh này
+# Đặt số của dòng được hiển thị trong kết quả tìm kiếm grep
+$ git config --global grep.lineNumber true
+
+# Làm cho kết quả tìm kiếm dễ đọc hơn, bao gồm cả gom nhóm
+$ git config --global alias.g "grep --break --heading --line-number"
+```
+
+```bash
+# Tìm "variableName" trong tất cả các file Java
+$ git grep 'variableName' -- '*.java'
+
+# Tìm một dòng mà có chứa "arrayListName" và, "add" hoặc "remove"
+$ git grep -e 'arrayListName' --and \( -e add -e remove \)
+```
+
+Google để xem thêm các ví dụ
+[Git Grep Ninja](http://travisjeffery.com/b/2012/02/search-a-git-repo-like-a-ninja)
+
+### log
+
+Hiển thị các commit đến repo.
+
+```bash
+# Hiện tất cả các commit
+$ git log
+
+# Hiện X commit
+$ git log -n 10
+
+# Chỉ hiện các commit đã merge merge commits
+$ git log --merges
+```
+
+### merge
+
+"Trộn" các thay đổi từ commit bên ngoài vào trong nhánh hiện tại.
+
+```bash
+# Merge nhánh cụ thể vào nhánh hiện tại.
+$ git merge branchName
+
+# Luôn khởi tạo một merge commit khi trộn (merge)
+$ git merge --no-ff branchName
+```
+
+### mv
+
+Đặt lại tên hoặc di chuyển một file
+
+```bash
+# Đặt lại tên một file
+$ git mv HelloWorld.c HelloNewWorld.c
+
+# Di chuyển một file
+$ git mv HelloWorld.c ./new/path/HelloWorld.c
+
+# Buộc đặt lại tên hoặc di chuyển
+# "existingFile" đã tồn tại trong thự mục, sẽ bị ghi đè
+$ git mv -f myFile existingFile
+```
+
+### pull
+
+Kéo (tải) về từ một repo và merge nó vào nhánh khác.
+
+```bash
+# Cập nhật repo cục bộ của bạn, bằng cách merge các thay đổi mới
+# từ remote "origin" và nhánh "master".
+# git pull <remote> <branch>
+# git pull => hoàn toàn mặc định như => git pull origin master
+$ git pull origin master
+
+# Merge các thay đổi từ nhánh remote và rebase
+# các commit nhánh lên trên thư mục cục bộ, như: "git pull <remote> <branch>, git rebase <branch>"
+$ git pull origin master --rebase
+```
+
+### push
+
+Đẩy và trộn (mege) các tay đổi từ một nhánh đế một remote & nhánh.
+
+```bash
+# Push và merge các thay đổi từ repo cục bộ đến một
+# remote tên là "origin" và nhánh "master".
+# git push <remote> <branch>
+# git push => hoàn toàn defaults to => git push origin master
+$ git push origin master
+```
+
+### rebase (thận trọng)
+
+Lấy tất cả các thay đổi mà đã được commit trên một nhánh, và replay (?) chúng trên một nhánh khác.
+*Không rebase các commit mà bạn đã push đến một repo công khai*.
+
+```bash
+# Rebase experimentBranch lên master
+# git rebase <basebranch> <topicbranch>
+$ git rebase master experimentBranch
+```
+
+[Đọc Thêm.](http://git-scm.com/book/en/Git-Branching-Rebasing)
+
+### reset (thận trọng)
+
+Thiết lập lạo HEAD hiện tại đến một trạng thái cụ thể. Điều này cho phép bạn làm lại các merges,
+pulls, commits, thêm, and hơn nữa. Nó là một lệnh hay nhưng cũng nguy hiểm nếu bạn không
+biết mình đang làm gì.
+
+```bash
+# Thiết lập lại staging area, để trùng với commit mới nhất (để thư mục không thay đổi)
+$ git reset
+
+# Thiết lập lại staging area, để trùng với commit mới nhất, và ghi đè lên thư mục hiện tại
+$ git reset --hard
+
+# Di chuyển nhánh hiện tại đến một commit cụ thể (để thư mục không thay đổi)
+# tất cả thay đổi vẫn duy trì trong thư mục.
+$ git reset 31f2bb1
+
+# Di chuyển nhánh hiện tại lùi về một commit cụ thể
+# và làm cho thư mục hiện tại trùng (xóa các thay đổi chưa được commit và tất cả các commit
+# sau một commit cụ thể).
+$ git reset --hard 31f2bb1
+```
+
+### rm
+
+Ngược lại với git add, git rm xóa file từ tree đang làm việc.
+
+```bash
+# xóa HelloWorld.c
+$ git rm HelloWorld.c
+
+# Xóa file từ thư mục khác
+$ git rm /pather/to/the/file/HelloWorld.c
+```
+
+## Thông tin thêm
+
+* [tryGit - A fun interactive way to learn Git.](http://try.github.io/levels/1/challenges/1)
+
+* [git-scm - Video Tutorials](http://git-scm.com/videos)
+
+* [git-scm - Documentation](http://git-scm.com/docs)
+
+* [Atlassian Git - Tutorials & Workflows](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/)
diff --git a/vi-vn/objective-c-vi.html.markdown b/vi-vn/objective-c-vi.html.markdown
new file mode 100644
index 00000000..f6296ec0
--- /dev/null
+++ b/vi-vn/objective-c-vi.html.markdown
@@ -0,0 +1,318 @@
+---
+
+language: Objective-C
+contributors:
+ - ["Eugene Yagrushkin", "www.about.me/yagrushkin"]
+ - ["Yannick Loriot", "https://github.com/YannickL"]
+lang: vi-vi
+filename: LearnObjectiveC-vi.m
+
+---
+
+Objective-C là ngôn ngữ lập trình chính được sử dụng bởi Apple cho các hệ điều hành OS X, iOS và các framework tương ứng của họ, Cocoa và Cocoa Touch.
+Nó là một ngôn ngữ lập trình mục đích tổng quát, hướng đối tượng có bổ sung thêm kiểu truyền thông điệp giống Smalltalk vào ngôn ngữ lập trình C.
+
+```objective-c
+// Chú thích dòng đơn bắt đầu với //
+
+/*
+Chú thích đa dòng trông như thế này.
+*/
+
+// Nhập các headers của framework Foundation với cú pháp #import
+#import <Foundation/Foundation.h>
+#import "MyClass.h"
+
+// Đầu vào chương trình của bạn là một hàm gọi là
+// main với một kiểu trả về kiểu integer.
+int main (int argc, const char * argv[])
+{
+ // Tạo một autorelease pool để quản lý bộ nhớ vào chương trình
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+
+ // Sử dụng hàm NSLog() để in ra các dòng lệnh vào console
+ NSLog(@"Hello World!"); // Print the string "Hello World!"
+
+ ///////////////////////////////////////
+ // Kiểu & Biến (Types & Variables)
+ ///////////////////////////////////////
+
+ // Khai báo số nguyên
+ int myPrimitive1 = 1;
+ long myPrimitive2 = 234554664565;
+
+ // Khai báo đối tượng
+ // Đặt dấu nháy * vào trước tên biến cho khai báo đối tượng strong
+ MyClass *myObject1 = nil; // Strong
+ id myObject2 = nil; // Weak
+ // %@ là một đối tượng
+ // 'miêu tả' ('desciption') là thông lệ để trình bày giá trị của các Đối tượng
+ NSLog(@"%@ và %@", myObject1, [myObject2 description]); // In ra "(null) và (null)"
+
+ // Chuỗi
+ NSString *worldString = @"World";
+ NSLog(@"Hello %@!", worldString); // In ra "Hello World!"
+
+ // Ký tự literals
+ NSNumber *theLetterZNumber = @'Z';
+ char theLetterZ = [theLetterZNumber charValue];
+ NSLog(@"%c", theLetterZ);
+
+ // Số nguyên literals
+ NSNumber *fortyTwoNumber = @42;
+ int fortyTwo = [fortyTwoNumber intValue];
+ NSLog(@"%i", fortyTwo);
+
+ NSNumber *fortyTwoUnsignedNumber = @42U;
+ unsigned int fortyTwoUnsigned = [fortyTwoUnsignedNumber unsignedIntValue];
+ NSLog(@"%u", fortyTwoUnsigned);
+
+ NSNumber *fortyTwoShortNumber = [NSNumber numberWithShort:42];
+ short fortyTwoShort = [fortyTwoShortNumber shortValue];
+ NSLog(@"%hi", fortyTwoShort);
+
+ NSNumber *fortyTwoLongNumber = @42L;
+ long fortyTwoLong = [fortyTwoLongNumber longValue];
+ NSLog(@"%li", fortyTwoLong);
+
+ // Dấu phẩy động (floating point) literals
+ NSNumber *piFloatNumber = @3.141592654F;
+ float piFloat = [piFloatNumber floatValue];
+ NSLog(@"%f", piFloat);
+
+ NSNumber *piDoubleNumber = @3.1415926535;
+ double piDouble = [piDoubleNumber doubleValue];
+ NSLog(@"%f", piDouble);
+
+ // BOOL literals
+ NSNumber *yesNumber = @YES;
+ NSNumber *noNumber = @NO;
+
+ // Đối tượng Mảng
+ NSArray *anArray = @[@1, @2, @3, @4];
+ NSNumber *thirdNumber = anArray[2];
+ NSLog(@"Third number = %@", thirdNumber); // In ra "Third number = 3"
+
+ // Đối tượng Từ điển
+ NSDictionary *aDictionary = @{ @"key1" : @"value1", @"key2" : @"value2" };
+ NSObject *valueObject = aDictionary[@"A Key"];
+ NSLog(@"Đối tượng = %@", valueObject); // In ra "Object = (null)"
+
+ ///////////////////////////////////////
+ // Toán Tử (Operators)
+ ///////////////////////////////////////
+
+ // Các toán tử cũng hoạt động giống như ngôn ngữ C
+ // Ví dụ:
+ 2 + 5; // => 7
+ 4.2f + 5.1f; // => 9.3f
+ 3 == 2; // => 0 (NO)
+ 3 != 2; // => 1 (YES)
+ 1 && 1; // => 1 (Logical and)
+ 0 || 1; // => 1 (Logical or)
+ ~0x0F; // => 0xF0 (bitwise negation)
+ 0x0F & 0xF0; // => 0x00 (bitwise AND)
+ 0x01 << 1; // => 0x02 (bitwise dịch trái (bởi 1))
+
+ /////////////////////////////////////////////
+ // Cấu Trúc Điều Khiển (Controls Structures)
+ /////////////////////////////////////////////
+
+ // Câu lệnh If-Else
+ if (NO)
+ {
+ NSLog(@"I am never run");
+ } else if (0)
+ {
+ NSLog(@"I am also never run");
+ } else
+ {
+ NSLog(@"I print");
+ }
+
+ // Câu lệnh Switch
+ switch (2)
+ {
+ case 0:
+ {
+ NSLog(@"I am never run");
+ } break;
+ case 1:
+ {
+ NSLog(@"I am also never run");
+ } break;
+ default:
+ {
+ NSLog(@"I print");
+ } break;
+ }
+
+ // Câu lệnh vòng lặp While
+ int ii = 0;
+ while (ii < 4)
+ {
+ NSLog(@"%d,", ii++); // ii++ tăng dần, sau khi sử dụng giá trị của nó.
+ } // => in ra "0,"
+ // "1,"
+ // "2,"
+ // "3,"
+
+ // Câu lệnh vòng lặp For
+ int jj;
+ for (jj=0; jj < 4; jj++)
+ {
+ NSLog(@"%d,", jj);
+ } // => in ra "0,"
+ // "1,"
+ // "2,"
+ // "3,"
+
+ // Câu lệnh Foreach
+ NSArray *values = @[@0, @1, @2, @3];
+ for (NSNumber *value in values)
+ {
+ NSLog(@"%@,", value);
+ } // => in ra "0,"
+ // "1,"
+ // "2,"
+ // "3,"
+
+ // Câu lệnh Try-Catch-Finally
+ @try
+ {
+ // Your statements here
+ @throw [NSException exceptionWithName:@"FileNotFoundException"
+ reason:@"Không Tìm Thấy Tập Tin trên Hệ Thống" userInfo:nil];
+ } @catch (NSException * e)
+ {
+ NSLog(@"Exception: %@", e);
+ } @finally
+ {
+ NSLog(@"Finally");
+ } // => in ra "Exception: Không Tìm Thấy Tập Tin trên Hệ Thống"
+ // "Finally"
+
+ ///////////////////////////////////////
+ // Đối Tượng (Objects)
+ ///////////////////////////////////////
+
+ // Tạo một thực thể đối tượng bằng cách phân vùng nhớ và khởi tạo đối tượng đó.
+ // Một đối tượng sẽ không thật sự hoạt động cho đến khi cả 2 bước alloc] init] được hoàn thành
+ MyClass *myObject = [[MyClass alloc] init];
+
+ // Mô hình lập trình hướng đối tượng của Objective-C dựa trên việc truyền thông điệp (message)
+ // và các thực thể đối tượng với nhau.
+ // Trong Objective-C một đối tượng không đơn thuần gọi phương thức; nó truyền thông điệp.
+ [myObject instanceMethodWithParameter:@"Steve Jobs"];
+
+ // Dọn dẹp vùng nhớ mà bạn đã dùng ở chương trình
+ [pool drain];
+
+ // Kết thúc chương trình
+ return 0;
+}
+
+///////////////////////////////////////
+// Lớp và Hàm (Classes & Functions)
+///////////////////////////////////////
+
+// Khai báo lớp của bạn ở một tập tin header (MyClass.h):
+// Cú pháp Khai Báo Lớp:
+// @interface ClassName : ParentClassName <ImplementedProtocols>
+// {
+// Khai báo biến thành viên;
+// }
+// -/+ (type) Khai báo method;
+// @end
+@interface MyClass : NSObject <MyProtocol>
+{
+ int count;
+ id data;
+ NSString *name;
+}
+// Ký hiệu (notation) tiện ích để tự động khởi tạo public getter và setter
+@property int count;
+@property (copy) NSString *name; // Sao chép đối tượng trong quá trình gán.
+@property (readonly) id data; // Chỉ khai báo phương thức getter.
+
+// Phương thức
++/- (return type)methodSignature:(Parameter Type *)parameterName;
+
+// dấu '+' cho phương thức lớp
++ (NSString *)classMethod;
+
+// dấu '-' cho phương thức thực thể
+- (NSString *)instanceMethodWithParameter:(NSString *)string;
+- (NSNumber *)methodAParameterAsString:(NSString*)string andAParameterAsNumber:(NSNumber *)number;
+
+@end
+
+// Thực thi các phương thức trong một tập tin thực thi (MyClass.m):
+
+@implementation MyClass
+
+// Gọi khi đối tượng được release
+- (void)dealloc
+{
+}
+
+// Phương thức khởi tạo (Constructors) là một cách để tạo các lớp
+// Đây là phương thức khởi tạo mặc định được gọi khi đối tượng được khởi tạo
+- (id)init
+{
+ if ((self = [super init]))
+ {
+ self.count = 1;
+ }
+ return self;
+}
+
++ (NSString *)classMethod
+{
+ return [[self alloc] init];
+}
+
+- (NSString *)instanceMethodWithParameter:(NSString *)string
+{
+ return @"New string";
+}
+
+- (NSNumber *)methodAParameterAsString:(NSString*)string andAParameterAsNumber:(NSNumber *)number
+{
+ return @42;
+}
+
+// Các phương thức được khai báo vào MyProtocol
+- (void)myProtocolMethod
+{
+ // câu lệnh
+}
+
+@end
+
+/*
+ * Một protocol khai báo các phương thức mà có thể thực thi bởi bất kỳ lớp nào.
+ * Các protocol chính chúng không phải là các lớp. Chúng chỉ đơn giản là định ra giao diện (interface)
+ * mà các đối tượng khác có trách nhiệm sẽ thực thi.
+ */
+@protocol MyProtocol
+ - (void)myProtocolMethod;
+@end
+
+
+
+```
+## Xem Thêm
+
++ [Wikipedia Objective-C](http://en.wikipedia.org/wiki/Objective-C)
+
++ Apple Docs':
+ + [Learning Objective-C](http://developer.apple.com/library/ios/referencelibrary/GettingStarted/Learning_Objective-C_A_Primer/)
+
+ + [Programming With Objective-C](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Introduction/Introduction.html)
+
+ + [Object-Oriented Programming with Objective-C](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/OOP_ObjC/Introduction/Introduction.html#//apple_ref/doc/uid/TP40005149)
+
+ + [Coding Guidelines for Cocoa](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html)
+
++ [iOS For High School Students: Getting Started](http://www.raywenderlich.com/5600/ios-for-high-school-students-getting-started)