Big Data and Blockchain (BDB) course (code 25418)

Lecturer: Dr. Paolo Coletti Paolo.Colettiunibz.it . Office E203 - Office hours: www.paolocoletti.it/timetable
Website: www.paolocoletti.it/bigdata

Exam September 2020

Exam is composed by four parts.

  1. Python: if you reject the first mid-term's grade or do not have it, it will be a practical exam exactly as first midterm. Topics are up to dictionaries and tuples and I will send you the file via email and receive the file back via email.
  2. Financial applications with Python: if you reject the assignments' grade or did not do them, it will be a practical exam similar to the first midterm. Topics are from hash functions to Monte Carlo technique and I will send you the file via email and receive the file back via email.
  3. Smart contracts on Ethereum blockchain: if you reject the last mid-term's grade or do not have it, it will be a practical exam exactly as last midterm. I will send you the file via email and receive the file back via email.
  4. Cryptocurrencies and blockchain technology: this part will be an oral examination on Teams. Note that oral examinations are public, so there could be other people connected (who obviously cannot speak!). I will not record the exam. I will ask you to show me your surroundings and there must be nobody around nor any course's material nor any other screen. You may hold an A4 paper with you which has one face written with whatever you want, including course's material. You will be evaluated on what you say, how you say it and on how much time does it take to answer (spending 10 minutes reading your A4 paper every time will penalise you).

Please have your unibz card or a valid ID document ready.

If I suspect you are cheating, I will interrupt the exam and report to the Dean.

Anti-cheating measures for parts 1, 2, 3

You will need to have a smartphone or tablet or computer (not the one on which you are doing the midterm) switched on and close to you. I must be able to make a VIDEOcall with you on:
- Teams on smartphone or another computer
- Zoom on smartphone or another compuer
You may use another person's device if you prefer to (your grandma's telephone...). 
During the exam I shall occasionally videocall you and ask you to show me your face and your monitor. Nobody must be in the same room and you may not have any other communication device or program switched on. I will consider this extra lost time when determining the exam's duration.

Course

Prerequisites

In order to correctly follow this course each student is required previous knowledge on these topics:

Course content

How to study for this course

This course is different from the majority of courses you are used to. This course is much more technical than theoretical and it is strictly sequential. This means that you have to adapt your study strategy:
1. First of all, you either attend all the lessons (or compensate for missing lessons watching immediately the corresponding videos or reading the book) or it is really not worth coming to the next one, since you will have a hard life understanding the next topic.
2. After each lesson you must repeat slowly on your own everything done in class in order to be sure to have fully grasped the explained concepts before the next lesson.
3. Needless to say it, do the exercise without copying them from your colleagues.
4. If you feel that writing programs and problem solving are not your best skills, it is better that before each lesson you watch the next videos so you will be able to grasp also the little concepts explained in the lessons.

For the exam the main difference with respect to other courses is that you have to train much more than studying. The content of this course is easy and does not need extensive study, however it is only with practice that you become skilled enough and know immediately what to do without wasting time.

Exam

Exam is split in four parts. The grade is the weighted average of the four parts, based on how many lessons were dedicated to each of them.

  1. Python: topics are up to dictionaries and tuples (practical exercises, open books) 18/34 of the grade
  2. open books pratical test on Financial applications with Python: topics are from hash functions to Monte Carlo technique (practical exercises, open books) 8/34 of the grade
  3. open books pratical test on Smart contracts on Ethereum blockchain (practical exercises, open books) 6/34 of the grade
  4. closed books questions on Cryptocurrencies and blockchain technology (two written open question, closed books) 2/34 of the grade

Coursework

Students have the opportunity to skip parts 1 and 3 of the exam with mid-terms. Each part is completely independent and will let you skip that part of exam. The mid-term grade will be your grade at the exam. If you believe that a grade in a certain mid-term is too low for you, write an email to dr. Coletti at least 7 days before the exam and you will be able to do the exam on that part. In order to be allowed to participate in the mid-terms you must submit all the home exercises that are assigned after each lesson by email to not later than 24 hours before the next lesson. You can do them alone or in a group of two, but your partner may not be the same of the previous homework. If they are not done properly or contain severe mistakes, you will receive immediate feedback from dr. Coletti. If you submit them early and not at the last minute and they are not sufficient, you can get the possibility to redo them after the feedback. Home exercises will be evaluated and you need to do them in a decent way to be allowed to participate in the mid-term, even though the home exercises grade will not be considered for your exam's grade.

Students have the opportunity to skip part 2 of the exam with assignments. This part is completely independent from the others. The assignments' grade will be your grade at the exam. If you believe that a grade is too low for you, write an email to dr. Coletti at least 7 days before the exam and you will be able to do the exam on that part. You must submit all the home exercises that are assigned after each lesson by email to not later than 24 hours before the next lesson. You can do them alone or in a group of two, but your partner may not be the same of the previous homework. If they are not done properly or contain severe mistakes, you will receive immediate feedback from dr. Coletti.

