Skip to content
Snippets Groups Projects
Verified Commit af28f383 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

first round of cleanup

parent c9f0b052
No related branches found
No related tags found
No related merge requests found
Showing
with 30 additions and 317 deletions
# How to configure `git`?
```bash
$ git config --global user.name "Firstname Lastname"
$ git config --global user.email "first.last@uni.lu"
```
Test whether your username and email have been registered
```bash
$ git config --list
```
This should list the configuration with `user.name` and `user.email`.
Exit by typing `q`.
# What is an SSH key?
An SSH key is a secure access credential.
**Principle**: <br><br>
Communicate **securely** with Github/Gitlab **without** entering the username/password.
# How do I get and set my SSH key?
Check if you already have an SSH key:
```bash
$ ls -al ~/.ssh
```
If there are 2 files named `id_rsa`, you have an SSH key.
If you don’t have yet an SSH key, you have to generate one:
```bash
$ ssh-keygen -t rsa # -b 4096
```
Then, add the SSH key to Github/Gitlab.
<img src="slides/img/icon-live-demo.png" height="100px">
\ No newline at end of file
# R3.school # R3.school
## June 11th, 2019 ## October 3rd, 2019
<div style="top: 6em; left: 0%; position: absolute;"> <div style="top: 6em; left: 0%; position: absolute;">
<img src="theme/img/lcsb_bg.png"> <img src="theme/img/lcsb_bg.png">
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
<div style="top: 5em; left: 60%; position: absolute;"> <div style="top: 5em; left: 60%; position: absolute;">
<img src="slides/img/r3-training-logo.png" height="200px"> <img src="slides/img/r3-training-logo.png" height="200px">
<br><br><br> <br><br><br>
<h1>git training for absolute beginners</h1> <h1>Basic git training</h1>
<br><br><br><br> <br><br><br><br>
<h4> <h4>
Laurent Heirendt, Ph.D.<br><br> Laurent Heirendt, Ph.D.<br>
laurent.heirendt@uni.lu<br><br> laurent.heirendt@uni.lu<br>
<i>Luxembourg Centre for Systems Biomedicine</i> <i>Luxembourg Centre for Systems Biomedicine</i>
</h4> </h4>
</div> </div>
# Installation of `git`
<img src="slides/img/github_app.png" class="as-is" height="200" />
**macOS**
Install *Xcode Command Line Tools*
**Windows**
Install Git Bash: <br>`https://git-scm.com/download/win`
**Linux (Ubuntu)**
```bash
$ sudo apt-get install git-all
```
# How to get started?
**macOS**
Start the `Terminal` or `iTerm`.
**Windows**
Start `GUI Bash`.
**Linux (Ubuntu)**
Start the `Terminal` or `Terminator`.
**Is `git` properly installed?**
```bash
$ git --version
# git version 2.10.0
```
\ No newline at end of file
[ [
{ { "filename": "index.md" },
"filename": "index.md" { "filename": "overview.md" },
}, { "filename": "what_is_git.md" },
{ { "filename": "the_terminal.md" },
"filename": "overview.md" { "filename": "github_gitlab.md" },
}, { "filename": "cloneRepo.md" },
{ { "filename": "forks.md" },
"filename": "wheel.md" { "filename": "branches.md" },
}, { "filename": "essential_commands.md" },
{ { "filename": "merge.md" },
"filename": "repro_crisis.md" { "filename": "syncFork.md" },
}, { "filename": "best_practices.md" },
{ { "filename": "thanks.md" }
"filename": "whatiscode.md"
},
{
"filename": "whyCare.md"
},
{
"filename": "qualityCode.md"
},
{
"filename": "what_is_git.md"
},
{
"filename": "the_terminal.md"
},
{
"filename": "the_editor.md"
},
{
"filename": "installation.md"
},
{
"filename": "github_gitlab.md"
},
{
"filename": "configuration.md"
},
{
"filename": "cloneRepo.md"
},
{
"filename": "forks.md"
},
{
"filename": "branches.md"
},
{
"filename": "essential_commands.md"
},
{
"filename": "merge.md"
},
{
"filename": "syncFork.md"
},
{
"filename": "best_practices.md"
},
{
"filename": "thanks.md"
}
] ]
# Overview # Overview
1. **PART I**: Quality of computer code. 1. The terminal
2. **PART II**: Basic git course 2. The editor
1. The terminal 3. What is `git`? What is the use of `git`? <!--(5 min)//-->
2. The editor 4. Installation of `git`
3. What is `git`? What is the use of `git`? <!--(5 min)//--> 5. GitHub and GitLab <!--(5min)//-->
4. Installation of `git` 6. How do I configure `git`? <!--(5min)//-->
5. GitHub and GitLab <!--(5min)//--> 7. Where and how to start? <!--(5min)//-->
6. How do I configure `git`? <!--(5min)//--> 8. What is a fork? <!--(5min)//-->
7. Where and how to start? <!--(5min)//--> 9. What are branches?
8. What is a fork? <!--(5min)//--> 10. The 5 essential commands (`pull` / `status` / `add` / `commit` / `push`)
9. What are branches? 11. What are merge/pull requests? <!--(10 min)//-->
10. The 5 essential commands (`pull` / `status` / `add` / `commit` / `push`) 12. How do I synchronize my fork?
11. What are merge/pull requests? <!--(10 min)//--> 13. Best practices
12. How do I synchronize my fork? \ No newline at end of file
13. Best practices
\ No newline at end of file
# Quality of computer code is relevant for everyone.
`This does not concern me – I am only writing documentation or a script for generating a figure that I want to publish!`
[Anonymous researcher]
<div class="fragment">
**Great**, but ...
- Figure may not be reproducible
- Figure looks different when the input data changes
- Documentation will become outdated
… actually, **EVERYONE** writing documentation, a script, or code is concerned!
<div align="center">
<img src="slides/img/snoopy.png" height="400px">
</div>
# Attributes of high-quality computer code
**Quality** of computer code can be seen as a **group of various attributes**.
High-quality computer code should be:
1. <font color="#A52A2A">**Versioned**</font>: incremental code
2. <font color="#FFA500">**Well-written**</font> (formatted, documented, commented): easy to read by a human
3. <font color="#008931">**Tested**</font>: extensively tested code
<div align="center">
<img src="slides/img/qualitybadge.png">
</div>
\ No newline at end of file
# Reproducibility crisis
<div align="center">
<img src="slides/img/reproCrisis.png">
</div>
*Baker, M., <a href="https://www.nature.com/news/1-500-scientists-lift-the-lid-on-reproducibility-1.19970">1,500 scientists lift the lid on reproducibility</a>, Nature 533, 452–454, 2016. doi:10.1038/533452a*
\ No newline at end of file
# The editor(s)
Recommended editors:
- **Visual Studio Code** (https://code.visualstudio.com)
- **Atom** (https://atom.io)
*Note*: Other editors such as IntelliJ IDEA (https://www.jetbrains.com/idea) or Sublime Text (https://www.sublimetext.com) can, of course, also be used.
<img src="slides/img/icon-live-demo.png" height="100px">
\ No newline at end of file
# PART II
<br><br><h1>Basic git course</h1>
# The terminal (shell)
**macOS users:**
Start the Terminal from your `/Applications` directoy.
![bulb](slides/img/bulb.png) Install iTerm2: `https://www.iterm2.com`
**Windows users:**
Install Git Bash: <br>`https://git-scm.com/download/win`
**Linux users:**
Launch default terminal.<br>
![bulb](slides/img/bulb.png) Install Terminator: `https://launchpad.net/terminator`
# First steps in the terminal # First steps in the terminal
Starting the terminal presents itself with a line where you can enter a command Starting the terminal presents itself with a line where you can enter a command
......
# What is computer code?
**Computer code**: Set of instructions executed by a computer
**Programming language:**: Style of writing the set of instructions (e.g., C, C++, Fortran, Python, R, Matlab, Julia, …)
**Example:**
<div align="center">
<img src="slides/img/computerCode.png">
</div>
<div class="fragment">
<div align="center"><font color="#A52A2A"><span class="fas fa-arrow-right"></span> Maybe this is not so relevant … or even, why should I care?</font></div>
# PART I
<br><br><h1>Quality of computer code.</h1><br>
<h1>Should you care? What if you didn't?</h1>
# A true story ...
<div align="center">
<img src="slides/img/wheel.png">
</div>
<table style="width:100%">
<tr>
<th width="33%" align="center">Researcher who cares about<br>quality of his code</th>
<th width="33%" align="center">Fellow researcher</th>
<th width="33%" align="center">Pi or Manager</th>
</tr>
</table>
\ No newline at end of file
# Why you should care (1)
<div align="center">
<video width="40%" controls>
<source src="slides/img/arianeLaunch.mov" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>
**Aerospace Application**: First launch of Ariane 5, 1996
<font color="#A52A2A"><span class="fas fa-times-circle"></span></font> **Problem**: Rocket exploded shortly after liftoff.
<font color="#FFA500"><span class="fas fa-exclamation-triangle"></span></font> **Root cause of disaster - Software error:**
Horizontal velocity of the rocket exceeded the limits of the 16-bit signed integer value and led to overflow
Ariane 5 launched with the same software as Ariane 4 - **the code had not been tested**
# Why you should care (2)
<div align="center">
<img src="slides/img/therac.png">
</div>
**Biotechnology Application**: Therac-25 – computer controlled radiation therapy machine
<font color="#A52A2A"><span class="fas fa-times-circle"></span></font> **Problem**: Device malfunctions and delivers a lethal dose of radiation - several patients died.
<font color="#FFA500"><span class="fas fa-exclamation-triangle"></span></font> **Root cause of disaster - Software error:**
**No testing** of software before release, **lack of documentation**
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment