Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • R3/school/courses
  • vilem.ded/courses
  • todor.kondic/courses
  • noua.toukourou/courses
  • nene.barry/courses
  • laurent.heirendt/courses
  • marina.popleteeva/courses
  • jenny.tran/courses
8 results
Show changes
Commits on Source (16)
Showing
with 2194 additions and 1 deletion
......@@ -23,3 +23,4 @@ package.json
./theme/package.json
__pycache__/
contribute.egg-info/
.*.swp
......@@ -2,7 +2,7 @@
- Create your own copy of the original (also called `upstream`) repository (`fork` in `git` jargon)
- Download your copy to your computer (`clone` in `git` jargon)
- Create a new brach
- Create a new branch
- Make changes
- Commit changes
- <font color="red">Push changes to server</font>
......
<div class=leader>
<i class="twa twa-axe"></i><i class="twa twa-carpentry-saw"></i><i class="twa twa-screwdriver"></i><i class="twa twa-wrench"></i><i class="twa twa-hammer"></i><br>
Bootstrapping Julia
</div>
# Installing Julia
Recommended method:
- Download an archive from https://julialang.org/downloads/
- Execute `julia` or `julia.exe` as-is
- Link it to your `$PATH`
Distribution packages usually work well too:
- **Debians&Ubuntus**: `apt install julia`
- **Iris/Aion**: `module add lang/Julia`
# Life in REPL
```julia
user@pc $ julia
julia> sqrt(1+1)
1.4142135623730951
julia> println("Well hello there!")
Well hello there!
julia> ?
help?> sqrt
sqrt(x)
Computes the square root .....
```
# REPL modes
Julia interprets some additional keys to make our life easier:
- `?`: help mode
- `;`: shell mode
- `]`: packaging mode (looks like a box!)
- `Backspace`: quits special mode
- `Tab`: autocomplete anything
- `\`... `Tab`: expand math characters
# Managing packages from the package management environment
- Install a package
```julia
] add UnicodePlots
```
- Uninstall a package
```julia
] remove UnicodePlots
```
# Loading libraries, modules and packages
- Load a local file (with shared functions etc.)
```julia
include("mylibrary.jl")
```
- Load a package, add its exports to the global namespace
```julia
using UnicodePlots
```
# <i class="twa twa-light-bulb"> </i> How to write a standalone program?
*Your scripts should communicate well with the environment!*
(that means, among other, you)
```julia
#!/usr/bin/env julia
function process_file(filename)
@info "Processing $filename..."
# ... do something ...
if error_detected
@error "something terrible has happened"
exit(1)
end
end
for file in ARGS
process_file(file)
end
```
Correct processing of commandline arguments makes your scripts *repurposable*
and *configurable*.
# <i class="twa twa-light-bulb"></i> Workflow: Make a local environment for your script
- Enter a local project with separate package versions
```julia
] activate path/to/project
```
- Install dependencies of the local project
```julia
] instantiate
```
- Execute a script with the project environment
```sh
$ julia --project=path/to/project script.jl
```
(Project data is stored in `Project.toml`, `Manifest.toml`.)
<div class=leader>
<i class="twa twa-rocket"></i>
<i class="twa twa-rocket"></i>
<i class="twa twa-rocket"></i><br>
Parallel Julia
</div>
# Julia model of distributed computation
<center>
<img src="slides/img/distrib.svg" width="50%">
</center>
# Basic parallel processing
**Using `Threads`:**
1. start Julia with parameter `-t N`
2. parallelize (some) loops with `Threads.@threads`
```julia
a = zeros(100000)
Threads.@threads for i = eachindex(a)
a[i] = hardfunction(i)
end
```
**Using `Distributed`:**
```julia
using Distributed
addprocs(N)
newVector = pmap(myFunction, myVector)
```
We will use the `Distributed` approach.
# Managing your workers
```julia
using Distributed
addprocs(4)
myid()
workers()
```
Running commands on workers:
```julia
@spawnat 3 @info "Message from worker"
@spawnat :any myid()
```
Getting results from workers:
```julia
job = @spawnat :any begin sleep(10); return 123+321; end
fetch(job)
```
Cleaning up:
```julia
rmprocs(workers())
```
# Processing lots of data items in parallel
```julia
datafiles = ["file$i.csv" for i=1:20]
@everywhere function process_file(name)
println("Processing file $name")
# ... do something ...
end
pmap(process_file, datafiles)
```
<i class="twa twa-light-bulb"></i><i class="twa twa-light-bulb"></i> Doing it manually:
```julia
@sync for f in datafiles
@async @spawnat :any process_file(f)
end
```
# Gathering results from workers
```julia
items = collect(1:1000)
@everywhere compute_item(i) = 123 + 321*i
pmap(compute_item, items)
```
<i class="twa twa-light-bulb"></i><i class="twa twa-light-bulb"></i><i class="twa twa-light-bulb"></i> Doing manually with `@spawnat`:
```julia
futures = [@spawnat :any compute_item(item) for item in items]
fetch.(futures)
```
# How to design for parallelization?
**Recommended way:** *Utilize the high-level looping primitives!*
- use `map`, parallelize by just switching to `pmap`
- use `reduce` or `mapreduce`, parallelize by just switching to `dmapreduce` (DistributedData.jl)
# <i class="twa twa-light-bulb"></i> Parallel → distributed processing
It is very easy to organize *multiple computers* to work for you!
You need a working `ssh` connection:
```sh
user@pc1 $ ssh server1
Last login: Wed Jan 13 15:29:34 2021 from 2001:a18:....
user@server $ _
```
Spawning remote processes on remote machines:
```julia
julia> using Distributed
julia> addprocs([("server1", 10), ("pc2", 2)])
```
**Benefit:** No additional changes to the parallel programs!
<div class=leader>
<i class="twa twa-abacus"></i>
<i class="twa twa-laptop"></i>
<i class="twa twa-desktop-computer"></i>
<i class="twa twa-flag-luxembourg"></i><br>
Utilizing ULHPC <i class="twa twa-light-bulb"></i>
</div>
# What does the cluster look like? (Iris)
<center>
<img src="slides/img/iris.png" width="30%">
<br>
<tt>hpc-docs.uni.lu/systems/iris</tt>
</center>
# Running Julia on the computing nodes
Start an allocation and connect to it:
```sh
0 [mkratochvil@access1 ~]$ srun -p interactive -t 30 --pty bash -i
```
(You can also use `si`.)
After some brief time, you should get a shell on a compute node. There you can install and start Julia as usual:
```
0 [mkratochvil@iris-131 ~](2696005 1N/T/1CN)$ module add lang/Julia
0 [mkratochvil@iris-131 ~](2696005 1N/T/1CN)$ julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.6.2 (2021-07-14)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia>
```
# Making a HPC-compatible Julia script
Main challenges:
1. discover the available resources
2. spawn worker processes at the right place
```julia
using ClusterManagers
addprocs_slurm(parse(Int, ENV["SLURM_NTASKS"]))
# ... continue as usual
```
# Scheduling an analysis script
Normally, you write a "batch script" and add it to a queue using `sbatch`.
Script in `runAnalysis.sbatch`:
```sh
#!/bin/bash
# SBATCH -J MyAnalysisInJulia
# SBATCH -n 10
# SBATCH -c 1
# SBATCH -t 30
# SBATCH --mem-per-cpu 4G
julia runAnalysis.jl
```
You start the script using:
```sh
$ sbatch runAnalysis.sbatch
```
<div class=leader>
<i class="twa twa-blueberries"></i>
<i class="twa twa-red-apple"></i>
<i class="twa twa-melon"></i>
<i class="twa twa-grapes"></i><br>
Questions?
</div>
Lets do some hands-on problem solving (expected around 15 minutes)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="309.045pt"
height="196.68pt"
viewBox="0 0 309.045 196.68"
version="1.2"
id="svg485"
sodipodi:docname="distrib.pdf"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview487"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="pt" />
<defs
id="defs100">
<g
id="g80">
<symbol
overflow="visible"
id="glyph0-0">
<path
style="stroke:none;"
d="M 5.40625 -10.46875 L 1.21875 -10.46875 L 1.21875 3.484375 L 5.40625 3.484375 Z M 4.875 -9.953125 L 4.875 2.96875 L 1.78125 2.96875 L 1.78125 -9.953125 Z M 3.234375 -4.5 C 2.84375 -4.5 2.296875 -4.375 2.296875 -4.109375 C 2.296875 -3.984375 2.390625 -3.875 2.546875 -3.875 C 2.578125 -3.875 2.625 -3.890625 2.671875 -3.90625 C 2.84375 -3.984375 2.984375 -4.015625 3.1875 -4.015625 C 3.6875 -4.015625 3.796875 -3.71875 3.796875 -3.328125 C 3.796875 -2.796875 3.609375 -2.609375 2.890625 -2.5625 L 2.890625 -1.71875 C 2.890625 -1.578125 3.015625 -1.484375 3.140625 -1.484375 C 3.265625 -1.484375 3.390625 -1.578125 3.390625 -1.71875 L 3.390625 -2.171875 C 4.0625 -2.265625 4.34375 -2.65625 4.34375 -3.34375 C 4.34375 -3.953125 4.09375 -4.5 3.234375 -4.5 Z M 3.140625 -1.203125 C 2.9375 -1.203125 2.796875 -1.046875 2.796875 -0.84375 C 2.796875 -0.640625 2.9375 -0.484375 3.140625 -0.484375 C 3.34375 -0.484375 3.484375 -0.640625 3.484375 -0.84375 C 3.484375 -1.046875 3.34375 -1.203125 3.140625 -1.203125 Z M 3.140625 -1.203125 "
id="path2" />
</symbol>
<symbol
overflow="visible"
id="glyph0-1">
<path
style="stroke:none;"
d="M 6.1875 -5.375 C 5.484375 -5.375 5 -5 4.625 -4.421875 C 4.421875 -5.03125 3.953125 -5.375 3.296875 -5.375 C 2.609375 -5.375 2.140625 -5.015625 1.78125 -4.484375 L 1.703125 -5.25 L 0.921875 -5.25 L 0.921875 0 L 1.828125 0 L 1.828125 -3.734375 C 2.1875 -4.28125 2.5 -4.65625 3.078125 -4.65625 C 3.46875 -4.65625 3.8125 -4.421875 3.8125 -3.640625 L 3.8125 0 L 4.71875 0 L 4.71875 -3.734375 C 5.078125 -4.28125 5.390625 -4.65625 5.96875 -4.65625 C 6.359375 -4.65625 6.703125 -4.421875 6.703125 -3.640625 L 6.703125 0 L 7.609375 0 L 7.609375 -3.765625 C 7.609375 -4.75 7.046875 -5.375 6.1875 -5.375 Z M 6.1875 -5.375 "
id="path5" />
</symbol>
<symbol
overflow="visible"
id="glyph0-2">
<path
style="stroke:none;"
d="M 4.4375 -1.21875 L 4.4375 -3.625 C 4.4375 -4.71875 3.859375 -5.375 2.59375 -5.375 C 2 -5.375 1.421875 -5.25 0.78125 -5.015625 L 1 -4.34375 C 1.546875 -4.53125 2.03125 -4.625 2.421875 -4.625 C 3.15625 -4.625 3.515625 -4.34375 3.515625 -3.59375 L 3.515625 -3.203125 L 2.71875 -3.203125 C 1.25 -3.203125 0.40625 -2.59375 0.40625 -1.46875 C 0.40625 -0.53125 1.03125 0.125 2.078125 0.125 C 2.71875 0.125 3.265625 -0.125 3.640625 -0.671875 C 3.796875 -0.15625 4.140625 0.0625 4.671875 0.125 L 4.875 -0.515625 C 4.609375 -0.625 4.4375 -0.765625 4.4375 -1.21875 Z M 2.28125 -0.5625 C 1.6875 -0.5625 1.375 -0.890625 1.375 -1.515625 C 1.375 -2.234375 1.859375 -2.59375 2.828125 -2.59375 L 3.515625 -2.59375 L 3.515625 -1.390625 C 3.21875 -0.84375 2.828125 -0.5625 2.28125 -0.5625 Z M 2.28125 -0.5625 "
id="path8" />
</symbol>
<symbol
overflow="visible"
id="glyph0-3">
<path
style="stroke:none;"
d="M 1.359375 -7.78125 C 0.984375 -7.78125 0.734375 -7.5 0.734375 -7.140625 C 0.734375 -6.796875 0.984375 -6.53125 1.359375 -6.53125 C 1.75 -6.53125 2.015625 -6.796875 2.015625 -7.140625 C 2.015625 -7.5 1.75 -7.78125 1.359375 -7.78125 Z M 1.828125 -5.25 L 0.921875 -5.25 L 0.921875 0 L 1.828125 0 Z M 1.828125 -5.25 "
id="path11" />
</symbol>
<symbol
overflow="visible"
id="glyph0-4">
<path
style="stroke:none;"
d="M 3.390625 -5.375 C 2.703125 -5.375 2.140625 -5.015625 1.78125 -4.46875 L 1.703125 -5.25 L 0.921875 -5.25 L 0.921875 0 L 1.828125 0 L 1.828125 -3.734375 C 2.1875 -4.28125 2.578125 -4.65625 3.171875 -4.65625 C 3.671875 -4.65625 4 -4.421875 4 -3.640625 L 4 0 L 4.921875 0 L 4.921875 -3.765625 C 4.921875 -4.765625 4.359375 -5.375 3.390625 -5.375 Z M 3.390625 -5.375 "
id="path14" />
</symbol>
<symbol
overflow="visible"
id="glyph0-5">
<path
style="stroke:none;"
d="M 3.328125 -5.375 C 2.734375 -5.375 2.15625 -5.078125 1.78125 -4.546875 L 1.703125 -5.25 L 0.921875 -5.25 L 0.921875 2.125 L 1.828125 2.015625 L 1.828125 -0.484375 C 2.171875 -0.0625 2.640625 0.125 3.203125 0.125 C 4.5625 0.125 5.28125 -1.03125 5.28125 -2.625 C 5.28125 -4.28125 4.71875 -5.375 3.328125 -5.375 Z M 2.984375 -0.625 C 2.515625 -0.625 2.109375 -0.859375 1.828125 -1.265625 L 1.828125 -3.828125 C 2.109375 -4.25 2.546875 -4.640625 3.09375 -4.640625 C 3.890625 -4.640625 4.28125 -4 4.28125 -2.625 C 4.28125 -1.25 3.828125 -0.625 2.984375 -0.625 Z M 2.984375 -0.625 "
id="path17" />
</symbol>
<symbol
overflow="visible"
id="glyph0-6">
<path
style="stroke:none;"
d="M 3.203125 -5.375 C 2.5625 -5.375 2.078125 -4.96875 1.796875 -4.1875 L 1.703125 -5.25 L 0.921875 -5.25 L 0.921875 0 L 1.828125 0 L 1.828125 -3 C 2.046875 -4 2.4375 -4.46875 3.09375 -4.46875 C 3.28125 -4.46875 3.390625 -4.453125 3.546875 -4.421875 L 3.71875 -5.3125 C 3.5625 -5.359375 3.375 -5.375 3.203125 -5.375 Z M 3.203125 -5.375 "
id="path20" />
</symbol>
<symbol
overflow="visible"
id="glyph0-7">
<path
style="stroke:none;"
d="M 2.921875 -5.375 C 1.421875 -5.375 0.5625 -4.25 0.5625 -2.625 C 0.5625 -0.953125 1.421875 0.125 2.90625 0.125 C 4.390625 0.125 5.25 -1 5.25 -2.625 C 5.25 -4.296875 4.421875 -5.375 2.921875 -5.375 Z M 2.921875 -4.640625 C 3.78125 -4.640625 4.265625 -4 4.265625 -2.625 C 4.265625 -1.25 3.78125 -0.625 2.90625 -0.625 C 2.03125 -0.625 1.5625 -1.25 1.5625 -2.625 C 1.5625 -4 2.046875 -4.640625 2.921875 -4.640625 Z M 2.921875 -4.640625 "
id="path23" />
</symbol>
<symbol
overflow="visible"
id="glyph0-8">
<path
style="stroke:none;"
d="M 2.859375 -5.375 C 1.4375 -5.375 0.5625 -4.25 0.5625 -2.578125 C 0.5625 -0.890625 1.453125 0.125 2.859375 0.125 C 3.46875 0.125 4 -0.078125 4.46875 -0.453125 L 4.046875 -1.0625 C 3.65625 -0.796875 3.34375 -0.65625 2.90625 -0.65625 C 2.078125 -0.65625 1.5625 -1.21875 1.5625 -2.609375 C 1.5625 -3.96875 2.078125 -4.609375 2.90625 -4.609375 C 3.34375 -4.609375 3.671875 -4.484375 4.03125 -4.234375 L 4.46875 -4.8125 C 3.984375 -5.21875 3.484375 -5.375 2.859375 -5.375 Z M 2.859375 -5.375 "
id="path26" />
</symbol>
<symbol
overflow="visible"
id="glyph0-9">
<path
style="stroke:none;"
d="M 4.921875 -2.78125 C 4.921875 -4.390625 4.171875 -5.375 2.75 -5.375 C 1.390625 -5.375 0.5625 -4.203125 0.5625 -2.578125 C 0.5625 -0.90625 1.421875 0.125 2.890625 0.125 C 3.625 0.125 4.203125 -0.125 4.71875 -0.53125 L 4.328125 -1.09375 C 3.875 -0.765625 3.484375 -0.625 2.953125 -0.625 C 2.203125 -0.625 1.640625 -1.09375 1.546875 -2.3125 L 4.890625 -2.3125 C 4.90625 -2.4375 4.921875 -2.609375 4.921875 -2.78125 Z M 4 -2.984375 L 1.546875 -2.984375 C 1.609375 -4.15625 2.078125 -4.640625 2.765625 -4.640625 C 3.59375 -4.640625 4 -4.078125 4 -3.046875 Z M 4 -2.984375 "
id="path29" />
</symbol>
<symbol
overflow="visible"
id="glyph0-10">
<path
style="stroke:none;"
d="M 2.375 -5.375 C 1.28125 -5.375 0.484375 -4.765625 0.484375 -3.921875 C 0.484375 -3.1875 0.921875 -2.703125 2.0625 -2.40625 C 3.078125 -2.140625 3.34375 -1.9375 3.34375 -1.421875 C 3.34375 -0.921875 2.90625 -0.625 2.21875 -0.625 C 1.640625 -0.625 1.15625 -0.8125 0.734375 -1.125 L 0.25 -0.5625 C 0.703125 -0.171875 1.34375 0.125 2.234375 0.125 C 3.296875 0.125 4.3125 -0.375 4.3125 -1.46875 C 4.3125 -2.390625 3.671875 -2.828125 2.5625 -3.109375 C 1.71875 -3.328125 1.4375 -3.53125 1.4375 -3.953125 C 1.4375 -4.375 1.796875 -4.640625 2.40625 -4.640625 C 2.890625 -4.640625 3.296875 -4.5 3.765625 -4.203125 L 4.15625 -4.78125 C 3.65625 -5.15625 3.109375 -5.375 2.375 -5.375 Z M 2.375 -5.375 "
id="path32" />
</symbol>
<symbol
overflow="visible"
id="glyph0-11">
<path
style="stroke:none;"
d="M 5.046875 -6.875 L 0.15625 -6.875 L 0.15625 -6.0625 L 2.109375 -6.0625 L 2.109375 0 L 3.046875 0 L 3.046875 -6.0625 L 4.953125 -6.0625 Z M 5.046875 -6.875 "
id="path35" />
</symbol>
<symbol
overflow="visible"
id="glyph0-12">
<path
style="stroke:none;"
d="M 3.21875 -5.625 L 2.40625 -5.625 L 0.34375 -4.34375 L 0.75 -3.703125 L 2.296875 -4.640625 L 2.296875 0 L 3.21875 0 Z M 3.21875 -5.625 "
id="path38" />
</symbol>
<symbol
overflow="visible"
id="glyph0-13">
<path
style="stroke:none;"
d="M 2.21875 -5.71875 C 1.34375 -5.71875 0.703125 -5.359375 0.15625 -4.671875 L 0.734375 -4.1875 C 1.21875 -4.765625 1.65625 -4.96875 2.203125 -4.96875 C 2.859375 -4.96875 3.328125 -4.5625 3.328125 -3.921875 C 3.328125 -3.125 3.015625 -2.6875 0.296875 -0.734375 L 0.296875 0 L 4.28125 0 L 4.390625 -0.765625 L 1.46875 -0.765625 C 4.046875 -2.40625 4.296875 -3.046875 4.296875 -3.953125 C 4.296875 -4.96875 3.484375 -5.71875 2.21875 -5.71875 Z M 2.21875 -5.71875 "
id="path41" />
</symbol>
<symbol
overflow="visible"
id="glyph0-14">
<path
style="stroke:none;"
d="M 3.25 -0.84375 C 2.984375 -0.703125 2.78125 -0.640625 2.546875 -0.640625 C 2.09375 -0.640625 1.921875 -0.890625 1.921875 -1.421875 L 1.921875 -4.546875 L 3.078125 -4.546875 L 3.171875 -5.25 L 1.921875 -5.25 L 1.921875 -6.546875 L 1 -6.4375 L 1 -5.25 L 0.09375 -5.25 L 0.09375 -4.546875 L 1 -4.546875 L 1 -1.375 C 1 -0.40625 1.53125 0.125 2.421875 0.125 C 2.875 0.125 3.25 0 3.59375 -0.234375 Z M 3.25 -0.84375 "
id="path44" />
</symbol>
<symbol
overflow="visible"
id="glyph0-15">
<path
style="stroke:none;"
d="M 3.390625 -5.375 C 2.734375 -5.375 2.21875 -5.046875 1.828125 -4.53125 L 1.828125 -7.453125 L 0.921875 -7.359375 L 0.921875 0 L 1.828125 0 L 1.828125 -3.734375 C 2.1875 -4.28125 2.59375 -4.65625 3.15625 -4.65625 C 3.65625 -4.65625 4 -4.421875 4 -3.640625 L 4 0 L 4.921875 0 L 4.921875 -3.765625 C 4.921875 -4.75 4.34375 -5.375 3.390625 -5.375 Z M 3.390625 -5.375 "
id="path47" />
</symbol>
<symbol
overflow="visible"
id="glyph0-16">
<path
style="stroke:none;"
d="M 6.5625 -6.875 L 5.28125 -6.875 L 3.90625 -1.875 L 2.46875 -6.875 L 1.1875 -6.875 L 0.625 0 L 1.515625 0 L 1.75 -3.03125 C 1.828125 -4.03125 1.875 -5.109375 1.875 -5.90625 L 3.4375 -0.78125 L 4.328125 -0.78125 L 5.8125 -5.90625 C 5.828125 -5.328125 5.890625 -4.171875 5.984375 -3.09375 L 6.21875 0 L 7.140625 0 Z M 6.5625 -6.875 "
id="path50" />
</symbol>
<symbol
overflow="visible"
id="glyph0-17">
<path
style="stroke:none;"
d="M 4.8125 -5.25 L 3.859375 -5.25 L 2.484375 -0.671875 L 1.078125 -5.25 L 0.09375 -5.25 L 1.859375 0 L 2.171875 0 C 1.875 0.8125 1.578125 1.21875 0.515625 1.40625 L 0.609375 2.125 C 2.0625 1.96875 2.6875 1.140625 3.046875 0.03125 Z M 4.8125 -5.25 "
id="path53" />
</symbol>
<symbol
overflow="visible"
id="glyph0-18">
<path
style="stroke:none;"
d="M 3.40625 -6.984375 C 1.84375 -6.984375 0.546875 -5.765625 0.546875 -3.4375 C 0.546875 -1.125 1.75 0.125 3.421875 0.125 C 4.34375 0.125 5 -0.265625 5.390625 -0.640625 L 4.921875 -1.25 C 4.53125 -0.953125 4.09375 -0.671875 3.453125 -0.671875 C 2.375 -0.671875 1.5625 -1.453125 1.5625 -3.4375 C 1.5625 -5.515625 2.421875 -6.203125 3.453125 -6.203125 C 3.9375 -6.203125 4.359375 -6.046875 4.78125 -5.703125 L 5.296875 -6.3125 C 4.75 -6.75 4.265625 -6.984375 3.40625 -6.984375 Z M 3.40625 -6.984375 "
id="path56" />
</symbol>
<symbol
overflow="visible"
id="glyph0-19">
<path
style="stroke:none;"
d="M 4.8125 -5.25 L 3.890625 -5.25 L 3.890625 -1.5 C 3.578125 -0.984375 3.15625 -0.59375 2.578125 -0.59375 C 2.015625 -0.59375 1.78125 -0.875 1.78125 -1.578125 L 1.78125 -5.25 L 0.859375 -5.25 L 0.859375 -1.484375 C 0.859375 -0.453125 1.40625 0.125 2.328125 0.125 C 3.078125 0.125 3.5625 -0.171875 3.953125 -0.8125 L 4.03125 0 L 4.8125 0 Z M 4.8125 -5.25 "
id="path59" />
</symbol>
<symbol
overflow="visible"
id="glyph0-20">
<path
style="stroke:none;"
d="M 2.21875 -5.71875 C 1.46875 -5.71875 0.859375 -5.46875 0.296875 -4.9375 L 0.765625 -4.390625 C 1.21875 -4.8125 1.609375 -4.984375 2.140625 -4.984375 C 2.84375 -4.984375 3.296875 -4.609375 3.296875 -3.984375 C 3.296875 -3.265625 2.734375 -2.859375 2.046875 -2.859375 L 1.703125 -2.859375 L 1.59375 -2.15625 L 2.09375 -2.15625 C 2.984375 -2.15625 3.453125 -1.796875 3.453125 -0.921875 C 3.453125 -0.09375 2.953125 0.421875 2.078125 0.421875 C 1.53125 0.421875 1.09375 0.21875 0.640625 -0.234375 L 0.09375 0.265625 C 0.609375 0.875 1.3125 1.171875 2.109375 1.171875 C 3.53125 1.171875 4.421875 0.296875 4.421875 -0.875 C 4.421875 -1.921875 3.78125 -2.453125 2.890625 -2.546875 C 3.65625 -2.71875 4.203125 -3.265625 4.203125 -4.0625 C 4.203125 -4.9375 3.515625 -5.71875 2.21875 -5.71875 Z M 2.21875 -5.71875 "
id="path62" />
</symbol>
<symbol
overflow="visible"
id="glyph0-21">
<path
style="stroke:none;"
d="M 4.9375 -1.109375 L 4.109375 -1.109375 L 4.109375 -2.921875 L 3.328125 -2.921875 L 3.25 -1.109375 L 1.171875 -1.109375 L 2.96875 -5.40625 L 2.203125 -5.71875 L 0.203125 -1.03125 L 0.203125 -0.40625 L 3.234375 -0.40625 L 3.234375 1.0625 L 4.109375 1.0625 L 4.109375 -0.40625 L 4.9375 -0.40625 Z M 4.9375 -1.109375 "
id="path65" />
</symbol>
<symbol
overflow="visible"
id="glyph0-22">
<path
style="stroke:none;"
d="M 1.9375 -6.875 L 1 -6.875 L 1 0 L 4.65625 0 L 4.765625 -0.828125 L 1.9375 -0.828125 Z M 1.9375 -6.875 "
id="path68" />
</symbol>
<symbol
overflow="visible"
id="glyph0-23">
<path
style="stroke:none;"
d="M 4.921875 -5.84375 C 4.296875 -5.5625 3.8125 -5.34375 2.515625 -5.375 C 1.359375 -5.375 0.484375 -4.609375 0.484375 -3.53125 C 0.484375 -2.859375 0.765625 -2.40625 1.375 -2.078125 C 1 -1.828125 0.796875 -1.5 0.796875 -1.15625 C 0.796875 -0.625 1.21875 -0.15625 2.15625 -0.15625 L 2.984375 -0.15625 C 3.640625 -0.15625 4.03125 0.09375 4.03125 0.59375 C 4.03125 1.109375 3.640625 1.40625 2.5 1.40625 C 1.34375 1.40625 1.078125 1.125 1.078125 0.53125 L 0.25 0.53125 C 0.25 1.59375 0.78125 2.125 2.5 2.125 C 4.125 2.125 4.96875 1.546875 4.96875 0.53125 C 4.96875 -0.3125 4.25 -0.921875 3.171875 -0.921875 L 2.328125 -0.921875 C 1.796875 -0.921875 1.640625 -1.109375 1.640625 -1.359375 C 1.640625 -1.546875 1.75 -1.734375 1.90625 -1.84375 C 2.125 -1.78125 2.328125 -1.75 2.578125 -1.75 C 3.828125 -1.75 4.578125 -2.5 4.578125 -3.53125 C 4.578125 -4.140625 4.265625 -4.578125 3.65625 -4.859375 C 4.25 -4.859375 4.75 -4.875 5.1875 -5.015625 Z M 2.515625 -4.71875 C 3.265625 -4.71875 3.640625 -4.3125 3.640625 -3.546875 C 3.640625 -2.796875 3.25 -2.359375 2.53125 -2.359375 C 1.8125 -2.359375 1.421875 -2.84375 1.421875 -3.53125 C 1.421875 -4.234375 1.796875 -4.71875 2.515625 -4.71875 Z M 2.515625 -4.71875 "
id="path71" />
</symbol>
<symbol
overflow="visible"
id="glyph0-24">
<path
style="stroke:none;"
d="M 2.6875 -6.984375 C 1.421875 -6.984375 0.53125 -6.25 0.53125 -5.1875 C 0.53125 -4.125 1.21875 -3.625 2.5625 -3.203125 C 3.734375 -2.84375 4.046875 -2.546875 4.046875 -1.890625 C 4.046875 -1.0625 3.375 -0.65625 2.578125 -0.65625 C 1.828125 -0.65625 1.28125 -0.921875 0.765625 -1.34375 L 0.25 -0.765625 C 0.8125 -0.203125 1.59375 0.125 2.578125 0.125 C 4.125 0.125 5.03125 -0.71875 5.03125 -1.90625 C 5.03125 -3.234375 4.09375 -3.65625 3 -4 C 1.765625 -4.375 1.5 -4.65625 1.5 -5.234375 C 1.5 -5.890625 2.046875 -6.203125 2.734375 -6.203125 C 3.296875 -6.203125 3.78125 -6.03125 4.296875 -5.609375 L 4.8125 -6.1875 C 4.234375 -6.703125 3.640625 -6.984375 2.6875 -6.984375 Z M 2.6875 -6.984375 "
id="path74" />
</symbol>
<symbol
overflow="visible"
id="glyph0-25">
<path
style="stroke:none;"
d="M 4.8125 -5.25 L 3.84375 -5.25 L 2.46875 -0.8125 L 1.09375 -5.25 L 0.09375 -5.25 L 1.90625 0 L 3.015625 0 Z M 4.8125 -5.25 "
id="path77" />
</symbol>
</g>
<clipPath
id="clip1">
<path
d="M 179 155 L 223 155 L 223 196.679688 L 179 196.679688 Z M 179 155 "
id="path82" />
</clipPath>
<clipPath
id="clip2">
<path
d="M 208 155 L 253 155 L 253 196.679688 L 208 196.679688 Z M 208 155 "
id="path85" />
</clipPath>
<clipPath
id="clip3">
<path
d="M 238 155 L 283 155 L 283 196.679688 L 238 196.679688 Z M 238 155 "
id="path88" />
</clipPath>
<clipPath
id="clip4">
<path
d="M 268 155 L 309.046875 155 L 309.046875 196.679688 L 268 196.679688 Z M 268 155 "
id="path91" />
</clipPath>
<clipPath
id="clip5">
<path
d="M 147 127 L 309.046875 127 L 309.046875 196.679688 L 147 196.679688 Z M 147 127 "
id="path94" />
</clipPath>
<clipPath
id="clip6">
<path
d="M 144 107 L 309.046875 107 L 309.046875 196.679688 L 144 196.679688 Z M 144 107 "
id="path97" />
</clipPath>
</defs>
<g
id="surface1">
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 30.451062 8.261313 L -30.447375 8.261313 C -31.9005 8.261313 -33.072375 7.085531 -33.072375 5.636313 L -33.072375 -5.633219 C -33.072375 -7.082437 -31.9005 -8.258219 -30.447375 -8.258219 L 30.451062 -8.258219 C 31.900281 -8.258219 33.076062 -7.082437 33.076062 -5.633219 L 33.076062 5.636313 C 33.076062 7.085531 31.900281 8.261313 30.451062 8.261313 Z M 30.451062 8.261313 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path102" />
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g112">
<use
xlink:href="#glyph0-1"
x="40.71"
y="51.383"
id="use104" />
<use
xlink:href="#glyph0-2"
x="49.17821"
y="51.383"
id="use106" />
<use
xlink:href="#glyph0-3"
x="54.548051"
y="51.383"
id="use108" />
<use
xlink:href="#glyph0-4"
x="57.297729"
y="51.383"
id="use110" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g118">
<use
xlink:href="#glyph0-5"
x="65.706163"
y="51.383"
id="use114" />
<use
xlink:href="#glyph0-6"
x="71.544247"
y="51.383"
id="use116" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g124">
<use
xlink:href="#glyph0-7"
x="75.160671"
y="51.383"
id="use120" />
<use
xlink:href="#glyph0-8"
x="80.978829"
y="51.383"
id="use122" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g130">
<use
xlink:href="#glyph0-9"
x="85.591513"
y="51.383"
id="use126" />
<use
xlink:href="#glyph0-10"
x="91.011167"
y="51.383"
id="use128" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g134">
<use
xlink:href="#glyph0-10"
x="95.564076"
y="51.383"
id="use132" />
</g>
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M -36.752063 -22.234781 C -36.752063 -16.547281 -41.361438 -11.937906 -47.048938 -11.937906 C -52.736438 -11.937906 -57.345813 -16.547281 -57.345813 -22.234781 C -57.345813 -27.922281 -52.736438 -32.531656 -47.048938 -32.531656 C -41.361438 -32.531656 -36.752063 -27.922281 -36.752063 -22.234781 Z M -36.752063 -22.234781 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path136" />
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g140">
<use
xlink:href="#glyph0-11"
x="18.931"
y="74.238"
id="use138" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g144">
<use
xlink:href="#glyph0-12"
x="23.68316"
y="74.238"
id="use142" />
</g>
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 10.622937 -28.184 C 10.622937 -22.316812 5.869031 -17.559 0.00184375 -17.559 C -5.86925 -17.559 -10.623156 -22.316812 -10.623156 -28.184 C -10.623156 -34.051187 -5.86925 -38.809 0.00184375 -38.809 C 5.869031 -38.809 10.622937 -34.051187 10.622937 -28.184 Z M 10.622937 -28.184 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path146" />
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g150">
<use
xlink:href="#glyph0-11"
x="65.566"
y="80.188"
id="use148" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g154">
<use
xlink:href="#glyph0-13"
x="70.417786"
y="80.188"
id="use152" />
</g>
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M -18.318469 -8.656656 L -37.380969 -17.664469 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path156" />
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 0.00184375 -8.656656 L 0.00184375 -17.160562 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path158" />
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 167.290906 8.089438 L 93.189344 8.089438 C 91.740125 8.089438 90.564344 6.913656 90.564344 5.464438 L 90.564344 -5.46525 C 90.564344 -6.914469 91.740125 -8.09025 93.189344 -8.09025 L 167.290906 -8.09025 C 168.740125 -8.09025 169.915906 -6.914469 169.915906 -5.46525 L 169.915906 5.464438 C 169.915906 6.913656 168.740125 8.089438 167.290906 8.089438 Z M 167.290906 8.089438 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path160" />
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g176">
<use
xlink:href="#glyph0-2"
x="164.347"
y="51.214"
id="use162" />
<use
xlink:href="#glyph0-4"
x="169.716841"
y="51.214"
id="use164" />
<use
xlink:href="#glyph0-7"
x="175.485187"
y="51.214"
id="use166" />
<use
xlink:href="#glyph0-14"
x="181.303345"
y="51.214"
id="use168" />
<use
xlink:href="#glyph0-15"
x="184.899844"
y="51.214"
id="use170" />
<use
xlink:href="#glyph0-9"
x="190.668189"
y="51.214"
id="use172" />
<use
xlink:href="#glyph0-6"
x="196.087844"
y="51.214"
id="use174" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g182">
<use
xlink:href="#glyph0-5"
x="202.543608"
y="51.214"
id="use178" />
<use
xlink:href="#glyph0-6"
x="208.381692"
y="51.214"
id="use180" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g188">
<use
xlink:href="#glyph0-7"
x="211.998116"
y="51.214"
id="use184" />
<use
xlink:href="#glyph0-8"
x="217.816274"
y="51.214"
id="use186" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g194">
<use
xlink:href="#glyph0-9"
x="222.428958"
y="51.214"
id="use190" />
<use
xlink:href="#glyph0-10"
x="227.848612"
y="51.214"
id="use192" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g198">
<use
xlink:href="#glyph0-10"
x="232.401521"
y="51.214"
id="use196" />
</g>
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 194.185437 -22.066812 C 194.185437 -16.379312 189.576062 -11.766031 183.888562 -11.766031 C 178.201062 -11.766031 173.591687 -16.379312 173.591687 -22.066812 C 173.591687 -27.754312 178.201062 -32.363687 183.888562 -32.363687 C 189.576062 -32.363687 194.185437 -27.754312 194.185437 -22.066812 Z M 194.185437 -22.066812 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path200" />
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g204">
<use
xlink:href="#glyph0-11"
x="249.867"
y="74.069"
id="use202" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g208">
<use
xlink:href="#glyph0-12"
x="254.61916"
y="74.069"
id="use206" />
</g>
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 150.872937 -8.488687 L 173.997937 -17.9965 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path210" />
<path
style="fill:none;stroke-width:1.59404;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:1.59404,1.99255;stroke-miterlimit:10;"
d="M 33.4745 -0.00040625 L 90.165906 -0.00040625 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path212" />
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 34.169812 11.980063 L -58.439563 11.980063 C -59.892688 11.980063 -61.064563 10.804281 -61.064563 9.355063 L -61.064563 -39.90275 C -61.064563 -41.351969 -59.892688 -42.52775 -58.439563 -42.52775 L 34.169812 -42.52775 C 35.619031 -42.52775 36.794812 -41.351969 36.794812 -39.90275 L 36.794812 9.355063 C 36.794812 10.804281 35.619031 11.980063 34.169812 11.980063 Z M 34.169812 11.980063 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path214" />
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g228">
<use
xlink:href="#glyph0-16"
x="12.718"
y="30.348"
id="use216" />
<use
xlink:href="#glyph0-9"
x="20.468903"
y="30.348"
id="use218" />
<use
xlink:href="#glyph0-1"
x="25.888557"
y="30.348"
id="use220" />
<use
xlink:href="#glyph0-7"
x="34.356767"
y="30.348"
id="use222" />
<use
xlink:href="#glyph0-6"
x="40.174926"
y="30.348"
id="use224" />
<use
xlink:href="#glyph0-17"
x="43.990601"
y="30.348"
id="use226" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g234">
<use
xlink:href="#glyph0-10"
x="51.53229"
y="30.348"
id="use230" />
<use
xlink:href="#glyph0-5"
x="56.184824"
y="30.348"
id="use232" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g240">
<use
xlink:href="#glyph0-2"
x="61.973094"
y="30.348"
id="use236" />
<use
xlink:href="#glyph0-8"
x="67.342936"
y="30.348"
id="use238" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g244">
<use
xlink:href="#glyph0-9"
x="71.95562"
y="30.348"
id="use242" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g248">
<use
xlink:href="#glyph0-12"
x="80.015363"
y="30.348"
id="use246" />
</g>
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 195.279187 11.808188 L 89.470594 11.808188 C 88.021375 11.808188 86.845594 10.632406 86.845594 9.183188 L 86.845594 -33.457437 C 86.845594 -34.906656 88.021375 -36.082437 89.470594 -36.082437 L 195.279187 -36.082437 C 196.732312 -36.082437 197.908094 -34.906656 197.908094 -33.457437 L 197.908094 9.183188 C 197.908094 10.632406 196.732312 11.808188 195.279187 11.808188 Z M 195.279187 11.808188 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path250" />
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g264">
<use
xlink:href="#glyph0-16"
x="160.628"
y="30.518"
id="use252" />
<use
xlink:href="#glyph0-9"
x="168.378903"
y="30.518"
id="use254" />
<use
xlink:href="#glyph0-1"
x="173.798557"
y="30.518"
id="use256" />
<use
xlink:href="#glyph0-7"
x="182.266767"
y="30.518"
id="use258" />
<use
xlink:href="#glyph0-6"
x="188.084926"
y="30.518"
id="use260" />
<use
xlink:href="#glyph0-17"
x="191.900601"
y="30.518"
id="use262" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g270">
<use
xlink:href="#glyph0-10"
x="199.44229"
y="30.518"
id="use266" />
<use
xlink:href="#glyph0-5"
x="204.094824"
y="30.518"
id="use268" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g276">
<use
xlink:href="#glyph0-2"
x="209.883094"
y="30.518"
id="use272" />
<use
xlink:href="#glyph0-8"
x="215.252936"
y="30.518"
id="use274" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g280">
<use
xlink:href="#glyph0-9"
x="219.86562"
y="30.518"
id="use278" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g284">
<use
xlink:href="#glyph0-13"
x="227.925363"
y="30.518"
id="use282" />
</g>
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:0.79701,1.99255;stroke-miterlimit:10;"
d="M 199.001844 32.132406 L -62.158313 32.132406 C -63.611438 32.132406 -64.787219 30.956625 -64.787219 29.507406 L -64.787219 -43.6215 C -64.787219 -45.070719 -63.611438 -46.2465 -62.158313 -46.2465 L 199.001844 -46.2465 C 200.451062 -46.2465 201.626844 -45.070719 201.626844 -43.6215 L 201.626844 29.507406 C 201.626844 30.956625 200.451062 32.132406 199.001844 32.132406 Z M 199.001844 32.132406 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path286" />
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g290">
<use
xlink:href="#glyph0-18"
x="8.999"
y="10.195"
id="use288" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g302">
<use
xlink:href="#glyph0-7"
x="14.378804"
y="10.195"
id="use292" />
<use
xlink:href="#glyph0-1"
x="20.196962"
y="10.195"
id="use294" />
<use
xlink:href="#glyph0-5"
x="28.665172"
y="10.195"
id="use296" />
<use
xlink:href="#glyph0-19"
x="34.503256"
y="10.195"
id="use298" />
<use
xlink:href="#glyph0-14"
x="40.231751"
y="10.195"
id="use300" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g308">
<use
xlink:href="#glyph0-9"
x="43.678811"
y="10.195"
id="use304" />
<use
xlink:href="#glyph0-6"
x="49.098465"
y="10.195"
id="use306" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g312">
<use
xlink:href="#glyph0-12"
x="55.55423"
y="10.195"
id="use310" />
</g>
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 165.607312 -93.926187 L 94.872937 -93.926187 C 93.423719 -93.926187 92.247937 -95.101969 92.247937 -96.551187 L 92.247937 -106.664469 C 92.247937 -108.117594 93.423719 -109.289469 94.872937 -109.289469 L 165.607312 -109.289469 C 167.056531 -109.289469 168.232312 -108.117594 168.232312 -106.664469 L 168.232312 -96.551187 C 168.232312 -95.101969 167.056531 -93.926187 165.607312 -93.926187 Z M 165.607312 -93.926187 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path314" />
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g318">
<use
xlink:href="#glyph0-6"
x="166.031"
y="152.414"
id="use316" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g328">
<use
xlink:href="#glyph0-9"
x="169.647424"
y="152.414"
id="use320" />
<use
xlink:href="#glyph0-1"
x="175.067078"
y="152.414"
id="use322" />
<use
xlink:href="#glyph0-7"
x="183.535288"
y="152.414"
id="use324" />
<use
xlink:href="#glyph0-14"
x="189.353447"
y="152.414"
id="use326" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g332">
<use
xlink:href="#glyph0-9"
x="192.800506"
y="152.414"
id="use330" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g338">
<use
xlink:href="#glyph0-5"
x="200.86025"
y="152.414"
id="use334" />
<use
xlink:href="#glyph0-6"
x="206.698333"
y="152.414"
id="use336" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g344">
<use
xlink:href="#glyph0-7"
x="210.314757"
y="152.414"
id="use340" />
<use
xlink:href="#glyph0-8"
x="216.132915"
y="152.414"
id="use342" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g350">
<use
xlink:href="#glyph0-9"
x="220.745599"
y="152.414"
id="use346" />
<use
xlink:href="#glyph0-10"
x="226.165254"
y="152.414"
id="use348" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g354">
<use
xlink:href="#glyph0-10"
x="230.718162"
y="152.414"
id="use352" />
</g>
<g
clip-path="url(#clip1)"
clip-rule="nonzero"
id="g358">
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 140.537 -128.891031 C 140.537 -123.203531 135.927625 -118.594156 130.240125 -118.594156 C 124.552625 -118.594156 119.94325 -123.203531 119.94325 -128.891031 C 119.94325 -134.578531 124.552625 -139.187906 130.240125 -139.187906 C 135.927625 -139.187906 140.537 -134.578531 140.537 -128.891031 Z M 140.537 -128.891031 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path356" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g362">
<use
xlink:href="#glyph0-11"
x="196.218"
y="180.892"
id="use360" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g366">
<use
xlink:href="#glyph0-12"
x="200.97016"
y="180.892"
id="use364" />
</g>
<g
clip-path="url(#clip2)"
clip-rule="nonzero"
id="g370">
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 170.751844 -129.21525 C 170.751844 -123.348062 165.994031 -118.594156 160.126844 -118.594156 C 154.259656 -118.594156 149.50575 -123.348062 149.50575 -129.21525 C 149.50575 -135.082437 154.259656 -139.84025 160.126844 -139.84025 C 165.994031 -139.84025 170.751844 -135.082437 170.751844 -129.21525 Z M 170.751844 -129.21525 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path368" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g374">
<use
xlink:href="#glyph0-11"
x="225.692"
y="181.218"
id="use372" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g378">
<use
xlink:href="#glyph0-13"
x="230.543786"
y="181.218"
id="use376" />
</g>
<g
clip-path="url(#clip3)"
clip-rule="nonzero"
id="g382">
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 200.966687 -129.543375 C 200.966687 -123.4965 196.064344 -118.594156 190.017469 -118.594156 C 183.966687 -118.594156 179.064344 -123.4965 179.064344 -129.543375 C 179.064344 -135.59025 183.966687 -140.492594 190.017469 -140.492594 C 196.064344 -140.492594 200.966687 -135.59025 200.966687 -129.543375 Z M 200.966687 -129.543375 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path380" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g386">
<use
xlink:href="#glyph0-11"
x="255.67"
y="180.96"
id="use384" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g390">
<use
xlink:href="#glyph0-20"
x="260.42216"
y="180.96"
id="use388" />
</g>
<g
clip-path="url(#clip4)"
clip-rule="nonzero"
id="g394">
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 230.747937 -129.434 C 230.747937 -123.445719 225.892469 -118.594156 219.904187 -118.594156 C 213.915906 -118.594156 209.060437 -123.445719 209.060437 -129.434 C 209.060437 -135.422281 213.915906 -140.27775 219.904187 -140.27775 C 225.892469 -140.27775 230.747937 -135.422281 230.747937 -129.434 Z M 230.747937 -129.434 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path392" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g398">
<use
xlink:href="#glyph0-11"
x="285.637"
y="180.904"
id="use396" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g402">
<use
xlink:href="#glyph0-21"
x="290.189908"
y="180.904"
id="use400" />
</g>
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 130.240125 -109.687906 L 130.240125 -118.191812 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path404" />
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 138.986219 -109.687906 L 152.033094 -121.738687 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path406" />
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 147.525281 -109.687906 L 179.736219 -124.738687 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path408" />
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 156.271375 -109.687906 L 209.169812 -126.101969 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path410" />
<path
style="fill:none;stroke-width:1.59404;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:1.59404,1.99255;stroke-miterlimit:10;"
d="M 7.81825 -8.656656 L 91.8495 -101.609781 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path412" />
<g
clip-path="url(#clip5)"
clip-rule="nonzero"
id="g416">
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;"
d="M 231.841687 -90.207437 L 91.154187 -90.207437 C 89.704969 -90.207437 88.529187 -91.383219 88.529187 -92.832437 L 88.529187 -141.3715 C 88.529187 -142.820719 89.704969 -143.9965 91.154187 -143.9965 L 231.841687 -143.9965 C 233.290906 -143.9965 234.466687 -142.820719 234.466687 -141.3715 L 234.466687 -92.832437 C 234.466687 -91.383219 233.290906 -90.207437 231.841687 -90.207437 Z M 231.841687 -90.207437 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path414" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g420">
<use
xlink:href="#glyph0-22"
x="162.312"
y="132.534"
id="use418" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g426">
<use
xlink:href="#glyph0-2"
x="167.173749"
y="132.534"
id="use422" />
<use
xlink:href="#glyph0-6"
x="172.54359"
y="132.534"
id="use424" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g432">
<use
xlink:href="#glyph0-23"
x="176.209827"
y="132.534"
id="use428" />
<use
xlink:href="#glyph0-9"
x="181.390379"
y="132.534"
id="use430" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g446">
<use
xlink:href="#glyph0-1"
x="189.450122"
y="132.534"
id="use434" />
<use
xlink:href="#glyph0-9"
x="197.918332"
y="132.534"
id="use436" />
<use
xlink:href="#glyph0-1"
x="203.337987"
y="132.534"
id="use438" />
<use
xlink:href="#glyph0-7"
x="211.806197"
y="132.534"
id="use440" />
<use
xlink:href="#glyph0-6"
x="217.624355"
y="132.534"
id="use442" />
<use
xlink:href="#glyph0-17"
x="221.440031"
y="132.534"
id="use444" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g452">
<use
xlink:href="#glyph0-10"
x="228.981719"
y="132.534"
id="use448" />
<use
xlink:href="#glyph0-5"
x="233.634253"
y="132.534"
id="use450" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g458">
<use
xlink:href="#glyph0-2"
x="239.422524"
y="132.534"
id="use454" />
<use
xlink:href="#glyph0-8"
x="244.792365"
y="132.534"
id="use456" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g462">
<use
xlink:href="#glyph0-9"
x="249.405049"
y="132.534"
id="use460" />
</g>
<g
clip-path="url(#clip6)"
clip-rule="nonzero"
id="g466">
<path
style="fill:none;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:0.79701,1.99255;stroke-miterlimit:10;"
d="M 235.560437 -70.055094 L 87.435437 -70.055094 C 85.986219 -70.055094 84.810437 -71.230875 84.810437 -72.680094 L 84.810437 -145.09025 C 84.810437 -146.543375 85.986219 -147.71525 87.435437 -147.71525 L 235.560437 -147.71525 C 237.009656 -147.71525 238.185437 -146.543375 238.185437 -145.09025 L 238.185437 -72.680094 C 238.185437 -71.230875 237.009656 -70.055094 235.560437 -70.055094 Z M 235.560437 -70.055094 "
transform="matrix(1,0,0,-1,70.463,48.566)"
id="path464" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g476">
<use
xlink:href="#glyph0-24"
x="158.593"
y="114.384"
id="use468" />
<use
xlink:href="#glyph0-9"
x="164.022617"
y="114.384"
id="use470" />
<use
xlink:href="#glyph0-6"
x="169.442271"
y="114.384"
id="use472" />
<use
xlink:href="#glyph0-25"
x="173.257947"
y="114.384"
id="use474" />
</g>
<g
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
id="g482">
<use
xlink:href="#glyph0-9"
x="178.119696"
y="114.384"
id="use478" />
<use
xlink:href="#glyph0-6"
x="183.53935"
y="114.384"
id="use480" />
</g>
</g>
</svg>
2022/2022-06-08_JuliaForNewcomers/slides/img/favicon.ico

39.9 KiB

2022/2022-06-08_JuliaForNewcomers/slides/img/iris.png

3.37 MiB

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 153.14 98.64"><defs><style>.cls-1{fill:#1a1a1a}.cls-2{fill:#4d64ae}.cls-3{fill:#ca3c32}.cls-4{fill:#9259a3}.cls-5{fill:#399746}</style></defs><title>Asset 2</title><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><g id="layer1"><g id="g3855"><g id="g945"><g id="g984"><g id="g920"><path id="path3804" d="M93.14,80.94h-13V21.13l13-3.58Z" class="cls-1"/><g id="g898"><g id="g893"><path id="path19" d="M22.17,36.33a8.9,8.9,0,1,1,8.9-8.9A8.91,8.91,0,0,1,22.17,36.33Z" class="cls-2"/></g><path id="path3819" d="M29.14,80.83A26.48,26.48,0,0,1,27.83,90a12.12,12.12,0,0,1-3.62,5.4A12.33,12.33,0,0,1,18.57,98a36.64,36.64,0,0,1-7.32.67,22.47,22.47,0,0,1-4.81-.47A13,13,0,0,1,2.9,96.93,6,6,0,0,1,.76,95.07,3.62,3.62,0,0,1,0,92.88,4.26,4.26,0,0,1,1.59,89.5a6.47,6.47,0,0,1,4.33-1.35,5,5,0,0,1,1.87.32,6,6,0,0,1,1.43.79,12,12,0,0,1,1.16,1.07c.31.4.59.77.83,1.12A7.58,7.58,0,0,0,12.72,93a2.3,2.3,0,0,0,1.15.4,1.85,1.85,0,0,0,1-.28,2,2,0,0,0,.71-1,7.18,7.18,0,0,0,.4-1.91,23.12,23.12,0,0,0,.16-3.06V40.48l13-3.58Z" class="cls-1"/></g><path id="path3802" d="M48.14,37.94V68a6.14,6.14,0,0,0,.47,2.39A6.45,6.45,0,0,0,50,72.24a7,7,0,0,0,2,1.27,6.12,6.12,0,0,0,2.4.48,4.2,4.2,0,0,0,1.61-.4,8.42,8.42,0,0,0,1.8-1.12,13.27,13.27,0,0,0,1.81-1.66,12.92,12.92,0,0,0,1.61-2.11V37.94h13v43h-13v-4a22.47,22.47,0,0,1-5.43,3.53,13.62,13.62,0,0,1-5.59,1.28,16.52,16.52,0,0,1-5.9-1,15.59,15.59,0,0,1-4.76-2.89,13.56,13.56,0,0,1-3.17-4.28,12.41,12.41,0,0,1-1.15-5.29V37.94Z" class="cls-1"/><g id="g905"><g id="g890"><path id="path13" d="M105.79,36.33a8.9,8.9,0,1,1,8.91-8.9A8.91,8.91,0,0,1,105.79,36.33Z" class="cls-3"/><path id="path25" d="M127.18,36.33a8.9,8.9,0,1,1,8.91-8.9A8.91,8.91,0,0,1,127.18,36.33Z" class="cls-4"/><path id="path31" d="M116.49,17.8a8.9,8.9,0,1,1,8.9-8.9,8.89,8.89,0,0,1-8.9,8.9Z" class="cls-5"/></g><path id="path3823" d="M100.14,40.6l13-3.58V80.94h-13Z" class="cls-1"/></g><path id="path3808" d="M140.14,58.77a37.64,37.64,0,0,0-3.77,1.87,21.89,21.89,0,0,0-3.46,2.3,12.77,12.77,0,0,0-2.55,2.67,5.12,5.12,0,0,0-1,2.94,8.53,8.53,0,0,0,.32,2.34,7,7,0,0,0,.87,1.91,5.15,5.15,0,0,0,1.23,1.27,2.67,2.67,0,0,0,1.51.48,6.3,6.3,0,0,0,3.18-1,41.31,41.31,0,0,0,3.62-2.47Zm13,22.17h-13V77.52c-.71.61-1.42,1.17-2.11,1.67a14.2,14.2,0,0,1-2.3,1.35,13.56,13.56,0,0,1-2.82.88,19.75,19.75,0,0,1-3.78.31,16,16,0,0,1-5.33-.83,12.23,12.23,0,0,1-4-2.31,10.23,10.23,0,0,1-2.51-3.53,11,11,0,0,1-.87-4.37,10.27,10.27,0,0,1,.91-4.42,13.11,13.11,0,0,1,2.55-3.57,19.36,19.36,0,0,1,3.77-2.86,40.26,40.26,0,0,1,4.65-2.31c1.67-.69,3.4-1.32,5.17-1.91l5.25-1.71,1.43-.31V49.34a11.91,11.91,0,0,0-.44-3.45,5.82,5.82,0,0,0-1.15-2.31,4,4,0,0,0-1.79-1.31,6.6,6.6,0,0,0-2.34-.4,7.38,7.38,0,0,0-2.59.4,4.37,4.37,0,0,0-1.67,1.11,3.94,3.94,0,0,0-.91,1.59,6.52,6.52,0,0,0-.28,2,9.51,9.51,0,0,1-.28,2.35,4.85,4.85,0,0,1-.91,2A4.47,4.47,0,0,1,126,52.6a6.84,6.84,0,0,1-2.9.52,7.51,7.51,0,0,1-2.51-.4,6.16,6.16,0,0,1-1.91-1.15,6,6,0,0,1-1.27-1.75,5.59,5.59,0,0,1-.44-2.18,6.42,6.42,0,0,1,1.51-4.1,13.16,13.16,0,0,1,4.06-3.3,23.45,23.45,0,0,1,5.92-2.14,31.07,31.07,0,0,1,7.12-.8,32.21,32.21,0,0,1,7.87.84,16.37,16.37,0,0,1,5.49,2.34,9.55,9.55,0,0,1,3.18,3.66,10.91,10.91,0,0,1,1,4.81Z" class="cls-1"/></g></g></g></g></g></g></g></svg>
\ No newline at end of file
2022/2022-06-08_JuliaForNewcomers/slides/img/r3-training-logo.png

32.4 KiB

2022/2022-06-08_JuliaForNewcomers/slides/img/unicodeplot.png

9.93 KiB

2022/2022-06-08_JuliaForNewcomers/slides/img/whyjulia.png

2.32 MiB

# Julia for newcomers
## June 8th, 2022
<div style="top: 6em; left: 0%; position: absolute;">
<img src="theme/img/lcsb_bg.png">
</div>
<div style="top: 1em; left: 60%; position: absolute;">
<img src="slides/img/r3-training-logo.png" height="200px">
<img src="slides/img/julia.svg" height="200px">
<h1 style="margin-top:3ex; margin-bottom:3ex;">Julia for newcomers</h1>
<h4>
Laurent Heirendt, Ph.D.<br>
Miroslav Kratochvíl, Ph.D.<br><br>
R3 Team - <a href="mailto:lcsb-r3@uni.lu">lcsb-r3@uni.lu</a><br>
<i>Luxembourg Centre for Systems Biomedicine</i>
</h4>
</div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/SebastianAigner/twemoji-amazing@1.0.0/twemoji-amazing.css">
<style>
code {border: 2pt dotted #f80; padding: .4ex; border-radius: .7ex; color:#444; }
.reveal pre code {border: 0; font-size: 18pt; line-height:27pt;}
em {color: #e02;}
li {margin-bottom: 1ex;}
div.leader {font-size:400%; line-height:120%; font-weight:bold; margin: 1em;}
section {padding-bottom: 10em;}
</style>
# Motivation first!
*Why is it good to work in compiled language?*
- Programs become much faster for free.
*What do we gain by having types in the language?*
- Generic programming, and lots of optimization possibilities for the compiler.
*Is Julia ecosystem ready for my needs? <i class="twa twa-thinking-face"></i>*
- Likely. If not, extending the packages is super easy.
- Base includes most of the functionality of Matlab, R and Python with numpy,
and many useful bits of C++
# Why Julia?
<center><img src="slides/img/whyjulia.png" width="80%"></center>
<div class=leader>
<i class="twa twa-bar-chart"></i>
<i class="twa twa-blue-book"></i>
<i class="twa twa-computer-disk"></i>
<i class="twa twa-chart-increasing"></i><br>
Working with data
</div>
# What do we usually need?
- we need a comfortable abstraction over "long" tabular data → *data frames*
- we need to get the data in and out → *IO functions*
- we need to make pictures → *plotting packages*
# Writing files
All at once:
```julia
write("file.txt", "What a string!\n")
write("data.bin", UInt32[1,2,3])
```
By parts (with streaming, etc.):
```julia
f = open("file.txt", "w")
println(f, "This is my string!")
# ...
close(f)
```
Better:
```julia
open("file.txt", "a") do f
println(f, "The string again!")
# ...
end
```
# Reading files
All at once:
```julia
read("file.txt", String)
open(x -> collect(readeach(x, UInt32)), "data.bin", "r")
```
Process all lines:
```julia
for line in eachline("file.txt")
println("got a line: " * line)
end
```
Manually:
```julia
open("inputs.txt", "r") do io
a = parse(Int, readline(io))
b = parse(Int, readline(io))
println("$a * $b = $(a*b)")
end
```
# Extremely useful: string interpolation
Pasting strings manually is _boring_.
```julia
"String contains $val and $otherval."
do_something("input$i.txt", "output$i.txt")
"$str <<-->> $(reverse(str))"
```
The conversion to actual strings is done using `show()`. (Customize by overloading!)
# Reading and writing structured data
```julia
using DelimitedFiles
mtx = readdlm("matrix.tsv", '\t', Int, '\n') # returns a Matrix{Int}
writedlm("matrix.csv", ',')
```
# Data frames
Package `DataFrames.jl` provides a work-alike of the data frames from
other environments (pandas, `data.frame`, tibbles, ...)
```julia
using DataFrames
mydata = DataFrame(id = [32,10,5], text = ["foo", "bar", "baz"])
mydata.text
mydata.text[mydata.id .>= 10]
```
Main change from `Matrix`: *columns are labeled and their types differ*, also entries may be missing
# DataFrames
Popular way of importing data:
```julia
using CSV
df = CSV.read("database.csv", DataFrame) # can also do a Matrix
CSV.write("backup.csv", df)
```
Popular among computer users:
```julia
using XLSX
x = XLSX.readxlsx("important_results.xls")
XLSX.sheetnames(x)
DataFrame(XLSX.gettable(x["Results sheet"])...)
```
<small>(Please do not export data to XLSX.)</small>
# Plotting
<center>
<img src="slides/img/unicodeplot.png" width="40%" />
</center>
# Usual plotting packages
- `UnicodePlots.jl` (useful in terminal, https://github.com/JuliaPlots/UnicodePlots.jl)
- `Plots.jl` (matplotlib workalike, works with Plotly)
- `GLMakie.jl` (interactive plots)
- `CairoMakie.jl` (PDF export of Makie plots)
Native `ggplot` and `cowplot` ports are in development.
Gallery available: https://makie.juliaplots.org
<div class=leader>
<i class="twa twa-blue-circle"></i>
<i class="twa twa-red-circle"></i>
<i class="twa twa-green-circle"></i>
<i class="twa twa-purple-circle"></i><br>
Julia language primer
</div>
# Expressions and types
Expressions and types You can discover types of stuff using `typeof`.
Common types:
- `Bool`
```julia
false, true
```
- `Char`
```julia
'a', 'b', ...
```
- `String`
```julia
"some random text"
```
- `Int`
```julia
1, 0, -1, ...
```
- `Float64`
```julia
1.1, 0, -1, ...
```
# Types may have parameters (usually "contained type")
- `Vector{Int}`
```julia
[1, 2, 5, 10]
```
- `Matrix{Float64}`
```julia
[1.0 2.0; 2.0 1.0]
```
- `Tuple`
```julia
(1, 2.0, "SomeLabel")
```
- `Set{Int}`
- `Dict{Int,String}`
(default parameter value is typically `Any`)
# Basic functionality and expectable stuff
- Math: `+`, `-`, `*`, `/`, `^`, ...
- Logic: `==`, `!=`, `<`, `>`, `<=`, `>=`, `&&`, `||`, `!`, ...
- Assignment: `=`, `+=`, `-=`, `*=`, ...
- I/O: `open`, `println`, `read`, `readlines`, ...
- Arrays: `array[1]`, `array[2:5]`, `array[begin+1:end-1]`, `size`, `length`, `cat`, `vcat`, `hcat`, ...
Most functions are *overloaded* to *efficiently* work with multiple types of data.
Functionality is easy to discover by just `Tab`bing the definitions, also `methods(...)` and `methodswith(...)`.
# Control flow: Commands and code blocks
Typically you write 1 command per 1 line.
Commands can be separated by semicolons, and grouped using code blocks:
```julia
begin
a = 10
b = 20; b += 20
a + b # implicit return!
end
```
Many constructions (cycles, function definitions) start the block
automatically, you only write `end`.
# Control flow: Conditional execution
- Traditional `if`:
```julia
if condition
actions
else # optional
actions # optional
end
```
- Shorter inline condition:
```julia
myfunction( index<=10 ? array[index] : default_value )
```
- <i class="twa twa-light-bulb"></i> Useful shell-like shortcuts:
```julia
a < 0 && (a = 0)
a > 10 && (a = 10)
isfinite(a) || @error "a is infinite, program will crash!"
```
# Control flow: Doing stuff many times
Iteration count-based loop:
```julia
for var = iterable # , var2 = iterable2, ...
code(variable, variable2)
# ...
end
```
Syntax with `in` instead of `=` is also supported.
Examples:
```julia
for i = 1:10
@info "iterating!" i
end
for i = 1:10, j = 1:10
matrix[i,j] = i*j
end
```
Utilities: `eachindex`, `enumerate`
# Control flow: Doing stuff many times
Condition satisfaction-based loop:
```julia
while condition
do_something() # condition is true
end
# condition is false
```
Example:
```julia
number = 123519
digit_sum = 0
while number > 0
digit_sum += number % 10
number ÷= 10
end
@info "We've got results!" digit_sum
```
<div class=leader>
<i class="twa twa-hot-beverage"></i><i class="twa twa-bubble-tea"></i><i class="twa twa-beverage-box"></i><br>
Short break
</div>
Let's have *10 minutes* for a coffee or something.
(Questions?)
<div class=leader>
<i class="twa twa-blue-circle"></i>
<i class="twa twa-red-circle"></i>
<i class="twa twa-green-circle"></i>
<i class="twa twa-purple-circle"></i><br>
Julia language primer<br>(part 2)
</div>
# <i class="twa twa-light-bulb"></i> Structured cycles!
Using functional-style loops is *much less error-prone* to indexing
errors.
- Transform an array:
```julia
map(sqrt, [1,2,3,4,5])
map((x,y) -> (x^2 - exp(y)), [1,2,3], [-1,0,1])
```
- Summarize an array:
```julia
reduce(+, [1,2,3,4,5])
reduce((a,b) -> "$b $a", ["Use", "the Force", "Luke"])
reduce(*, [1 2 3; 4 5 6], dims=1)
```
**Tricky question (<i class="twa twa-light-bulb"></i><i class="twa twa-light-bulb"></i><i class="twa twa-light-bulb"></i>):** What is the overhead of the "nice" loops?
# Making new arrays with loops
```julia
julia> [i*10 + j for i = 1:3, j = 1:5]
3×5 Matrix{Int64}:
11 12 13 14 15
21 22 23 24 25
31 32 33 34 35
julia> join(sort([c for word in ["the result is 123", "what's happening?", "stuff"]
for c in word
if isletter(c)]))
"aaeeeffghhhiilnnpprssssttttuuw"
```
# Control flow: subroutines (functions)
- Multi-line function definition
```julia
function combine(a,b)
return a + b
end
```
- "Mathematical" neater definition
```julia
combine(a,b) = a + b
```
- <i class="twa twa-light-bulb"></i> Definition with types specified (prevents errors, allows optimizations!)
```julia
function combine(a::Int, b::Int)::Int
return a + b
end
```
# <i class="twa twa-light-bulb"></i><i class="twa twa-light-bulb"></i> Control flow: subroutine overloading (methods)
- A method for combining integers
```julia
combine(a::Int, b::Int)::Int = a + b
```
- A method of the "same function" for combining strings
```julia
combine(a::String, b::String)::String = "$a and $b"
```
# <i class="twa twa-light-bulb"></i><i class="twa twa-light-bulb"></i><i class="twa twa-light-bulb"></i> Supertype hierarchy
Types possess a single supertype, which allows you to easily group
multiple types under e.g. `Real`, `Function`, `Type`, `Any`, ...
This creates *groups of types* that are useful for restricting your functions to work on the most reasonable subsets of inputs.
<pre style="font-size: 80%; line-height:120%;"><code class="language-julia hljs">
julia> Int
Int64
julia> Int.super
Signed
julia> Int.super.super
Integer
julia> Int.super.super.super
Real
julia> Int.super.super.super.super
Number
julia> Int.super.super.super.super.super
Any
</code></pre>
(Upon calling the function, Julia picks the *most specific* available method.)
# Function arguments
- Keyword arguments (can not be used for overloading)
```julia
function f(a, b=0; extra=0)
return a + b + extra
end
f(123, extra=321)
```
- <i class="twa twa-light-bulb"></i> Managing arguments en masse
```julia
euclidean(x; kwargs...) = sqrt.(sum(x.^2; kwargs...))
max_squared(args...) = maximum(args .^ 2)
```
# Broadcasting over iterable things
- Broadcasting operators by prepending a dot
```julia
matrix[row, :] .+= vector1 .* vector2
```
- Broadcasting a function
```julia
sqrt.(1:10)
maximum.(eachcol(rand(100,100)))
x = [1,2,3,4]
x' .* x
```
<i class="twa twa-light-bulb"></i> The "magic dot" is a shortcut for calling `broadcast(...)`.
# Advanced container types
- Dictionaries (`Dict{KeyType, ValueType`) allow O(log n) indexing, great for
lookups or keyed data structures. Contents may be typed for increased
efficiency.
```julia
person = Dict("name" => "John", "surname" => "Foo", "age" => 30)
person["age"]
indexof(v::Vector) = Dict(v .=> eachindex(v))
```
- <i class="twa twa-light-bulb"></i> Sets are key-only containers (keys are _unique_)
```julia
julia> x=Set([1,2,3,2,1]);
julia> println(x)
Set([2, 3, 1])
julia> push!(x,5);
julia> push!(x,5);
julia> println(x)
Set([5, 2, 3, 1])
```
[
{ "filename": "index.md" },
{ "filename": "overview.md" },
{ "filename": "intro.md" },
{ "filename": "bootstrap.md" },
{ "filename": "language.md" },
{ "filename": "io.md" },
{ "filename": "distributed.md" },
{ "filename": "thanks.md" }
]
# Overview
1. Why would you learn another programming language again?
2. Bootstrapping, working with packages, writing a script (30m)
3. Language and syntax primer (35m) with a pause (10m) in the middle
4. Getting the data in and out (15m)
5. Running programs on ULHPC (15m)
6. Questions, hands-on, time buffer (15m)
# Thank you!
<center><img src="slides/img/r3-training-logo.png" height="200px"></center>
Contact us if you need help:
<a href="mailto:lcsb-r3@uni.lu">lcsb-r3@uni.lu</a>