Do not:
- search with Google and come up with a solution which uses techniques and tools not explained in class. All exercises are designed to be solved with what is explained in class and you cannot use other tools to make your job easier, it is not useful for you;
- copy the assignment from your colleagues (excluding obviously the colleague with whom you are working, if you chose to work as a group). I will have to inform the Dean if this happens (yes, in the past it happened...);
- send your code to your colleagues. It is fine to help other students and even to work together in more than two, but each group has his/her own code. If you send your code around, for sure somebody will send it to me very similar and I will inform the Dean (yes, in the past it happened...);
- send the assignment to me without specifying that you worked in a group with another person. It is not possible to attach a person after you have submitted (yes, in the past somebody tried it...)

Note that all students have this possibility, regardless of whether they attend or not. However, at the beginning of each lesson we will discuss together the home exercises and your problems and thus being present has its advantages for your comprehension and you can get extra points for course's improvements and good suggestions.

Study resources

Topic
Lessons' slides
Videos as replacement of attendance
Written material as support
Precourse No slides anymore in XXI century Go down here

No textbook in XXI century !

Python No slides anymore in XXI century Go down here No textbook in XXI century !
financial applications with Python No slides anymore in XXI century Go down here No textbook in XXI century !
Cryptocurrencies and Blockchain technology Slides in PDF and in PPTX Go down here No textbook in XXI century !
Crypto2 te be determined    
Smart contracts No slides anymore in XXI century Go down here No textbook in XXI century !

 

Files and programs used in class Last updated
Directory with the files used in class  

Python 3 versus Python 2

Issue Python 2 Python 3
print it is a command:
print <string>
it is a function, therefore it needs parentheses:
print(<string>)
print with trailing comma a trailing comma after print suppresses new line:
print <string>,
to suppress new line use:
print(<string>, end="")
integer division 5/2 gives 2. To get the float result:
either 5.0/2 or float(5)/2 or 5/2.0 or 5/float(2); float(5/2) still returns 2.0

5/2 gives 2.5
If you want the integer division, use 5//2

requests.get(<pageAddress>) its .content is type str its .content is type byte, covert it to string with str(page.content) before using it for .find
dict order is decided by the computer memory, so do not rely on it order is exactly the insertion order
range function range function returns a list range function returns a range object. To get a list:
list(range(<arguments>))
xrange function xrange function returns a range object, like range in Python 3  
sha256 sha256(<string>).hexdigest() sha256(<string>.encode('utf-8')).hexdigest()

Videos of lessons

course advertisement
YouTube Old course advertisement
course brief presentation
YouTube Brief course presentation
precourse 01
YouTube Precourse for Windows 10 on unibz network and file handling, first part.
precourse 02
YouTube Precourse for Windows 10 on unibz network and file handling, second part.
precourse Mac 01
YouTube Precourse for Mac on unibz network and file handling, first part.
precourse Mac 02
YouTube Precourse for Mac on unibz network and file handling, second part.
   
01 installing Anaconda
YouTube For Python we will use Anaconda with Jupyter and Python 3 (in the video I install 2.7 but the procedure is identical)
01bis refusing to install Anaconda
YouTube For those who do not have a notebook (and borrow one from the library) or refuse to install Anaconda
02 basic Python
YouTube Basic Python programming, Bakus-Naur form, integer and float variables, string variables, find method.
How to solve problems
YouTube

How to solve computer problems explained with a carpentry example

03 procedures and decisions
YouTube Procedures, tab, logical expressions, and, or, not, If, else, elif.
04 flowcharts
YouTube Flowcharts
05 while and complexity
YouTube While loops, break, multiple assignment, computational complexity
07 Solving problems
YouTube How to tackle a computational problem
08 Lists
YouTube Lists and strings, loops, objects and their differences towards variables.
10 Dictionaries
YouTube Flags, dictionaries, tuples.
12 Hash functions
YouTube Hash functions: fingerprint for large objects, keeping passwords and PIN secret, timestamping, mining bitcoins
     
20 objects
YouTube Classes, libraries, packages.
21 arrays and random
YouTube  
22 importing data
YouTube  
23 rate of return
YouTube  
24 portfolios
YouTube  
25 risk
YouTube  
32 Monte Carlo for predicting stock prices
YouTube  
   
