Skip to content

Commit

Permalink
Merge pull request #4 from opencode18/master
Browse files Browse the repository at this point in the history
Updated Fork
  • Loading branch information
arpitmisraw authored Jan 17, 2018
2 parents 640fd37 + cb4b230 commit fe8a158
Show file tree
Hide file tree
Showing 34 changed files with 395 additions and 0 deletions.
81 changes: 81 additions & 0 deletions Solutions/AK-007/Task1/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
@import url("https://fonts.googleapis.com/css?family=Audiowide");
@import url("https://fonts.googleapis.com/css?family=Roboto");
html {
background-color: #252627;
text-align: center;
color: white;
font-family: "Roboto", sans-serif;
}
h1 {
color: #197278;
font-family: "Audiowide", cursive;
font-weight: 800;
font-size: 50px;
}
input {
border-radius: 50px;
outline: none;
border: none;
background-color: #edddd4;
padding: 15px;
width: 300px;
font-family: "Roboto", sans-serif;
font-size: 15px;
margin: 10px;
}
form {
position: relative;
text-align: center;
}
.foot {
color: white;
font-size: 20px;
position: relative;
margin-top: 400px;
}
button {
border-radius: 50px;
border: none;
outline: none;
padding: 10px;
width: 100px;
cursor: pointer;
background-color: #c44536;
color: white;
font-family: "Roboto", sans-serif;
font-size: 15px;
margin-left: 1px;
margin-top: 30px;
}
.set {
padding: 5px;
margin: 10px;
background-color: #eceeed;
border: none;
outline: none;
border-radius: 10px;
}
.result {
position: relative;
}
.title {
color: #383a39;
}
.company {
color: #0b3c49;
}
.desc {
color: #6987c9;
}
a:link {
color: #bf211e;
}
a:link,
a:hover,
a:visited,
a:active {
text-decoration: none;
}
a:hover {
color: #9d44b5;
}
40 changes: 40 additions & 0 deletions Solutions/AK-007/Task1/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Job Hunt</title>
<meta name="viewport" content="width=device-width, initial-scale=1">


<link rel="stylesheet" href="css/style.css">


</head>

<body>

<h1>JOB HUNT</h1>
<div class="input">
<form id="value">
<input type="text" placeholder="Enter expertise">
<input type="text" placeholder="Enter location">
<button type="button" onclick="myFunction()" value="Submit">Submit</button>
</form>
</div>
<div class="result"></div>
<div class="foot">Developed by Ayush Gupta</div>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/js/bootstrap.min.js'></script>



<script src="js/index.js"></script>




</body>

</html>
35 changes: 35 additions & 0 deletions Solutions/AK-007/Task1/js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
function myFunction() {
$('.result').empty();
var x = document.getElementById("value");
var desc = x.elements[0].value;
var loc = x.elements[1].value;
var link =
"https://jobs.github.com/positions.json?description=" +
desc +
"&location=" +
loc;
$.ajax({
url: link,
dataType: "jsonp",
success: function(data) {
for (var i = 0; i < data.length; i++) {
var title = data[i].title;
var company = data[i].company;
var link = data[i].url;
var description = data[i].description;
var string =
"<div class='set'><h3 class='title'>" +
title +
"</h3><h4 class='company'>Company : " +
company +
"</h4><div class='desc'>" +
description +
"</div><div class='url'><a href='" +
link +
"' target='_blank'>Link</a></div></div>";
$(".result").append(string);
}
$(".foot").css("margin-top", "20px");
}
});
}
28 changes: 28 additions & 0 deletions Solutions/Jigar3/Task7/image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from PIL import ImageFont, ImageDraw, Image


print("NOTE: Please place the image in the same folder as the one in which the script is running")
print("NOTE: Name the text file to be read as names.txt")

imName = raw_input("Input the name of the image along with its extension type\n")

print("Enter the co-ordinates of the text to be placed")
x = int(raw_input("X co-ordinate:\n"))
y = int(raw_input("Y co-ordinate:\n"))

fontName = raw_input("Enter the name of the font file which is to be used:\n")
fontSize = int(raw_input("Enter the size of font:\n"))

with open("names.txt") as f:
for line in f:
text = line.rstrip()


im = Image.open(imName)
draw = ImageDraw.Draw(im)

font = ImageFont.truetype(fontName, fontSize)
draw.text((x, y), text, font=font)

im.save(text + '.jpg')
print("Finished with " + text + ".jpg")
11 changes: 11 additions & 0 deletions Solutions/Tlazypanda/Task2/task2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import re

exp= input()
date = r'(\d{2})-(\d{2})-(\d{4})'
reg = re.search(date,exp)
str = reg.group()
month=str[3:5]
day=str[:2]
year=str[6:]
ans = month+'-'+day+'-'+year
print(ans)
19 changes: 19 additions & 0 deletions Solutions/arpitmisraw/Task3/task3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import requests
from bs4 import BeautifulSoup

url = "https://scirate.com/"
resp = requests.get(url)

html = resp.text
scirate_soup = BeautifulSoup(html)


title = scirate_soup.select('.title a')


href = scirate_soup.select('a.paper-download')



