Skip to content

Commit

Permalink
Remaining solutions added
Browse files Browse the repository at this point in the history
  • Loading branch information
pani-vishal committed Jan 29, 2018
1 parent b0766a5 commit 6ca6f48
Show file tree
Hide file tree
Showing 19 changed files with 703 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Solutions/falconis/Task1/job_search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from bs4 import BeautifulSoup as bs
import requests, json

print("Enter the location of the job")
loc = raw_input()
print("Enter your job description")
job_des = raw_input()
source = requests.get("https://jobs.github.com/positions.json?description="+job_des+"&location="+loc)
jsonObj = json.loads(source.content)

i = 1
if (jsonObj):
print("\n\nJOBS FOUND!!\n\n")
for j in jsonObj:
print("-----------------------------------" + str(i) + "---------------------------------\n\n")
print("TITLE: " + j['title'] + "\n\n")
print("COMPANY: " + j["company"] + "\n")
print("LOCATION: " + j['location'] + "\n\n")
print("TYPE: " + j["type"] + "\n\n")
desc = bs(j['description'], "lxml")
print("DESCRIPTION: " + desc.get_text() + "\n\n")
hta = bs(j['how_to_apply'], "lxml")
print("PLEASE CHECK: " + hta.get_text() + "\n\n")
print("WEBSITE: " + j["company_url"] + "\n\n")
print("------------------------------- X --------------------------------------\n\n\n")
i += 1
else:
print("------------------SORRY NO JOBS FOUND!---------------")
14 changes: 14 additions & 0 deletions Solutions/falconis/Task3/paper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import bs4 as bs
import urllib.request

source = urllib.request.urlopen('https://scirate.com/').read()
page = bs.BeautifulSoup(source, 'lxml')

names = page.find_all('div', class_='title')
links = page.find_all('a', class_ = 'paper-download btn btn-success')
num = len(names)
for x in range(num):
print("--------------------------------" + str(x+1) + "---------------------------------")
print("TITLE:" + names[x].text)
print("LINK:" + links[x].get('href'), end='\n\n')

Binary file added Solutions/falconis/Task4/sine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Solutions/falconis/Task4/sine_go.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions Solutions/falconis/Task4/task4.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package main

import (
"math"

"github.com/Arafatk/glot"
)

func main() {
dimensions := 2
// The dimensions supported by the plot
persist := false
debug := false
plot, _ := glot.NewPlot(dimensions, persist, debug)
pointGroupName := "Sine Wave"
var x []float64
j := 0.0
for i := 0; i < 10000; i++ {
x = append(x, j)
j += 0.0001
}
var y []float64
for i := 0; i < 10000; i++ {
y = append(y, math.Sin(x[i]*2*math.Pi))
}
style := "lines"
points := [][]float64{x, y}
plot.AddPointGroup(pointGroupName, style, points)
plot.SetTitle("Sine Plot")
plot.SetYrange(-2, 2)
plot.SetXLabel("X-Axis(2* pi * x)")
plot.SetYLabel("Y-Axis")
plot.SavePlot("sine_go.png")
// pointGroupName := "Simple Circles"
// style := "circle"
// points := [][]float64{{7, 3, 13, 5.6, 11.1}, {12, 13, 11, 1, 7}}
// // Adding a point group
// plot.AddPointGroup(pointGroupName, style, points)
// pointGroupName = "Simple Lines"
// style = "lines"
// points = [][]float64{{7, 3, 3, 5.6, 5.6, 7, 7, 9, 13, 13, 9, 9}, {10, 10, 4, 4, 5.4, 5.4, 4, 4, 4, 10, 10, 4}}
// plot.AddPointGroup(pointGroupName, style, points)
// // A plot type used to make points/ curves and customize and save them as an image.
// // plot.SetTitle("Example Plot")
// // // Optional: Setting the title of the plot
// // plot.SetXLabel("X-Axis")
// // plot.SetYLabel("Y-Axis")
// // // Optional: Setting label for X and Y axis
// // plot.SetXrange(-2, 18)
// // plot.SetYrange(-2, 18)
// // // Optional: Setting axis ranges
// plot.SavePlot("2.png")
}
12 changes: 12 additions & 0 deletions Solutions/falconis/Task4/task4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import matplotlib.pyplot as plt
import numpy as np

x = np.arange(start = 0, stop = 1, step = 0.01)
y = np.sin(x * 2 * np.pi)
plt.plot(x, y)
plt.title('Sine Wave')
plt.xlabel('2 * pi * x')
plt.ylabel('y')
plt.grid(True)
plt.savefig('sine')
plt.show()
21 changes: 21 additions & 0 deletions Solutions/falconis/Task5/task5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import threading

def exp(x):
print("Square:", x**2)

def fact(x):
i = 1
ans = 1
while(i <= x):
ans *= i
i += 1
print("Factorial:", ans)

x = int(input())
thread1 = threading.Thread(target=exp, args=(x,))
thread2 = threading.Thread(target=fact, args=(x,))
thread1.start()
thread2.start()
thread1.join()
thread2.join()

14 changes: 14 additions & 0 deletions Solutions/falconis/Task6/task6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from selenium import webdriver

username = input("Enter Github username:-\n")
password = input("Enter password:-\n")

browser = webdriver.Firefox()
browser.get('https://github.com/login')
usernameField = browser.find_element_by_id("login_field")
passwordField = browser.find_element_by_id("password")
signInField = browser.find_element_by_name("commit")

usernameField.send_keys(username)
passwordField.send_keys(password)
signInField.submit()
Binary file added Solutions/falconis/Task7/certi.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Solutions/falconis/Task7/certi1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Solutions/falconis/Task7/certi2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Solutions/falconis/Task7/certi3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Solutions/falconis/Task7/font.ttf
Binary file not shown.
3 changes: 3 additions & 0 deletions Solutions/falconis/Task7/names.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Jake Peralta
Raymond Holt
Terry Jeffords
16 changes: 16 additions & 0 deletions Solutions/falconis/Task7/task7.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from PIL import Image, ImageFont, ImageDraw


x = int(input("Enter x-coordinate:"))
y = int(input("Enter y-coordinate:"))

f = open("names.txt", "r")
i = 1
for name in f:
image = Image.open('certi.jpg')
img_draw = ImageDraw.Draw(image)
font = ImageFont.truetype("font.ttf", 60)
img_draw.text((x, y), name.strip(), fill='black', font=font)
image.save('certi' + str(i) + '.jpg')
i += 1

Binary file added Solutions/falconis/Task9/fma.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6ca6f48

Please sign in to comment.