Cryptocurrencies and blockchain technology
YouTube A decentralised currency, basic cryptography, Bitcoin history and technology, blockchain technology, advantages and criticisms
01 smart contracts introduction
YouTube  
02 Metamask and Remix
YouTube You need to install Chrome or Firefox. Safari and Edge do not work :-(
03 first Solidity contracts
YouTube  
04 a decentralized unstoppable bank
YouTube  
05 purchase contract
YouTube  
06 cryptotoken
YouTube THIS LESSON IS NOT ASKED AT THE EXAM (even though it is the most interesting smart contract...)
YouTube

This short video illustrates how to reach unibz network folder \\ubz01fst (which contains course_coletti and your own personal stuff) using VPN when you are connected from outside university or when you are connected using wifi.
This procedure is not part of exam's stuff.

Exam

Before the exam:

  1. if you do not use your own notebook, borrow a computer from the library well before the exam and configure it before the exam
  2. make sure that Anaconda is installed and that you can use Jupyter for Python;
  3. make sure Metamask is installed, that you have some Rinkeby ethers on its accounts and that it interacts correctly with Remix;
  4. check that you are able to locate \\ubz01fst.unibz.it\Courses directory;
  5. just in case your notebook crashes the night before, some days before the exam borrow a computer from the library and check that you are able to log in on your unibz account and that you have, or are able to install, everything you need

Frequently Asked Questions

Q: Which software do I need for Python on my notebook?
A:
Anaconda is available for Windows and for Mac. Take care to install Python 3. Watch the video 01 or 01bis for details.

Q: Which software do I need for smart contracts on my notebook?
A:
We will use only Metamask, which is a browser add-on. Unfortunately only Chrome, Firefox and Opera accept add-on, so you need to have one of these three browsers. Watch video 02 on smart contracts for details

Q: I have no notebook. What do I need for the course and for the exam?
A:
You can borrow a notebook from the library. Watch the video 01bis to know how can you use Jupyter, you have several possibilities. For smart contracts, probably before every lesson you will need to install the add-on to the browser with your 12-words phrase.

Q: How can I reach network folder \\ubz01fst from outside unibz or connected via wifi?
A: For Windows users: if you are connected to wifi ScientificNetwork try to digit in any explorer address bar \\ubz01fst.unibz.it and see whether you reach it. You need to provide your login and password, but you need to tell to your computer that you are using a different domain and then you have to type unibz\loginname instead of simply loginname. If this fails or if you are no connected to ScientificNetwork, then you need to install VPN. There is a specific video up here.
For Mac users: if you are connected to wifi ScientificNetwork, Finder -> Go -> Connect to server -> smb://ubz01fst.unibz.it . You need to provide your login and password, but you need to tell to your computer that you are using a different domain and then you have to type unibz\loginname instead of simply loginname.

Q: May I fix an appointment to talk with you?
A: Sure, write me an email and we can fix it online or live. Alternatively, you can write me your questions via email or Teams message and I shall answer very soon.

Q: When will the next exam be? Can you give me a hint on the exam's date because I have to catch a plane? Can you move the exam's date? Can you fix the exam's date on the week I suggest?
A: Please stop writing me emails on this topic. Exam's date appears on your timetable as soon as it is official. If you have something to say about it, contact your students' speaker who is the only one who can submit requests on students' behalf.

Q: I may not enrol online for technical or administrative reasons or I forgot to enrol or it is my third attempt and I cannot enrol. Can I do the exam anyway?
A: No, I may not let non-enrolled students take part of the exam. Do not ask me to do illegal things! Ask the secretary whether there is something they can do.

Q: May I do the exam with my computer?
A: Sure. But beware: (1) you must be able to navigate the Internet and to enter directory \\ubz01fst.unibz.it\Courses\Course_Coletti. Do not wait for the day before the exam to check it. (2) You are responsible for your different programs' versions and configurations and for the absence on your computer of specific programs.
In any case you will have a unibz desktop computer in front of you.

Q: May I use the operating system in a different language?
A: Yes, sure. Your business.

Q: Will the exam be similar to the other exams on this website?
A: Sure. For the first year (2018/19) I shall put a couple of exam's prototypes.

Q: I lost a file during the practical exam because I did not save it correctly. What may you do?
A: Absolutely nothing. With time spent on exercises you should know the unreliability level of your programs, and how often you have to save.

Q: My files were not copied correctly at the end of the practical exam. What may I do?
A: Checking that the copy is correct, and practicing file copy even during the exam, is your task and is official prerequisite for this course.

Previous exams

ID
Session
Notes
Exam link
Solution link
Videosolution for Python
Videosolution for smart contracts
Python training exercises
exam
solution
03
May 2019
exam
solution
YouTube
YouTube
02
prototype for A.Y. 2018/19
exam
solution
YouTube
01
prototype for A.Y. 2018/19
exam
solution
YouTube

Just to give you some examples of written questions on cryptocurrencies given in the past years:

This page is maintained by Paolo Coletti.

Marisa Crucitti il teatro per ringiovanire Paolo Coletti personal page La stanza dell'arte Paolo Coletti Paolo Associazione culturale e ricreativa Kender Trento Bolzano La stanza dell'arte Marzia Centro Felix Trento Aarghen Thael Il Vecchio Continente GURPS Marisa Crucitti il teatro per ringiovanire Laboratorio d'arte Gabbana cornici Rovereto Nursing Up sindacato infermieri Bolzano ASL Italia Advanced Squad Leader Club scherma Bolzano Bozen Fecht club spada fioretto sciabola