#Python Commands
- Create the virtual environment. (The required python version can be specified)
python3.8 -m venv venv-name
- Activate the enviroment
source venv-name/bin/activate
# Credits: https://gist.github.com/AaronCQL/3ee6bbb1999402b558c942eb8f50cf29#file-sunfire-print-sh | |
# Login to Sunfire | |
ssh noel@sunfire.comp.nus.edu.sg | |
# Copy a local file to Sunfire | |
scp some_file.txt e0123456@sunfire.comp.nus.edu.sg:/home/e/e0123456/ | |
scp some_file.txt noel@sunfire.comp.nus.edu.sg:/home/n/noel/ # Try with username if above line doesn't work | |
# Copy a local directory to Sunfire |
COPY
is used to copy contents from the local directory to the container..dockerignore are not copied
COPY . .
WORKDIR
is similar to cd and is used to change the working directory inside the container.Replace the id with the id of the file to be downloaded
!wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1SCh8gSoyvrJ7N9OwlRcWc65zo1qf6SAy' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1SCh8gSoyvrJ7N9OwlRcWc65zo1qf6SAy" -O zipfile.zip && rm -rf /tmp/cookies.txt
from typing import List, Tuple | |
import random | |
# Question: A wedding is being held in a huge conference hall attended by a massive number of people. The organiser has given you a list of people with their location in the conference hall at a certain snapshot. Your task is to find out, in that snapshot, who in that list has disobeyed social distancing measure and mingled with more than 8 people within a 2-metre radius. | |
class Person: | |
""" | |
Class represeting a person | |
... |
{ | |
"theatre":"Nex", | |
"hall":"nex Hall 5", | |
"movie":"Jumanji: The Next Level", | |
"date":"18 Jan 2020", | |
"time":"1:00 PM+", | |
"session_code":"P00000000000000000200104", | |
"seats":[ | |
{ | |
"seat_status":"AV", |
{ | |
"basics":{ | |
"name":"Noel Mathew Isaac", | |
"label":"Student", | |
"image":"https://avatars0.githubusercontent.com/u/42365024?v=4", | |
"email":"noelmathewisaac@gmail.com", | |
"phone":"", | |
"url":null, | |
"summary":"I enjoy using tech to automate stuff and solve real-world problems. I am passionate about Machine Learning and Cybersecurity and regularly take part in hackathons to learn new skills. When I am away from my 'techie' side I am usually engrossed in learning about investing and playing chess.", | |
"profiles":[ |