Browse Source

Adding Ubuntu version

Pierre-Yves Barriat 1 year ago
parent
commit
bff8a028f7
8 changed files with 151 additions and 4 deletions
  1. 1 0
      .gitignore
  2. 9 1
      README.md
  3. 133 0
      VSCode_Ubuntu.md
  4. BIN
      VSCode_Ubuntu.pdf
  5. 3 1
      VSCode_WSL.md
  6. BIN
      VSCode_WSL.pdf
  7. BIN
      assets/ubuntu_logo.png
  8. 5 2
      compile.sh

+ 1 - 0
.gitignore

@@ -1,5 +1,6 @@
 VSCode.html
 VSCode_WSL.html
+VSCode_Ubuntu.html
 
 # ---> VisualStudioCode
 .settings

+ 9 - 1
README.md

@@ -1,7 +1,15 @@
 # learning-vscode
 
-This is the repository for the training Visual Studio Code for WSL
+This is the repository for the training Visual Studio Code 
+
+## Visual Studio Code for Windows (WSL)
 
 You can find the slides [here](./VSCode_WSL.pdf).
 
 Presentation is [here](https://www.elic.ucl.ac.be/users/pbarriat/slides/VSCode_WSL.html)
+
+## Visual Studio Code for Linux (Ubuntu)
+
+You can find the slides [here](./VSCode_Ubuntu.pdf).
+
+Presentation is [here](https://www.elic.ucl.ac.be/users/pbarriat/slides/VSCode_Ubuntu.html)

+ 133 - 0
VSCode_Ubuntu.md

@@ -0,0 +1,133 @@
+---
+marp: true
+title: Visual Studio Code for Ubuntu
+author: P.Y. Barriat
+description: How to use VSCode with Ubuntu
+backgroundImage: url('assets/back.png')
+_backgroundImage: url('assets/garde.png')
+footer: 01/06/2023 | Visual Studio Code for Ubuntu | PY Barriat
+_footer: ""
+paginate: true
+_paginate: false
+math: true
+---
+
+Visual Studio Code for Ubuntu<!--fit-->
+===
+
+https://gogs.elic.ucl.ac.be/pbarriat/learning-vscode
+
+![h:250](assets/ubuntu_logo.png)![h:250](assets/logo_vscode.png)
+
+**Pierre-Yves Barriat**
+ELIC Training Sessions `June 13th, 2023`
+
+---
+
+# What is Visual Studio Code :question:
+
+**Visual Studio Code** (VS Code) is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux.
+
+It has a rich ecosystem of extensions for languages (such as C++, Fortran, Java, Python, etc) and runtimes (Git, Jupyter, etc)
+
+VSC is one of the most popular and powerful text editors used by software engineers today 
+> free, open-source and [available](https://code.visualstudio.com/download) for macOS, Windows and Linux :+1:
+
+---
+
+# VS Code 
+
+You can install Visual Studio Code from the web link [here](https://code.visualstudio.com/download)
+
+`wget` the **deb** package then `dpkg -i code*.deb`
+
+That's it ! :smiley:
+
+---
+
+## Install extensions
+
+- Python
+- Jupyter
+
+![h:400](assets/vscode_extensions.png)
+
+---
+
+# Jupyter Notebook in VS Code
+
+Create a new Juyter Notebook
+
+![h:200](assets/new_ipynb.png)
+
+Fill the first cell
+
+```python
+import numpy as np
+```
+
+---
+
+Try to run the cell
+
+> you must choose a Python environment first (Python 3.6)
+>
+> ![h:100](assets/vscode_pyenv.png)
+
+If :boom: ... maybe you must install a missing extension !
+
+So open a **terminal** in VS Code an do
+
+```bash
+sudo apt install python3-pip
+```
+
+---
+
+Now, install the missing Python extension ... 
+
+```bash
+pip instal numpy
+```
+
+![h:350](assets/vscode_add_ext.png)
+
+... and run the cell again: great, it's OK now :smiley:
+
+---
+
+## Let's try a full notebook example
+
+Install Git : `sudo apt install git -y`
+
+Now clone this **Git repository**
+
+```bash
+git clone https://gogs.elic.ucl.ac.be/pbarriat/learning-vscode
+```
+
+> You don't already know what's Git :question:
+> Shame on you ! :confounded:
+>
+> **It's not to late**: take a look here
+> https://gogs.elic.ucl.ac.be/TECLIM/Git_Training
+
+Now open the file `example.ipynb`
+
+---
+
+The first cell implies you must install some requirements
+
+To run this example, install the extensions below
+
+```bash
+pip install netCDF4
+sudo apt install libgeos-dev libgdal-dev
+pip install cartopy
+```
+
+Now, try to run all the cells of this notebook :exclamation:
+
+---
+
+# Visual Studio Code for Ubuntu :speech_balloon:

BIN
VSCode_Ubuntu.pdf


+ 3 - 1
VSCode.md → VSCode_WSL.md

@@ -215,7 +215,9 @@ pip instal numpy
 
 ## Let's try a full notebook example
 
-First clone this **Git repository**
+Install Git : `sudo apt install git -y`
+
+Now clone this **Git repository**
 
 ```bash
 git clone https://gogs.elic.ucl.ac.be/pbarriat/learning-vscode

BIN
VSCode_WSL.pdf


BIN
assets/ubuntu_logo.png


+ 5 - 2
compile.sh

@@ -6,5 +6,8 @@
 # https://github.com/marp-team/marp-cli/releases
 #
 
-marp --allow-local-files --theme ./assets/tum.css VSCode.md -o VSCode_WSL.pdf
-marp --template bespoke --bespoke.progress --allow-local-files --theme ./assets/tum.css VSCode.md -o VSCode_WSL.html
+marp --allow-local-files --theme ./assets/tum.css VSCode_WSL.md -o VSCode_WSL.pdf
+marp --template bespoke --bespoke.progress --allow-local-files --theme ./assets/tum.css VSCode_WSL.md -o VSCode_WSL.html
+
+marp --allow-local-files --theme ./assets/tum.css VSCode_Ubuntu.md -o VSCode_Ubuntu.pdf
+marp --template bespoke --bespoke.progress --allow-local-files --theme ./assets/tum.css VSCode_Ubuntu.md -o VSCode_Ubuntu.html