diff --git a/ansible.html.markdown b/ansible.html.markdown
index 41a8c9b5..30dfba13 100644
--- a/ansible.html.markdown
+++ b/ansible.html.markdown
@@ -30,9 +30,9 @@ But ansible is way more! It provides execution plans, an API, library, and callb
#### Pros
-* It is an agent-less tools In most scenarios, it use ssh as a transport layer.
+* It is an agent-less tool. In most scenarios, it uses ssh as a transport layer.
In some way you can use it as 'bash on steroids'.
-* It is very easy to start. If you are familiar with ssh concept - you already
+* It is very easy to start. If you are familiar with the concept of ssh - you already
know Ansible (ALMOST).
* It executes 'as is' - other tools (salt, puppet, chef - might execute in
different scenario than you would expect)
@@ -176,7 +176,7 @@ instances in the cloud, execute shell command). The simplest module is called
Example of modules:
* Module: `ping` - the simplest module that is useful to verify host connectivity
-* Module: `shell` - a module that executes shell command on a specified host(s).
+* Module: `shell` - a module that executes a shell command on a specified host(s).
```bash
@@ -204,13 +204,13 @@ the module subsystem (useful to install python2.7)
Execution of a single Ansible **module** is called a **task**. The simplest
module is called `ping` as you could see above.
-Another example of the module that allow you to execute command remotly on
+Another example of the module that allows you to execute a command remotely on
multiple resources is called `shell`. See above how you were using them already.
### Playbook
**Execution plan** written in a form of script file(s) is called **playbook**.
-Playbook consist of multiple elements -
+Playbooks consist of multiple elements -
* a list (or group) of hosts that 'the play' is executed against
* `task(s)` or `role(s)` that are going to be executed
* multiple optional settings (like default variables, and way more)
@@ -247,7 +247,7 @@ Note: Example playbook is explained in the next chapter: 'Roles'
### Inventory
-Inventory is a set of objects or hosts, against which we are executing our
+An inventory is a set of objects or hosts, against which we are executing our
playbooks or single tasks via shell commands. For these few minutes, let's
assume that we are using the default ansible inventory (which in Debian based
system is placed in `/etc/ansible/hosts`).
@@ -303,11 +303,11 @@ Role can be included in your playbook (executed via your playbook).
```
#### For remaining examples we would use additional repository
-This example install ansible in `virtualenv` so it is independend from a system.
-You need to initialize it into your shell-context with `source environment.sh`
+This example installs ansible in `virtualenv` so it is independent from the system.
+You need to initialize it into your shell-context with the `source environment.sh`
command.
-We are going to use this repository with examples: [https://github.com/sirkubax/ansible-for-learnXinYminutes]()
+We are going to use this repository with examples: [https://github.com/sirkubax/ansible-for-learnXinYminutes](https://github.com/sirkubax/ansible-for-learnXinYminutes)
```bash
$ # The following example contains a shell-prompt to indicate the venv and relative path
@@ -513,7 +513,7 @@ $ # Now we would run the above playbook with roles
You can use the jinja in the CLI too
```bash
-ansible -m shell -a 'echo {{ my_variable }}` -e 'my_variable=something, playbook_parameter=twentytwo" localhost
+ansible -m shell -a 'echo {{ my_variable }}' -e 'my_variable=something, playbook_parameter=twentytwo' localhost
```
In fact - jinja is used to template parts of the playbooks too
@@ -551,7 +551,7 @@ provides a way to encrypt confidential files so you can store them in the
repository, yet the files are decrypted on-the-fly during ansible execution.
The best way to use it is to store the secret in some secure location, and
-configure ansible to use during runtime.
+configure ansible to use them during runtime.
```bash
# Try (this would fail)
@@ -588,7 +588,7 @@ You might like to know, that you can build your inventory dynamically.
deliver that to ansible - anything is possible.
You do not need to reinvent the wheel - there are plenty of ready to use
-inventory scripts for most popular Cloud providers and a lot of in-house
+inventory scripts for the most popular Cloud providers and a lot of in-house
popular usecases.
[AWS example](http://docs.ansible.com/ansible/latest/intro_dynamic_inventory.html#example-aws-ec2-external-inventory-script)
@@ -614,7 +614,7 @@ callback_whitelist = profile_tasks
### facts-cache and ansible-cmdb
-You can pull some information about your environment from another hosts.
+You can pull some information about your environment from another host.
If the information does not change - you may consider using a facts_cache
to speed things up.
diff --git a/coq.html.markdown b/coq.html.markdown
index 115d9ff8..4c1ad690 100644
--- a/coq.html.markdown
+++ b/coq.html.markdown
@@ -25,19 +25,20 @@ Inside Proof General `Ctrl+C Ctrl+` will evaluate up to your cursor.
(*** Variables and functions ***)
-(* The Coq proof assistant can be controlled and queried by a command language called
- the vernacular. Vernacular keywords are capitalized and the commands end with a period.
- Variable and function declarations are formed with the Definition vernacular. *)
+(* The Coq proof assistant can be controlled and queried by a command
+ language called the vernacular. Vernacular keywords are capitalized and
+ the commands end with a period. Variable and function declarations are
+ formed with the Definition vernacular. *)
Definition x := 10.
-(* Coq can sometimes infer the types of arguments, but it is common practice to annotate
- with types. *)
+(* Coq can sometimes infer the types of arguments, but it is common practice
+ to annotate with types. *)
Definition inc_nat (x : nat) : nat := x + 1.
-(* There exists a large number of vernacular commands for querying information.
- These can be very useful. *)
+(* There exists a large number of vernacular commands for querying
+ information. These can be very useful. *)
Compute (1 + 1). (* 2 : nat *) (* Compute a result. *)
@@ -46,48 +47,50 @@ Check tt. (* tt : unit *) (* Check the type of an expressions *)
About plus. (* Prints information about an object *)
(* Print information including the definition *)
-Print true. (* Inductive bool : Set := true : Bool | false : Bool *)
+Print true. (* Inductive bool : Set := true : Bool | false : Bool *)
Search nat. (* Returns a large list of nat related values *)
Search "_ + _". (* You can also search on patterns *)
Search (?a -> ?a -> bool). (* Patterns can have named parameters *)
Search (?a * ?a).
-(* Locate tells you where notation is coming from. Very helpful when you encounter
- new notation. *)
-Locate "+".
+(* Locate tells you where notation is coming from. Very helpful when you
+ encounter new notation. *)
-(* Calling a function with insufficient number of arguments
- does not cause an error, it produces a new function. *)
+Locate "+".
+
+(* Calling a function with insufficient number of arguments does not cause
+ an error, it produces a new function. *)
Definition make_inc x y := x + y. (* make_inc is int -> int -> int *)
Definition inc_2 := make_inc 2. (* inc_2 is int -> int *)
Compute inc_2 3. (* Evaluates to 5 *)
-(* Definitions can be chained with "let ... in" construct.
- This is roughly the same to assigning values to multiple
- variables before using them in expressions in imperative
- languages. *)
+
+(* Definitions can be chained with "let ... in" construct. This is roughly
+ the same to assigning values to multiple variables before using them in
+ expressions in imperative languages. *)
+
Definition add_xy : nat := let x := 10 in
let y := 20 in
x + y.
-
(* Pattern matching is somewhat similar to switch statement in imperative
languages, but offers a lot more expressive power. *)
+
Definition is_zero (x : nat) :=
match x with
| 0 => true
| _ => false (* The "_" pattern means "anything else". *)
end.
+(* You can define recursive function definition using the Fixpoint
+ vernacular.*)
-(* You can define recursive function definition using the Fixpoint vernacular.*)
Fixpoint factorial n := match n with
| 0 => 1
| (S n') => n * factorial n'
end.
-
(* Function application usually doesn't need parentheses around arguments *)
Compute factorial 5. (* 120 : nat *)
@@ -104,11 +107,12 @@ end with
| (S n) => is_even n
end.
-(* As Coq is a total programming language, it will only accept programs when it can
- understand they terminate. It can be most easily seen when the recursive call is
- on a pattern matched out subpiece of the input, as then the input is always decreasing
- in size. Getting Coq to understand that functions terminate is not always easy. See the
- references at the end of the article for more on this topic. *)
+(* As Coq is a total programming language, it will only accept programs when
+ it can understand they terminate. It can be most easily seen when the
+ recursive call is on a pattern matched out subpiece of the input, as then
+ the input is always decreasing in size. Getting Coq to understand that
+ functions terminate is not always easy. See the references at the end of
+ the article for more on this topic. *)
(* Anonymous functions use the following syntax: *)
@@ -119,16 +123,18 @@ Definition my_id2 : forall A : Type, A -> A := fun A x => x.
Compute my_id nat 3. (* 3 : nat *)
(* You can ask Coq to infer terms with an underscore *)
-Compute my_id _ 3.
+Compute my_id _ 3.
-(* An implicit argument of a function is an argument which can be inferred from contextual
- knowledge. Parameters enclosed in {} are implicit by default *)
+(* An implicit argument of a function is an argument which can be inferred
+ from contextual knowledge. Parameters enclosed in {} are implicit by
+ default *)
Definition my_id3 {A : Type} (x : A) : A := x.
Compute my_id3 3. (* 3 : nat *)
-(* Sometimes it may be necessary to turn this off. You can make all arguments explicit
- again with @ *)
+(* Sometimes it may be necessary to turn this off. You can make all
+ arguments explicit again with @ *)
+
Compute @my_id3 nat 3.
(* Or give arguments by name *)
@@ -168,17 +174,19 @@ let rec factorial n = match n with
(*** Notation ***)
-(* Coq has a very powerful Notation system that can be used to write expressions in more
- natural forms. *)
+(* Coq has a very powerful Notation system that can be used to write
+ expressions in more natural forms. *)
+
Compute Nat.add 3 4. (* 7 : nat *)
Compute 3 + 4. (* 7 : nat *)
-(* Notation is a syntactic transformation applied to the text of the program before being
- evaluated. Notation is organized into notation scopes. Using different notation scopes
- allows for a weak notion of overloading. *)
+(* Notation is a syntactic transformation applied to the text of the program
+ before being evaluated. Notation is organized into notation scopes. Using
+ different notation scopes allows for a weak notion of overloading. *)
-(* Imports the Zarith module containing definitions related to the integers Z *)
-Require Import ZArith.
+(* Imports the Zarith module holding definitions related to the integers Z *)
+
+Require Import ZArith.
(* Notation scopes can be opened *)
Open Scope Z_scope.
@@ -187,7 +195,7 @@ Open Scope Z_scope.
Compute 1 + 7. (* 8 : Z *)
(* Integer equality checking *)
-Compute 1 =? 2. (* false : bool *)
+Compute 1 =? 2. (* false : bool *)
(* Locate is useful for finding the origin and definition of notations *)
Locate "_ =? _". (* Z.eqb x y : Z_scope *)
@@ -199,10 +207,10 @@ Compute 1 + 7. (* 8 : nat *)
(* Scopes can also be opened inline with the shorthand % *)
Compute (3 * -7)%Z. (* -21%Z : Z *)
-(* Coq declares by default the following interpretation scopes: core_scope, type_scope,
- function_scope, nat_scope, bool_scope, list_scope, int_scope, uint_scope. You may also
- want the numerical scopes Z_scope (integers) and Q_scope (fractions) held in the ZArith
- and QArith module respectively. *)
+(* Coq declares by default the following interpretation scopes: core_scope,
+ type_scope, function_scope, nat_scope, bool_scope, list_scope, int_scope,
+ uint_scope. You may also want the numerical scopes Z_scope (integers) and
+ Q_scope (fractions) held in the ZArith and QArith module respectively. *)
(* You can print the contents of scopes *)
Print Scope nat_scope.
@@ -230,17 +238,19 @@ Bound to classes nat Nat.t
"x * y" := Init.Nat.mul x y
*)
-(* Coq has exact fractions available as the type Q in the QArith module.
- Floating point numbers and real numbers are also available but are a more advanced
- topic, as proving properties about them is rather tricky. *)
+(* Coq has exact fractions available as the type Q in the QArith module.
+ Floating point numbers and real numbers are also available but are a more
+ advanced topic, as proving properties about them is rather tricky. *)
Require Import QArith.
Open Scope Q_scope.
Compute 1. (* 1 : Q *)
-Compute 2. (* 2 : nat *) (* only 1 and 0 are interpreted as fractions by Q_scope *)
+
+(* Only 1 and 0 are interpreted as fractions by Q_scope *)
+Compute 2. (* 2 : nat *)
Compute (2 # 3). (* The fraction 2/3 *)
-Compute (1 # 3) ?= (2 # 6). (* Eq : comparison *)
+Compute (1 # 3) ?= (2 # 6). (* Eq : comparison *)
Close Scope Q_scope.
Compute ( (2 # 3) / (1 # 5) )%Q. (* 10 # 3 : Q *)
@@ -279,40 +289,43 @@ Definition my_fst2 {A B : Type} (x : A * B) : A := let (a,b) := x in
(*** Lists ***)
-(* Lists are built by using cons and nil or by using notation available in list_scope. *)
+(* Lists are built by using cons and nil or by using notation available in
+ list_scope. *)
Compute cons 1 (cons 2 (cons 3 nil)). (* (1 :: 2 :: 3 :: nil)%list : list nat *)
-Compute (1 :: 2 :: 3 :: nil)%list.
+Compute (1 :: 2 :: 3 :: nil)%list.
(* There is also list notation available in the ListNotations modules *)
Require Import List.
-Import ListNotations.
+Import ListNotations.
Compute [1 ; 2 ; 3]. (* [1; 2; 3] : list nat *)
-(*
-There are a large number of list manipulation functions available, including:
+(* There is a large number of list manipulation functions available,
+ including:
• length
-• head : first element (with default)
+• head : first element (with default)
• tail : all but first element
• app : appending
• rev : reverse
• nth : accessing n-th element (with default)
• map : applying a function
-• flat_map : applying a function returning lists
+• flat_map : applying a function returning lists
• fold_left : iterator (from head to tail)
-• fold_right : iterator (from tail to head)
+• fold_right : iterator (from tail to head)
*)
Definition my_list : list nat := [47; 18; 34].
Compute List.length my_list. (* 3 : nat *)
+
(* All functions in coq must be total, so indexing requires a default value *)
-Compute List.nth 1 my_list 0. (* 18 : nat *)
+Compute List.nth 1 my_list 0. (* 18 : nat *)
Compute List.map (fun x => x * 2) my_list. (* [94; 36; 68] : list nat *)
-Compute List.filter (fun x => Nat.eqb (Nat.modulo x 2) 0) my_list. (* [18; 34] : list nat *)
-Compute (my_list ++ my_list)%list. (* [47; 18; 34; 47; 18; 34] : list nat *)
+Compute List.filter (fun x => Nat.eqb (Nat.modulo x 2) 0) my_list.
+ (* [18; 34] : list nat *)
+Compute (my_list ++ my_list)%list. (* [47; 18; 34; 47; 18; 34] : list nat *)
(*** Strings ***)
@@ -342,16 +355,19 @@ Close Scope string_scope.
• PArith : Basic positive integer arithmetic
• NArith : Basic binary natural number arithmetic
• ZArith : Basic relative integer arithmetic
-• Numbers : Various approaches to natural, integer and cyclic numbers (currently
- axiomatically and on top of 2^31 binary words)
+
+• Numbers : Various approaches to natural, integer and cyclic numbers
+ (currently axiomatically and on top of 2^31 binary words)
• Bool : Booleans (basic functions and results)
+
• Lists : Monomorphic and polymorphic lists (basic functions and results),
Streams (infinite sequences defined with co-inductive types)
• Sets : Sets (classical, constructive, finite, infinite, power set, etc.)
-• FSets : Specification and implementations of finite sets and finite maps
+• FSets : Specification and implementations of finite sets and finite maps
(by lists and by AVL trees)
-• Reals : Axiomatization of real numbers (classical, basic functions, integer part,
- fractional part, limit, derivative, Cauchy series, power series and results,...)
+• Reals : Axiomatization of real numbers (classical, basic functions,
+ integer part, fractional part, limit, derivative, Cauchy series,
+ power series and results,...)
• Relations : Relations (definitions and basic results)
• Sorting : Sorted list (basic definitions and heapsort correctness)
• Strings : 8-bits characters and strings
@@ -360,18 +376,20 @@ Close Scope string_scope.
(*** User-defined data types ***)
-(* Because Coq is dependently typed, defining type aliases is no different than defining
- an alias for a value. *)
+(* Because Coq is dependently typed, defining type aliases is no different
+ than defining an alias for a value. *)
Definition my_three : nat := 3.
Definition my_nat : Type := nat.
-(* More interesting types can be defined using the Inductive vernacular. Simple enumeration
- can be defined like so *)
+(* More interesting types can be defined using the Inductive vernacular.
+ Simple enumeration can be defined like so *)
+
Inductive ml := OCaml | StandardML | Coq.
Definition lang := Coq. (* Has type "ml". *)
-(* For more complicated types, you will need to specify the types of the constructors. *)
+(* For more complicated types, you will need to specify the types of the
+ constructors. *)
(* Type constructors don't need to be empty. *)
Inductive my_number := plus_infinity
@@ -379,23 +397,28 @@ Inductive my_number := plus_infinity
Compute nat_value 3. (* nat_value 3 : my_number *)
-(* Record syntax is sugar for tuple-like types. It defines named accessor functions for
- the components. Record types are defined with the notation {...} *)
+(* Record syntax is sugar for tuple-like types. It defines named accessor
+ functions for the components. Record types are defined with the notation
+ {...} *)
+
Record Point2d (A : Set) := mkPoint2d { x2 : A ; y2 : A }.
(* Record values are constructed with the notation {|...|} *)
Definition mypoint : Point2d nat := {| x2 := 2 ; y2 := 3 |}.
Compute x2 nat mypoint. (* 2 : nat *)
-Compute mypoint.(x2 nat). (* 2 : nat *)
+Compute mypoint.(x2 nat). (* 2 : nat *)
+
+(* Types can be parameterized, like in this type for "list of lists of
+ anything". 'a can be substituted with any type. *)
-(* Types can be parameterized, like in this type for "list of lists
- of anything". 'a can be substituted with any type. *)
Definition list_of_lists a := list (list a).
Definition list_list_nat := list_of_lists nat.
(* Types can also be recursive. Like in this type analogous to
built-in list of naturals. *)
-Inductive my_nat_list := EmptyList | NatList : nat -> my_nat_list -> my_nat_list.
+Inductive my_nat_list :=
+ EmptyList | NatList : nat -> my_nat_list -> my_nat_list.
+
Compute NatList 1 EmptyList. (* NatList 1 EmptyList : my_nat_list *)
(** Matching type constructors **)
@@ -427,31 +450,38 @@ Compute sum_list [1; 2; 3]. (* Evaluates to 6 *)
(*** A Taste of Proving ***)
-(* Explaining the proof language is out of scope for this tutorial, but here is a taste to
- whet your appetite. Check the resources below for more. *)
+(* Explaining the proof language is out of scope for this tutorial, but here
+ is a taste to whet your appetite. Check the resources below for more. *)
-(* A fascinating feature of dependently type based theorem provers is that the same
- primitive constructs underly the proof language as the programming features.
- For example, we can write and prove the proposition A and B implies A in raw Gallina *)
+(* A fascinating feature of dependently type based theorem provers is that
+ the same primitive constructs underly the proof language as the
+ programming features. For example, we can write and prove the
+ proposition A and B implies A in raw Gallina *)
-Definition my_theorem : forall A B, A /\ B -> A := fun A B ab => match ab with
- | (conj a b) => a
- end.
+Definition my_theorem : forall A B, A /\ B -> A :=
+ fun A B ab => match ab with
+ | (conj a b) => a
+ end.
+
+(* Or we can prove it using tactics. Tactics are a macro language to help
+ build proof terms in a more natural style and automate away some
+ drudgery. *)
-(* Or we can prove it using tactics. Tactics are a macro language to help build proof terms
- in a more natural style and automate away some drudgery. *)
Theorem my_theorem2 : forall A B, A /\ B -> A.
Proof.
intros A B ab. destruct ab as [ a b ]. apply a.
Qed.
-(* We can prove easily prove simple polynomial equalities using the automated tactic ring. *)
+(* We can prove easily prove simple polynomial equalities using the
+ automated tactic ring. *)
+
Require Import Ring.
Require Import Arith.
Theorem simple_poly : forall (x : nat), (x + 1) * (x + 2) = x * x + 3 * x + 2.
Proof. intros. ring. Qed.
-(* Here we prove the closed form for the sum of all numbers 1 to n using induction *)
+(* Here we prove the closed form for the sum of all numbers 1 to n using
+ induction *)
Fixpoint sumn (n : nat) : nat :=
match n with
@@ -465,8 +495,10 @@ Proof. intros n. induction n.
- simpl. ring [IHn]. (* induction step *)
Qed.
```
-
-With this we have only scratched the surface of Coq. It is a massive ecosystem with many interesting and peculiar topics leading all the way up to modern research.
+
+With this we have only scratched the surface of Coq. It is a massive
+ecosystem with many interesting and peculiar topics leading all the way up
+to modern research.
## Further reading
diff --git a/csharp.html.markdown b/csharp.html.markdown
index 37573e01..b965c2d4 100644
--- a/csharp.html.markdown
+++ b/csharp.html.markdown
@@ -653,10 +653,10 @@ on a new line! ""Wow!"", the masses cried";
return ++count;
}
- // A delegate is a reference to a method
+ // A delegate is a reference to a method.
// To reference the Increment method,
- // first declare a delegate with the same signature
- // ie. takes no arguments and returns an int
+ // first declare a delegate with the same signature,
+ // i.e. takes no arguments and returns an int
public delegate int IncrementDelegate();
// An event can also be used to trigger delegates
@@ -727,10 +727,10 @@ on a new line! ""Wow!"", the masses cried";
int _speed; // Everything is private by default: Only accessible from within this class.
// can also use keyword private
public string Name { get; set; }
-
+
// Properties also have a special syntax for when you want a readonly property
// that simply returns the result of an expression
- public string LongName => Name + " " + _speed + " speed";
+ public string LongName => Name + " " + _speed + " speed";
// 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).
@@ -1091,7 +1091,7 @@ on a new line! ""Wow!"", the masses cried";
// Spell failed
return false;
}
- // Other exceptions, or MagicServiceException where Code is not 42
+ // Other exceptions, or MagicServiceException where Code is not 42
catch(Exception ex) when (LogException(ex))
{
// Execution never reaches this block
@@ -1215,7 +1215,7 @@ namespace Csharp7
Console.WriteLine(tt.GetLastName());
}
}
-
+
// PATTERN MATCHING
class PatternMatchingTest
{
@@ -1315,8 +1315,10 @@ namespace Csharp7
* [C# language reference](https://docs.microsoft.com/dotnet/csharp/language-reference/)
* [Learn .NET](https://dotnet.microsoft.com/learn)
* [C# Coding Conventions](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions)
- * [DotNetPerls](https://www.dotnetperls.com/)
- * [C# in Depth](https://manning.com/skeet3)
- * [Programming C# 5.0](http://shop.oreilly.com/product/0636920024064)
- * [LINQ Pocket Reference](http://shop.oreilly.com/product/9780596519254)
- * [Windows Forms Programming in C#](https://www.amazon.com/Windows-Forms-Programming-Chris-Sells/dp/0321116208)
+ * [DotNetPerls](http://www.dotnetperls.com)
+ * [C# in Depth](http://manning.com/skeet2)
+ * [Programming C# 5.0](http://shop.oreilly.com/product/0636920024064.do)
+ * [LINQ Pocket Reference](http://shop.oreilly.com/product/9780596519254.do)
+ * [Windows Forms Programming in C#](http://www.amazon.com/Windows-Forms-Programming-Chris-Sells/dp/0321116208)
+ * [freeCodeCamp - C# Tutorial for Beginners](https://www.youtube.com/watch?v=GhQdlIFylQ8)
+
\ No newline at end of file
diff --git a/d.html.markdown b/d.html.markdown
index d2a57cae..93c08da2 100644
--- a/d.html.markdown
+++ b/d.html.markdown
@@ -212,6 +212,7 @@ found in the wonderful `std.algorithm` module!
```d
import std.algorithm : map, filter, reduce;
import std.range : iota; // builds an end-exclusive range
+import std.stdio;
void main() {
// We want to print the sum of a list of squares of even ints
diff --git a/dart.html.markdown b/dart.html.markdown
index ce6f681b..7db9bd33 100644
--- a/dart.html.markdown
+++ b/dart.html.markdown
@@ -29,6 +29,7 @@ example1() {
nested2() => print("Example1 nested 1 nested 2");
nested2();
}
+
nested1();
}
@@ -37,6 +38,7 @@ example2() {
nested1(fn) {
fn();
}
+
nested1(() => print("Example2 nested 1"));
}
@@ -47,9 +49,12 @@ example3() {
planA(fn(informSomething)) {
fn("Example3 plan A");
}
- planB(fn) { // Or don't declare number of parameters.
+
+ planB(fn) {
+ // Or don't declare number of parameters.
fn("Example3 plan B");
}
+
planA((s) => print(s));
planB((s) => print(s));
}
@@ -60,17 +65,20 @@ example4() {
nested1(fn(informSomething)) {
fn(example4Something);
}
+
nested1((s) => print(s));
}
// Class declaration with a sayIt method, which also has closure access
// to the outer variable as though it were a function as seen before.
var example5method = "Example5 sayIt";
+
class Example5Class {
sayIt() {
print(example5method);
}
}
+
example5() {
// Create an anonymous instance of the Example5Class and call the sayIt
// method on it.
@@ -86,6 +94,7 @@ class Example6Class {
print(instanceVariable);
}
}
+
example6() {
new Example6Class().sayIt();
}
@@ -96,10 +105,12 @@ class Example7Class {
static sayItFromClass() {
print(classVariable);
}
+
sayItFromInstance() {
print(classVariable);
}
}
+
example7() {
Example7Class.sayItFromClass();
new Example7Class().sayItFromInstance();
@@ -111,7 +122,7 @@ example7() {
// by default. But arrays and maps are not. They can be made constant by
// declaring them "const".
var example8Array = const ["Example8 const array"],
- example8Map = const {"someKey": "Example8 const map"};
+ example8Map = const {"someKey": "Example8 const map"};
example8() {
print(example8Array[0]);
print(example8Map["someKey"]);
@@ -172,6 +183,7 @@ example13() {
print("Example13 regexp doesn't match '${s}'");
}
}
+
match(s1);
match(s2);
}
@@ -190,7 +202,7 @@ example14() {
}
// dynamic typed null can be convert to bool
- var b;// b is dynamic type
+ var b; // b is dynamic type
b = "abc";
try {
if (b) {
@@ -211,7 +223,7 @@ example14() {
// statically typed null can not be convert to bool
var c = "abc";
c = null;
- // complie failed
+ // compile failed
// if (c) {
// print("true, c is $c");
// } else {
@@ -240,9 +252,11 @@ example15() {
// StringBuffer. Or you could join a string array.
example16() {
var sb = new StringBuffer(), a = ["a", "b", "c", "d"], e;
- for (e in a) { sb.write(e); }
+ for (e in a) {
+ sb.write(e);
+ }
print("Example16 dynamic string created with "
- "StringBuffer '${sb.toString()}'");
+ "StringBuffer '${sb.toString()}'");
print("Example16 join string array '${a.join()}'");
}
@@ -302,11 +316,13 @@ class Example21 {
set names(List list) {
_names = list;
}
+
int get length => _names.length;
void add(String name) {
_names.add(name);
}
}
+
void example21() {
Example21 o = new Example21();
o.add("c");
@@ -320,7 +336,9 @@ class Example22A {
var _name = "Some Name!";
get name => _name;
}
+
class Example22B extends Example22A {}
+
example22() {
var o = new Example22B();
print("Example22 class inheritance '${o.name}'");
@@ -334,19 +352,21 @@ example22() {
// single inheritance doesn't get in the way of reusable code.
// Mixins follow the "with" statement during the class declaration.
class Example23A {}
+
class Example23Utils {
addTwo(n1, n2) {
return n1 + n2;
}
}
+
class Example23B extends Example23A with Example23Utils {
addThree(n1, n2, n3) {
return addTwo(n1, n2) + n3;
}
}
+
example23() {
- var o = new Example23B(), r1 = o.addThree(1, 2, 3),
- r2 = o.addTwo(1, 2);
+ var o = new Example23B(), r1 = o.addThree(1, 2, 3), r2 = o.addTwo(1, 2);
print("Example23 addThree(1, 2, 3) results in '${r1}'");
print("Example23 addTwo(1, 2) results in '${r2}'");
}
@@ -362,12 +382,13 @@ class Example24A {
}
get value => _value;
}
+
class Example24B extends Example24A {
Example24B({value: "someOtherValue"}) : super(value: value);
}
+
example24() {
- var o1 = new Example24B(),
- o2 = new Example24B(value: "evenMore");
+ var o1 = new Example24B(), o2 = new Example24B(value: "evenMore");
print("Example24 calling super during constructor '${o1.value}'");
print("Example24 calling super during constructor '${o2.value}'");
}
@@ -379,10 +400,11 @@ class Example25 {
var value, anotherValue;
Example25({this.value, this.anotherValue});
}
+
example25() {
var o = new Example25(value: "a", anotherValue: "b");
print("Example25 shortcut for constructor '${o.value}' and "
- "'${o.anotherValue}'");
+ "'${o.anotherValue}'");
}
// Named parameters are available when declared between {}.
@@ -394,17 +416,19 @@ example26() {
_name = name;
_surname = surname;
}
+
setConfig2(name, [surname, email]) {
_name = name;
_surname = surname;
_email = email;
}
+
setConfig1(surname: "Doe", name: "John");
print("Example26 name '${_name}', surname '${_surname}', "
- "email '${_email}'");
+ "email '${_email}'");
setConfig2("Mary", "Jane");
print("Example26 name '${_name}', surname '${_surname}', "
- "email '${_email}'");
+ "email '${_email}'");
}
// Variables declared with final can only be set once.
@@ -416,6 +440,7 @@ class Example27 {
// that follows the :
Example27({this.color1, color2}) : color2 = color2;
}
+
example27() {
final color = "orange", o = new Example27(color1: "lilac", color2: "white");
print("Example27 color is '${color}'");
@@ -434,6 +459,7 @@ class Example28 extends IterableBase {
}
get iterator => names.iterator;
}
+
example28() {
var o = new Example28();
o.forEach((name) => print("Example28 '${name}'"));
@@ -459,10 +485,12 @@ example29() {
callItForMe(fn()) {
return fn();
}
+
rand() {
v = new DM.Random().nextInt(50);
return v;
}
+
while (true) {
print("Example29 callItForMe(rand) '${callItForMe(rand)}'");
if (v != 30) {
@@ -477,8 +505,12 @@ example29() {
// Parse int, convert double to int, or just keep int when dividing numbers
// by using the ~/ operation. Let's play a guess game too.
example30() {
- var gn, tooHigh = false,
- n, n2 = (2.0).toInt(), top = int.parse("123") ~/ n2, bottom = 0;
+ var gn,
+ tooHigh = false,
+ n,
+ n2 = (2.0).toInt(),
+ top = int.parse("123") ~/ n2,
+ bottom = 0;
top = top ~/ 6;
gn = new DM.Random().nextInt(top + 1); // +1 because nextInt top is exclusive
print("Example30 Guess a number between 0 and ${top}");
@@ -488,10 +520,11 @@ example30() {
} else {
tooHigh = n > gn;
print("Example30 Number ${n} is too "
- "${tooHigh ? 'high' : 'low'}. Try again");
+ "${tooHigh ? 'high' : 'low'}. Try again");
}
return n == gn;
}
+
n = (top - bottom) ~/ 2;
while (!guessNumber(n)) {
if (tooHigh) {
@@ -548,12 +581,15 @@ example33() {
// the program needs to startup with.
main() {
print("Learn Dart in 15 minutes!");
- [example1, example2, example3, example4, example5, example6, example7,
- example8, example9, example10, example11, example12, example13, example14,
- example15, example16, example17, example18, example19, example20,
- example21, example22, example23, example24, example25, example26,
- example27, example28, example29, example30, example31, example32, example33
- ].forEach((ef) => ef());
+ [
+ example1, example2, example3, example4, example5,
+ example6, example7, example8, example9, example10,
+ example11, example12, example13, example14, example15,
+ example16, example17, example18, example19, example20,
+ example21, example22, example23, example24, example25,
+ example26, example27, example28, example29,
+ example30 // Adding this comment stops the dart formatter from putting all items on a new line
+ ].forEach((ef) => ef());
}
```
@@ -564,6 +600,3 @@ Dart has a comprehensive web-site. It covers API reference, tutorials, articles
useful Try Dart online.
[https://www.dartlang.org](https://www.dartlang.org)
[https://try.dartlang.org](https://try.dartlang.org)
-
-
-
diff --git a/de-de/bash-de.html.markdown b/de-de/bash-de.html.markdown
index 3fb3e71f..3a76708a 100644
--- a/de-de/bash-de.html.markdown
+++ b/de-de/bash-de.html.markdown
@@ -157,7 +157,7 @@ echo "#helloworld" | cat > output.out
echo "#helloworld" | tee output.out >/dev/null
# Löschen der Hilfsdateien von oberhalb, mit Anzeige der Dateinamen
-# (mit '-i' für "interactive" erfolgt für jede Date eine Rückfrage)
+# (mit '-i' für "interactive" erfolgt für jede Datei eine Rückfrage)
rm -v output.out error.err output-and-error.log
# Die Ausgabe von Befehlen kann mit Hilfe von $( ) in anderen Befehlen verwendet weden:
diff --git a/de-de/html-de.html.markdown b/de-de/html-de.html.markdown
index 0bf58f9c..8b5597e7 100644
--- a/de-de/html-de.html.markdown
+++ b/de-de/html-de.html.markdown
@@ -50,10 +50,10 @@ Dieser Artikel ist bedacht darauf, nur HTML Syntax und nützliche Tipps zu geben
-
+
-
+
@@ -65,13 +65,13 @@ Dieser Artikel ist bedacht darauf, nur HTML Syntax und nützliche Tipps zu geben
-
-
+
+
@@ -93,12 +93,12 @@ Dieser Artikel ist bedacht darauf, nur HTML Syntax und nützliche Tipps zu geben
-
-
Erster Tabellenkopf
+
+
Erster Tabellenkopf
Zweiter Tabllenkopf
-
Erste Zeile, erste Spalte
+
Erste Zeile, erste Spalte
Erste Zeile, zweite Spalte
diff --git a/de-de/java-de.html.markdown b/de-de/java-de.html.markdown
index e8ac5bda..e52087ec 100644
--- a/de-de/java-de.html.markdown
+++ b/de-de/java-de.html.markdown
@@ -477,7 +477,7 @@ Für tiefergreifende Fragen ist Google der beste Startpunkt.
* [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](https://www.oracle.com/technetwork/java/codeconventions-150003.pdf)
**Online Tutorials**
diff --git a/de-de/make-de.html.markdown b/de-de/make-de.html.markdown
index cf90dc29..1bae332c 100644
--- a/de-de/make-de.html.markdown
+++ b/de-de/make-de.html.markdown
@@ -11,14 +11,14 @@ lang: de-de
---
Eine Makefile definiert einen Graphen von Regeln um ein Ziel (oder Ziele)
-zu erzeugen. Es dient dazu die geringste Menge an Arbeit zu verrichten um
-ein Ziel in einklang mit dem Quellcode zu bringen. Make wurde berühmterweise
+zu erzeugen. Es dient dazu, die geringste Menge an Arbeit zu verrichten um
+ein Ziel in Einklang mit dem Quellcode zu bringen. Make wurde berühmterweise
von Stuart Feldman 1976 übers Wochenende geschrieben. Make ist noch immer
-sehr verbreitet (vorallem im Unix umfeld) obwohl es bereits sehr viel
+sehr verbreitet (vorallem im Unix Umfeld) obwohl es bereits sehr viel
Konkurrenz und Kritik zu Make gibt.
-Es gibt eine vielzahl an Varianten von Make, dieser Artikel beschäftig sich
-mit der Version GNU Make. Diese Version ist standard auf Linux.
+Es gibt eine Vielzahl an Varianten von Make, dieser Artikel beschäftigt sich
+mit der Version GNU Make. Diese Version ist Standard auf Linux.
```make
@@ -44,14 +44,15 @@ file0.txt:
# die erste Regel ist die Standard-Regel.
-# Diese Regel wird nur abgearbeitet wenn file0.txt aktueller als file1.txt ist.
+# Diese Regel wird nur abgearbeitet, wenn file0.txt aktueller als file1.txt ist.
file1.txt: file0.txt
cat file0.txt > file1.txt
# Verwende die selben Quoting-Regeln wie die Shell
@cat file0.txt >> file1.txt
# @ unterdrückt die Ausgabe des Befehls an stdout.
-@echo 'hello'
- # - bedeutet das Make die Abarbeitung fortsetzt auch wenn Fehler passieren.
+ # - bedeutet, dass Make die Abarbeitung fortsetzt auch wenn Fehler
+ # passieren.
# Versuche `make file1.txt` auf der Kommandozeile.
# Eine Regel kann mehrere Ziele und mehrere Voraussetzungen haben.
@@ -59,7 +60,7 @@ file2.txt file3.txt: file0.txt file1.txt
touch file2.txt
touch file3.txt
-# Make wird sich beschweren wenn es mehrere Rezepte für die gleiche Regel gibt.
+# Make wird sich beschweren, wenn es mehrere Rezepte für die gleiche Regel gibt.
# Leere Rezepte zählen nicht und können dazu verwendet werden weitere
# Voraussetzungen hinzuzufügen.
@@ -67,8 +68,8 @@ file2.txt file3.txt: file0.txt file1.txt
# Phony-Ziele
#-----------------------------------------------------------------------
-# Ein Phony-Ziel ist ein Ziel das keine Datei ist.
-# Es wird nie aktuell sein, daher wird Make immer versuchen es abzuarbeiten
+# Ein Phony-Ziel ist ein Ziel, das keine Datei ist.
+# Es wird nie aktuell sein, daher wird Make immer versuchen, es abzuarbeiten
all: maker process
# Es ist erlaubt Dinge ausserhalb der Reihenfolge zu deklarieren.
@@ -89,14 +90,14 @@ ex0.txt ex1.txt: maker
# Automatische Variablen & Wildcards
#-----------------------------------------------------------------------
-process: file*.txt # Eine Wildcard um Dateinamen zu Vergleichen
+process: file*.txt # Eine Wildcard um Dateinamen zu vergleichen
@echo $^ # $^ ist eine Variable die eine Liste aller
# Voraussetzungen enthält.
@echo $@ # Namen des Ziels ausgeben.
#(Bei mehreren Ziel-Regeln enthält $@ den Verursacher der Abarbeitung
#der Regel.)
@echo $< # Die erste Voraussetzung aus der Liste
- @echo $? # Nur die Voraussetzungen die nicht aktuell sind.
+ @echo $? # Nur die Voraussetzungen, die nicht aktuell sind.
@echo $+ # Alle Voraussetzungen inklusive Duplikate (nicht wie Üblich)
#@echo $| # Alle 'order only' Voraussetzungen
@@ -114,20 +115,20 @@ process: ex1.txt file0.txt
%.png: %.svg
inkscape --export-png $^
-# Muster-Vergleichs-Regeln werden nur abgearbeitet wenn make entscheidet das Ziel zu
-# erzeugen
+# Muster-Vergleichs-Regeln werden nur abgearbeitet, wenn make entscheidet das
+# Ziel zu erzeugen
# Verzeichnis-Pfade werden normalerweise bei Muster-Vergleichs-Regeln ignoriert.
# Aber make wird versuchen die am besten passende Regel zu verwenden.
small/%.png: %.svg
inkscape --export-png --export-dpi 30 $^
-# Make wird die letzte Version einer Muster-Vergleichs-Regel verwenden die es
+# Make wird die letzte Version einer Muster-Vergleichs-Regel verwenden, die es
# findet.
%.png: %.svg
@echo this rule is chosen
-# Allerdings wird make die erste Muster-Vergleicher-Regel verwenden die das
+# Allerdings wird make die erste Muster-Vergleicher-Regel verwenden, die das
# Ziel erzeugen kann.
%.png: %.ps
@echo this rule is not chosen if *.svg and *.ps are both present
@@ -171,7 +172,7 @@ name4 ?= Jean
# nicht gibt.
override name5 = David
-# Verhindert das Kommando-Zeilen Argumente diese Variable ändern können.
+# Verhindert, dass Kommando-Zeilen Argumente diese Variable ändern können.
name4 +=grey
# Werte an eine Variable anhängen (inkludiert Leerzeichen).
@@ -179,9 +180,9 @@ name4 +=grey
# Muster-Spezifische Variablen Werte (GNU Erweiterung).
echo: name2 = Sara # Wahr innerhalb der passenden Regel und auch innerhalb
# rekursiver Voraussetzungen (ausser wenn es den Graphen zerstören
- # kann wenn es zu kompilizert wird!)
+ # kann, wenn es zu kompilizert wird!)
-# Ein paar Variablen die von Make automatisch definiert werden.
+# Ein paar Variablen, die von Make automatisch definiert werden.
echo_inbuilt:
echo $(CC)
echo ${CXX}
@@ -196,7 +197,7 @@ echo_inbuilt:
# Variablen 2
#-----------------------------------------------------------------------
-# Der erste Typ von Variablen wird bei jeder verwendung ausgewertet.
+# Der erste Typ von Variablen wird bei jeder Verwendung ausgewertet.
# Das kann aufwendig sein, daher exisitert ein zweiter Typ von Variablen.
# Diese werden nur einmal ausgewertet. (Das ist eine GNU make Erweiterung)
@@ -215,7 +216,7 @@ var4 ::= good night
# Funktionen
#-----------------------------------------------------------------------
-# Make verfügt über eine vielzahl von Funktionen.
+# Make verfügt über eine Vielzahl von Funktionen.
sourcefiles = $(wildcard *.c */*.c)
objectfiles = $(patsubst %.c,%.o,$(sourcefiles))
diff --git a/docker.html.markdown b/docker.html.markdown
new file mode 100644
index 00000000..24f85247
--- /dev/null
+++ b/docker.html.markdown
@@ -0,0 +1,146 @@
+---
+language: docker
+filename: docker.bat
+contributors:
+ - ["Ruslan López", "http://javapro.org/"]
+---
+
+```
+:: download, install and run hello-world image
+docker run hello-world
+
+:: if this is the first time you should be able to see the message
+:: Unable to find image 'hello-world:latest' locally
+:: latest: Pulling from library/hello-world
+:: 1b930d010525: Pull complete
+:: Digest: sha256:4fe721ccc2e8dc7362278a29dc660d833570ec2682f4e4194f4ee23e415e1064
+:: Status: Downloaded newer image for hello-world:latest
+::
+:: Hello from Docker!
+:: This message shows that your installation appears to be working correctly.
+::
+:: To generate this message, Docker took the following steps:
+:: 1. The Docker client contacted the Docker daemon.
+:: 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
+:: (amd64)
+:: 3. The Docker daemon created a new container from that image which runs the
+:: executable that produces the output you are currently reading.
+:: 4. The Docker daemon streamed that output to the Docker client, which sent it
+:: to your terminal.
+::
+:: To try something more ambitious, you can run an Ubuntu container with:
+:: $ docker run -it ubuntu bash
+::
+:: Share images, automate workflows, and more with a free Docker ID:
+:: https://hub.docker.com/
+::
+:: For more examples and ideas, visit:
+:: https://docs.docker.com/get-started/
+
+:: now lets see currently running images
+docker ps
+:: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
+:: NAMES
+
+:: lets see the images we have ran previously
+docker ps -a
+
+:: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
+:: NAMES
+:: 4a76281f9c53 hello-world "/hello" 2 minutes ago Exited (0) 2 minutes ago
+:: happy_poincare
+:: the name part is generated automatically so it probably will be different for you
+
+:: let's remove our previously generated image
+docker rm happy_poincare
+
+:: lets test if it was really deleted
+docker ps -a
+:: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
+:: NAMES
+
+:: specify a custom name for the container
+docker run --name test_container hello-world
+:: Hello from Docker!
+:: This message shows that your installation appears to be working correctly.
+::
+:: To generate this message, Docker took the following steps:
+:: 1. The Docker client contacted the Docker daemon.
+:: 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
+:: (amd64)
+:: 3. The Docker daemon created a new container from that image which runs the
+:: executable that produces the output you are currently reading.
+:: 4. The Docker daemon streamed that output to the Docker client, which sent it
+:: to your terminal.
+::
+:: To try something more ambitious, you can run an Ubuntu container with:
+:: $ docker run -it ubuntu bash
+::
+:: Share images, automate workflows, and more with a free Docker ID:
+:: https://hub.docker.com/
+::
+:: For more examples and ideas, visit:
+:: https://docs.docker.com/get-started/
+
+docker ps -a
+:: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
+:: NAMES
+:: d345fe1a4f41 hello-world "/hello" About a minute ago Exited (0) About a minute ago
+:: test_container
+:: as you can see the name is now what we have specified
+
+:: retireve logs from a named container
+docker logs test_container
+:: Hello from Docker!
+:: This message shows that your installation appears to be working correctly.
+::
+:: To generate this message, Docker took the following steps:
+:: 1. The Docker client contacted the Docker daemon.
+:: 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
+:: (amd64)
+:: 3. The Docker daemon created a new container from that image which runs the
+:: executable that produces the output you are currently reading.
+:: 4. The Docker daemon streamed that output to the Docker client, which sent it
+:: to your terminal.
+::
+:: To try something more ambitious, you can run an Ubuntu container with:
+:: $ docker run -it ubuntu bash
+::
+:: Share images, automate workflows, and more with a free Docker ID:
+:: https://hub.docker.com/
+::
+:: For more examples and ideas, visit:
+:: https://docs.docker.com/get-started/
+
+docker rm test_container
+
+docker run ubuntu
+:: Unable to find image 'ubuntu:latest' locally
+:: latest: Pulling from library/ubuntu
+:: 2746a4a261c9: Pull complete
+:: 4c1d20cdee96: Pull complete 0d3160e1d0de: Pull complete c8e37668deea: Pull complete Digest: sha256:250cc6f3f3ffc5cdaa9d8f4946ac79821aafb4d3afc93928f0de9336eba21aa4
+:: Status: Downloaded newer image for ubuntu:latest
+
+docker ps -a
+:: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
+:: NAMES
+:: c19e9e5b000a ubuntu "/bin/bash" 5 seconds ago Exited (0) 4 seconds ago
+:: relaxed_nobel
+
+:: running a container in an interactive mode
+docker run -it ubuntu
+:: root@e2cac48323d2:/# uname
+:: Linux
+:: root@e2cac48323d2:/# exit
+:: exit
+
+docker rm relaxed_nobel
+
+docker ps -a
+:: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
+:: NAMES
+:: e2cac48323d2 ubuntu "/bin/bash" 2 minutes ago Exited (0) About a minute ago
+:: nifty_goldwasser
+
+docker rm nifty_goldwasser
+```
\ No newline at end of file
diff --git a/dynamic-programming.html.markdown b/dynamic-programming.html.markdown
index c73b1845..5d260206 100644
--- a/dynamic-programming.html.markdown
+++ b/dynamic-programming.html.markdown
@@ -3,6 +3,7 @@ category: Algorithms & Data Structures
name: Dynamic Programming
contributors:
- ["Akashdeep Goel", "http://github.com/akashdeepgoel"]
+ - ["Miltiadis Stouras", "https://github.com/mstou"]
---
# Dynamic Programming
@@ -48,6 +49,15 @@ for i=0 to n-1
## Online Resources
-* [codechef](https://www.codechef.com/wiki/tutorial-dynamic-programming)
+* MIT 6.006: [Lessons 19,20,21,22](https://www.youtube.com/playlist?list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb)
+* TopCoder: [Dynamic Programming from Novice to Advanced](https://www.topcoder.com/community/data-science/data-science-tutorials/dynamic-programming-from-novice-to-advanced/)
+* [CodeChef](https://www.codechef.com/wiki/tutorial-dynamic-programming)
* [InterviewBit](https://www.interviewbit.com/courses/programming/topics/dynamic-programming/)
+* GeeksForGeeks:
+ * [Overlapping Subproblems](https://www.geeksforgeeks.org/dynamic-programming-set-1/)
+ * [Tabulation vs Memoization](https://www.geeksforgeeks.org/tabulation-vs-memoizatation/)
+ * [Optimal Substructure Property](https://www.geeksforgeeks.org/dynamic-programming-set-2-optimal-substructure-property/)
+ * [How to solve a DP problem](https://www.geeksforgeeks.org/solve-dynamic-programming-problem/)
+* [How to write DP solutions](https://www.quora.com/Are-there-any-good-resources-or-tutorials-for-dynamic-programming-DP-besides-the-TopCoder-tutorial/answer/Michal-Danilák)
+And a [quiz](https://www.commonlounge.com/discussion/cdbbfe83bcd64281964b788969247253) to test your knowledge.
diff --git a/el-gr/python3-gr.html.markdown b/el-gr/python3-gr.html.markdown
new file mode 100644
index 00000000..08c3d4aa
--- /dev/null
+++ b/el-gr/python3-gr.html.markdown
@@ -0,0 +1,1030 @@
+---
+language: python3
+contributors:
+ - ["Louie Dinh", "http://pythonpracticeprojects.com"]
+ - ["Steven Basart", "http://github.com/xksteven"]
+ - ["Andre Polykanine", "https://github.com/Oire"]
+ - ["Zachary Ferguson", "http://github.com/zfergus2"]
+ - ["evuez", "http://github.com/evuez"]
+ - ["Rommel Martinez", "https://ebzzry.io"]
+ - ["Roberto Fernandez Diaz", "https://github.com/robertofd1995"]
+filename: learnpython3.py
+---
+
+Η Python δημιουργήθηκε από τον Guido van Rossum στις αρχές των 90s. Πλέον είναι μία από τις πιο
+δημοφιλείς γλώσσες. Ερωτευεται κανείς την python για τη συντακτική της απλότητα.
+Βασικά είναι εκτελέσιμος ψευδοκώδικας.
+
+Το Feedback είναι πάντα δεκτό! Μπορείτε να με βρείτε στο [@haritonaras](http://twitter.com/haritonaras)
+ή τον αρχικό συγγραφέα στο [@louiedinh](http://twitter.com/louiedinh) ή στο
+louiedinh [at] [google's email service]
+
+Σημείωση: Το παρόν άρθρο ασχολείται μόνο με την Python 3. Δείτε [εδώ](http://learnxinyminutes.com/docs/python/) αν θέλετε να μάθετε την παλιά Python 2.7
+
+```python
+
+# Τα σχόλια μίας γραμμής ξεκινούν με #
+
+""" Τα σχόλια πολλαπλών γραμμών μπορούν
+ να γραφούν με τρία ", και συχνά χρησιμοποιούνται
+ ως documentation.
+"""
+
+####################################################
+## 1. Primitive (πρωταρχικοί) Τύποι Δεδομένων και Τελεστές
+####################################################
+
+# Αφού έχει αριθμούς
+3 # => 3
+
+# Λογικά θα έχει και Μαθηματικά...
+1 + 1 # => 2
+8 - 1 # => 7
+10 * 2 # => 20
+35 / 5 # => 7.0
+
+# Η διαίρεση ακεραίων κάνει στρογγυλοποίηση προς τα κάτω για θετικούς και αρνητικούς αριθμούς
+5 // 3 # => 1
+-5 // 3 # => -2
+5.0 // 3.0 # => 1.0 # works on floats too
+-5.0 // 3.0 # => -2.0
+
+# Το αποτέλεσμα της διαίρεσης είναι πάντα float
+10.0 / 3 # => 3.3333333333333335
+
+# Modulo τελεστής
+7 % 3 # => 1
+
+# Ύψωση σε δύναμη (x**y, x στην y-οστή δύναμη)
+2**3 # => 8
+
+# Ελέγχουμε την προτεραιότητα πράξεων με παρενθέσεις
+(1 + 3) * 2 # => 8
+
+# Οι Boolean τιμές είναι primitives (Σημ.: τα κεφαλαία)
+True
+False
+
+# άρνηση με το not
+not True # => False
+not False # => True
+
+# Boolean τελεστές
+# Σημ. ότι τα "and" και "or" είναι case-sensitive
+True and False # => False
+False or True # => True
+
+# Τα True και False είναι 1 και 0 αλλά με διαφορετικά keywords
+True + True # => 2
+True * 8 # => 8
+False - 5 # => -5
+
+# Μπορούμε να δούμε τις αριθμητικές τιμές των True και False μέσω των τελεστών σύγκρισης
+0 == False # => True
+1 == True # => True
+2 == True # => False
+-5 != False # => True
+
+# Χρησιμοποιώντας τελεστές boolean σε ακεραίους, οι ακέραιοι γίνονται cast σε
+# boolean ώστε να γίνει η αποτίμηση της έκφρασης.
+# Το αποτέλεσμα όμως είναι non-cast, δηλαδή ίδιου τύπου με τα αρχικά ορίσματα
+# Μην μπερδεύετε τις bool(ints) και bitwise and/or (&,|)
+bool(0) # => False
+bool(4) # => True
+bool(-6) # => True
+0 and 2 # => 0
+-5 or 0 # => -5
+
+# Ισότητα ==
+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 and 2 < 3 # => True
+2 < 3 and 3 < 2 # => False
+# Το Chaining (αλυσίδωση? :P) κάνει το παραπάνω πιο όμορφα
+1 < 2 < 3 # => True
+2 < 3 < 2 # => False
+
+# (is vs. ==) το is ελέγχει αν δύο μεταβλητές αναφέρονται στο ίδιο αντικείμενο,
+# αλλά το == ελέγχει αν τα αντικείμενα στα οποία αναφέρονται οι μεταβλητές έχουν τις ίδιες τιμές
+a = [1, 2, 3, 4] # το a δείχνει σε μία νέα λίστα, [1,2,3,4]
+b = a # το b δείχνει στο αντικείμενο που δείχνει το a
+b is a # => True, a και b αναφέρονται στο ίδιο αντικείμενο
+b == a # => True, τα αντικείμενα των a κι b είναι ίσα
+b = [1, 2, 3, 4] # Το b δείχνει σε μία νέα λίστα, [1, 2, 3, 4]
+b is a # => False, a και b δεν αναφέρονται στο ίδιο αντικείμενο
+b == a # => True, τα αντικείμενα των a και b είναι ίσα
+
+# Τα Strings (συμβολοσειρές) δημιουργούνται με " ή '
+"This is a string."
+'This is also a string.'
+
+# Μπορούμε και να προσθέτουμε Strings, αλλά προσπαθήστε να μην το κάνετε
+"Hello " + "world!" # => "Hello world!"
+# Τα String literals (αλλά όχι οι μεταβλητές) μπορούν να συντμιθούν και χωρίς το '+'
+"Hello " "world!" # => "Hello world!"
+
+# Μπορούμε να φερθούμε σε string σαν να είναι λίστα από χαρακτήρες
+"This is a string"[0] # => 'T'
+
+# Μπορούμε να βρούμε το μήκος ενός string
+len("This is a string") # => 16
+
+# Το .format μπορεί να χρησιμοποιηθεί για να μορφοποιήσουμε strings, όπως εδώ:
+"{} can be {}".format("Strings", "interpolated") # => "Strings can be interpolated"
+
+# Μπορείς να επαναλάβεις τα ορίσματα του formatting για να γλιτώσεις λίγο χρονο
+"{0} be nimble, {0} be quick, {0} jump over the {1}".format("Jack", "candle stick")
+# => "Jack be nimble, Jack be quick, Jack jump over the candle stick"
+
+# Μπορείς να χρησιμοποιήσεις keywords αν βαριέσαι το μέτρημα.
+"{name} wants to eat {food}".format(name="Bob", food="lasagna") # => "Bob wants to eat lasagna"
+
+# Αν ο κώδικας Python 3 που γράφεις πρόκειται να τρέξει και με python 2.5 ή παλιότερη
+# μπορείς επίσης να χρησιμοποιήσεις το παλιό τρόπο για formatting:
+"%s can be %s the %s way" % ("Strings", "interpolated", "old") # => "Strings can be interpolated the old way"
+
+# Μπορείς επίσης να μορφοποιήσεις χρησιμοποιώντας τα f-strings / formatted string literals (σε Python 3.6+)
+name = "Reiko"
+f"She said her name is {name}." # => "She said her name is Reiko"
+# Μπορείς βασικά να βάλεις οποιαδήποτε έκφραση Python στα άγκιστρα και θα εμφανιστεί στο string.
+f"{name} is {len(name)} characters long."
+
+
+# το None είναι ένα αντικείμενο (object)
+None # => None
+
+# Μη χρησιμοποιείτε το σύμβολο ισότητας "==" για να συγκρίνετε αντικείμενα με το None
+# Χρησιμοποιείτε το "is". Αυτό ελέγχει για ισότητα της ταυτότητας του αντικειμένου.
+"etc" is None # => False
+None is None # => True
+
+# Τα None, 0, και τα κενά strings/lists/dicts/tuples αποτιμούνται στην τιμή False
+# All other values are True
+bool(0) # => False
+bool("") # => False
+bool([]) # => False
+bool({}) # => False
+bool(()) # => False
+
+####################################################
+## 2. Μεταβλητές (variables) και Συλλογές (collections)
+####################################################
+
+# Η Python έχει μία συνάρτηση print()
+print("I'm Python. Nice to meet you!") # => I'm Python. Nice to meet you!
+
+# By default, η συνάρτηση print() τυπώνει και ένα χαρακτήρα αλλαγής γραμμμής στο τέλος
+# Χρησιμοποιείτε το προαιρετικό όρισμο end για να τυπώνει οτιδήποτε άλλο
+print("Hello, World", end="!") # => Hello, World!
+
+# Απλός τρόπος για να πάρουμε δεδομένα εισόδου από το console
+input_string_var = input("Enter some data: ") # επιστρέφει τα δεδομένα ως string
+# Σημ.: Στις προηγούμενες εκδόσεις της Python, η μέθοδος input() ονομαζόταν raw_input()
+
+# Δεν υπάρχουν δηλώσεις, μόνο αναθέσεις τιμών.
+# Η σύμβαση είναι να χρησιμοποιούμε μικρά γράμματα με κάτω παύλες
+some_var = 5
+some_var # => 5
+
+# Η πρόσβαση σε μεταβλητή που δεν έχει λάβει τιμή είναι εξαίρεση
+# Δες τον Έλεγχο Ροής για να μάθεις περισσότερα για το χειρισμό εξαιρέσεων
+some_unknown_var # Προκαλέι ένα NameError
+
+# Η παρακάτω έκφραση μπορεί να χρησιμποιηθεί ισοδύναμα με τον τελεστή '?' της C
+"yahoo!" if 3 > 2 else 2 # => "yahoo!"
+
+# Οι λίστες κρατούν ακολουθίς
+li = []
+# Μπορείς να αρχίσεις με μία προ-γεμισμένη λίστα
+other_li = [4, 5, 6]
+
+# Και να βάλεις πράγματα στο τέλος με την μέθοδο 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 και η li γίνεται [1, 2, 4]
+# Ας βάλουμε το 3 πίσω στη θέση του
+li.append(3) # η li γίνεται πάλι [1, 2, 4, 3].
+
+# Προσπελαύνουμε τις λίστες όπως τους πίνακες σε άλλες γλώσσες
+li[0] # => 1
+# Το τελευταίο στοιχείο...
+li[-1] # => 3
+
+# Όταν βγαίνουμε εκτός ορίων της λίστας προκαλείται IndexError
+li[4] # προκαλεί IndexError
+
+# Μπορείς να δεις ranges μιας λίστας με το slice syntax ':'
+# Ο δείκτης εκίνησης περιλαμβάνεται στο διάστημα, ο δείκτης τερματισμού όχι
+# (είναι ανοικτό/κλειστό διάστημα για τους φίλους των μαθηματικών)
+li[1:3] # => [2, 4]
+# Αγνόησε την αρχή και επίστρεψε τη λίστα
+li[2:] # => [4, 3]
+# Αγνόησε το τέλος και επίστρεψε τη λίστα
+li[:3] # => [1, 2, 4]
+# Διάλεξε κάθε δεύτερο στοιχείο
+li[::2] # =>[1, 4]
+# Επίστρεψε ένα reversed αντίγραφο της λίστας
+li[::-1] # => [3, 4, 2, 1]
+# Χρησιμοποιείστε οποιαδήποτε συνδυασμό αυτών για να φτιάξετε πιο προχωρημένα slices
+# li[start:end:step]
+
+# Φτιάξε ένα αντίγραφο της λίστας χρησιμοποιώντας slices
+li2 = li[:] # => li2 = [1, 2, 4, 3] αλλά το (li2 is li) επιστρέφει False
+
+# Αφαίρεσε οποιοδήποτε στοιχείο από λίστα με την εντολή "del"
+del li[2] # η li γίνεται [1, 2, 3]
+
+# Αφαιρούμε το πρώτο στιγμυότυπο μιας τιμής
+li.remove(2) # η li γίνεται [1, 3]
+li.remove(2) # Προκαλεί ένα ValueError καθώς το 2 δεν βρίσκεται στη λίστα.
+
+# Εισαγωγή ενός στοιχείου σε συγκεκριμένη θέση
+li.insert(1, 2) # η li γίνεται πάλι [1, 2, 3]
+
+# Βρες το index (δείκτη) του πρώτου στοιχείου με τιμή ίση με το όρισμα
+li.index(2) # => 1
+li.index(4) # Προκαλεί ValueError καθώς το 4 δεν βρίσκεται στη λίστα
+
+# Μπορείς να προσθέτεις λίστες
+# Σημ.: οι τιμές των li, other_li δεν αλλάζουν.
+li + other_li # => [1, 2, 3, 4, 5, 6]
+
+# Σύντμιση λιστών με τη μέθοδο "extend()"
+li.extend(other_li) # Τώρα η li είναι [1, 2, 3, 4, 5, 6]
+
+# Ελεγχος της ύπαρξης στοιχείου σε λίστα με το "in"
+1 in li # => True
+
+# Εξατάζουμε το μήκος με "len()"
+len(li) # => 6
+
+
+# Τα Tuples είναι σαν τις λίστες αλλά είναι αμετάβλητα (immutable).
+tup = (1, 2, 3)
+tup[0] # => 1
+tup[0] = 3 # Προκαλεί TypeError
+
+# Σημειώστε ότι ένα tuple μήκους 1 πρέπει να έχει ένα κόμμα μετά το τελευταίο στοιχείο
+# αλλά τα tuples άλλων μηκών, ακόμα και μηδενικού μήκους, δεν χρειάζονται κόμμα.
+type((1)) # =>
+type((1,)) # =>
+type(()) # =>
+
+# Μπορείς να εφαρμόσεις τις περισσότερες μεθόδους των λιστών και στα tuples
+len(tup) # => 3
+tup + (4, 5, 6) # => (1, 2, 3, 4, 5, 6)
+tup[:2] # => (1, 2)
+2 in tup # => True
+
+# Μπορείς να κάνεις unpack/"ξεπακετάρεις" tuples σε μεταβλητές
+a, b, c = (1, 2, 3) # a == 1, b == 2 και c == 3
+# Μπορείς επίσης να επεκτείνεις το unpacking
+a, *b, c = (1, 2, 3, 4) # a == 1, b == [2, 3] και c == 4
+# Τα Tuples δημιουργούνται by deafult αν δεν βάλεις παρενθέσεις
+d, e, f = 4, 5, 6 # το tuple 4, 5, 6 "ξεπακετάρεται" στις μεταβλητές d, e και f
+# αντίστοιχα έτσι ώστε να γίνεται d = 4, e = 5 and f = 6
+# Δείτε πόσο εύκολα μπορούμε να εναλλάσουμε δύο τιμές
+e, d = d, e # το d παίρνει την τιμή 5 και το e παίρνει την τιμή 4
+
+
+# Τα λεξικά (Dictionaries) αποθηκεύουν απεικονίσεις από κλειδιά σε τιμές
+empty_dict = {}
+# Εδώ έχουμε ένα προ-γεμισμένο dictionary
+filled_dict = {"one": 1, "two": 2, "three": 3}
+
+# Σημ. ότι τα κλειδιά για τα dictionaries πρέπει να είναι αμετάβλητοι τύποι
+# (immutable) αυτό γίνετια για να διασφαλίσουμε ότι τα κλειδιά μπορούν να
+# μετατρέπονται σε σταθερές τιμές κατακερματισμού (hash values) για γρήγορη εύρεση.
+# Μερικοί αμετάβλητοι τύποι είναι τα ints, floats, strings, tuples.
+invalid_dict = {[1,2,3]: "123"} # => Προκαλεί TypeError: unhashable type: 'list'
+valid_dict = {(1,2,3):[1,2,3]} # Οι τιμές όμως μπορούν να έχουν οποιοδήποτε τύπο.
+
+# Βρίσκουμε τιμές με []
+filled_dict["one"] # => 1
+
+# Μπορείς να πάρεις όλα τα κλειδιά με τη μέθοδο "keys()".
+# Πρέπει να "τυλίξουμε" την κλήση με list() για να το μετατρέψουμε σε λίστα
+# Θα μιλήσουμε για αυτά αργότερα. Σημ. - σε εκδόσεις Python < 3.7, η σειρά που
+# εμφανίζονται τα κλειδιά δεν είναι εγγυημένη. Τα αποτελέσματά σας ίσως να μην
+# είναι ακριβώς ίδια με τα παρακάτω. Στην έκδοση 3.7 πάντως, τα αντικείμενα του
+# λεξικού διατηρούν τη σειρά με την οποία εισήχθησαν στο dictionary
+list(filled_dict.keys()) # => ["three", "two", "one"] σε Python <3.7
+list(filled_dict.keys()) # => ["one", "two", "three"] σε Python 3.7+
+
+# Παίρνουμε όλες τις τιμές ενός iterable με τη μέθοδο "values()". Και πάλι
+# χρειάζεται να το περιτυλίξουμε σε list()
+# Σημ. - όπως παραπάνω σχετικά με τη σειρά των keys
+list(filled_dict.values()) # => [3, 2, 1] in Python <3.7
+list(filled_dict.values()) # => [1, 2, 3] in Python 3.7+
+
+# Έλεγχος της ύπαρξης κλειδιών σε ένα dictionary με το "in"
+"one" in filled_dict # => True
+1 in filled_dict # => False
+
+# Αν ψάξεις την τιμή ανύπαρκτου κλειδιού προκαλείται KeyError
+filled_dict["four"] # KeyError
+
+# Χρησιμοποιούμε τη μέθοδο "get()" για να αποφύγουμε το KeyError
+filled_dict.get("one") # => 1
+filled_dict.get("four") # => None
+# στο δεύτερο argument της get() μπορούμε να βάλουμε μία τιμή που πρέπει να
+# επιστρέψει αν δεν υπάρχει το key που ψάχνουμε
+filled_dict.get("one", 4) # => 1
+filled_dict.get("four", 4) # => 4
+
+# το "setdefault()" εισάγει στο dictionary μόνο αν δεν υπάρχει το κλειδί
+filled_dict.setdefault("five", 5) # filled_dict["five"] γίνεται 5
+filled_dict.setdefault("five", 6) # filled_dict["five"] μένει 5 (υπαρκτό κλειδί)
+
+# Προσθήκη σε dictionary
+filled_dict.update({"four":4}) # => {"one": 1, "two": 2, "three": 3, "four": 4}
+filled_dict["four"] = 4 # β' τρόπος
+
+# Αφαίρεση κλειδιών από dictionary με del
+del filled_dict["one"] # Αφαιρεί το κλειδί "one" από το filled_dict
+
+# Από την Python 3.5 μπορείς να χρησιμοποιήσεις και πρόσθετες επιλογές για unpacking
+{'a': 1, **{'b': 2}} # => {'a': 1, 'b': 2}
+{'a': 1, **{'a': 2}} # => {'a': 2}
+
+
+
+# τα Sets -όπως όλοι περιμένουμε- αποθηκεύουν σύνολα
+empty_set = set()
+# Αρχικοποιούμε ένα set με μερικές τιμές. Ναι, μοιάζει λίγο με dictionary, Sorry.
+some_set = {1, 1, 2, 2, 3, 4} # some_set is now {1, 2, 3, 4}
+
+# Παρομοίως με τα κλειδιά του dictionary, τα στοιχεία ενός συνόλου πρέπει να είναι
+# αμετάβλητα (immutable)
+invalid_set = {[1], 1} # => Προκαλεί TypeError: unhashable type: 'list'
+valid_set = {(1,), 1}
+
+# Προσθέτουμε άλλο ένα στοιχείο στο σύνολο
+filled_set = some_set
+filled_set.add(5) # το filled_set είναι τώρα {1, 2, 3, 4, 5}
+# Τα σύνολα δεν έχουν διπλοτυπα αντικείμενα
+filled_set.add(5) # το σύνολο παραμένει ίδιο {1, 2, 3, 4, 5}
+
+# το & κάνει την τομή δύο συνόλων.
+other_set = {3, 4, 5, 6}
+filled_set & other_set # => {3, 4, 5}
+
+# και το | την ένωση
+filled_set | other_set # => {1, 2, 3, 4, 5, 6}
+
+# Η διαφορά συνόλων με το -
+{1, 2, 3, 4} - {2, 3, 5} # => {1, 4}
+
+# Το ^ επιστρέφει τη συμμετρική διαφορά
+{1, 2, 3, 4} ^ {2, 3, 5} # => {1, 4, 5}
+
+# Ελεγχος για το αν το δεξιά σύνολο είναι υπερσύνολο του δεξιού
+{1, 2} >= {1, 2, 3} # => False
+
+# Ελεγχος για το αν το δεξιά σύνολο είναι υποσύνολο του δεξιού
+{1, 2} <= {1, 2, 3} # => True
+
+# με το in κάνουμε έλεγχο ύπαρξης στοιχείο σε σετ
+2 in filled_set # => True
+10 in filled_set # => False
+
+
+
+####################################################
+## 3. Έλεγχος Ροής και Iterables
+####################################################
+
+# Φτιάχνουμε μία μεταβλητή
+some_var = 5
+
+# Εδώ έχουμε ένα if statement. Η στοίχιση είναι σημαντική στην Python!
+# Η σύμβαση είναι να χρησιμοποιούμε 4 κενά, όχι tabs.
+# Το παρακάτω τυπώνει "some_var is smaller than 10"
+if some_var > 10:
+ print("some_var is totally bigger than 10.")
+elif some_var < 10: # το (else if) -> elif μέρος είναι προαιρετικό.
+ print("some_var is smaller than 10.")
+else: # και το else είναι προαιρετικό.
+ print("some_var is indeed 10.")
+
+
+"""
+τα for loops τρέχουν πάνω σε lists
+το παρακάτω τυπώνει:
+ dog is a mammal
+ cat is a mammal
+ mouse is a mammal
+"""
+for animal in ["dog", "cat", "mouse"]:
+ # You can use format() to interpolate formatted strings
+ print("{} is a mammal".format(animal))
+
+"""
+το "range(number)" επιστρέφει ένα iterable με αριθμούς
+από το μηδέν μέχρι τον δωσμένο αριθμό number (κλειστό/ανοικτό διάστημα)
+Το παρακάτω τυπώνει:
+ 0
+ 1
+ 2
+ 3
+"""
+for i in range(4):
+ print(i)
+
+"""
+το "range(lower, upper)" επιστρέφει ένα iterable με αριθμούς
+από το lower εώς το upper (κλειστό/ανοικτό διάστημα)
+το παρακάτω τυπώνει:
+ 4
+ 5
+ 6
+ 7
+"""
+for i in range(4, 8):
+ print(i)
+
+"""
+το "range(lower, upper, step)" επιστρέφει ένα iterable με αριθμούς
+από το lower μέχρι το upper, με βήμα step
+αν δεν δώσουμε τιμή βήματος, το default βήμα είναι 1.
+το παρακάτω τυπώνει:
+ 4
+ 6
+"""
+for i in range(4, 8, 2):
+ print(i)
+"""
+
+τα While loops τρέχουν μέχρι μία συνθήκη να γίνει ψευδής.
+το παρακάτω τυπώνει:
+ 0
+ 1
+ 2
+ 3
+"""
+x = 0
+while x < 4:
+ print(x)
+ x += 1 # Shorthand for x = x + 1
+
+# Χειριζόμαστε εξαιρέσεις με ένα try/except block
+try:
+ # Χρησιμοποιούμε το "raise" για να πετάξουμε ένα error
+ raise IndexError("This is an index error")
+except IndexError as e:
+ pass # το Pass δεν κάνει τίποτα. Συνήθως κάνουμε ανάκτηση.
+except (TypeError, NameError):
+ pass # Μπορούμε να χειριζόμαστε πολλές εξαιρέσεις μαζί, αν χρειαστεί
+else: # Προαιρετικό στο try/except block. Πρέπει να ακολουθεί όλα τα except blocks
+ print("All good!") # τρέχει μόνο αν ο κώδικας στο try δεν προκαλεί εξαιρέσεις
+finally: # Εκτελείται ό,τι και να γίνει
+ print("We can clean up resources here")
+
+# Αντί για try/finally για να καθαρίσουμε τους πόρους, μπορούμε να χρησιμοποιούμε το
+# with expression as target:
+ pass to cleanup resources you can use a with statement
+with open("myfile.txt") as f:
+ for line in f:
+ print(line)
+
+# Η Python προσφέρει μία θεμελιώδη αφαίρεση (abstraction) που λέγεται Iterable.
+# iterable είναι ένα αντικείμενο που μπορεί να χρησιμοποιηθεί ως ακολουθία.
+# Το αντικείμενο που επιστρέφει η συνάρτηση range, είναι ένα iterable.
+
+filled_dict = {"one": 1, "two": 2, "three": 3}
+our_iterable = filled_dict.keys()
+print(our_iterable) # => dict_keys(['one', 'two', 'three']).
+# Αυτό είναι ένα αντικείμενο που υλοποιεί την iterable διεπαφή μας.
+
+# μπορούμε να τρέχουμε loops πάνω του.
+for i in our_iterable:
+ print(i) # Prints one, two, three
+
+# Ωστόσο δεν μπορούμε να προσπελάσουμε τα στοιχεία του με index.
+our_iterable[1] # προκαλεί a TypeError
+
+# Ένα iterable είναι ένα αντικείμενο που ξέρει πώς να δημιουργήσει έναν iterator.
+our_iterator = iter(our_iterable)
+
+# Ο iterator μας είναι ένα αντικείμενο που μπορεί να θυμάται την κατάσταση όπως το διατρέχουμε.
+# Παίρνουμε το επόμενο αντικείμενο με το "next()"
+next(our_iterator) # => "one"
+
+# Διατηρεί την κατάσταση καθώς επαναλαμβάνουμε.
+next(our_iterator) # => "two"
+next(our_iterator) # => "three"
+
+# Όταν ο iterator έχει επιστρέψει όλα τα δεδομένα του, προκαλεί ένα μια εξαίρεση StopIteration.
+next(our_iterator) # προκαλεί StopIteration
+
+# Μπορείς να πάρεις όλα τα αντικείμενα ενός iteratior καλώντας list() πάνω του.
+list(filled_dict.keys()) # => Επιστρέφει ["one", "two", "three"]
+
+
+####################################################
+## 4. Συναρτήσεις
+####################################################
+
+# Χρησιμποιούμε το "def" για να ορίσουμε νέες συναρτήσεις
+def add(x, y):
+ print("x is {} and y is {}".format(x, y))
+ return x + y # επιστρέφει τιμές με την εντολή return
+
+# Καλούμε συναρτήσεις με παραμέτρους
+add(5, 6) # => τυπώνει "x is 5 and y is 6" και επιστρέφει 11
+
+# Ένας άλλος τρόπος να καλέσεις συνάρτησει είναι με keyword arguments (ορίσματα λέξεις-κλειδιά)
+add(y=6, x=5) # τα Keyword arguments μπορούν να δωθούν με οποιαδήποτε σειρά.
+
+# Μπορείς να ορίσεις συναρτήσεις που δέχονται μεταβλητό πλήθος ορισμάτων
+def varargs(*args):
+ return args
+
+varargs(1, 2, 3) # => (1, 2, 3)
+
+# Μπορούμε να ορίσουμε και συναρτήσεις που δέχονται μεταβλητό πλήθος keyword arguments
+def keyword_args(**kwargs):
+ return kwargs
+
+# Για να δούμε τι γίνεται αν την καλέσουμε
+keyword_args(big="foot", loch="ness") # => {"big": "foot", "loch": "ness"}
+
+
+# Μπορείς να κάνεις και τα δύο ταυτόχρονα αν θες
+def all_the_args(*args, **kwargs):
+ print(args)
+ print(kwargs)
+"""
+all_the_args(1, 2, a=3, b=4) τυπώνει:
+ (1, 2)
+ {"a": 3, "b": 4}
+"""
+
+# Όταν καλείς συναρτήσεις μπορείς να κάνεις και το αντίστροφο από args/kwargs!
+# Χρησιμοποίησε το * για να επεκτείνεις tuples και χρησιμοποίησε το ** για να επεκτείλεις kwargs
+args = (1, 2, 3, 4)
+kwargs = {"a": 3, "b": 4}
+all_the_args(*args) # ισοδύναμο με all_the_args(1, 2, 3, 4)
+all_the_args(**kwargs) # ισοδύναμο με all_the_args(a=3, b=4)
+all_the_args(*args, **kwargs) # ισοδύναμο με all_the_args(1, 2, 3, 4, a=3, b=4)
+
+# Επιστρέφουμε πλειάδα τιμών (με tuple assignments)
+def swap(x, y):
+ return y, x # Επιστρέφει πολλές τιμές ως tuple χωρίς την παρένθεση
+ # (Σημ.: οι παρενθέσεις έχουν παραλειφθεί αλλά μπορούν να γραφούν)
+
+x = 1
+y = 2
+x, y = swap(x, y) # => x = 2, y = 1
+# (x, y) = swap(x,y) # Ξανά, οι παρενθέσεις έχουν παραληφθεί αλλά μπορούν να γραφούν
+
+# Εμβέλεια συναρτήσεων
+x = 5
+
+def set_x(num):
+ # Η τοπική μεταβλητή x δεν είναι η ίδια με την global μεταβλητή x
+ x = num # => 43
+ print(x) # => 43
+
+def set_global_x(num):
+ global x
+ print(x) # => 5
+ x = num # η global μεταβλητή x τώρα είναι 6
+ print(x) # => 6
+
+set_x(43)
+set_global_x(6)
+
+
+# Η Python έχει πρώτης τάξης συναρτήσεις
+def create_adder(x):
+ def adder(y):
+ return x + y
+ return adder
+
+add_10 = create_adder(10)
+add_10(3) # => 13
+
+# Αλλά έχει και anonymous συναρτήσεις.
+(lambda x: x > 2)(3) # => True
+(lambda x, y: x ** 2 + y ** 2)(2, 1) # => 5
+
+# Υπάρχουν ενσωματωμένες συναρτήσεις μεγαλύτερης τάξης
+list(map(add_10, [1, 2, 3])) # => [11, 12, 13]
+list(map(max, [1, 2, 3], [4, 2, 1])) # => [4, 2, 3]
+
+list(filter(lambda x: x > 5, [3, 4, 5, 6, 7])) # => [6, 7]
+
+# Μπορούμε να χρησιμοποιήσουμε list comprehensions για ωραία maps και filters
+# το List comprehension αποθηκεύει την έξοδο ως μία λίστα που μπορεί και η ίδια
+# να είναι μια εμφωλευμένη λίστα
+[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]
+
+# Μπορείς επίσης να κατασκευάσεις set και dict comprehensions.
+{x for x in 'abcddeef' if x not in 'abc'} # => {'d', 'e', 'f'}
+{x: x**2 for x in range(5)} # => {0: 0, 1: 1, 2: 4, 3: 9, 4: 16}
+
+
+####################################################
+## 5. Modules
+####################################################
+
+# Μπορείς να κάνεις import modules
+import math
+print(math.sqrt(16)) # => 4.0
+
+# Μπορείς να πάρεις συγκεκριμένες συναρτήσεις από ένα module
+from math import ceil, floor
+print(ceil(3.7)) # => 4.0
+print(floor(3.7)) # => 3.0
+
+# Μπορείς να κάνεις import όλες τις συναρτήσεις από ένα module.
+# Προσοχή: δεν προτείνεται
+from math import *
+
+# Μπορείς να δημιουργείς συντομογραφίες για τα ονόματα των modules
+import math as m
+math.sqrt(16) == m.sqrt(16) # => True
+
+# Τα Python modules είναι απλά αρχεία Python. Μπορείς να δημιουργήσεις τα δικά σου
+# και να τα κάνεις import το όνομα του module είναι ίδιο με το όνομα του αρχείου
+
+# μπορείς να βρεις ποιες συναρτήσεις και γνωρίσματα ορίζονται στο module
+import math
+dir(math)
+
+# Αν έχεις ένα Python script με όνομα math.py στον ίδιο φάκελο με το τρέχον script
+# το αρχείο math.py θα φορτωθεί και όχι το built-in Python module
+# Αυτό συμβαίνει επειδή τα τοπικά αρχεία έχουν προτεραιότητα έναντι των built-in
+# βιβλιοθηκών της Python
+
+
+####################################################
+## 6. Κλάσεις - Classes
+####################################################
+
+# χρησιμοποιούμε το "class" statement για να δημιουργήσουμε μια κλάση
+class Human:
+
+ # Ένα γνώρισμα της κλάσης. Είναι κοινό για όλα τα στιγμιότυπα αυτής.
+ species = "H. sapiens"
+
+ # Βασικός initializer, καλείται όταν δημιουργείται στιγμιότυπο της κλάσης.
+ # Σημ. οι διπλές κάτω παύλες πριν και μετά υποδηλώνουν αντικείμενα
+ # ή γνωρίσματα που χρησιμοποιούνται από την Python αλλά ζουν σε ελεγχόμενα από
+ # το χρήση namespaces.
+ # Μέθοδοι (ή αντικείμενα ή γνωρίσματα) σαν τα __init__, __str__, __repr__ κλπ
+ # είναι ειδικές μέθοδοι (λέγονται και dunder (double underscore) μέθοδοι)
+ # Δεν πρέπει να δηλώνεις δικές σου τέτοιες συναρτήσεις
+ def __init__(self, name):
+ # Εκχώρησε στο attribute name του object το όρισμα
+ self.name = name
+
+ # Αρχικοποίησε την ιδιότητα
+ self._age = 0
+
+ # Μία μέθοδος στιγμιότυπου (instance method). Όλες οι μέθοδοι παίρνουν το
+ # "self" ως πρώτο όρισμα
+ def say(self, msg):
+ print("{name}: {message}".format(name=self.name, message=msg))
+
+ # Ακόμα μία instance method
+ def sing(self):
+ return 'yo... yo... microphone check... one two... one two...'
+
+ # Μία μέθοδος κλάσεις είναι κοινή ανάμεσα σε όλα τα instances.
+ # Καλούνται με calling class ώς πρώτο όρισμα
+ @classmethod
+ def get_species(cls):
+ return cls.species
+
+ # Μία στατική μέθοδος καλείται χωρίς αναφορά σε κλάση ή στιγμιότυπο
+ @staticmethod
+ def grunt():
+ return "*grunt*"
+
+ # Ένα property είναι ακριβώς σαν ένα getter.
+ # Μετατρέπει τη μέθοδο age σε ένα γνώρισμα (attribute) μόνο-για-ανάγνωση
+ # με το ίδιο όνομα.
+ # Δεν χρειάζεται να γράφουμε τετριμένους getters και setters στην Python όμως.
+ @property
+ def age(self):
+ return self._age
+
+ # Αυτό επιτρέπει στο property να γίνει set
+ @age.setter
+ def age(self, age):
+ self._age = age
+
+ # Αυτό επιτρέπει σε ένα property να διαγραφεί
+ @age.deleter
+ def age(self):
+ del self._age
+
+
+# Όταν ο διερμηνέας της Python διαβάζει αρχείο πηγαίου κώδικα τον εκτελεί όλο.
+# Αυτός ο έλεγχος του __name__ σιγουρεύει ότι αυτό το block κώδικα τρέχει μόνο
+# αυτό το module είναι το κύριο πρόγραμμα (και όχι imported)
+if __name__ == '__main__':
+ # Δημιουργούμε στιγμιότυπο κλάσης
+ i = Human(name="Ian")
+ i.say("hi") # "Ian: hi"
+ j = Human("Joel")
+ j.say("hello") # "Joel: hello"
+ # τα i και j είναι στιγμιότυπα του τύπου Human
+
+ # Καλούμε τη μέθοδο της κλάσης
+ i.say(i.get_species()) # "Ian: H. sapiens"
+ # Αλλάζουμε το κοινό attribute των αντικειμένων της κλάσης
+ Human.species = "H. neanderthalensis"
+ i.say(i.get_species()) # => "Ian: H. neanderthalensis"
+ j.say(j.get_species()) # => "Joel: H. neanderthalensis"
+
+ # Καλούμε τη static μέθοδο
+ print(Human.grunt()) # => "*grunt*"
+
+ # Δεν μπορούμε να καλέσουμε τη στατική μέθοδο με ένα στιγμιότυπο
+ # επειδή το i.grunt() θα βάλει αυτόματα το self (δηλαδή το αντικείμενο i) ως όρισμα
+ print(i.grunt()) # => TypeError: grunt() takes 0 positional arguments but 1 was given
+
+ # Ενημερώνουμε το property για αυτό το στγμιότυπο
+ i.age = 42
+ # Παίρνουμε το property
+ i.say(i.age) # => "Ian: 42"
+ j.say(j.age) # => "Joel: 0"
+ # Διαγράφουμε το property
+ del i.age
+ # i.age # => αυτό θα προκαλούσε AttributeError
+
+
+####################################################
+## 6.1 Κληρονομικότητα - Inheritance
+####################################################
+
+# Η κληρονομικότητα επιτρέπει σε νέες κλάσεις-παιδιά να οριστούν και να υιοθετήσουν
+# μεθόδους και μεταβλητές από την κλάση-γονέα.
+
+# Χρησιμοποιώντας την κλάση Human που ορίστηκε πριν ως τη βασική κλάση (ή κλάση-γονέα)
+# μπορούμε να ορίσουμε τις κλάσεις-παιδιά Superhero, που κληρονομεί μεταβλητές όπως
+# "species", "name", και "age", καθώς και μεθόδους όπως "sing" και "grunt"
+# από την κλάση Human, αλλά επίσης έχει τις δικές του ξεχωριστές ιδιότητες
+
+# Για να εκμεταλλευτείς το modularization κατά αρχείο, μπορείς να βάλεις την παραπάνω κλάση
+# σε δικό της αρχείο, ας πούμε human.py
+
+# Για να κάνουμε import συναρτήσεις από άλλα αρχεία χρησιμοποιούμε το παρακάτω format
+# from "filename-without-extension" import "function-or-class"
+
+from human import Human
+
+
+# Προσδιόρισε την/τις parent class(es) ως παραμέτρους της κλάσης που ορίζεται
+class Superhero(Human):
+
+ # Αν η κλάση-παιδί πρέπει να κληρονομήσει όλους τους οεισμούς της κλάσης-γονέα
+ # χωρίς καμία αλλαγή, μπορείς απλά να γράψεις pass (και τίποτα άλλο)
+ # αλλά σε αυτή την περίπτωση είναι σχολιασμένο για να επιτρέψει τη δημιουργία
+ # ξεχωριστής κλάσης-παιδιού:
+ # pass
+
+ # Η κλάση παιδί μπορεί να υπερφορτώσει (override) τα attributes της κλάσης από την οποία κληρονομεί
+ species = 'Superhuman'
+
+ # Τα παιδιά αυτόματα, κληρονομούν τον constructo της κλάσης-γονέα
+ # συμπεριλαμβανομένων των ορισμάτων, αλλά μπορείς και να ορίσεις πρόσθετα ορίσματα
+ # ή ορισμούς και να κάνεις override τις μεθόδους, όπως τον constructor.
+ # Αυτός ο constructor κληρονομεί το όρισμα "name" από την κλάση Human και
+ # προσθέτει τα ορίσματα "superpower" και "movie":
+ def __init__(self, name, movie=False,
+ superpowers=["super strength", "bulletproofing"]):
+
+ # πρόσθήκη επιπλέον attributes της κλάσης:
+ self.fictional = True
+ self.movie = movie
+ # έχετε το νου σας τις μεταβλητές (mutable) default τιμές, καθώς είναι κοινές
+ self.superpowers = superpowers
+
+ # Η συνάρτηση "super" επιτρέπει την πρόσβαση στις μεθόδους της κλάσης-γονέα
+ # που είναι υπερφορτωμένες από το παιδί. Σε αυτή την περίπτωση τη μέθοδο __init__
+ # Το παρακάτω καλεί τον constructor της κλάσης-γονέα:
+ super().__init__(name)
+
+ # υπερφόρτωση της μεθόδου sing
+ def sing(self):
+ return 'Dun, dun, DUN!'
+
+ # προσθήκη νέας μεθόδου που εφαρμόζεται σε στιγμιότυπα
+ def boast(self):
+ for power in self.superpowers:
+ print("I wield the power of {pow}!".format(pow=power))
+
+
+if __name__ == '__main__':
+ sup = Superhero(name="Tick")
+
+ # Έλεγχος για το αν το στιγμιότυπο sup ανήκει στην κλάση Human
+ if isinstance(sup, Human):
+ print('I am human')
+ if type(sup) is Superhero:
+ print('I am a superhero')
+# TODO:
+ # Παίρνουμε το Method Resolution search Order που χρησιμοποιούν οι getattr() και super()
+ # Αυτό το attribute είναι δυναμικό και μπορεί να ανανεωθεί
+ print(Superhero.__mro__) # => (,
+ # => , )
+
+ # Καλούμε μέθοδο της κλάσης-γονέα, αλλά χρησιμοποιεί το δικό της attribute
+ print(sup.get_species()) # => Superhuman
+
+ # Καλεί την υπερφορτωμένη μέθοδο
+ print(sup.sing()) # => Dun, dun, DUN!
+
+ # Καλεί μέθοδο από την κλάση Human
+ sup.say('Spoon') # => Tick: Spoon
+
+ # Καλεί μέθοδο που υπάρχει μόνο στην κλάση Superhero
+ sup.boast() # => I wield the power of super strength!
+ # => I wield the power of bulletproofing!
+
+ # Κληρονομημένο class attribute
+ sup.age = 31
+ print(sup.age) # => 31
+
+ # Attribute που υπάρχει μόνο στην μέσα στην κλάση Superhero
+ print('Am I Oscar eligible? ' + str(sup.movie))
+
+####################################################
+## 6.2 Πολλαπλή Κληρονομικότητα - Multiple Inheritance
+####################################################
+
+# Ένας ακόμη ορισμός κλάσης
+# bat.py
+class Bat:
+
+ species = 'Baty'
+
+ def __init__(self, can_fly=True):
+ self.fly = can_fly
+
+ # Αυτή η κλάση έχει επίσης μία μέθοδο say
+ def say(self, msg):
+ msg = '... ... ...'
+ return msg
+
+ # Και τη δική της μέθοδο sonar
+ def sonar(self):
+ return '))) ... ((('
+
+if __name__ == '__main__':
+ b = Bat()
+ print(b.say('hello'))
+ print(b.fly)
+
+
+# Και ορίζουμε μία ακόμα κλάση που κληρονομεί από τις κλάσεις Superhero και Bat
+# superhero.py
+from superhero import Superhero
+from bat import Bat
+
+# Ας πούμε αυτή την κλάση Batman
+class Batman(Superhero, Bat):
+
+ def __init__(self, *args, **kwargs):
+ # Τυπικά γα να κληρονομήουμε attributes πρέπει να καλέσουμε τη super:
+ # super(Batman, self).__init__(*args, **kwargs)
+ # Ωστόσο έχουμε να κάνουμε με πολλαπλή κληρονομικότητα εδώ, και το super()
+ # δουλεύει μόνο με την αμέσως ανώτερη κλάση στην ιεραρχία.
+ # Οπότε, καλούμε ρητά την __init__ για όλους τους πρόγονους
+ # Η χρήση των *args και **kwargs επιτρέπει έναν καθαρό τρόπο για να περνάμε ορίσματα
+ # με κάθε κλάση-γονέα να "βγάζει μία φλούδα από το κρεμμύδι".
+ Superhero.__init__(self, 'anonymous', movie=True,
+ superpowers=['Wealthy'], *args, **kwargs)
+ Bat.__init__(self, *args, can_fly=False, **kwargs)
+ # υπερφορτώνουμε την τιμή του γνωρίσματος name
+ self.name = 'Sad Affleck'
+
+ def sing(self):
+ return 'nan nan nan nan nan batman!'
+
+
+if __name__ == '__main__':
+ sup = Batman()
+
+ #
+ # Λάβε το Method Resolution search Order που χρησιμοποιείται από το getattr() και το super().
+ # Αυτό το attribute είναι δυναμικό και μπορεί να ενημερωθεί
+ print(Batman.__mro__) # => (,
+ # => ,
+ # => ,
+ # => , )
+
+ # Καλεί την μέθοδο της κλάσης-πατέρα αλλά χρησιμοποιεί το attribute της δικής του κλάσης
+ print(sup.get_species()) # => Superhuman
+
+ # Καλεί την υπερφορτωμένη μέθοδο
+ print(sup.sing()) # => nan nan nan nan nan batman!
+
+ # Καλεί μέθοδο από την κλάση Human, επειδή μετράει η σειρά της κληρονομιάς
+ sup.say('I agree') # => Sad Affleck: I agree
+
+ # Καλεί μέθοδο που ανήκει μόνο στον δεύτερο πρόγονο
+ print(sup.sonar()) # => ))) ... (((
+
+ # Attribute της κληρονομημένης κλάσης
+ sup.age = 100
+ print(sup.age) # => 100
+
+ # Κληρονομούμενο attribute από τον δεύτερο πρόγονο του οποίου η default τιμή
+ # έχει υπερφορτωθεί.
+ print('Can I fly? ' + str(sup.fly)) # => Can I fly? False
+
+
+
+####################################################
+## 7. Προχωρημένα
+####################################################
+
+# Με τους Generators μπορείς να γράψεις τεμπέλικο κώδικα.
+def double_numbers(iterable):
+ for i in iterable:
+ yield i + i
+# Οι Generators είναι αποδοτικοί από άποψη μνήμης επειδή φορτώνουν μόνο τα δεδομένα
+# που είναι αναγκαία για να επεξεργαστούμε την επόμενη τιμή του iterable.
+# Αυτό μας επιτρέπει να κάνουμε πράξεις σε τιμές που υπό άλλες συνθήκες θα ήταν
+# απαγορευτικά μεγάλες.
+for i in double_numbers(range(1, 900000000)): # το `range` είναι ένας generator.
+ print(i)
+ if i >= 30:
+ break
+
+# Όπως μπορείς να δημιουργήσεις list comprehension, έτσι μπορείς να δημιουργήσεις και
+# generator comprehensions
+values = (-x for x in [1,2,3,4,5])
+for x in values:
+ print(x) # τυπώνει -1 -2 -3 -4 -5 στο console/terminal
+
+# Μπορείς επίσης να μετατρέψεις ένα generator comprehension απευθείας σε λίστα.
+values = (-x for x in [1,2,3,4,5])
+gen_to_list = list(values)
+print(gen_to_list) # => [-1, -2, -3, -4, -5]
+
+
+# Decorators
+# σε αυτό το παράδειγμα το `beg` τυλίγει το `say`. Αν το say_please είναι True τότε
+# θα αλλάξει το μήνυμα που επιστρέφεται.
+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 :(
+```
+
+## Έτοιμοι για περισσότερα?
+
+### Δωρεάν Online
+
+* [Automate the Boring Stuff with Python](https://automatetheboringstuff.com)
+* [Ideas for Python Projects](http://pythonpracticeprojects.com)
+* [The Official Docs](http://docs.python.org/3/)
+* [Hitchhiker's Guide to Python](http://docs.python-guide.org/en/latest/)
+* [Python Course](http://www.python-course.eu/index.php)
+* [First Steps With Python](https://realpython.com/learn/python-first-steps/)
+* [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/)
+* [Dive Into Python 3](http://www.diveintopython3.net/index.html)
+* [A Crash Course in Python for Scientists](http://nbviewer.jupyter.org/gist/anonymous/5924718)
diff --git a/elixir.html.markdown b/elixir.html.markdown
index 7af29202..0b717ca6 100644
--- a/elixir.html.markdown
+++ b/elixir.html.markdown
@@ -1,7 +1,7 @@
---
language: elixir
contributors:
- - ["Joao Marques", "http://github.com/mrshankly"]
+ - ["Joao Marques", "https://github.com/mrshankly"]
- ["Dzianis Dashkevich", "https://github.com/dskecse"]
- ["Ryan Plant", "https://github.com/ryanplant-au"]
- ["Ev Bogdanov", "https://github.com/evbogdanov"]
@@ -451,9 +451,9 @@ Agent.update(my_agent, fn colors -> ["blue" | colors] end)
## References
-* [Getting started guide](http://elixir-lang.org/getting-started/introduction.html) from the [Elixir website](http://elixir-lang.org)
+* [Getting started guide](https://elixir-lang.org/getting-started/introduction.html) from the [Elixir website](https://elixir-lang.org)
* [Elixir Documentation](https://elixir-lang.org/docs.html)
* ["Programming Elixir"](https://pragprog.com/book/elixir/programming-elixir) by Dave Thomas
-* [Elixir Cheat Sheet](http://media.pragprog.com/titles/elixir/ElixirCheat.pdf)
-* ["Learn You Some Erlang for Great Good!"](http://learnyousomeerlang.com/) by Fred Hebert
+* [Elixir Cheat Sheet](https://media.pragprog.com/titles/elixir/ElixirCheat.pdf)
+* ["Learn You Some Erlang for Great Good!"](https://learnyousomeerlang.com/) by Fred Hebert
* ["Programming Erlang: Software for a Concurrent World"](https://pragprog.com/book/jaerlang2/programming-erlang) by Joe Armstrong
diff --git a/es-es/hq9+-es.html.markdown b/es-es/hq9+-es.html.markdown
new file mode 100644
index 00000000..0e1a36e1
--- /dev/null
+++ b/es-es/hq9+-es.html.markdown
@@ -0,0 +1,44 @@
+---
+language: HQ9+
+filename: hq9+-es.html
+contributors:
+ - ["Alexey Nazaroff", "https://github.com/rogaven"]
+translators:
+ - ["Roberto R", "https://github.com/rrodriguze"]
+lang: es-es
+---
+
+HQ9+ es una parodia de los lenguajes de programación esotéricos y fue creado
+por Cliff Biffle.
+El lenguaje tiene solo cuatro comandos y no está completo de Turing.
+
+```
+Solo hay cuatro comandos, representados por los siguientes cuatro caracteres
+H: imprime "Hello, world!"
+Q: imprime el código fuente del programa (ein Quine)
+9: imprime la letra de "99 Bottles of Beer"
++: aumenta el acumulador en uno (el valod del acumulador no se puede leer)
+Cualquier otro caracter es ignorado.
+
+Ok. Escribamos el programa:
+ HQ
+
+Resultado:
+ Hello world!
+ HQ
+
+HQ9+ es muy simple, pero te permite hacer cosas en él. Otros lenguajes son muy
+difíciles.Por ejemplo, el siguiente programa imprime tres copias de sí mismo en
+la pantalla:
+ QQQ
+Esto imprime:
+ QQQ
+ QQQ
+ QQQ
+```
+
+Y esto es todo. Hay muchos intérpretes para HQ9+.
+A continuación encontrarás uno de ellos.
+
++ [One of online interpreters](https://almnet.de/esolang/hq9plus.php)
++ [HQ9+ official website](http://cliffle.com/esoterica/hq9plus.html)
diff --git a/es-es/pcre-es.html.markdown b/es-es/pcre-es.html.markdown
new file mode 100644
index 00000000..279c9a39
--- /dev/null
+++ b/es-es/pcre-es.html.markdown
@@ -0,0 +1,84 @@
+---
+language: PCRE
+filename: pcre-es.txt
+contributors:
+ - ["Sachin Divekar", "http://github.com/ssd532"]
+translators:
+ - ["Roberto R", "https://github.com/rrodriguze"]
+lang: es-es
+---
+
+Una expresión regular (regex o regexp para abreviar) es una cadena especial
+utilizada para definir un patrón, por ejemplo, buscar una secuencia de
+caracteres; por ejemplo, `/^[a-z]+:/` se puede usar para extraer `http:`
+desde la URL `http://github.com/`.
+
+PCRE (Pearl Compatible Regular Expressions) es una biblioteca para expresiones
+muy similar a la Perls, desde ahí el nombre. Se trata de una de las sintaxis
+más comunes para escribir expresiones regulares.
+
+Hay dos tipos de metacaracteres (caracteres con una función especial):
+
+* Caracteres reconocidos en todas partes excepto corchetes
+
+```
+ \ caracter de escape
+ ^ buscar al principio de la cadena (o línea, en modo multilínea)
+ $ busca al final de la cadena (o línea, en modo multilínea)
+ . cualquier caracter exceptoo las nuevas líneas
+ [ inicio de clase de caracter
+ | condiciones alternativas del separador
+ ( inicio del subpatrón
+ ) fin del subpatrón
+ ? cuantificador "0 o 1"
+ * quantificatore "0 o más"
+ + quantificatore "1 o más"
+ { inicio de cuantificador numérico
+```
+
+* Caracteres reconocidos entre corchetes
+
+```
+ \ caracter de escape
+ ^ negar la clase si es el primer caracter
+ - indica una serie de caracteres
+ [ clase de caracteres POSIX (si sigue la sintaxis POSIX)
+ ] termina la clase de caracteres
+```
+
+PCRE también proporciona clases de caracteres predefinidas
+
+```
+ \d cifra decimal
+ \D cifra NO decimal
+ \h espacio horizontal vacío
+ \H espacio horizontal NO vacío
+ \s espacio
+ \S NO esoacui
+ \v espacio vertical vacío
+ \V espacio vertical NO vacío
+ \w palabra
+ \W "NO palabra"
+```
+
+## Ejemplos
+
+Usaremos la siguiente cadena para nuestras pruebas:
+
+```
+66.249.64.13 - - [18/Sep/2004:11:07:48 +1000] "GET /robots.txt HTTP/1.0" 200 468 "-" "Googlebot/2.1"
+```
+
+Se trata de una línea de log del servidor web Apache.
+
+| Regex | Resultado | Comentario |
+| :---- | :-------------- | :------ |
+| `GET` | GET | Busque exactamente la cadena "GET" (distingue entre mayúsculas y minúsculas) |
+| `\d+.\d+.\d+.\d+` | 66.249.64.13 | `\d+` identifica uno o más (cuantificador `+`) números [0-9], `\.` identifica el caracter `.` |
+| `(\d+\.){3}\d+` | 66.249.64.13 | `(\d+\.){3}` busca el grupo (`\d+\.`) exactamente 3 veces. |
+| `\[.+\]` | [18/Sep/2004:11:07:48 +1000] | `.+` identifica cualquier caracter, excepto las nuevas líneas; `.` indica cualquier carácter |
+| `^\S+` | 66.249.64.13 | `^` buscar al inicio de la cadena, `\S+` identifica la primera cadena de caracteres que no sea espacio |
+| `\+[0-9]+` | +1000 | `\+` identifica el caracter `+`. `[0-9]` indica una cifra de 0 a 9. La expresión es equivalente a `\+\d+` |
+
+## Otros recursos
+[Regex101](https://regex101.com/) - probador de expresiones regulares
diff --git a/go.html.markdown b/go.html.markdown
index ae99535b..4fc155b5 100644
--- a/go.html.markdown
+++ b/go.html.markdown
@@ -30,6 +30,12 @@ Go comes with a good standard library and a sizeable community.
/* Multi-
line comment */
+ /* A build tag is a line comment starting with // +build
+ and can be execute by go build -tags="foo bar" command.
+ Build tags are placed before the package clause near or at the top of the file
+ followed by a blank line or other line comments. */
+// +build prod, dev, test
+
// A package clause starts every source file.
// Main is a special name declaring an executable rather than a library.
package main
diff --git a/haskell.html.markdown b/haskell.html.markdown
index 90d47c27..1cc79ec9 100644
--- a/haskell.html.markdown
+++ b/haskell.html.markdown
@@ -293,7 +293,13 @@ foldr (\x y -> 2*x + y) 4 [1,2,3] -- 16
-- 7. Data Types
----------------------------------------------------
--- Here's how you make your own data type in Haskell
+-- A data type is declared with a 'type constructor' on the left
+-- and one or more 'data constructors' on the right, separated by
+-- the pipe | symbol. This is a sum/union type. Each data constructor
+-- is a (possibly nullary) function that creates an object of the type
+-- named by the type constructor.
+
+-- This is essentially an enum
data Color = Red | Blue | Green
@@ -304,7 +310,62 @@ say Red = "You are Red!"
say Blue = "You are Blue!"
say Green = "You are Green!"
--- Your data types can have parameters too:
+-- Note that the type constructor is used in the type signature
+-- and the data constructors are used in the body of the function
+-- Data constructors are primarily pattern-matched against
+
+-- This next one is a traditional container type holding two fields
+-- In a type declaration, data constructors take types as parameters
+-- Data constructors can have the same name as type constructors
+-- This is common where the type only has a single data constructor
+
+data Point = Point Float Float
+
+-- This can be used in a function like:
+
+distance :: Point -> Point -> Float
+distance (Point x y) (Point x' y') = sqrt $ dx + dy
+ where dx = (x - x') ** 2
+ dy = (y - y') ** 2
+
+-- Types can have multiple data constructors with arguments, too
+
+data Name = Mononym String
+ | FirstLastName String String
+ | FullName String String String
+
+-- To make things clearer we can use record syntax
+
+data Point2D = CartesianPoint2D { x :: Float, y :: Float }
+ | PolarPoint2D { r :: Float, theta :: Float }
+
+myPoint = CartesianPoint2D { x = 7.0, y = 10.0 }
+
+-- Using record syntax automatically creates accessor functions
+-- (the name of the field)
+
+xOfMyPoint = x myPoint
+
+-- xOfMyPoint is equal to 7.0
+
+-- Record syntax also allows a simple form of update
+
+myPoint' = myPoint { x = 9.0 }
+
+-- myPoint' is CartesianPoint2D { x = 9.0, y = 10.0 }
+
+-- Even if a type is defined with record syntax, it can be declared like
+-- a simple data constructor. This is fine:
+
+myPoint'2 = CartesianPoint2D 3.3 4.0
+
+-- It's also useful to pattern match data constructors in `case` expressions
+
+distanceFromOrigin x =
+ case x of (CartesianPoint2D x y) -> sqrt $ x ** 2 + y ** 2
+ (PolarPoint2D r _) -> r
+
+-- Your data types can have type parameters too:
data Maybe a = Nothing | Just a
@@ -313,8 +374,98 @@ Just "hello" -- of type `Maybe String`
Just 1 -- of type `Maybe Int`
Nothing -- of type `Maybe a` for any `a`
+-- For convenience we can also create type synonyms with the 'type' keyword
+
+type String = [Char]
+
+-- Unlike `data` types, type synonyms need no constructor, and can be used
+-- anywhere a synonymous data type could be used. Say we have the
+-- following type synonyms and items with the following type signatures
+
+type Weight = Float
+type Height = Float
+type Point = (Float, Float)
+getMyHeightAndWeight :: Person -> (Height, Weight)
+findCenter :: Circle -> Point
+somePerson :: Person
+someCircle :: Circle
+distance :: Point -> Point -> Float
+
+-- The following would compile and run without issue,
+-- even though it does not make sense semantically,
+-- because the type synonyms reduce to the same base types
+
+distance (getMyHeightAndWeight somePerson) (findCenter someCircle)
+
----------------------------------------------------
--- 8. Haskell IO
+-- 8. Typeclasses
+----------------------------------------------------
+
+-- Typeclasses are one way Haskell does polymorphism
+-- They are similar to interfaces in other languages
+-- A typeclass defines a set of functions that must
+-- work on any type that is in that typeclass.
+
+-- The Eq typeclass is for types whose instances can
+-- be tested for equality with one another.
+
+class Eq a where
+ (==) :: a -> a -> Bool
+ (/=) :: a -> a -> Bool
+ x == y = not (x /= y)
+ x /= y = not (x == y)
+
+-- This defines a typeclass that requires two functions, (==) and (/=)
+-- It also declares that one function can be declared in terms of another
+-- So it is enough that *either* the (==) function or the (/=) is defined
+-- And the other will be 'filled in' based on the typeclass definition
+
+-- To make a type a member of a type class, the instance keyword is used
+
+instance Eq TrafficLight where
+ Red == Red = True
+ Green == Green = True
+ Yellow == Yellow = True
+ _ == _ = False
+
+-- Now we can use (==) and (/=) with TrafficLight objects
+
+canProceedThrough :: TrafficLight -> Bool
+canProceedThrough t = t /= Red
+
+-- You can NOT create an instance definition for a type synonym
+
+-- Functions can be written to take typeclasses with type parameters,
+-- rather than types, assuming that the function only relies on
+-- features of the typeclass
+
+isEqual (Eq a) => a -> a -> Bool
+isEqual x y = x == y
+
+-- Note that x and y MUST be the same type, as they are both defined
+-- as being of type parameter 'a'.
+-- A typeclass does not state that different types in the typeclass can
+-- be mixed together.
+-- So `isEqual Red 2` is invalid, even though 2 is an Int which is an
+-- instance of Eq, and Red is a TrafficLight which is also an instance of Eq
+
+-- Other common typeclasses are:
+-- Ord for types that can be ordered, allowing you to use >, <=, etc.
+-- Read for types that can be created from a string representation
+-- Show for types that can be converted to a string for display
+-- Num, Real, Integral, Fractional for types that can do math
+-- Enum for types that can be stepped through
+-- Bounded for types with a maximum and minimum
+
+-- Haskell can automatically make types part of Eq, Ord, Read, Show, Enum,
+-- and Bounded with the `deriving` keyword at the end of the type declaration
+
+data Point = Point Float Float deriving (Eq, Read, Show)
+
+-- In this case it is NOT necessary to create an 'instance' definition
+
+----------------------------------------------------
+-- 9. Haskell IO
----------------------------------------------------
-- While IO can't be explained fully without explaining monads,
@@ -395,7 +546,7 @@ main'' = do
----------------------------------------------------
--- 9. The Haskell REPL
+-- 10. The Haskell REPL
----------------------------------------------------
-- Start the repl by typing `ghci`.
diff --git a/hdl.html.markdown b/hdl.html.markdown
new file mode 100644
index 00000000..cad07817
--- /dev/null
+++ b/hdl.html.markdown
@@ -0,0 +1,231 @@
+---
+language: hdl
+filename: learnhdl.hdl
+contributors:
+ - ["Jack Smith", "https://github.com/JSmithTech2019"]
+---
+
+HDL (hardware description language) is a specialized language used to describe the structure/behavior of real world circuits.
+
+It is used by circuit designers to simulate circuits and logic prior to wiring and fabricating a hardware circuit.
+
+HDL allows circuit designers to simulate circuits at a high level without being connected to specific components.
+
+## Basic building blocks & introduction to the language---
+This programming language is built by simulating hardware chips and wiring. Normal programming functions are replaced with specialized chips that are added to the current wiring desing. Every base chip must be written as it's own file and imported to be used in the current chip, though they may be reused as often as desired.
+
+```verilog
+// Single line comments start with two forward slashes.
+
+/*
+ * Multiline comments can be written using '/*' and 'star/'.
+ * These are often used as comments.
+ *
+ * Note that they cannot be nested and will end at the first 'star/'.
+ */
+
+////////////////////////////////////////////////////
+// 1. Chips & Components
+////////////////////////////////////////////////////
+/*
+ * Unlike other languages HDL creates an individual chip (function) per file
+ * These are defined with a name, input arguments, output arguments
+ * and finally the parts/logic of that specific chip.
+ */
+
+// Note CHIP is capitalized, the chip name does not need to be.
+CHIP Ex {
+ IN a, // Single bit (0 or 1) variable.
+ c[16]; // 16 bit variable bus of single bit values.
+
+ OUT out[16], // 16 bit variable bus output.
+ carry; // Single bit output variable
+
+ PARTS:
+ // The functional components of the chip.
+}
+
+// Lines are ended with semicolons but can be continued using commas. The
+// whitespace is ignored.
+
+
+
+////////////////////////////////////////////////////
+// 2. Inputs, Outputs, & Variables
+////////////////////////////////////////////////////
+/*
+ * Variables and IO are treated as pins/wires and can carry a single bit
+ * of data (0 or 1).
+ */
+
+// Hardware works on low level 0's and 1's, in order to use a constant
+// high or low we use the terms true and false.
+a=false; // This is a 0 value.
+b=true; // This is a 1 value.
+
+// Inputs and outputs can be defined as single bits
+IN a, b; // Creates two single bit inputs
+
+// They can also be defined as busses act as arrays where each
+// index can contain a single bit value.
+OUT c[16]; // Creates a 16 bit output array.
+
+// Bussed values can be accessed using brackets
+a[0] // The first indexed value in the bus a.
+a[0..3] // The first 4 values in the a bus.
+// Values can also be passed in entirety. For example if the function
+// foo() takes an 8 bit input bus and outputs a 2 bit bus:
+foo(in=a[0..7], out=c); // C is now a 2 bit internal bus
+
+
+// Note that internally defined busses cannot be subbussed!
+// To access these elements, output or input them seperately:
+foo(in[0]=false, in[1..7]=a[0..6], out[0]=out1, out[1]=out2);
+// out1 and out2 can then be passed into other circuits within the design.
+
+
+
+////////////////////////////////////////////////////
+// Combining Subsystems
+////////////////////////////////////////////////////
+/*
+ * HDL relies heavily on using smaller "building block" chips to then be
+ * added into larger and more complex designs. Creating the smaller components
+ * and then adding them to the larger circuit allows for fewer lines of code
+ * as well as reduction in total rewriting of code.
+ */
+
+// We are writing the function AND that checks if inputs I and K are both one.
+// To implement this chip we will use the built in NAND gate as well as design
+// a custom NOT gate to invert a single input.
+
+// First we construct the Negation (not) chip. We will use the logically
+// complete gate NAND that is built in for this task.
+CHIP Not {
+ IN i; // Not gates only take one single bit input.
+ OUT o; // The negated value of a.
+
+ PARTS:
+ // Add the input to the built in chip, which then sends output to the NOT
+ // output. This effectively negates the given value.
+ Nand(a=i, b=i, out=o);
+}
+
+// By using the built in NAND gate we were able to construct a NOT gate
+// that works like a real world hardware logic chip. Now we must construct
+// the AND gate using these two gate primitives.
+
+// We define a two input, single output AND gate:
+CHIP And {
+ IN i, k; // Two single bit inputs.
+ OUT o; // One single bit output.
+
+ PARTS:
+ // Insert I and K into the nand gate and store the output in an internal
+ // wire called notOut.
+ Nand(a=i,b=b,out=notOut);
+
+ // Use the not gate we constructed to invert notOut and send to the AND
+ // output.
+ Not(in=notOut,out=o);
+}
+
+// Easy! Now we can use Nand, And, and Not gates in higher level circuits.
+// Many of these low level components are built in to HDL but any chip can
+// be written as a submodule and used in larger designs.
+```
+
+## Test Files
+When working with the nand2tetris hardware simulator chips written using HDL will
+then be processed against test and comparison files to test functionality of the
+simulated chip versus the expected output. To do this a test file will be loaded
+into the hardware simulator and run against the simulated hardware.
+
+```verilog
+// First the chip the test file is written for is loaded
+load .hdl
+
+// We set the output file for the simulated chip output as well as the comparison
+// file that it will be tested against. We also specify what the output is
+// expected to look like. In this case there will be two output columns, each
+// will be buffered by a single space on either side and 4 binary values in
+// the center of each column.
+output-file .out,
+compare-to .cmp,
+output-list in%B1.4.1 out%B1.4.1;
+
+// Then we set initial values for inputs to the chip. For example
+set enable1 1, // set input enable1 to 1
+set enable2 0, // set input enable2 to 0
+
+// The clock is also controlled in the test file using tick and tock. Tick is a
+// positive pulse and tock takes the clock back to 0. Clock cycles can be run
+// multiple times in a row with no other changes to inputs or outputs.
+tick,
+tock,
+
+// Finally we output the first expected value (from the test file) which is then
+// compared with the first line of real output from our HDL circuit. This output
+// can be viewed in the .out file.
+output;
+
+// An example of , a chip that takes in a 4 bit value as input and
+// adds 1 to that value could have the following as test code:
+
+// Set the input value to 0000, clock pulse, compare output from cmp file to actual out.
+set in %B0000,
+tick,
+tock,
+output;
+
+// Set the input value to 0110, clock pulse, compare output from cmp file to actual out.
+set in %B0110,
+tick,
+tock,
+output;
+
+// The expected output for case 1 should be 0001 and case 2 expects 0111, lets
+// learn a little more about comparison files before finalizing our lesson.
+```
+
+## Comparison Files
+Now lets take a look at comparison files, the files that hold what the test file
+compares with the actual output of an HDL chip in the hardware simulator!
+
+```verilog
+// Like the example above, the structure of the comparison file
+// would look something like this
+| in | out |
+| 0000 | 0001 |
+| 0110 | 0111 |
+
+// Notice how the input values specified in the test case are equivalent to the
+// `in` column of the comparison file, and that the space buffer is 1 on either side.
+
+// If the output from the HDL code we not this, such as the output below, then the
+// test will fail and the user will know that the simulated chip is not correctly designed.
+| in | out |
+| 0000 | 0001 |
+| 0110 | 0110 | // Error! The chip did not add 1 here, something went wrong.
+
+
+```
+
+This is incredibly useful as it allows designers to simulate chip logic prior to
+fabricating real life hardware and identify problems in their designs. Be warned that
+errors in the test or comparison files can lead to both false positives and also
+the more damaging false negatives so ensure that the logic is sound behind the test
+creation.
+
+
+Good luck and happy coding!
+
+## Resources
+
+* [From Nand To Tetris](https://www.nand2tetris.org)
+
+## Further Reading
+
+* [Hardware Description Language](https://en.wikipedia.org/wiki/Hardware_description_language)
+
+* [HDL Programming Fundamentals](https://www.electronicdesign.com/products/hdl-programming-fundamentals)
\ No newline at end of file
diff --git a/it-it/bash-it.html.markdown b/it-it/bash-it.html.markdown
index 099cc681..cfe58f30 100644
--- a/it-it/bash-it.html.markdown
+++ b/it-it/bash-it.html.markdown
@@ -63,7 +63,7 @@ echo ${Variabile}
# Sotto ci sono altri esempi che analizzano l'uso dell'espansione dei parametri.
# Sostituzione di stringhe nelle variabili
-echo ${Variabile/Una/A}
+echo ${Variabile/Una/La}
# Questo sostituirà la prima occorrenza di "Una" con "La"
# Sottostringa di una variabile
diff --git a/java.html.markdown b/java.html.markdown
index 4f45a268..79769352 100644
--- a/java.html.markdown
+++ b/java.html.markdown
@@ -381,7 +381,7 @@ public class LearnJava {
do {
System.out.println(fooDoWhile);
// Increment the counter
- // Iterated 99 times, fooDoWhile 0->99
+ // Iterated 100 times, fooDoWhile 0->99
fooDoWhile++;
} while(fooDoWhile < 100);
System.out.println("fooDoWhile Value: " + fooDoWhile);
diff --git a/javascript.html.markdown b/javascript.html.markdown
index ce9772ca..ad1af76a 100644
--- a/javascript.html.markdown
+++ b/javascript.html.markdown
@@ -188,7 +188,7 @@ someVar = myArray.pop(); // Remove last element and return it
// Join all elements of an array with semicolon
var myArray0 = [32,false,"js",12,56,90];
-myArray0.join(";") // = "32;false;js;12;56;90"
+myArray0.join(";"); // = "32;false;js;12;56;90"
// Get subarray of elements from index 1 (include) to 4 (exclude)
myArray0.slice(1,4); // = [false,"js",12]
diff --git a/kdb+.html.markdown b/kdb+.html.markdown
index 027b6571..680c01c1 100644
--- a/kdb+.html.markdown
+++ b/kdb+.html.markdown
@@ -771,6 +771,6 @@ select from splayed / (the columns are read from disk on request)
* [*q for mortals* q language tutorial](http://code.kx.com/q4m3/)
* [*Introduction to Kdb+* on disk data tutorial](http://code.kx.com/q4m3/14_Introduction_to_Kdb+/)
-* [q language reference](http://code.kx.com/q/ref/card/)
+* [q language reference](https://code.kx.com/q/ref/)
* [Online training courses](http://training.aquaq.co.uk/)
* [TorQ production framework](https://github.com/AquaQAnalytics/TorQ)
diff --git a/latex.html.markdown b/latex.html.markdown
index c980f5e5..e8bc6064 100644
--- a/latex.html.markdown
+++ b/latex.html.markdown
@@ -141,7 +141,7 @@ 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.
+have pre-defined LaTeX commands.
Let's write an equation to see how it's done:
$\cos(2\theta) = \cos^{2}(\theta) - \sin^{2}(\theta)$
diff --git a/linker.html.markdown b/linker.html.markdown
index ebe6233d..42839e05 100644
--- a/linker.html.markdown
+++ b/linker.html.markdown
@@ -5,5 +5,5 @@ contributors:
- ["Alexander Kovalchuk", "https://github.com/Zamuhrishka"]
---
-This article is available in [Russian](http://localhost:4567/docs/ru-ru/linker-ru/).
+This article is available in [Russian](https://learnxinyminutes.com/docs/ru-ru/linker-ru/).
diff --git a/mips.html.markdown b/mips.html.markdown
index 4134d3fa..45e16e7b 100644
--- a/mips.html.markdown
+++ b/mips.html.markdown
@@ -20,12 +20,12 @@ gateways and routers.
# Programs typically contain a .data and .text sections
.data # Section where data is stored in memory (allocated in RAM), similar to
- # variables in higher level languages
+ # variables in higher-level languages
# Declarations follow a ( label: .type value(s) ) form of declaration
hello_world: .asciiz "Hello World\n" # Declare a null terminated string
num1: .word 42 # Integers are referred to as words
- # (32 bit value)
+ # (32-bit value)
arr1: .word 1, 2, 3, 4, 5 # Array of words
arr2: .byte 'a', 'b' # Array of chars (1 byte each)
@@ -139,7 +139,7 @@ gateways and routers.
# The basic format of these branching instructions typically follow
#