Skip to content

Instantly share code, notes, and snippets.

View vrootic's full-sized avatar
🏠
Working from home

Vic vrootic

🏠
Working from home
View GitHub Profile
class Point:
def __init__(self, x, y, name):
self.x = x
self.y = y
self.name = name
def get_coordinate(self):
return (self.x, self.y)
def set_name(self, name):
class Point:
def __init__(self, x, y, name):
self.x = x
self.y = y
self.name = name
def get_coordinate(self):
return (self.x, self.y)
def set_name(self, name):
import pandas as pd
d = pd.read_excel('filename.xlsx')
total = 0
number_of_rows = len(d)
for i in range(number_of_rows):
if d['ORIG_MESH_250M'][i] == d['DEST_MESH_250M'][i]:
total = total + (d['TRIP_COUNT_EX'][i]*100)
@vrootic
vrootic / maze.py
Last active September 7, 2017 02:51
# Your previous Python 2 content is preserved below:
#
# ### ASCII Maze Master
#
# # Write a program that will find a path through a simple maze. A simple maze in this context is a maze where all of the walls are connected to each other. Take this example maze segment.
#
# '''
# # # ### #
# # #
# # ### B #
def plot_tool_release_industry_usage(version_name, industry):
if version_name == "all":
session = Session.objects.all().select_related()
if industry != "all":
session = session.filter(user__industry=industry)
else:
session = Session.objects.filter(version_name=version_name).select_related()
if industry != "all":
session = session.filter(user__industry=industry)
from math import ceil
import requests
from bs4 import BeautifulSoup
def get_soup(url, headers, payload):
total_pages = 0
r = requests.get(url, params=payload, headers=headers)
soup = BeautifulSoup(r.text, 'html5lib')
import requests
from bs4 import BeautifulSoup
def get_soup(url, headers, payload):
total_pages = 0
r = requests.get(url, params=payload, headers=headers)
soup = BeautifulSoup(r.text, 'html5lib')
return soup
import reqeusts
url = 'http://salesforce.careermount.com/candidate/job_search/quick/results'
payload = {
'location': 'California',
'keyword': 'software',
'sort_dir': 'desc',
'sort_field': 'post_date',
'relevance': 'false'
import reqeusts
url = 'http://salesforce.careermount.com/candidate/job_search/quick/results'
payload = {
'location': 'California',
'keyword': 'software',
'sort_dir': 'desc',
'sort_field': 'post_date',
'relevance': 'false'
def apply_async(func, args, *, callback):
result = func(*args)
callback(result)
def add(x, y):
return x + y
# Using closure