- Create a new user named oj_main and add it to sudo group
sudo adduser oj_main
sudo usermod -aG sudo oj_main
su oj_main
import sys | |
def getCostMatrix(): | |
numRows = int(input('Enter the number of sources : '))+1 | |
numCols = int(input('Enter the number of destinations : '))+1 | |
costMatrix = [] | |
for i in range(numRows-1): | |
rowCostArray=list(map(int, input('Enter the costs for source %s and the total supply at the end, separated by space\n'%(i+1)).split())) | |
costMatrix.append(rowCostArray) | |
rowCostArray = list(map(int, input('Enter the demand values for each destination separated by space\n').split())) | |
costMatrix.append(rowCostArray) |
import requests | |
def asteroidOrbits(year, orbitclass): | |
r=requests.get("https://jsonmock.hackerrank.com/api/asteroids/search?page="+str(1)).json() | |
total_pages=r["total_pages"] | |
list=[] | |
for i in range(1,total_pages+1): | |
req=requests.get("https://jsonmock.hackerrank.com/api/asteroids/search?page="+str(i)).json() | |
for j in req["data"]: | |
if(str(year)==j["discovery_date"][:4]and orbitclass.lower() in j["orbit_class"].lower()): |
Based on dribbble shot by Kreativa Studio - https://dribbble.com/shots/2375246-Fashion-Butique-slider-animation
Fullscreen please. Looks best in Webkit browsers, because clip-path not working in FF/IE without SVG fallbacks, which I don't want to use in this demo. Not responsive atm, I will figure out something soon.
Features:
#include<bits/stdc++.h> | |
using namespace std; | |
#define ll long long | |
#define deb(x) cout << #x << "=" << x << endl | |
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl | |
#define fo(i,n) for(i=0;i<n;i++) | |
#define fl(i,l,n) for(i=l;i<n;i++) | |
#define pb push_back | |
#define strev(a, b) sort(a, b, greater<>()) |
To preprocess your text simply means to bring your text into a form that is predictable and analyzable for your task. Whenever we have textual data, we need to apply several pre-processing steps to the data to transform words into numerical features that work with machine learning algorithms.
For preprocessing in python, we will be using NLTK(Natural Language Toolkit), string and regex packages.
We are going to make the web app using flask library in python. There will be two pages one the homepage and the other the search results page.
""" | |
Program to crawl the specified url with given depth | |
""" | |
from bs4 import BeautifulSoup | |
import requests | |
import pymongo | |
import urllib.parse | |
import sys |