https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
//Kruskal using Union_Find | |
#include "stdio.h" | |
#include "string.h" | |
#include "vector" | |
#include "algorithm" | |
using namespace std; | |
#define pii pair<int, int> | |
#define pip pair<int, pii> | |
#define F first |
import imaplib, serial, struct, time | |
class Mail(): | |
def __init__(self): | |
self.user= 'USER' | |
self.password= 'PASS' | |
self.ser = serial.Serial('/dev/tty.usbmodem621', 9600) | |
self.M = imaplib.IMAP4_SSL('imap.gmail.com', '993') | |
self.M.login(self.user, self.password) | |
Asynchronous programming can be tricky for beginners, therefore I think it's useful to iron some basic concepts to avoid common pitfalls.
For an explanation about generic asynchronous programming, I recommend you one of the [many][2] [resources][3] [online][4].
I will focus on solely on asynchronous programming in [Tornado][1]. From Tornado's homepage: