vault backup: 2026-07-13 15:27:21
This commit is contained in:
Vendored
+7
-7
@@ -11,14 +11,14 @@
|
|||||||
"id": "3ba46ad009838dd8",
|
"id": "3ba46ad009838dd8",
|
||||||
"type": "leaf",
|
"type": "leaf",
|
||||||
"state": {
|
"state": {
|
||||||
"type": "split-diff-view",
|
"type": "markdown",
|
||||||
"state": {
|
"state": {
|
||||||
"aFile": "Semester 2/EIST/EIST CHEATSHEET.md",
|
"file": "Semester 2/EIST/EIST CHEATSHEET.md",
|
||||||
"bFile": "Semester 2/EIST/EIST CHEATSHEET.md",
|
"mode": "source",
|
||||||
"aRef": ""
|
"source": false
|
||||||
},
|
},
|
||||||
"icon": "diff",
|
"icon": "lucide-file",
|
||||||
"title": "Diff: EIST CHEATSHEET (Working Tree)"
|
"title": "EIST CHEATSHEET"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -208,8 +208,8 @@
|
|||||||
},
|
},
|
||||||
"active": "3ba46ad009838dd8",
|
"active": "3ba46ad009838dd8",
|
||||||
"lastOpenFiles": [
|
"lastOpenFiles": [
|
||||||
"Semester 2/EIST/EIST CHEATSHEET.md",
|
|
||||||
"Semester 2/EIST/Progress.md",
|
"Semester 2/EIST/Progress.md",
|
||||||
|
"Semester 2/EIST/EIST CHEATSHEET.md",
|
||||||
"Semester 2/EIST/EIST CHEATSHEET.pdf",
|
"Semester 2/EIST/EIST CHEATSHEET.pdf",
|
||||||
"2026-07-10.md",
|
"2026-07-10.md",
|
||||||
"Semester 2/EIST/lu280859klubr.tmp",
|
"Semester 2/EIST/lu280859klubr.tmp",
|
||||||
|
|||||||
@@ -202,8 +202,14 @@ public class ActivityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
<div class="page-break"></div>
|
|
||||||
|
|
||||||
|
## Excersises:
|
||||||
|
- L02PE01 TUM Social App
|
||||||
|
- L02PE02 REST Architectural Style Part 2
|
||||||
|
- L09PE02 Wizardry Character Creation
|
||||||
|
-
|
||||||
|
|
||||||
|
<div class="page-break"></div>
|
||||||
# Flask API in Python
|
# Flask API in Python
|
||||||
## *Server side* endpoints
|
## *Server side* endpoints
|
||||||
|
|
||||||
@@ -390,11 +396,64 @@ def list(self):
|
|||||||
return self.json_request("GET","/",request_body)
|
return self.json_request("GET","/",request_body)
|
||||||
pass
|
pass
|
||||||
```
|
```
|
||||||
|
## Excersises:
|
||||||
|
- L03PE01 Online FileFolder
|
||||||
|
|
||||||
|
# Python - general syntax and tips:
|
||||||
|
## Dictonaries:
|
||||||
|
```python
|
||||||
|
thisdict = {
|
||||||
|
"brand": "Ford",
|
||||||
|
"model": "Mustang",
|
||||||
|
"year": 1964
|
||||||
|
}
|
||||||
|
print(thisdict["brand"])
|
||||||
|
```
|
||||||
|
|
||||||
|
```python
|
||||||
|
thisdict = dict(name = "John", age = 36, country = "Norway")
|
||||||
|
print(thisdict)
|
||||||
|
```
|
||||||
|
You can check if a key exists with the keyword *in*:
|
||||||
|
```python
|
||||||
|
if "model" in thisdict:
|
||||||
|
print("Yes, 'model' is one of the keys in the thisdict dictionary")
|
||||||
|
```
|
||||||
|
|
||||||
|
You can loop over keys and values in dictionary:
|
||||||
|
```python
|
||||||
|
for x in thisdict: # Loop over keys
|
||||||
|
print(x)
|
||||||
|
for x in thisdict.keys(): #Another way to loop over keys
|
||||||
|
print(x)
|
||||||
|
|
||||||
|
for x in thisdict: # Loop over values
|
||||||
|
print(thisdict[x])
|
||||||
|
for x in thisdict.values(): # Another way to loop over values
|
||||||
|
print(x)
|
||||||
|
|
||||||
|
for x, y in thisdict.items(): # Looping over key-value pairs as tuples
|
||||||
|
print(x, y)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Dictionary methods
|
||||||
|
| Method | Description |
|
||||||
|
| ------------ | ----------------------------------------------------------------------------------------------------------- |
|
||||||
|
| clear() | Removes all the elements from the dictionary |
|
||||||
|
| copy() | Returns a copy of the dictionary |
|
||||||
|
| fromkeys() | Returns a dictionary with the specified keys and value |
|
||||||
|
| get() | Returns the value of the specified key |
|
||||||
|
| items() | Returns a list containing a tuple for each key value pair |
|
||||||
|
| keys() | Returns a list containing the dictionary's keys |
|
||||||
|
| pop() | Removes the element with the specified key |
|
||||||
|
| popitem() | Removes the last inserted key-value pair |
|
||||||
|
| setdefault() | Returns the value of the specified key. If the key does not exist: insert the key, with the specified value |
|
||||||
|
| update() | Updates the dictionary with the specified key-value pairs |
|
||||||
|
| values() | Returns a list of all the values in the dictionary |
|
||||||
# DOCKER
|
# DOCKER
|
||||||
|
|
||||||
**Docker reference: https://docs.docker.com/**
|
**Docker reference: https://docs.docker.com/**
|
||||||
|
|
||||||
|
|
||||||
### Dockerfiles
|
### Dockerfiles
|
||||||
https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile/
|
https://docs.docker.com/get-started/docker-concepts/building-images/writing-a-dockerfile/
|
||||||
https://docs.docker.com/reference/dockerfile/
|
https://docs.docker.com/reference/dockerfile/
|
||||||
@@ -528,8 +587,6 @@ public void getCityWeatherSingleDay(LocationDate request, StreamObserver<CityWea
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### For returning a *stream* of data just call onNext multiple times
|
#### For returning a *stream* of data just call onNext multiple times
|
||||||
With iteration:
|
With iteration:
|
||||||
```Java
|
```Java
|
||||||
@@ -599,7 +656,7 @@ public void getTrafficData(RouteRequest request, StreamObserver<TrafficResponse>
|
|||||||
|
|
||||||
#### Setup
|
#### Setup
|
||||||
|
|
||||||
The **blocking stub** is a placeholder on which the functions are called. It needs to be received from the gRPC object in some way.
|
The **blocking stub** is a placeholder on which functions are called. It needs to be received from the gRPC object in some way.
|
||||||
|
|
||||||
```java
|
```java
|
||||||
public WeatherClient(Channel channel) {
|
public WeatherClient(Channel channel) {
|
||||||
@@ -706,6 +763,10 @@ public String displayPlaylist(int[] playlist) throws SpotifyClientException {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Excersises:
|
||||||
|
- L02PB01 Weather Reporter
|
||||||
|
- L02P01 Spotify gRPC
|
||||||
|
- L03PE03 Gobblemaps
|
||||||
|
|
||||||
<div class="page-break"></div>
|
<div class="page-break"></div>
|
||||||
|
|
||||||
|
|||||||
@@ -8,15 +8,15 @@
|
|||||||
- [x] L02PE01
|
- [x] L02PE01
|
||||||
- [x] L02PE02
|
- [x] L02PE02
|
||||||
- [x] L02PE03
|
- [x] L02PE03
|
||||||
- [ ] **Lecture 3:**
|
- [x] **Lecture 3:**
|
||||||
- [x] L03PB01
|
- [x] L03PB01
|
||||||
- [x] L03PB02
|
- [x] L03PB02
|
||||||
- [x] L03P01
|
- [x] L03P01
|
||||||
- [ ] L03P02
|
- [x] L03P02
|
||||||
- [ ] L03PE01
|
- [x] L03PE01
|
||||||
- [ ] L03PE02
|
- [x] L03PE02
|
||||||
- [ ] L03PE03
|
- [x] L03PE03
|
||||||
- [ ] L03PE04
|
- [x] L03PE04
|
||||||
- [ ] **Lecture 4:**
|
- [ ] **Lecture 4:**
|
||||||
- [ ] L04PB01
|
- [ ] L04PB01
|
||||||
- [ ] L04PB02
|
- [ ] L04PB02
|
||||||
|
|||||||
Reference in New Issue
Block a user