diff options
-rw-r--r-- | clojure.html.markdown | 3 | ||||
-rw-r--r-- | lsf/lambda-calculus-lsf.html.markdown | 90 | ||||
-rw-r--r-- | lsf/latex-lsf.html.markdown | 146 | ||||
-rw-r--r-- | pt-br/clojure-pt.html.markdown | 3 | ||||
-rw-r--r-- | pt-br/python3-pt.html.markdown | 28 | ||||
-rw-r--r-- | swift.html.markdown | 56 | ||||
-rw-r--r-- | th-th/typescript.th.html.markdown | 2 | ||||
-rw-r--r-- | typescript.html.markdown | 2 |
8 files changed, 286 insertions, 44 deletions
diff --git a/clojure.html.markdown b/clojure.html.markdown index c94625d6..16771e25 100644 --- a/clojure.html.markdown +++ b/clojure.html.markdown @@ -416,3 +416,6 @@ Clojuredocs.org has documentation with examples for most core functions: Clojure-doc.org (yes, really) has a number of getting started articles: [http://clojure-doc.org/](http://clojure-doc.org/) + +Clojure for the Brave and True has a great introduction to Clojure and a free online version: +[https://www.braveclojure.com/clojure-for-the-brave-and-true/](https://www.braveclojure.com/clojure-for-the-brave-and-true/) diff --git a/lsf/lambda-calculus-lsf.html.markdown b/lsf/lambda-calculus-lsf.html.markdown new file mode 100644 index 00000000..36583367 --- /dev/null +++ b/lsf/lambda-calculus-lsf.html.markdown @@ -0,0 +1,90 @@ +--- +category: Algorithms & Data Structures +name: Lambda Calculus +contributors: + - ["Max Sun", "http://github.com/maxsun"] +translators: + - ["Victore Leve", "https://github.com/AcProIL"] +lang: lsf +--- + +# Calculo λ + +Calculo lambda, creato principto per Alonzo Church, es lingua de programmatura computatro maximo parvo. Quamquam non habe numero, serie de charactere vel ullo +typo de data non functionale, id pote repraesenta omne machina de Turing. + +Tres elemento compone calculo lambda: **quantitate variabile** (q.v.), +**functione** et **applicatione**. + +| Elemento | Syntaxe | Exemplo | +|----------------------|-----------------------------------|-----------| +| Quantitate variabile | `<nomine>` | `x` | +| Functione | `λ<parametro>.<corpore>` | `λx.x` | +| Applicatione | `<functione><q.v. aut functione>` | `(λx.x)a` | + +Functione fundamentale es identitate: `λx.x` cum argumento primo `x` et cum +corpore secundo `x`. In mathematica, nos scribe `id: x↦x`. + +## Quantitate variabile libero et ligato + +* In functione praecedente, `x` es q.v. ligato nam id es et in copore et + argumento. +* In `λx.y`, `y` es q.v. libero nam non es declarato ante. + +## Valutatione + +Valutatione es facto per reductione beta (reductione β) que es essentialiter +substitutione lexicale. + +Dum valutatione de formula `(λx.x)a`, nos substitue omne evento de `x` in +corpore de functione pro `a`. + +* `(λx.x)a` vale `a` +* `(λx.y)a` vale `y` + +Pote etiam crea functione de ordine supero: `(λx.(λy.x))a` vale `λy.a`. + +Etsi calculo lambda solo tracta functione de uno parametro, nos pote crea +functione cum plure argumento utente methodo de Curry: `λx.(λy.(λz.xyz))` +es scriptura informatica de formula mathematico `f: x, y, z ↦ x(y(z)))`. + +Ergo, interdum, nos ute `λxy.<corpore>` pro `λx.λy.<corpore>`. + +## Arithmetica + +### Logica de Boole + +Es nec numero nec booleano in calculo lambda. + +* «vero» es `v = λx.λy.x` +* «falso» es `f = λx.λy.y` + +Primo, nos pote defini functione «si t tunc a alio b» per `si = λtab.tab`. +Si `t` es vero, valutatione da `(λxy.x) a b` id es `a`. Similiter si `t` es +falso, nos obtine `b`. + +Secundo, nos pote defini operatore de logica: + +* «a et b» es `et = λa.λb.si a b f` +* «a vel b» es `vel = λa.λb.si a t b` +* «non a» es `non = λa.si a f t` + +### Numeros + +Nos pone: + +* `0 = λf.λx.x` (`0: f↦id`) +* `1 = λf.λx.f x` (`1: f↦f`) +* `2 = λf.λx.f(f x)` (`2: f↦f⚬f`) + +Cum mente generale, successore de numero `n` es `S n = λf.λx.f((n f) x)` +(`n+1: f↦f⚬fⁿ`). Id es **`n` est functione que da `fⁿ` ex functione `f`**. + +Postremo additione es `λab.(a S)b` + +## Ut progrede + +### In lingua anglo + +1. [A Tutorial Introduction to the Lambda Calculus](http://www.inf.fu-berlin.de/lehre/WS03/alpi/lambda.pdf) per Raúl Roja +2. [The Lambda Calculus](http://www.cs.cornell.edu/courses/cs3110/2008fa/recitations/rec26.html), CS 312 Recitation 26 diff --git a/lsf/latex-lsf.html.markdown b/lsf/latex-lsf.html.markdown new file mode 100644 index 00000000..18c2e62b --- /dev/null +++ b/lsf/latex-lsf.html.markdown @@ -0,0 +1,146 @@ +--- +language: latex +lang: lsf +contributors: + - ["Chaitanya Krishna Ande", "http://icymist.github.io"] + - ["Colton Kohnke", "http://github.com/voltnor"] + - ["Sricharan Chiruvolu", "http://sricharan.xyz"] +translators: + - ["Victore Leve", "https://github.com/AcProIL"] +filename: learn-latex-lsf.tex +--- + +```tex +% Solo existe commentario monolinea, illo incipe cum charactere % + +% LaTeX non es sicut MS Word aut OpenOffice: que scribe non es que obtine. +% Primo, scribe imperio (que semper incipe cum \) et secundo programma crea +% lima. + +% Nos defini typo de document (id es articulo aut libro aut libello etc.). +% Optione muta quomodo programma age, per exemplo altore de littera. +\documentclass[12pt]{article} + +% Deinde nos lista paccettos que nos vol ute. Es classe de imperio que alio +% utatore e scribe. Pote muta funda, geometria de pagina, etc. vel adde +% functionnalitate. +\usepackage{euler} +\usepackage{graphicx} + +% Ultimo statione ante scribe documento es metadata id es titulo, auctore et +% tempore. Charactere ~ es spatio que non pote es secato. +\title{Disce LaTeX in~Y Minutos!} +\author{Chaitanya Krishna Ande, Colton Kohnke \& Sricharan Chiruvolu} +\date{\today} + +% Principio de documento +\begin{document} + \maketitle % Nos vol adfige metadata. + + % Saepe nos adde breviario us describe texto. + \begin{abstract} + Hic es exmplo de documento sibre cum lingua de LaTeX. + \end{abstract} + + % \section crea sectione cum titulo dato sicut sperato + \section{Introductione} + + Traductione de hic cursu es importante. + + \subsection{Methodo} + Iste parte non es utile. + + \subsubsection{Methodo peculiare} + % \label da nomine ad parte ut post ute imperio de referentia \ref. + \label{subsec:metpec} + + % Cum asteritco nos indice que nos non vol numero ante titulo de sectione. + \section*{Me non aestima numero…} + + …sed de Peano aut de Church. + + \section{Listas} + + Que me debe scribe: + + \begin{enumerate} % `enumerate` designa lista cum numeros contra `itemize`. + \item articulo, + \item libro, + \item cursu. + \end{enumerate} + + \section{Mathematica} + + Methematicas ute multo programma LaTeX ut communica suo decooperito. + Illo necessita symbolo multo instar de logica vel sagitta vel littera cum + accento. + + % Fornula es in linea si nos scribe inter \( et \) (aut duo $) sed magno si + % nos ute \[ et \]. + \(\forall n\in N_0\) % pro omne n in classe N₀ + \[^{3}/_{4} = \frac{3}{4} < 1\] % ¾ < 1 + + Alphabeta graeco contine littera $\alpha$. + + % Ut scribe equatione cum numero et nomine, existe circumiecto `equation`. + \begin{equation} + c^2 = a^2 + b^2 + \label{eq:pythagoras} + \end{equation} + + \begin{equation} + % Summa ab 1 ad n de numeros dimidio de n(n+1) + \sum_{i=1}^n i = \frac{n(n+1)}{2} + \end{equation} + + \section{Figura} + + % Nos adde imagine `right-triangle.png` cum latitudo de quinque centimetro, + % horizontaliter in centro et cum capite «Triangulo recto». + \begin{figure} + \centering + \includegraphics[width=5cm]{right-triangle.png} + \caption{Triangulo recto} + \label{fig:right-triangle} + \end{figure} + + \subsection{Tabula} + + \begin{table} + \caption{Título para la tabla.} + % Argumento de `tabular` es lineamente de columna. + % c: centro, l: sinistra, r: destra, | linea verticale + \begin{tabular}{c|cc} + Numero & B & C \\ + \hline % linea horizontale + 1 & et & aut \\ + 2 & atque & vel + \end{tabular} + \end{table} + + \section{Stylo} + + Texto pote es \textbf{crasso} et \textit{italico}! + + \section{Texto puro} + + % Circumiecto `verbatim` ignora imperio, nos saepe ute id pro monstra + % programma. + \begin{verbatim} +from math import tau, e +print(e ** tau) + \end{verbatim} + + \section{Et plus!} + LaTeX habe facultate crea bibliographia, paritura, scaccarip… cum paccetto + dedicato. +\end{document} +``` + +Imperio ut conge documento es `pdflatex documento` in terminale. + +## Ut progrede + +### In lingua anglo + +* [LaTeX tutorial](http://www.latex-tutorial.com/) per Claudio Vellage diff --git a/pt-br/clojure-pt.html.markdown b/pt-br/clojure-pt.html.markdown index b88d4eec..409394f2 100644 --- a/pt-br/clojure-pt.html.markdown +++ b/pt-br/clojure-pt.html.markdown @@ -382,3 +382,6 @@ Clojuredocs.org tem documentação com exemplos para quase todas as funções pr Clojure-doc.org tem um bom número de artigos para iniciantes: [http://clojure-doc.org/](http://clojure-doc.org/) + +Clojure for the Brave and True é um livro de introdução ao Clojure e possui uma versão gratuita online: +[https://www.braveclojure.com/clojure-for-the-brave-and-true/](https://www.braveclojure.com/clojure-for-the-brave-and-true/) diff --git a/pt-br/python3-pt.html.markdown b/pt-br/python3-pt.html.markdown index b72c732a..23a9b3ce 100644 --- a/pt-br/python3-pt.html.markdown +++ b/pt-br/python3-pt.html.markdown @@ -7,6 +7,7 @@ contributors: - ["Zachary Ferguson", "http://github.com/zfergus2"] translators: - ["Paulo Henrique Rodrigues Pinheiro", "http://www.sysincloud.it"] + - ["Monique Baptista", "https://github.com/bfmonique"] lang: pt-br filename: learnpython3-pt.py --- @@ -44,7 +45,7 @@ aprender o velho Python 2.7. 8 - 1 # => 7 10 * 2 # => 20 -# Números inteiros por padrão, exceto na divisão, que retorna número +# Números são inteiros por padrão, exceto na divisão, que retorna número # de ponto flutuante (float). 35 / 5 # => 7.0 @@ -64,7 +65,7 @@ aprender o velho Python 2.7. # Exponenciação (x**y, x elevado à potência y) 2**4 # => 16 -# Determine a precedência usando parêntesis +# Determine a precedência usando parênteses (1 + 3) * 2 # => 8 # Valores lógicos são primitivos (Atenção à primeira letra maiúscula) @@ -105,9 +106,8 @@ False or True # => True 1 < 2 < 3 # => True 2 < 3 < 2 # => False -# (operador 'is' e operador '==') is verifica se duas variáveis -# referenciam um mesmo objeto, mas == verifica se as variáveis -# apontam para o mesmo valor. +# 'is' verifica se duas variáveis representam o mesmo endereço +# na memória; '==' verifica se duas variáveis têm o mesmo valor a = [1, 2, 3, 4] # Referência a uma nova lista, [1, 2, 3, 4] b = a # b referencia o que está referenciado por a b is a # => True, a e b referenciam o mesmo objeto @@ -174,7 +174,7 @@ input_string_var = input("Digite alguma coisa: ") # Retorna o que foi digitado e # Observação: Em versões antigas do Python, o método input() era chamado raw_input() # Não é necessário declarar variáveis antes de iniciá-las -# È uma convenção usar letras_minúsculas_com_sublinhados +# É uma convenção usar letras_minúsculas_com_sublinhados alguma_variavel = 5 alguma_variavel # => 5 @@ -182,31 +182,31 @@ alguma_variavel # => 5 # Veja Controle de Fluxo para aprender mais sobre tratamento de exceções. alguma_variavel_nao_inicializada # Gera a exceção NameError -# Listas armazenam sequencias +# Listas armazenam sequências li = [] -# Você pode iniciar com uma lista com alguns valores +# Você pode iniciar uma lista com valores outra_li = [4, 5, 6] -# Adicionar conteúdo ao fim da lista com append +# Adicione conteúdo ao fim da lista com append li.append(1) # li agora é [1] li.append(2) # li agora é [1, 2] li.append(4) # li agora é [1, 2, 4] li.append(3) # li agora é [1, 2, 4, 3] -# Remover do final da lista com pop +# Remova do final da lista com pop li.pop() # => 3 e agora li é [1, 2, 4] # Vamos colocá-lo lá novamente! li.append(3) # li agora é [1, 2, 4, 3] novamente. -# Acessar uma lista da mesma forma que você faz com um array +# Acesse uma lista da mesma forma que você faz com um array li[0] # => 1 -# Acessa o último elemento +# Acessando o último elemento li[-1] # => 3 -# Acessando além dos limites gera um IndexError +# Acessar além dos limites gera um IndexError li[4] # Gera o IndexError # Você pode acessar vários elementos com a sintaxe de limites -# (É um limite fechado, aberto pra você que gosta de matemática.) +# Inclusivo para o primeiro termo, exclusivo para o segundo li[1:3] # => [2, 4] # Omitindo o final li[2:] # => [4, 3] diff --git a/swift.html.markdown b/swift.html.markdown index c2fb3471..1f9fe897 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -91,7 +91,7 @@ let multiLineString = """ This is a multi-line string. It's called that because it takes up multiple lines (wow!) Any indentation beyond the closing quotation marks is kept, the rest is discarded. - You can include " or "" in multi-line strings because the delimeter is three "s. + You can include " or "" in multi-line strings because the delimiter is three "s. """ // Arrays @@ -159,12 +159,12 @@ let `class` = "keyword" or contains nil (no value) to indicate that a value is missing. Nil is roughly equivalent to `null` in other languages. A question mark (?) after the type marks the value as optional of that type. - + If a type is not optional, it is guaranteed to have a value. - + Because Swift requires every property to have a type, even nil must be explicitly stored as an Optional value. - + Optional<T> is an enum, with the cases .none (nil) and .some(T) (the value) */ @@ -178,7 +178,7 @@ let someOptionalString4 = String?.none //nil To access the value of an optional that has a value, use the postfix operator !, which force-unwraps it. Force-unwrapping is like saying, "I know that this optional definitely has a value, please give it to me." - + Trying to use ! to access a non-existent optional value triggers a runtime error. Always make sure that an optional contains a non-nil value before using ! to force-unwrap its value. @@ -194,7 +194,7 @@ if someOptionalString != nil { // Swift supports "optional chaining," which means that you can call functions // or get properties of optional values and they are optionals of the appropriate type. // You can even do this multiple times, hence the name "chaining." - + let empty = someOptionalString?.isEmpty // Bool? // if-let structure - @@ -370,7 +370,7 @@ func say(_ message: String) { } say("Hello") -// Default parameters can be ommitted when calling the function. +// Default parameters can be omitted when calling the function. func printParameters(requiredParameter r: Int, optionalParameter o: Int = 10) { print("The required parameter was \(r) and the optional parameter was \(o)") } @@ -443,7 +443,7 @@ func testGuard() { return // guard statements MUST exit the scope that they are in. // They generally use `return` or `throw`. } - + print("number is \(aNumber)") } testGuard() @@ -564,7 +564,7 @@ enum Furniture { case desk(height: Int) // Associate with String and Int case chair(String, Int) - + func description() -> String { //either placement of let is acceptable switch self { @@ -591,15 +591,15 @@ print(chair.description()) // "Chair of Foo with 40 cm" - Define initializers to set up their initial state - Be extended to expand their functionality beyond a default implementation - Conform to protocols to provide standard functionality of a certain kind - + Classes have additional capabilities that structures don't have: - Inheritance enables one class to inherit the characteristics of another. - Type casting enables you to check and interpret the type of a class instance at runtime. - Deinitializers enable an instance of a class to free up any resources it has assigned. - Reference counting allows more than one reference to a class instance. - + Unless you need to use a class for one of these reasons, use a struct. - + Structures are value types, while classes are reference types. */ @@ -607,7 +607,7 @@ print(chair.description()) // "Chair of Foo with 40 cm" struct NamesTable { let names: [String] - + // Custom subscript subscript(index: Int) -> String { return names[index] @@ -629,7 +629,7 @@ class Shape { class Rect: Shape { var sideLength: Int = 1 - + // Custom getter and setter property var perimeter: Int { get { @@ -640,16 +640,16 @@ class Rect: Shape { sideLength = newValue / 4 } } - + // Computed properties must be declared as `var`, you know, cause' they can change var smallestSideLength: Int { return self.sideLength - 1 } - + // Lazily load a property // subShape remains nil (uninitialized) until getter called lazy var subShape = Rect(sideLength: 4) - + // If you don't need a custom getter and setter, // but still want to run code before and after getting or setting // a property, you can use `willSet` and `didSet` @@ -659,19 +659,19 @@ class Rect: Shape { print(someIdentifier) } } - + init(sideLength: Int) { self.sideLength = sideLength // always super.init last when init custom properties super.init() } - + func shrink() { if sideLength > 0 { sideLength -= 1 } } - + override func getArea() -> Int { return sideLength * sideLength } @@ -703,13 +703,13 @@ class Circle: Shape { override func getArea() -> Int { return 3 * radius * radius } - + // Place a question mark postfix after `init` is an optional init // which can return nil init?(radius: Int) { self.radius = radius super.init() - + if radius <= 0 { return nil } @@ -813,7 +813,7 @@ for _ in 0..<10 { - Internal: Accessible and subclassible in the module it is declared in. - Fileprivate: Accessible and subclassible in the file it is declared in. - Private: Accessible and subclassible in the enclosing declaration (think inner classes/structs/enums) - + See more here: https://docs.swift.org/swift-book/LanguageGuide/AccessControl.html */ @@ -878,11 +878,11 @@ extension Int { var doubled: Int { return self * 2 } - + func multipliedBy(num: Int) -> Int { return num * self } - + mutating func multiplyBy(num: Int) { self *= num } @@ -965,18 +965,18 @@ func fakeFetch(value: Int) throws -> String { guard 7 == value else { throw MyError.reallyBadValue(msg: "Some really bad value") } - + return "test" } func testTryStuff() { // assumes there will be no error thrown, otherwise a runtime exception is raised let _ = try! fakeFetch(value: 7) - + // if an error is thrown, then it proceeds, but if the value is nil // it also wraps every return value in an optional, even if its already optional let _ = try? fakeFetch(value: 7) - + do { // normal try operation that provides error handling via `catch` block try fakeFetch(value: 1) diff --git a/th-th/typescript.th.html.markdown b/th-th/typescript.th.html.markdown index fc2a823b..5395c2a7 100644 --- a/th-th/typescript.th.html.markdown +++ b/th-th/typescript.th.html.markdown @@ -190,7 +190,7 @@ interface Person { } var p1: Person = { name: "Tyrone", age: 42 }; -p1.age = 25; // Error แน่นอน เพราะ p1.x ถูกกำหนดเป็น read-only +p1.age = 25; // Error แน่นอน เพราะ p1.age ถูกกำหนดเป็น read-only var p2 = { name: "John", age: 60 }; // สังเกตว่า p2 ไม่ได้กำหนดเป็น Person var p3: Person = p2; // ทำได้ เป็น read-only alias ของ p2 และกำหนดเป็น Person diff --git a/typescript.html.markdown b/typescript.html.markdown index cf2111d5..6f238d5b 100644 --- a/typescript.html.markdown +++ b/typescript.html.markdown @@ -199,7 +199,7 @@ interface Person { } var p1: Person = { name: "Tyrone", age: 42 }; -p1.age = 25; // Error, p1.x is read-only +p1.age = 25; // Error, p1.age is read-only var p2 = { name: "John", age: 60 }; var p3: Person = p2; // Ok, read-only alias for p2 |