diff options
| -rw-r--r-- | c++.html.markdown | 4 | ||||
| -rw-r--r-- | de-de/opencv-de.html.markdown | 3 | ||||
| -rw-r--r-- | git.html.markdown | 60 | ||||
| -rw-r--r-- | jquery.html.markdown | 6 | ||||
| -rw-r--r-- | json.html.markdown | 2 | ||||
| -rw-r--r-- | nl-nl/vim-nl.html.markdown | 272 | ||||
| -rw-r--r-- | pt-br/cypher-pt.html.markdown | 250 | ||||
| -rw-r--r-- | pt-br/less-pt.html.markdown | 390 | ||||
| -rw-r--r-- | pt-br/make-pt.html.markdown | 242 | ||||
| -rw-r--r-- | tcl.html.markdown | 8 | ||||
| -rw-r--r-- | typescript.html.markdown | 7 | 
11 files changed, 1209 insertions, 35 deletions
| diff --git a/c++.html.markdown b/c++.html.markdown index 8be5a278..4113d5f4 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -1057,6 +1057,8 @@ cout << ST.size();  // will print the size of set ST  // Output: 0  // NOTE: for duplicate elements we can use multiset +// NOTE: For hash sets, use unordered_set. They are more efficient but  +// do not preserve order. unordered_set is available since C++11  // Map  // Maps store elements formed by a combination of a key value @@ -1084,6 +1086,8 @@ cout << it->second;  // Output: 26 +// NOTE: For hash maps, use unordered_map. They are more efficient but do  +// not preserve order. unordered_map is available since C++11.  ///////////////////////////////////  // Logical and Bitwise operators diff --git a/de-de/opencv-de.html.markdown b/de-de/opencv-de.html.markdown index 31d0d05f..2d9a2c4e 100644 --- a/de-de/opencv-de.html.markdown +++ b/de-de/opencv-de.html.markdown @@ -145,8 +145,9 @@ cv2.destroyAllWindows()  * OpenCV Zeichenfunktionen [https://docs.opencv.org/2.4/modules/core/doc/drawing_functions.html]()  * Eine aktuelle Sprachenreferenz kann hier gefunden werden [https://opencv.org]()  * Zusätzliche Ressourcen können hier gefunden werden [https://en.wikipedia.org/wiki/OpenCV]() -* Gute OpenCv Tutorials +* Gute OpenCV Tutorials      * [https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_tutorials.html]()      * [https://realpython.com/python-opencv-color-spaces]()      * [https://pyimagesearch.com]()      * [https://www.learnopencv.com]() +    * [https://docs.opencv.org/master/]() diff --git a/git.html.markdown b/git.html.markdown index 582f8863..aa96c90a 100644 --- a/git.html.markdown +++ b/git.html.markdown @@ -26,11 +26,11 @@ Version control is a system that records changes to a file(s), over time.  ### Centralized Versioning vs. Distributed Versioning -* Centralized version control focuses on synchronizing, tracking, and backing  +* Centralized version control focuses on synchronizing, tracking, and backing  up files. -* Distributed version control focuses on sharing changes. Every change has a  +* Distributed version control focuses on sharing changes. Every change has a  unique id. -* Distributed systems have no defined structure. You could easily have a SVN  +* Distributed systems have no defined structure. You could easily have a SVN  style, centralized system, with git.  [Additional Information](http://git-scm.com/book/en/Getting-Started-About-Version-Control) @@ -57,7 +57,7 @@ A git repository is comprised of the .git directory & working tree.  ### .git Directory (component of repository) -The .git directory contains all the configurations, logs, branches, HEAD, and  +The .git directory contains all the configurations, logs, branches, HEAD, and  more.  [Detailed List.](http://gitready.com/advanced/2009/03/23/whats-inside-your-git-directory.html) @@ -68,15 +68,15 @@ referred to as your working directory.  ### Index (component of .git dir) -The Index is the staging area in git. It's basically a layer that separates  -your working tree from the Git repository. This gives developers more power  +The Index is the staging area in git. It's basically a layer that separates +your working tree from the Git repository. This gives developers more power  over what gets sent to the Git repository.  ### Commit -A git commit is a snapshot of a set of changes, or manipulations to your  -Working Tree. For example, if you added 5 files, and removed 2 others, these  -changes will be contained in a commit (or snapshot). This commit can then be  +A git commit is a snapshot of a set of changes, or manipulations to your +Working Tree. For example, if you added 5 files, and removed 2 others, these +changes will be contained in a commit (or snapshot). This commit can then be  pushed to other repositories, or not!  ### Branch @@ -91,13 +91,13 @@ functionality to mark release points (v1.0, and so on)  ### HEAD and head (component of .git dir) -HEAD is a pointer that points to the current branch. A repository only has 1  -*active* HEAD.   -head is a pointer that points to any commit. A repository can have any number  +HEAD is a pointer that points to the current branch. A repository only has 1 +*active* HEAD. +head is a pointer that points to any commit. A repository can have any number  of heads.  ### Stages of Git -* Modified - Changes have been made to a file but file has not been committed  +* Modified - Changes have been made to a file but file has not been committed  to Git Database yet  * Staged - Marks a modified file to go into your next commit snapshot  * Committed - Files have been committed to the Git Database @@ -111,7 +111,7 @@ to Git Database yet  ### init -Create an empty Git repository. The Git repository's settings, stored  +Create an empty Git repository. The Git repository's settings, stored  information, and more is stored in a directory (a folder) named ".git".  ```bash @@ -179,7 +179,7 @@ $ git help status  ### add -To add files to the staging area/index. If you do not `git add` new files to  +To add files to the staging area/index. If you do not `git add` new files to  the staging area/index, they will not be included in commits!  ```bash @@ -201,7 +201,7 @@ working directory/repo.  ### branch -Manage your branches. You can view, edit, create, delete branches using this  +Manage your branches. You can view, edit, create, delete branches using this  command.  ```bash @@ -250,7 +250,7 @@ $ git push origin --tags  ### checkout -Updates all files in the working tree to match the version in the index, or  +Updates all files in the working tree to match the version in the index, or  specified tree.  ```bash @@ -269,7 +269,7 @@ $ git checkout -b newBranch  ### clone  Clones, or copies, an existing repository into a new directory. It also adds -remote-tracking branches for each branch in the cloned repo, which allows you  +remote-tracking branches for each branch in the cloned repo, which allows you  to push to a remote branch.  ```bash @@ -285,7 +285,7 @@ $ git clone -b master-cn https://github.com/adambard/learnxinyminutes-docs.git -  ### commit -Stores the current contents of the index in a new "commit." This commit  +Stores the current contents of the index in a new "commit." This commit  contains the changes made and a message created by the user.  ```bash @@ -401,11 +401,11 @@ Pulls from a repository and merges it with another branch.  $ git pull origin master  # By default, git pull will update your current branch -# by merging in new changes from its remote-tracking branch  +# by merging in new changes from its remote-tracking branch  $ git pull  # Merge in changes from remote branch and rebase -# branch commits onto your local repo, like: "git fetch <remote> <branch>, git  +# branch commits onto your local repo, like: "git fetch <remote> <branch>, git  # rebase <remote>/<branch>"  $ git pull origin master --rebase  ``` @@ -421,7 +421,7 @@ Push and merge changes from a branch to a remote & branch.  $ git push origin master  # By default, git push will push and merge changes from -# the current branch to its remote-tracking branch  +# the current branch to its remote-tracking branch  $ git push  # To link up current local branch with a remote branch, add -u flag: @@ -432,7 +432,7 @@ $ git push  ### stash -Stashing takes the dirty state of your working directory and saves it on a  +Stashing takes the dirty state of your working directory and saves it on a  stack of unfinished changes that you can reapply at any time.  Let's say you've been doing some work in your git repo, but you want to pull @@ -464,7 +464,7 @@ nothing to commit, working directory clean  ```  You can see what "hunks" you've stashed so far using `git stash list`. -Since the "hunks" are stored in a Last-In-First-Out stack, our most recent  +Since the "hunks" are stored in a Last-In-First-Out stack, our most recent  change will be at top.  ```bash @@ -495,7 +495,7 @@ Now you're ready to get back to work on your stuff!  ### rebase (caution) -Take all changes that were committed on one branch, and replay them onto  +Take all changes that were committed on one branch, and replay them onto  another branch.  *Do not rebase commits that you have pushed to a public repo*. @@ -510,7 +510,7 @@ $ git rebase master experimentBranch  ### reset (caution)  Reset the current HEAD to the specified state. This allows you to undo merges, -pulls, commits, adds, and more. It's a great command but also dangerous if you  +pulls, commits, adds, and more. It's a great command but also dangerous if you  don't know what you are doing.  ```bash @@ -535,7 +535,7 @@ $ git reset --hard 31f2bb1  Reflog will list most of the git commands you have done for a given time period,  default 90 days. -This give you the chance to reverse any git commands that have gone wrong  +This give you the chance to reverse any git commands that have gone wrong  (for instance, if a rebase has broken your application).  You can do this: @@ -558,8 +558,8 @@ ed8ddf2 HEAD@{4}: rebase -i (pick): pythonstatcomp spanish translation (#1748)  ### revert -Revert can be used to undo a commit. It should not be confused with reset which  -restores the state of a project to a previous point. Revert will add a new  +Revert can be used to undo a commit. It should not be confused with reset which +restores the state of a project to a previous point. Revert will add a new  commit which is the inverse of the specified commit, thus reverting it.  ```bash @@ -604,3 +604,5 @@ $ git rm /pather/to/the/file/HelloWorld.c  * [Pro Git](http://www.git-scm.com/book/en/v2)  * [An introduction to Git and GitHub for Beginners (Tutorial)](http://product.hubspot.com/blog/git-and-github-tutorial-for-beginners) + +* [The New Boston tutorial to Git covering basic commands and workflow](https://www.youtube.com/playlist?list=PL6gx4Cwl9DGAKWClAD_iKpNC0bGHxGhcx) diff --git a/jquery.html.markdown b/jquery.html.markdown index 9326c74b..a1673c10 100644 --- a/jquery.html.markdown +++ b/jquery.html.markdown @@ -104,7 +104,7 @@ tables.animate({margin-top:"+=50", height: "100px"}, 500, myFunction);  // 3. Manipulation  // These are similar to effects but can do more -$('div').addClass('taming-slim-20'); // Adds class taming-slim-20 to all div  +$('div').addClass('taming-slim-20'); // Adds class taming-slim-20 to all div  // Common manipulation methods  $('p').append('Hello world'); // Adds to end of element @@ -126,3 +126,7 @@ $('p').each(function() {  ``` + +## Further Reading + +* [Codecademy - jQuery](https://www.codecademy.com/learn/learn-jquery) A good introduction to jQuery in a "learn by doing it" format. diff --git a/json.html.markdown b/json.html.markdown index cd42d42d..322c7a47 100644 --- a/json.html.markdown +++ b/json.html.markdown @@ -81,3 +81,5 @@ Supported data types:  ## Further Reading  * [JSON.org](http://json.org) All of JSON beautifully explained using flowchart-like graphics. + +* [JSON Tutorial](https://www.youtube.com/watch?v=wI1CWzNtE-M) A concise introduction to JSON. diff --git a/nl-nl/vim-nl.html.markdown b/nl-nl/vim-nl.html.markdown new file mode 100644 index 00000000..a69c031c --- /dev/null +++ b/nl-nl/vim-nl.html.markdown @@ -0,0 +1,272 @@ +--- +category: tool +tool: vim +contributors: +    - ["RadhikaG", "https://github.com/RadhikaG"] +translators: +  - ["Rick Haan", "https://github.com/RickHaan"] +filename: learnvim-nl.yaml +lang: nl-nl +--- + +# Vim in het Nederlands + +[Vim](http://www.vim.org) +(Vi IMproved) is een kopie van de populaire vi editor voor Unix. Het is +ontworpen voor snelheid, verhoogde productiviteit en is beschikbaar in de meeste +unix-gebaseerde systemen. Het heeft verscheidene toetscombinaties voor snelle +navigatie en aanpassingen in het doelbestand. + +## De Basis van het navigeren in Vim + +``` Vim +    vim <bestandsnaam> # Open <bestandsnaam> in vim +    :help <onderwerp>  # Open ingebouwde documentatie over <onderwerp> als +    deze bestaat +    :q               # Vim afsluiten +    :w               # Huidig bestand opslaan +    :wq              # Huidig bestand opslaan en vim afsluiten +    ZZ               # Huidig bestand opslaan en vim afsluiten +    :x               # Huidig bestand opslaan en vim afsluiten, verkorte versie +    :q!              # Afsluiten zonder opslaan +                     # ! *forceert* het normale afsluiten met :q + +    u                # Ongedaan maken +    CTRL+R           # Opnieuw doen + +    h                # Ga 1 karakter naar links +    j                # Ga 1 regel naar beneden +    k                # Ga 1 regel omhoog +    l                # Ga 1 karakter naar rechts + +    Ctrl+B           # Ga 1 volledig scherm terug +    Ctrl+F           # Ga 1 volledig scherm vooruit +    Ctrl+D           # Ga 1/2 scherm vooruit +    Ctrl+U           # Ga 1/2 scherm terug + +    # Verplaatsen over de regel + +    0                # Verplaats naar het begin van de regel +    $                # Verplaats naar het eind van de regel +    ^                # Verplaats naar het eerste niet-lege karakter op de regel + +    # Zoeken in de tekst + +    /word            # Markeert alle voorvallen van 'word' na de cursor +    ?word            # Markeert alle voorvallen van 'word' voor de cursor +    n                # Verplaatst de cursor naar het volgende voorval van +    de zoekopdracht +    N                # Verplaatst de cursor naar het vorige voorval van +    de zoekopdracht + +    :%s/foo/bar/g    # Verander 'foo' naar 'bar' op elke regel van het bestand +    :s/foo/bar/g     # Verander 'foo' naar 'bar' op de huidge regel in +    het bestand +    :%s/\n/\r/g      # Vervang nieuwe regel karakters met nieuwe regel karakters + +    # Spring naar karakters + +    f<character>     # Spring vooruit en land op <character> +    t<character>     # Spring vooruit en land net voor <character> + +    # Bijvoorbeeld, +    f<               # Spring vooruit en land op < +    t<               # Spring vooruit en land net voor < + +    # Verplaatsen per woord + +    w                # Ga 1 woord vooruit +    b                # Ga 1 woord achteruit +    e                # Ga naar het einde van het huidige woord + +    # Andere karakters om mee te verplaatsen + +    gg               # Ga naar de bovenkant van het bestand +    G                # Ga naar de onderkant van het bestand +    :NUM             # Ga naar regel NUM (NUM is elk nummer) +    H                # Ga naar de bovenkant van het scherm +    M                # Ga naar het midden van het scherm +    L                # Ga naar de onderkant van het scherm +``` + +## Help documentatie + +Vim heeft ingebouwde help documentatie dat benaderd kan worden met +`:help <onderwerp>`. Bijvoorbeeld `:help navigation` geeft documentatie weer hoe +door vim te navigeren. `:help` kan ook gebruikt worden zonder onderwerp. Dan wordt de standaard documentatie weergeven die bedoelt is om vim toegankelijker te maken. + +## Modus + +Vim is gebaseerd op het concept van **modus**. + +* Command (opdracht) modus - Vim wordt opgestart in deze mode. Deze mode wordt +gebruikt om opdrachten te geven en te navigeren +* Insert (invoer) modus - Wordt gebruikt voor het aanpassen van het bestand +* Zichtbare (Visual) modus - Wordt gebruikt voor het markeren en bewerken van +tekst +* Ex modus - Wordt gebruikt voor het uitvoeren van opdrachten met `:` + +``` Vim +    i                # Zet vim in de Command modus voor de cursor positie +    a                # Zet vim in de Insert modus na de cursor positie (append) +    v                # Zet vim in de Visual modus +    :                # Zet vim in de ex modus +    <esc>            # 'Escapes' vanuit elke modus naar de Command modus + +    # Het kopiëren en plakken van tekst + +    y                # Yank (kopieer) wat geselecteerd is +    yy               # Yank (kopieer) de huidige regel +    d                # Verwijder wat geselecteerd is +    dd               # Verwijder de huidige regel +    p                # Plak de huidige tekst op de cursor positie +    P                # Plak de huidige tekst voor de cursor positie +    x                # Verwijder karakter op cursor positie +``` + +## De 'gramatica' van vim + +Vim kan aangeleerd worden als een set van acties in het 'Verb-Modifier-Noun' +formaat waar: + +Verb (werkwoord) - De uit te voeren actie +Modifier (bijwoord) - Hoe de actie uitgevoerd dient te worden +Noun - Het object waarop de actie uitgevoerd wordt + +Een paar belangrijke voorbeelden van 'Verbs', 'Modifiers', en 'Nouns' zijn: + +``` Vim +    # 'Verbs' + +    d       # Verwijder +    c       # Verander +    y       # Kopieer +    v       # Zichtbaar selecteren + +    # 'Modifiers' + +    i       # Binnen +    a       # Rondom +    NUM     # Elk nummer +    f       # Zoekt iets en selecteerd het +    t       # Zoekt iets en selecteerd het karakter voor het +    /       # Vindt een combinatie van tekens vanaf de cursor +    ?       # Vindt een combinatie van tekens voor de cursor + +    # 'Nouns' + +    w       # Woord +    s       # Zin +    p       # Paragraaf +    b       # Blok + +    # Voorbeeld 'zinnen' of opdrachten + +    d2w     # Verwijder twee woorden +    cis     # Verander in de zin +    yip     # Kopiereer in de paragraaf +    ct<     # Verander naar haakje openen +            # Verander de tekst vanaf de huidige positie tot het volgende haakje +            openen +    d$      # Verwijder tot het einde van de regel +``` + +## Een aantal afkortingen en trucs + +``` Vim +    >               # Verspring de selectie met 1 blok +    <               # Verspring de selectie met 1 blok terug +    :earlier 15     # Zet het document terug naar de situatie van 15 minuten +    geleden +    :later 15       # Zet het document in de situatie 15 minuten in de toekomst +    (omgekeerde van de vorige opdracht) +    ddp             # Wissel de positie van opeenvolgende regels. dd daarna p +    .               # Herhaal de vorige opdracht +    :w !sudo tee%   # Sla het huidige bestand op als root +    :set syntax=c   # Stel syntax uitlichten in op 'c' +    :sort           # Sorteer alle regels +    :sort!          # Sorteer alle regels omgekeerd +    :sort u         # Sorteer alle regels en verwijder duplicaten +    ~               # Stel letter case in voor geselecteerde tekst +    u               # Verander de geselecteerde tekst naar kleine letters +    U               # Verander de geselecteerde tekst naar hoofdletters + +    # Fold text +    zf              # Creeer een vouw op de geslecteerde tekst +    zo              # Open huidige vouw +    zc              # Sluit huidige vouw +    zR              # Open alle vouwen +    zM              # Sluit alle vouwen +``` + +## Macro's + +Macro's zijn opgeslagen opdrachten. Wanneer je begint met het opnemen van een +macro dan worden **alle** acties opgenomen, totdat je stopt met opnemen. Als de +macro uitgevoerd wordt, worden alle acties in de zelfde volgorde als tijdens het +opnemen uitgevoerd. + +``` Vim +    qa  # Start met het opnemen van de makro genaamd 'a' +    q   # Stop met opnemen +    @a  # Gebruik macro 'a' +``` + +## Configureren van .vimrc + +Het .vimrc bestand kan gebruikt worden voor het opslaan van een +standaardconfiguratie van Vim. Het bestand wordt opgeslagen in de home map van de gebruiker. Hieronder staat een voorbeeld van een .vimrc bestand. + +``` Vim +" Voorbeeld ~/.vimrc +" 2015.10 + +" In te stellen dat Vim niet samenwerkt met Vi +set nocompatible + +" Stel in dat Vim kijkt naar de bestandstype voor syntax uitlichting en +automatish inspringen +filetype indent plugin on + +" Zet inspringen aan +syntax on + +" Betere opdracht regel aanvulling +set wildmenu + +" Gebruik niet hoofdlettergevoelig zoeken. +set ignorecase +set smartcase + +" Gebruik automatisch inspringen +set autoindent + +" Geef regelnummers weer +set number + +" Het aantal zichtbare spatie's per TAB +set tabstop=4 + +" Het aantal spatie's tijdens het aanpassen +set softtabstop=4 + +" Aantal spatie's wanneer (>> en <<) worden gebruikt + +" Maak van TAB's spatie's +set expandtab + +" Gebruik slimme tabs spatie's voor inspringen en uitlijnen +set smarttab +``` + +## Referenties (Engels) + +[Vim | Home](http://www.vim.org/index.php) + +`$ vimtutor` + +[A vim Tutorial and Primer](https://danielmiessler.com/study/vim/) + +[What are the dark corners of Vim your mom never told you about? (Stack Overflow thread)](http://stackoverflow.com/questions/726894/what-are-the-dark-corners-of-vim-your-mom-never-told-you-about) + +[Arch Linux Wiki](https://wiki.archlinux.org/index.php/Vim)
\ No newline at end of file diff --git a/pt-br/cypher-pt.html.markdown b/pt-br/cypher-pt.html.markdown new file mode 100644 index 00000000..7cfd8dcd --- /dev/null +++ b/pt-br/cypher-pt.html.markdown @@ -0,0 +1,250 @@ +--- +language: cypher +filename: LearnCypher.cql +contributors: +    - ["Théo Gauchoux", "https://github.com/TheoGauchoux"] + +lang: pt-br +--- + +O Cypher é a linguagem de consulta do Neo4j para manipular gráficos facilmente. Ela reutiliza a sintaxe do SQL e a mistura com o tipo de ascii-art para representar gráficos. Este tutorial pressupõe que você já conheça conceitos de gráficos como nós e relacionamentos. + +[Leia mais aqui.](https://neo4j.com/developer/cypher-query-language/) + + +Nós +--- + +**Representa um registro em um gráfico.** + +`()` +É um *nó* vazio, para indicar que existe um *nó*, mas não é relevante para a consulta. + +`(n)` +É um *nó* referido pela variável **n**, reutilizável na consulta. Começa com minúsculas e usa o camelCase. + +`(p:Person)` +Você pode adicionar um *label* ao seu nó, aqui **Person**. É como um tipo / uma classe / uma categoria. Começa com maiúsculas e usa o camelCase. + +`(p:Person:Manager)` +Um nó pode ter muitos *labels*. + +`(p:Person {name : 'Théo Gauchoux', age : 22})` +Um nó pode ter algumas *propriedades*, aqui **name** e **age**. Começa com minúsculas e usa o camelCase. + +Os tipos permitidos nas propriedades: + + - Numeric + - Boolean + - String + - Lista de tipos primitivos anteriores + +*Aviso: não há propriedade datetime no Cypher! Você pode usar String com um padrão específico ou um Numeric a partir de uma data específica.* + +`p.name` +Você pode acessar uma propriedade com o estilo de ponto. + + +Relacionamentos (ou Arestas) +--- + +**Conecta dois nós** + +`[:KNOWS]` +É um *relacionamento* com o *label* **KNOWS**. É um *label* como um rótulo do nó. Começa com maiúsculas e usa UPPER_SNAKE_CASE. + +`[k:KNOWS]` +O mesmo *relacionamento*, referido pela variável **k**, reutilizável na consulta, mas não é necessário. + +`[k:KNOWS {since:2017}]` +O mesmo *relacionamento*, com *propriedades* (como *nó*), aqui **since**. + +`[k:KNOWS*..4]` +É uma informação estrutural para usar em um *path* (visto posteriormente). Aqui, **\*..4** diz, “Corresponda o padrão, com a relação **k** que é repetida de 1 a 4 vezes. + + +Paths +--- + +**A maneira de misturar nós e relacionamentos.** + +`(a:Person)-[:KNOWS]-(b:Person)` +Um path descrevendo que **a** e **b** se conhecem. + +`(a:Person)-[:MANAGES]->(b:Person)` +Um path pode ser direcionado. Este path descreve que **a** é o gerente de **b**. + +`(a:Person)-[:KNOWS]-(b:Person)-[:KNOWS]-(c:Person)` +Você pode encadear vários relacionamentos. Este path descreve o amigo de um amigo. + +`(a:Person)-[:MANAGES]->(b:Person)-[:MANAGES]->(c:Person)` +Uma encadeamento também pode ser direcionada. Este path descreve que **a** é o chefe de **b** e o grande chefe de **c**. + +Padrões frequentemente usados (do Neo4j doc) : + +``` +// Amigo de um amigo +(user)-[:KNOWS]-(friend)-[:KNOWS]-(foaf) + +// Path mais curto +path = shortestPath( (user)-[:KNOWS*..5]-(other) ) + +// Filtragem colaborativa +(user)-[:PURCHASED]->(product)<-[:PURCHASED]-()-[:PURCHASED]->(otherProduct) + +// Navegação de árvore +(root)<-[:PARENT*]-(leaf:Category)-[:ITEM]->(data:Product) + +``` + + +Crie consultas +--- + +Create a new node +``` +CREATE (a:Person {name:"Théo Gauchoux"}) +RETURN a +``` +*`RETURN` permite ter um resultado após a consulta. Pode ser múltiplo, como `RETURN a, b`.* + +Crie um novo relacionamento (com 2 novos nós) +``` +CREATE (a:Person)-[k:KNOWS]-(b:Person) +RETURN a,k,b +``` + +Consultas que casam +--- + +Casam todos os nós +``` +MATCH (n) +RETURN n +``` + +Casam nós por label +``` +MATCH (a:Person) +RETURN a +``` + +Casam nós por label e propriedade +``` +MATCH (a:Person {name:"Théo Gauchoux"}) +RETURN a +``` + +Casam nós de acordo com os relacionamentos (não direcionados) +``` +MATCH (a)-[:KNOWS]-(b) +RETURN a,b +``` + +Casam nós de acordo com os relacionamentos (direcionados) +``` +MATCH (a)-[:MANAGES]->(b) +RETURN a,b +``` + +Casam nós com um cláusula `WHERE` +``` +MATCH (p:Person {name:"Théo Gauchoux"})-[s:LIVES_IN]->(city:City) +WHERE s.since = 2015 +RETURN p,state +``` + +Você pode usa a cláusula `MATCH WHERE` com a cláusula `CREATE` +``` +MATCH (a), (b) +WHERE a.name = "Jacquie" AND b.name = "Michel" +CREATE (a)-[:KNOWS]-(b) +``` + + +Atualizar consultas +--- + +Atualizar uma propriedade específica de um nó +``` +MATCH (p:Person) +WHERE p.name = "Théo Gauchoux" +SET p.age = 23 +``` + +Substituir todas as propriedades de um nó +``` +MATCH (p:Person) +WHERE p.name = "Théo Gauchoux" +SET p = {name: "Michel", age: 23} +``` + +Adicionar nova propriedade a um nó +``` +MATCH (p:Person) +WHERE p.name = "Théo Gauchoux" +SET p + = {studies: "IT Engineering"} +``` + +Adicione um label a um nó +``` +MATCH (p:Person) +WHERE p.name = "Théo Gauchoux" +SET p:Internship +``` + + +Excluir consultas +--- + +Excluir um nó específico (os relacionamentos vinculados devem ser excluídos antes) +``` +MATCH (p:Person)-[relationship]-() +WHERE p.name = "Théo Gauchoux" +DELETE relationship, p +``` + +Remover uma propriedade em um nó específico +``` +MATCH (p:Person) +WHERE p.name = "Théo Gauchoux" +REMOVE p.age +``` +*Prestar atenção à palavra chave `REMOVE`, não é `DELETE` !* + +Remover um label de um nó específico +``` +MATCH (p:Person) +WHERE p.name = "Théo Gauchoux" +DELETE p:Person +``` + +Excluir o banco de dados inteiro +``` +MATCH (n) +OPTIONAL MATCH (n)-[r]-() +DELETE n, r +``` +*Sério, é o `rm -rf /` do Cypher !* + + +Outras cláusulas úteis +--- + +`PROFILE` +Antes de uma consulta, mostre o plano de execução dela. + +`COUNT(e)` +Contar entidades (nós ou relacionamentos) que casam com **e**. + +`LIMIT x` +Limite o resultado aos primeiros x resultados. + + +Dicas Especiais +--- + +- Há apenas comentários de uma linha no Cypher, com barras duplas : // Comentários +- Você pode executar um script Cypher armazenado em um arquivo **.cql** diretamente no Neo4j (é uma importação). No entanto, você não pode ter várias instruções neste arquivo (separadas por **;**). +- Use o shell Neo4j para escrever Cypher, é realmente incrível. +- O Cypher será a linguagem de consulta padrão para todos os bancos de dados de gráficos (conhecidos como **OpenCypher**). diff --git a/pt-br/less-pt.html.markdown b/pt-br/less-pt.html.markdown new file mode 100644 index 00000000..679a2ed2 --- /dev/null +++ b/pt-br/less-pt.html.markdown @@ -0,0 +1,390 @@ +--- +language: less +filename: learnless.less +contributors: +  - ["Saravanan Ganesh", "http://srrvnn.me"] + +lang: pt-br +--- + +Less é um pré-processador de CSS, que adiciona recursos como variáveis, aninhamento, mixins e muito mais. +Less (e outros pré-processadores, como o [Sass](http://sass-lang.com/)) ajudam os desenvolvedores a escreverem código que pode ser mantido e DRY (não se repita). + +```css + + +//Comentários de linha única são removidos quando Less é compilado para CSS. + +/*Comentários de várias linhas são preservados.*/ + + + +/* Variáveis +==============================*/ + + +/* Você pode armazenar um valor de CSS (como uma cor) em uma variável. +   Use o símbolo '@' para criar uma variável. */ + +@primary-color: #a3a4ff; +@secondary-color: #51527f; +@body-font: 'Roboto', sans-serif; + +/* Você pode usar as variáveis em toda a sua folha de estilo. +   Agora, se você quiser alterar uma cor, só precisa fazer a alteração uma vez. */ + +body { +	background-color: @primary-color; +	color: @secondary-color; +	font-family: @body-font; +} + +/* Isso compilará para: */ + +body { +	background-color: #a3a4ff; +	color: #51527F; +	font-family: 'Roboto', sans-serif; +} + + +/* Isso é muito mais sustentável do que ter que mudar a cor +   cada vez que aparece em toda a sua folha de estilo. */ + + + +/* Mixins +==============================*/ + + +/* Se você achar que está escrevendo o mesmo código para mais de um +   elemento, você pode querer reutilizá-lo facilmente. */ + +.center { +	display: block; +	margin-left: auto; +	margin-right: auto; +	left: 0; +	right: 0; +} + +/* Você pode usar o mixin simplesmente adicionando o seletor como um estilo. */ + +div { +	.center; +	background-color: @primary-color; +} + +/* Que compilaria para: */ + +.center { +  display: block; +  margin-left: auto; +  margin-right: auto; +  left: 0; +  right: 0; +} +div { +	display: block; +	margin-left: auto; +	margin-right: auto; +	left: 0; +	right: 0; +	background-color: #a3a4ff; +} + +/* Você pode omitir o código mixin de ser compilado adicionando parênteses +   depois do seletor. */ + +.center() { +  display: block; +  margin-left: auto; +  margin-right: auto; +  left: 0; +  right: 0; +} + +div { +  .center; +  background-color: @primary-color; +} + +/* Que compilaria para: */ +div { +  display: block; +  margin-left: auto; +  margin-right: auto; +  left: 0; +  right: 0; +  background-color: #a3a4ff; +} + + + +/* Aninhamento +==============================*/ + + +/* Less permite aninhar seletores nos seletores. */ + +ul { +	list-style-type: none; +	margin-top: 2em; + +	li { +		background-color: #f00; +	} +} + +/* '&' será substituído pelo seletor pai. */ +/* Você também pode aninhar pseudo-classes. */ +/* Tenha em mente que o aninhamento excessivo tornará seu código menos sustentável. +   As melhores práticas recomendam não ultrapassar 3 níveis de profundidade ao aninhar. +   Por exemplo: */ + +ul { +  list-style-type: none; +  margin-top: 2em; + +  li { +    background-color: red; + +    &:hover { +      background-color: blue; +    } + +    a { +      color: white; +    } +  } +} + +/* Compila para: */ + +ul { +  list-style-type: none; +  margin-top: 2em; +} + +ul li { +  background-color: red; +} + +ul li:hover { +  background-color: blue; +} + +ul li a { +  color: white; +} + + + +/* Functions +==============================*/ + + +/* Less fornece funções que podem ser usadas para realizar uma variedade de +   tarefas. Considere o seguinte: */ + +/* Funções podem ser invocadas usando seu nome e passando os +   argumentos requeridos. */ + +body { +  width: round(10.25px); +} + +.header { +	background-color: lighten(#000, 0.5); +} + +.footer { +  background-color: fadeout(#000, 0.25) +} + +/* Compila para: */ + +body { +  width: 10px; +} + +.header { +  background-color: #010101; +} + +.footer { +  background-color: rgba(0, 0, 0, 0.75); +} + +/* Você também pode definir suas próprias funções. Funções são muito semelhantes às +   mixins. Ao tentar escolher entre uma função ou a um mixin, lembre-se +   que mixins são melhores para gerar CSS, enquanto as funções são melhores para +   lógica que pode ser usada em todo o seu código Less. Os exemplos na +   seção 'Operadores Matemáticos' são candidatos ideais para se tornarem funções reutilizáveis. */ + +/* Esta função calcula a média de dois números: */ + +.average(@x, @y) { +  @average-result: ((@x + @y) / 2); +} + +div { +  .average(16px, 50px); // "chama" o mixin +  padding: @average-result;    // use seu valor de "retorno" +} + +/* Compila para: */ + +div { +  padding: 33px; +} + + + +/* Estender (herança) +==============================*/ + + +/* Estender é uma maneira de compartilhar as propriedades de um seletor com outro. */ + +.display { +  height: 50px; +} + +.display-success { +  &:extend(.display); +	border-color: #22df56; +} + +/* Compila para: */ + +.display, +.display-success { +  height: 50px; +} +.display-success { +  border-color: #22df56; +} + +/* Estender uma instrução CSS é preferível para criar um mixin +   por causa da maneira como agrupa as classes que compartilham +   o mesmo estilo base. Se isso foi feito com um mixin, as propriedades +   seriam duplicadas para cada declaração que +   chamou o mixin. Embora isso não afete o seu fluxo de trabalho, +   adicione o inchaço desnecessário aos arquivos criados pelo compilador Less. */ + + + +/* Parciais e Importações +==============================*/ + + +/* Less permite criar arquivos parciais. Isso pode ajudar a manter o seu +   código Less modularizado. Arquivos parciais convencionalmente começam com um '_', +   por exemplo. _reset.less. e são importados para um arquivo less principal que recebe +   o css compilado. */ + +/* Considere o seguinte CSS que vamos colocar em um arquivo chamado _reset.less */ + +html, +body, +ul, +ol { +  margin: 0; +  padding: 0; +} + +/* Less disponibiliza @import que podem ser usadas para importar parciais em um arquivo. +   Isso difere da declaração tradicional CSS @import que faz +   outra solicitação HTTP para buscar o arquivo importado. Less leva o +   arquivo importado e combina com o código compilado. */ + +@import 'reset'; + +body { +  font-size: 16px; +  font-family: Helvetica, Arial, Sans-serif; +} + +/* Compila para: */ + +html, body, ul, ol { +  margin: 0; +  padding: 0; +} + +body { +  font-size: 16px; +  font-family: Helvetica, Arial, Sans-serif; +} + + + +/* Operações Matemáticas +==============================*/ + + +/* Less fornece os seguintes operadores: +, -, *, / e %. Estes podem +   ser úteis para calcular valores diretamente nos seus arquivos Less +   para usar valores que você já calculou manualmente. Abaixo está um exemplo +   de como configurar um design simples de duas colunas. */ + +@content-area: 960px; +@main-content: 600px; +@sidebar-content: 300px; + +@main-size: @main-content / @content-area * 100%; +@sidebar-size: @sidebar-content / @content-area * 100%; +@gutter: 100% - (@main-size + @sidebar-size); + +body { +  width: 100%; +} + +.main-content { +  width: @main-size; +} + +.sidebar { +  width: @sidebar-size; +} + +.gutter { +  width: @gutter; +} + +/* Compila para: */ + +body { +  width: 100%; +} + +.main-content { +  width: 62.5%; +} + +.sidebar { +  width: 31.25%; +} + +.gutter { +  width: 6.25%; +} + + +``` + +## Pratique Less + +Se você quiser praticar com Less no seu navegador, confira: * [Codepen](http://codepen.io/) * [LESS2CSS](http://lesscss.org/less-preview/) + +## Compatibilidade + +Less pode ser usado em qualquer projeto, desde que você tenha um programa para compilá-lo em CSS. Você deseja verificar +se o CSS que você está usando é compatível com seus navegadores de destino. + +[QuirksMode CSS](http://www.quirksmode.org/css/) e [CanIUse](http://caniuse.com) são ótimos recursos para verificar a compatibilidade. + +## Leitura adicional +* [Documentação Oficial](http://lesscss.org/features/) +* [Less CSS - Guia do iniciante](http://www.hongkiat.com/blog/less-basic/) diff --git a/pt-br/make-pt.html.markdown b/pt-br/make-pt.html.markdown new file mode 100644 index 00000000..8e7603cc --- /dev/null +++ b/pt-br/make-pt.html.markdown @@ -0,0 +1,242 @@ +---
 +language: make
 +contributors:
 +    - ["Robert Steed", "https://github.com/robochat"]
 +    - ["Stephan Fuhrmann", "https://github.com/sfuhrm"]
 +filename: Makefile
 +
 +lang: pt-br
 +---
 +
 +Um Makefile define um gráfico de regras para criar um alvo (ou alvos). Sua finalidade é fazer o mínimo de trabalho necessário para atualizar um alvo para a versão mais recente da fonte. Famosamente escrito ao longo de um fim de semana por Stuart Feldman em 1976, ainda é amplamente usada (particularmente no Unix e no Linux) apesar de muitos concorrentes e críticas.
 +
 +Existem muitas variedades de make na existência, no entanto, este artigo pressupõe que estamos usando o GNU make, que é o padrão no Linux.
 +
 +```make
 +
 +# Comentários podem ser escritos assim.
 +
 +# O arquivo deve ser nomeado Makefile e então pode ser executado como `make <alvo>`.
 +# Caso contrário, nós usamos `make -f "nome-do-arquivo" <alvo>`.
 +
 +# Aviso - use somente TABS para identar em Makefiles, nunca espaços!
 +
 +#-----------------------------------------------------------------------
 +# Noções básicas
 +#-----------------------------------------------------------------------
 +
 +# Regras são do formato
 +# alvo: <pré-requisito>
 +# onde os pré-requisitos são opcionais.
 +
 +# Uma regra - esta regra só será executada se o arquivo0.txt não existir.
 +arquivo0.txt:
 +	echo "foo" > arquivo0.txt
 +	# Mesmo os comentários nestas seções da 'receita' são passados para o shell.
 +	# Experimentar `make arquivo0.txt` or simplyou simplesmente `make` - primeira regra é o padrão.
 +
 +# Esta regra só será executada se arquivo0.txt for mais recente que arquivo1.txt.
 +arquivo1.txt: arquivo0.txt
 +	cat arquivo0.txt > arquivo1.txt
 +	# se as mesmas regras de citação do shell.
 +	@cat arquivo0.txt >> arquivo1.txt
 +	# @ pára o comando de ser ecoado para stdout.
 +	-@echo 'hello'
 +	# - significa que make continuará em caso de erro.
 +	# Experimentar `make arquivo1.txt` na linha de comando.
 +
 +# Uma regra pode ter vários alvos e vários pré-requisitos
 +arquivo2.txt arquivo3.txt: arquivo0.txt arquivo1.txt
 +	touch arquivo2.txt
 +	touch arquivo3.txt
 +
 +# Make vai reclamar sobre várias receitas para a mesma regra. Esvaziar
 +# receitas não contam e podem ser usadas para adicionar novas dependências.
 +
 +#-----------------------------------------------------------------------
 +# Alvos falsos
 +#-----------------------------------------------------------------------
 +
 +# Um alvo falso. Qualquer alvo que não seja um arquivo.
 +# Ele nunca será atualizado, portanto, o make sempre tentará executá-lo.
 +all: maker process
 +
 +# Podemos declarar as coisas fora de ordem.
 +maker:
 +	touch ex0.txt ex1.txt
 +
 +# Pode evitar quebrar regras falsas quando um arquivo real tem o mesmo nome
 +.PHONY: all maker process
 +# Este é um alvo especial. Existem vários outros.
 +
 +# Uma regra com dependência de um alvo falso sempre será executada
 +ex0.txt ex1.txt: maker
 +
 +# Alvos falsos comuns são: todos fazem instalação limpa ...
 +
 +#-----------------------------------------------------------------------
 +# Variáveis Automáticas e Curingas
 +#-----------------------------------------------------------------------
 +
 +process: Arquivo*.txt	# Usando um curinga para corresponder nomes de arquivos
 +	@echo $^	# $^ é uma variável que contém a lista de pré-requisitos
 +	@echo $@	# imprime o nome do alvo
 +	#(fpara várias regras alvo, $@ é o que causou a execução da regra)
 +	@echo $<	# o primeiro pré-requisito listado
 +	@echo $?	# somente as dependências que estão desatualizadas
 +	@echo $+	# todas as dependências, incluindo duplicadas (ao contrário do normal)
 +	#@echo $|	# todos os pré-requisitos 'somente pedidos'
 +
 +# Mesmo se dividirmos as definições de dependência de regra, $^ vai encontrá-los
 +process: ex1.txt arquivo0.txt
 +# ex1.txt será encontrado, mas arquivo0.txt será desduplicado.
 +
 +#-----------------------------------------------------------------------
 +# Padrões
 +#-----------------------------------------------------------------------
 +
 +# Pode ensinar make a converter certos arquivos em outros arquivos.
 +
 +%.png: %.svg
 +	inkscape --export-png $^
 +
 +# As regras padrões só farão qualquer coisa se decidirem criar o alvo.
 +
 +# Os caminhos de diretório são normalmente ignorados quando as regras de
 +# padrões são correspondentes. Mas make tentará usar a regra mais
 +# apropriada disponível.
 +small/%.png: %.svg
 +	inkscape --export-png --export-dpi 30 $^
 +
 +# make utilizará a última versão para uma regra de padrão que encontrar.
 +%.png: %.svg
 +	@echo esta regra é escolhida
 +
 +# No entanto, o make usará a primeira regra padrão que pode se tornar o alvo
 +%.png: %.ps
 +	@echo esta regra não é escolhida se *.svg and *.ps estão ambos presentes
 +
 +# make já tem algumas regras padrões embutidas. Por exemplo, ele sabe
 +# como transformar arquivos *.c em arquivos *.o.
 +
 +# Makefiles antigos podem usar regras de sufixo em vez de regras padrões
 +.png.ps:
 +	@echo essa regra é semelhante a uma regra de padrão.
 +
 +# make sobre a regra de sufixo
 +.SUFFIXES: .png
 +
 +#-----------------------------------------------------------------------
 +# Variáveis
 +#-----------------------------------------------------------------------
 +# aka. macros
 +
 +# As variáveis são basicamente todos os tipos de string
 +
 +name = Ted
 +name2="Sarah"
 +
 +echo:
 +	@echo $(name)
 +	@echo ${name2}
 +	@echo $name    # Isso não funcionará, tratado como $ (n)ame.
 +	@echo $(name3) # Variáveis desconhecidas são tratadas como strings vazias.
 +
 +# Existem 4 lugares para definir variáveis.
 +# Em ordem de prioridade, do maior para o menor:
 +# 1: argumentos de linha de comando
 +# 2: Makefile
 +# 3: variáveis de ambiente do shell - faça importações automaticamente.
 +# 4: make tem algumas variáveis predefinidas
 +
 +name4 ?= Jean
 +# Somente defina a variável se a variável de ambiente ainda não estiver definida.
 +
 +override name5 = David
 +# Pára os argumentos da linha de comando de alterar essa variável.
 +
 +name4 +=grey
 +# Anexar valores à variável (inclui um espaço).
 +
 +# Valores variáveis específicos de padrões (extensão GNU).
 +echo: name2 = Sara # Verdadeiro dentro da regra de correspondência
 +	# e também dentro de suas recursivas dependências
 +	# (exceto que ele pode quebrar quando seu gráfico ficar muito complicado!)
 +
 +# Algumas variáveis definidas automaticamente pelo make
 +echo_inbuilt:
 +	echo $(CC)
 +	echo ${CXX}
 +	echo $(FC)
 +	echo ${CFLAGS}
 +	echo $(CPPFLAGS)
 +	echo ${CXXFLAGS}
 +	echo $(LDFLAGS)
 +	echo ${LDLIBS}
 +
 +#-----------------------------------------------------------------------
 +# Variáveis 2
 +#-----------------------------------------------------------------------
 +
 +# O primeiro tipo de variáveis é avaliado a cada vez que elas são usadas.
 +# TIsso pode ser caro, então existe um segundo tipo de variável que é
 +# avaliado apenas uma vez. (Esta é uma extensão do GNU make)
 +
 +var := hello
 +var2 ::=  $(var) hello
 +#:= e ::= são equivalentes.
 +
 +# Essas variáveis são avaliadas procedimentalmente (na ordem em que
 +# aparecem), quebrando assim o resto da línguagem!
 +
 +# Isso não funciona
 +var3 ::= $(var4) and good luck
 +var4 ::= good night
 +
 +#-----------------------------------------------------------------------
 +# Funções
 +#-----------------------------------------------------------------------
 +
 +# make tem muitas funções disponíveis.
 +
 +sourcefiles = $(wildcard *.c */*.c)
 +objectfiles = $(patsubst %.c,%.o,$(sourcefiles))
 +
 +# O formato é $(func arg0,arg1,arg2...)
 +
 +# Alguns exemplos
 +ls:	* src/*
 +	@echo $(filter %.txt, $^)
 +	@echo $(notdir $^)
 +	@echo $(join $(dir $^),$(notdir $^))
 +
 +#-----------------------------------------------------------------------
 +# Diretivas
 +#-----------------------------------------------------------------------
 +
 +# Inclua outros makefiles, úteis para código específico da plataforma
 +include foo.mk
 +
 +sport = tennis
 +# Compilação condicional
 +report:
 +ifeq ($(sport),tennis)
 +	@echo 'game, set, match'
 +else
 +	@echo "They think it's all over; it is now"
 +endif
 +
 +# Há também ifneq, ifdef, ifndef
 +
 +foo = true
 +
 +ifdef $(foo)
 +bar = 'hello'
 +endif
 +```
 +
 +### More Resources
 +
 ++ [documentação gnu make](https://www.gnu.org/software/make/manual/)
 ++ [tutorial de carpintaria de software](http://swcarpentry.github.io/make-novice/)
 ++ aprenda C da maneira mais difícil [ex2](http://c.learncodethehardway.org/book/ex2.html) [ex28](http://c.learncodethehardway.org/book/ex28.html)
 diff --git a/tcl.html.markdown b/tcl.html.markdown index f48d5271..3d23870b 100644 --- a/tcl.html.markdown +++ b/tcl.html.markdown @@ -5,7 +5,7 @@ contributors:  filename: learntcl.tcl  --- -Tcl was created by [John Ousterhout](https://wiki.tcl.tk/John%20Ousterout) as a +Tcl was created by [John Ousterhout](https://wiki.tcl-lang.org/page/John+Ousterhout) as a  reusable scripting language for circuit design tools that he authored.  In 1997 he  was awarded the [ACM Software System  Award](https://en.wikipedia.org/wiki/ACM_Software_System_Award) for Tcl.   Tcl @@ -283,7 +283,7 @@ set c [expr {$a + $b}]  # Since "expr" performs variable substitution on its own, brace the expression  # to prevent Tcl from performing variable substitution first.  See -# "http://wiki.tcl.tk/Brace%20your%20#%20expr-essions" for details. +# "https://wiki.tcl-lang.org/page/Brace+your+expr-essions" for details.  # "expr" understands variable and script substitution: @@ -581,8 +581,8 @@ a  ## Reference -[Official Tcl Documentation](http://www.tcl.tk/man/tcl/) +[Official Tcl Documentation](https://www.tcl-lang.org) -[Tcl Wiki](http://wiki.tcl.tk) +[Tcl Wiki](https://wiki.tcl-lang.org)  [Tcl Subreddit](http://www.reddit.com/r/Tcl) diff --git a/typescript.html.markdown b/typescript.html.markdown index db6579e2..9158f123 100644 --- a/typescript.html.markdown +++ b/typescript.html.markdown @@ -113,6 +113,13 @@ class Point {    static origin = new Point(0, 0);  } +// Classes can be explicitly marked as implementing an interface. +// Any missing properties will then cause an error at compile-time.  +class PointPerson implements Person { +    name: string +    move() {} +} +  let p1 = new Point(10, 20);  let p2 = new Point(25); //y will be 0 | 
