Skip to content

Commit

Permalink
exm 2020-06-16
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLeoni committed Jun 16, 2020
1 parent 82a5577 commit 825b3db
Show file tree
Hide file tree
Showing 20 changed files with 2,793 additions and 936 deletions.
26 changes: 13 additions & 13 deletions exams/2020-02-10/exam-2020-02-10-solution.ipynb

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions exams/2020-06-16/UserQos_12345678901.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Meeting ID,Topic,Host,Email,User Type,Department,Group,Start Time,End Time,Duration (hh:mm:ss),Participants,Phone,VoIP,3rd Party Audio,Video,Screen Sharing,Recording,CRC,Encryption
123 4567 8901,Hydraulics Exam,One Eyed Jack,jack@one.eyed.com, Licensed,,,"Apr 17, 2020 02:00 PM", 04:PM,02:00:00,5,,true,false,true,true,true,false,true,

Participant,Device,IP Address,Location,Network Type,Microphone,Speaker,Camera,Data Center,Connection Type,Join Time,Leave Time,Version,Audio (Receiving) Bitrate,Audio (Sending) Bitrate,Audio (Receiving) Latency,Audio (Sending) Latency,Audio (Receiving) Jitter,Audio (Sending) Jitter,Audio (Receiving) Packet Loss-Avg(Max),Audio (Sending) Packet Loss-Avg(Max),Video (Receiving) Bitrate,Video (Sending) Bitrate,Video (Receiving) Latency,Video (Sending) Latency,Video (Receiving) Jitter,Video (Sending) Jitter,Video (Receiving) Packet Loss-Avg(Max),Video (Sending) Packet Loss-Avg(Max),Video (Receiving) Resolution,Video (Sending) Resolution,Video (Receiving) Frame Rate,Video (Sending) Frame Rate,Screen Sharing (Receiving) Bitrate,Screen Sharing (Sending) Bitrate,Screen Sharing (Receiving) Latency,Screen Sharing (Sending) Latency,Screen Sharing (Receiving) Jitter,Screen Sharing (Sending) Jitter,Screen Sharing (Receiving) Packet Loss-Avg(Max),Screen Sharing (Sending) Packet Loss-Avg(Max),Screen Sharing (Receiving) Resolution,Screen Sharing (Sending) Resolution,Screen Sharing (Receiving) Frame Rate,Screen Sharing (Sending) Frame Rate,Zoom Min Cpu Usage,Zoom Avg Cpu Usage,Zoom Max Cpu Usage,System Max Cpu Usage,
Luigi,Windows,Public IP: 224.23.175.162 Local IP: 192.168.1.232,Trento (IT ),Wifi,Gruppo microfoni (Realtek High Definition Audio(SST)),Altoparlanti (Realtek High Definition Audio(SST)),,FR (Sub),UDP,01:54 PM,03:10 PM(Luigi got disconnected from the meeting.Reason: Network connection error. ),4.7.20133.0407,125 kbps,43 kbps,30 ms,181 ms,11 ms,40 ms,0.35 %(6.92 %),0.71 %(4.40 %),280 kbps,-,30 ms,-,9 ms,-,0.5 %(8.39 %),-(-),256*144,-,12 fps,-,272 kbps,272 kbps,30 ms,30 ms,12 ms,12 ms,-(-),-(-),1920*1030,1920*1030,16 fps,16 fps,18 %,25 %,32 %,54 %
Luigi,Windows,Public IP: 224.23.175.162 Local IP: 192.168.1.232,Trento (IT ),Wifi,Gruppo microfoni (Realtek High Definition Audio(SST)),Altoparlanti (Realtek High Definition Audio(SST)),,FR (Sub),UDP,03:12 PM,03:54 PM(Luigi left the meeting.Reason: left the meeting.),4.7.20133.0407,125 kbps,43 kbps,30 ms,181 ms,11 ms,40 ms,0.35 %(6.92 %),0.71 %(4.40 %),280 kbps,-,30 ms,-,9 ms,-,0.5 %(8.39 %),-(-),256*144,-,12 fps,-,272 kbps,272 kbps,30 ms,30 ms,12 ms,12 ms,-(-),-(-),1920*1030,1920*1030,16 fps,16 fps,18 %,25 %,32 %,54 %
Mario,Linux,Public IP: 215.72.148.181 Local IP: 192.168.1.138,Rovereto (IT ),Wifi,Gruppo microfoni (Realtek High Definition Audio(SST)),Altoparlanti (Realtek High Definition Audio(SST)),,FR (Sub),UDP,02:02 PM,02:16 PM(Mario got disconnected from the meeting.Reason: Network connection error. ),4.7.20133.0407,125 kbps,43 kbps,30 ms,181 ms,11 ms,40 ms,0.35 %(6.92 %),0.71 %(4.40 %),280 kbps,-,30 ms,-,9 ms,-,0.5 %(8.39 %),-(-),256*144,-,12 fps,-,272 kbps,272 kbps,30 ms,30 ms,12 ms,12 ms,-(-),-(-),1920*1030,1920*1030,16 fps,16 fps,18 %,25 %,32 %,54 %
Mario,Linux,Public IP: 215.72.148.181 Local IP: 192.168.1.138,Rovereto (IT ),Wifi,Gruppo microfoni (Realtek High Definition Audio(SST)),Altoparlanti (Realtek High Definition Audio(SST)),,FR (Sub),UDP,02:19 PM,03:02 PM(Mario got disconnected from the meeting.Reason: Network connection error. ),4.7.20133.0407,125 kbps,43 kbps,30 ms,181 ms,11 ms,40 ms,0.35 %(6.92 %),0.71 %(4.40 %),280 kbps,-,30 ms,-,9 ms,-,0.5 %(8.39 %),-(-),256*144,-,12 fps,-,272 kbps,272 kbps,30 ms,30 ms,12 ms,12 ms,-(-),-(-),1920*1030,1920*1030,16 fps,16 fps,18 %,25 %,32 %,54 %
Mario,Linux,Public IP: 215.72.148.181 Local IP: 192.168.1.138,Rovereto (IT ),Wifi,Gruppo microfoni (Realtek High Definition Audio(SST)),Altoparlanti (Realtek High Definition Audio(SST)),,FR (Sub),UDP,03:04 PM,03:50 PM(Mario got disconnected from the meeting.Reason: Network connection error. ),4.7.20133.0407,125 kbps,43 kbps,30 ms,181 ms,11 ms,40 ms,0.35 %(6.92 %),0.71 %(4.40 %),280 kbps,-,30 ms,-,9 ms,-,0.5 %(8.39 %),-(-),256*144,-,12 fps,-,272 kbps,272 kbps,30 ms,30 ms,12 ms,12 ms,-(-),-(-),1920*1030,1920*1030,16 fps,16 fps,18 %,25 %,32 %,54 %
Mario,Linux,Public IP: 215.72.148.181 Local IP: 192.168.1.138,Rovereto (IT ),Wifi,Gruppo microfoni (Realtek High Definition Audio(SST)),Altoparlanti (Realtek High Definition Audio(SST)),,FR (Sub),UDP,03:52 PM,03:55 PM(Mario got disconnected from the meeting.Reason: Network connection error. ),4.7.20133.0407,125 kbps,43 kbps,30 ms,181 ms,11 ms,40 ms,0.35 %(6.92 %),0.71 %(4.40 %),280 kbps,-,30 ms,-,9 ms,-,0.5 %(8.39 %),-(-),256*144,-,12 fps,-,272 kbps,272 kbps,30 ms,30 ms,12 ms,12 ms,-(-),-(-),1920*1030,1920*1030,16 fps,16 fps,18 %,25 %,32 %,54 %
Mario,Linux,Public IP: 215.72.148.181 Local IP: 192.168.1.138,Rovereto (IT ),Wifi,Gruppo microfoni (Realtek High Definition Audio(SST)),Altoparlanti (Realtek High Definition Audio(SST)),,FR (Sub),UDP,03:56 PM,4:00 PM(Mario left the meeting.Reason: Host closed the meeting. ),4.7.20133.0407,125 kbps,43 kbps,30 ms,181 ms,11 ms,40 ms,0.35 %(6.92 %),0.71 %(4.40 %),280 kbps,-,30 ms,-,9 ms,-,0.5 %(8.39 %),-(-),256*144,-,12 fps,-,272 kbps,272 kbps,30 ms,30 ms,12 ms,12 ms,-(-),-(-),1920*1030,1920*1030,16 fps,16 fps,18 %,25 %,32 %,54 %
Bowser,Windows,Public IP: 105.2.19.24 Local IP: 192.168.1.02,Verona (IT ),Wifi,Gruppo microfoni (Realtek High Definition Audio(SST)),Altoparlanti (Realtek High Definition Audio(SST)),,FR (Sub),UDP,02:15 PM,02:30 PM(Bowser got disconnected from the meeting.Reason: Network connection error. ),4.7.20133.0407,125 kbps,43 kbps,30 ms,181 ms,11 ms,40 ms,0.35 %(6.92 %),0.71 %(4.40 %),280 kbps,-,30 ms,-,9 ms,-,0.5 %(8.39 %),-(-),256*144,-,12 fps,-,272 kbps,272 kbps,30 ms,30 ms,12 ms,12 ms,-(-),-(-),1920*1030,1920*1030,16 fps,16 fps,18 %,25 %,32 %,54 %
Bowser,Windows,Public IP: 105.2.19.24 Local IP: 192.168.1.02,Verona (IT ),Wifi,Gruppo microfoni (Realtek High Definition Audio(SST)),Altoparlanti (Realtek High Definition Audio(SST)),,FR (Sub),UDP,02:54 PM,03:03 PM(Bowser got disconnected from the meeting.Reason: Network connection error. ),4.7.20133.0407,125 kbps,43 kbps,30 ms,181 ms,11 ms,40 ms,0.35 %(6.92 %),0.71 %(4.40 %),280 kbps,-,30 ms,-,9 ms,-,0.5 %(8.39 %),-(-),256*144,-,12 fps,-,272 kbps,272 kbps,30 ms,30 ms,12 ms,12 ms,-(-),-(-),1920*1030,1920*1030,16 fps,16 fps,18 %,25 %,32 %,54 %
Bowser,Windows,Public IP: 105.2.19.24 Local IP: 192.168.1.02,Verona (IT ),Wifi,Gruppo microfoni (Realtek High Definition Audio(SST)),Altoparlanti (Realtek High Definition Audio(SST)),,FR (Sub),UDP,03:12 PM,03:40 PM(Bowser got disconnected from the meeting.Reason: Network connection error. ),4.7.20133.0407,125 kbps,43 kbps,30 ms,181 ms,11 ms,40 ms,0.35 %(6.92 %),0.71 %(4.40 %),280 kbps,-,30 ms,-,9 ms,-,0.5 %(8.39 %),-(-),256*144,-,12 fps,-,272 kbps,272 kbps,30 ms,30 ms,12 ms,12 ms,-(-),-(-),1920*1030,1920*1030,16 fps,16 fps,18 %,25 %,32 %,54 %
Bowser,Windows,Public IP: 105.2.19.24 Local IP: 192.168.1.02,Verona (IT ),Wifi,Gruppo microfoni (Realtek High Definition Audio(SST)),Altoparlanti (Realtek High Definition Audio(SST)),,FR (Sub),UDP,03:45 PM,04:00 PM(Bowser left the meeting.Reason: Host closed the meeting. ),4.7.20133.0407,125 kbps,43 kbps,30 ms,181 ms,11 ms,40 ms,0.35 %(6.92 %),0.71 %(4.40 %),280 kbps,-,30 ms,-,9 ms,-,0.5 %(8.39 %),-(-),256*144,-,12 fps,-,272 kbps,272 kbps,30 ms,30 ms,12 ms,12 ms,-(-),-(-),1920*1030,1920*1030,16 fps,16 fps,18 %,25 %,32 %,54 %
Princess Toadstool,Mac,Public IP: 210.33.42.139 Local IP: 192.168.1.13,Verona (IT ),Wifi,Gruppo microfoni (Realtek High Definition Audio(SST)),Altoparlanti (Realtek High Definition Audio(SST)),,FR (Sub),UDP,01:56 PM,03:33 PM(Princess Toadstool left the meeting.Reason: left the meeting.),4.7.20133.0407,125 kbps,43 kbps,30 ms,181 ms,11 ms,40 ms,0.35 %(6.92 %),0.71 %(4.40 %),280 kbps,-,30 ms,-,9 ms,-,0.5 %(8.39 %),-(-),256*144,-,12 fps,-,272 kbps,272 kbps,30 ms,30 ms,12 ms,12 ms,-(-),-(-),1920*1030,1920*1030,16 fps,16 fps,18 %,25 %,32 %,54 %
Wario,Windows,Public IP: 113.208.67.239 Local IP: 192.168.1.119,Verona (IT ),Wifi,Gruppo microfoni (Realtek High Definition Audio(SST)),Altoparlanti (Realtek High Definition Audio(SST)),,FR (Sub),UDP,02:05 PM,02:10 PM(Wario got disconnected from the meeting.Reason: Network connection error. ),4.7.20133.0407,125 kbps,43 kbps,30 ms,181 ms,11 ms,40 ms,0.35 %(6.92 %),0.71 %(4.40 %),280 kbps,-,30 ms,-,9 ms,-,0.5 %(8.39 %),-(-),256*144,-,12 fps,-,272 kbps,272 kbps,30 ms,30 ms,12 ms,12 ms,-(-),-(-),1920*1030,1920*1030,16 fps,16 fps,18 %,25 %,32 %,54 %
Wario,Windows,Public IP: 113.208.67.239 Local IP: 192.168.1.119,Verona (IT ),Wifi,Gruppo microfoni (Realtek High Definition Audio(SST)),Altoparlanti (Realtek High Definition Audio(SST)),,FR (Sub),UDP,02:15 PM,02:29 PM(Wario got disconnected from the meeting.Reason: Network connection error. ),4.7.20133.0407,125 kbps,43 kbps,30 ms,181 ms,11 ms,40 ms,0.35 %(6.92 %),0.71 %(4.40 %),280 kbps,-,30 ms,-,9 ms,-,0.5 %(8.39 %),-(-),256*144,-,12 fps,-,272 kbps,272 kbps,30 ms,30 ms,12 ms,12 ms,-(-),-(-),1920*1030,1920*1030,16 fps,16 fps,18 %,25 %,32 %,54 %
Wario,Windows,Public IP: 113.208.67.239 Local IP: 192.168.1.119,Verona (IT ),Wifi,Gruppo microfoni (Realtek High Definition Audio(SST)),Altoparlanti (Realtek High Definition Audio(SST)),,FR (Sub),UDP,02:33 PM,03:10 PM(Wario left the meeting.Reason: left the meeting.),4.7.20133.0407,125 kbps,43 kbps,30 ms,181 ms,11 ms,40 ms,0.35 %(6.92 %),0.71 %(4.40 %),280 kbps,-,30 ms,-,9 ms,-,0.5 %(8.39 %),-(-),256*144,-,12 fps,-,272 kbps,272 kbps,30 ms,30 ms,12 ms,12 ms,-(-),-(-),1920*1030,1920*1030,16 fps,16 fps,18 %,25 %,32 %,54 %
Wario,Windows,Public IP: 113.208.67.239 Local IP: 192.168.1.119,Verona (IT ),Wifi,Gruppo microfoni (Realtek High Definition Audio(SST)),Altoparlanti (Realtek High Definition Audio(SST)),,FR (Sub),UDP,03:25 PM,03:54 PM(Wario got disconnected from the meeting.Reason: Network connection error. ),4.7.20133.0407,125 kbps,43 kbps,30 ms,181 ms,11 ms,40 ms,0.35 %(6.92 %),0.71 %(4.40 %),280 kbps,-,30 ms,-,9 ms,-,0.5 %(8.39 %),-(-),256*144,-,12 fps,-,272 kbps,272 kbps,30 ms,30 ms,12 ms,12 ms,-(-),-(-),1920*1030,1920*1030,16 fps,16 fps,18 %,25 %,32 %,54 %
Wario,Windows,Public IP: 113.208.67.239 Local IP: 192.168.1.119,Verona (IT ),Wifi,Gruppo microfoni (Realtek High Definition Audio(SST)),Altoparlanti (Realtek High Definition Audio(SST)),,FR (Sub),UDP,03:55 PM,04:00 PM(Wario left the meeting.Reason: Host closed the meeting. ),4.7.20133.0407,125 kbps,43 kbps,30 ms,181 ms,11 ms,40 ms,0.35 %(6.92 %),0.71 %(4.40 %),280 kbps,-,30 ms,-,9 ms,-,0.5 %(8.39 %),-(-),256*144,-,12 fps,-,272 kbps,272 kbps,30 ms,30 ms,12 ms,12 ms,-(-),-(-),1920*1030,1920*1030,16 fps,16 fps,18 %,25 %,32 %,54 %
117 changes: 117 additions & 0 deletions exams/2020-06-16/bin_tree_solution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@