for i in range(len(title)):
print(i+1,". ",title[i].getText(),'\n','Link:',href[i].get('href'),'\n\n')
39 changes: 39 additions & 0 deletions Solutions/marshallKR7/Task-2/Threading.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#include<iostream.h>
#include<thread.h>
using namespace std;

void fact(long long int n)
{
long long int ans=1,i;
for(i=2;i<=n;i++)
{
ans=(ans*i)%1000000007;
}
cout<<"The factorial is"<<ans<<"\n";
}

void expo(long long int t)
{
long long int base,exp,final=1;
base=t;
exp=t;
while(exp>0)
{
if(exp%2!=0)
final=(final*base)%1000000007;
base=(base*base)%1000000007;
exp/=2;
}
cout<<"The exponential of number with respect to itself is"<<final<<"\n";
}

int main()
{
long long int a;
cin>>a;
thread t1(&fact,a);
thread t2(&expo,a);
t1.join();
t2.join();
return 0;
}
18 changes: 18 additions & 0 deletions Solutions/nab331/Task6/facebookScript.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from selenium import webdriver
from selenium.webdriver.common.keys import Keys


username = "notmyusername"
password = "notmypassword"

driver = webdriver.Chrome()
driver.get("http://www.facebook.com")

username_box = driver.find_element_by_id("email");
password_box = driver.find_element_by_id("pass");

username_box.send_keys(username)
password_box.send_keys(password)

login = driver.find_element_by_id('loginbutton')
login.click()
25 changes: 25 additions & 0 deletions Solutions/nab331/Task6/gmailScript.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep

#Page going to google accounts by default

username = "notmyusername"
password = "notmypassword"

driver = webdriver.Chrome()
driver.get("http://www.gmail.com")

username_box = driver.find_element_by_id("identifierId")
username_box.send_keys(username)

Next = driver.find_elements_by_id("identifierNext")
Next[0].click()

sleep(1)

password_box = driver.find_element_by_name("password")
password_box.send_keys(password)

Next = driver.find_element_by_id("passwordNext")
Next.click()
Binary file added Solutions/nab331/Task7/Output/1 - IIT2016001.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/nab331/Task7/Output/11 - fop.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/nab331/Task7/Output/13 - huhhh.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/nab331/Task7/Output/14 - 45.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/nab331/Task7/Output/15 - memelord45.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/nab331/Task7/Output/16 - abcdefg.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/nab331/Task7/Output/17 - opencodee.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/nab331/Task7/Output/2 - IIT2016002.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/nab331/Task7/Output/3 - IIT20167.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/nab331/Task7/Output/4 - mubu.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/nab331/Task7/Output/5 - dawei.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/nab331/Task7/Output/6 - test1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/nab331/Task7/Output/8 - a.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/nab331/Task7/Output/9 - 45.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/nab331/Task7/fonts/best_font.ttf
Binary file not shown.
18 changes: 18 additions & 0 deletions Solutions/nab331/Task7/input.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
IIT2016001
IIT2016002
IIT20167
mubu
dawei
test1
biggerlengthwordwow
a
45
ogioigrneio
fop
frpeowfjvor or
huhhh
45
memelord45
abcdefg
opencodee
you have found it
Binary file added Solutions/nab331/Task7/sample_in.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions Solutions/nab331/Task7/script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
import csv
import os

participants = []

with open("input.csv","rb") as f:
reader = csv.reader(f)
for row in reader:
participants.append( row[0] )



fonts_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'fonts')
font = ImageFont.truetype(os.path.join(fonts_path, 'best_font.ttf'), 80)

output_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'Output')



i=1
for name in participants:

img = Image.open("sample_in.jpg")
draw = ImageDraw.Draw(img)
fsize_x , fsize_y = draw.textsize(name,font)

x = 1065-(fsize_x)/2
y = 510-(fsize_y)/2
draw.text( (x , y) ,name,(0,0,0),font)

output_name = os.path.join( output_path , str(i)+" - "+name+".jpg" )
img.save(output_name)
i+=1
Binary file added Solutions/rahulkumaran/Task7/a.TTF
Binary file not shown.
30 changes: 30 additions & 0 deletions Solutions/rahulkumaran/Task7/certificates.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import os
from PIL import ImageFont, ImageDraw, Image

fileName = raw_input("Enter name of the file from which you want to read the names of participants: ")
imgName = raw_input("Enter the name of image that you want to use as your template along with extension: ")

coOrdinates = raw_input("Enter the x and y co-ordinates of the text to be placed by separating them with a space like \"500 500\"")
coOrdinates_List = coOrdinates.split(" ")
x = int(coOrdinates_List[0])
y = int(coOrdinates_List[1])


with open(filename) as f:
for line in f:
name = line.rstrip()


img = Image.open(imgName)
draw = ImageDraw.Draw(img)

font = font = ImageFont.truetype("a.ttf", 60)
draw.text((x, y), name, font=font)

img.save(name + '.jpg')

if not os.path.exists( 'certificates' ) :
os.makedirs( 'certificates' )

img.save( 'certificates\\'+ name +'.pdf', "PDF", resolution=100.0)

Loading

0 comments on commit fe8a158

Please sign in to comment.