Skip to content

Instantly share code, notes, and snippets.

View shudarshon's full-sized avatar
🎯
Focusing

Shudarshon Chaki shudarshon

🎯
Focusing
View GitHub Profile
n,m=map(int,raw_input().split())
A=[]
B=[]
C=[]
for _ in range(n):
A.append(raw_input())
for _ in range(m):
B.append(raw_input())
for item in B:
for i in range(len(A)):
n, ss=int(raw_input()), map(int,raw_input().split())
money=0
for i in range(int(raw_input())):
item,price=map(int, raw_input().split())
try:
ss.remove(item)
money=money+price
except:
continue
print money
for i in range(int(raw_input())):
try:
a,b=map(int,raw_input().split())
print a/b
except ZeroDivisionError as e:
print "Error Code:", e
except ValueError as e:
print "Error Code:", e
A=set(map(int,raw_input().split()))
n=int(raw_input())
result="False"
for i in range(n):
a=set(map(int, raw_input().split()))
if len(a) == len(a.intersection(A)):
result="True"
a=set()
else:
result="False"
for i in range(int(raw_input())): #More than 4 lines will result in 0 score. Blank lines won't be counted.
a = int(raw_input()); A = set(raw_input().split())
b = int(raw_input()); B = set(raw_input().split())
if len(A) == len(A.intersection(B)):
print "True"
else:
print "False"
n=int(raw_input())
a=set(map(int, raw_input().split()))
N=int(raw_input())
for i in range(N):
com=raw_input().split()
if len(com)==2:
if com[0]=="intersection_update":
b=set(map(int,raw_input().split()))
@shudarshon
shudarshon / nodeapp-pm2
Created January 29, 2018 12:15
with this script you can run node app in the server with pm2. It's not a production grade script though.
#!/bin/bash
## install node and set permission
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get update
sudo apt-get install -y nodejs
sudo npm install -g gulp
sudo npm install -g bower
sudo npm install -g gulp-cli
if __name__ == '__main__':
n = int(raw_input())
student_marks = {}
for _ in range(n):
line = raw_input().split()
name, scores = line[0], line[1:]
scores = map(float, scores)
student_marks[name] = scores
query_name = raw_input()
arr = []
point = []
for _ in range(int(raw_input())):
name = raw_input()
score = float(raw_input())
point.append(score)
temp_list = [name,score]
arr.append(temp_list)
n=min(point)
@shudarshon
shudarshon / Docker_compose_ubuntu_16.04.md
Created January 25, 2018 17:16 — forked from arsho/Basic Commands.md
Step by step installation procedure of Docker in a ubuntu machine.

Install DOCKER COMPOSE in Ubuntu 16.04

What is Docker Compose?

Compose is a tool for defining and running complex applications with Docker. With Compose, you define a multi-container application in a single file, then spin your application up in a single command which does everything that needs to be done to get it running.

Compose uses a YAML file to configure application's services. Then, with a single command, all the services can be started or stopped from the configuration. Some reasons you might want to use Compose :

  • Multiple isolated environments on a single host