class BinaryTree:
""" A simple binary tree with left and right branches
"""

def __init__(self, data):
self._data = data
self._left = None
self._right = None

def data(self):
return self._data

def left(self):
return self._left

def right(self):
return self._right

def __str__(self):
""" Returns a pretty string of the tree """
def str_branches(node, branches):
""" Returns a string with the tree pretty printed.
branches: a list of characters representing the parent branches. Characters can be either ` ` or '│'
"""
strings = [str(node._data)]

i = 0
if node._left != None or node._right != None:
for current in [node._left, node._right]:
if i == 0:
joint = '├'
else:
joint = '└'

strings.append('\n')
for b in branches:
strings.append(b)
strings.append(joint)
if i == 0:
branches.append('│')
else:
branches.append(' ')

if current != None:
strings.append(str_branches(current, branches))
branches.pop()
i += 1
return "".join(strings)

return str_branches(self, [])


def insert_left(self, data):
""" Takes as input DATA (*NOT* a node !!) and MODIFIES current node this way:
- First creates a new BinaryTree (let's call it B) into which provided data is wrapped.
- Then:
- if there is no left node in self, new node B is attached to the left of self
- if there already is a left node L, it is substituted by new node B, and L becomes the
left node of B
"""
B = BinaryTree(data)
if self._left == None:
self._left = B
else:
B._left = self._left
self._left = B


def insert_right(self, data):
""" Takes as input DATA (*NOT* a node !!) and MODIFIES current node this way:
- First creates a new BinaryTree (let's call it B) into which provided data is wrapped.
- Then:
- if there is no right node in self, new node B is attached to the right of self
- if there already is a right node L, it is substituted by new node B, and L becomes the
right node of B
"""
B = BinaryTree(data)
if self._right == None:
self._right = B
else:
B._right = self._right
self._right = B


def prune_rec(self, el):
""" MODIFIES the tree by cutting all the subtrees that have their
root node data equal to el. By 'cutting' we mean they are no longer linked
by the tree on which prune is called.
- if prune is called on a node having data equal to el, raises ValueError
- MUST execute in O(n) where n is the number of nodes of the tree
- NOTE: with big trees a recursive solution would surely
exceed the call stack, but here we don't mind
"""
#jupman-raise

if self._data == el:
raise ValueError('Tried to prune the tree root!')

if self._left != None:
if self._left._data == el:
self._left = None
else:
self._left.prune_rec(el)

if self._right != None:
if self._right._data == el:
self._right = None
else:
self._right.prune_rec(el)

#/jupman-raise

0 comments on commit 825b3db

Please sign in to comment.