The two questions are intended to be short and simple that you can implement each in half-an-hour.
The criteria for evaluation are
- Efficiency of the code
- Documentation and formatting
- Separation of concerns
- A general taste in programming :)
def add_provider(auth_hash) | |
unless auth_existing = authorizations.find_by_provider_and_uid(auth_hash["provider"], auth_hash["uid"]) | |
# No auth exists for this provider. Create one and update keys. | |
auth = Authorization.create :user => self, :provider => auth_hash["provider"], :uid => auth_hash["uid"] | |
auth.update_access_keys(auth_hash) | |
else | |
# Auth already exists but we need to update the access_tokens | |
auth_existing.update_access_keys(auth_hash) | |
end | |
end |
Rescuegroups.configure do |config| | |
config.api_key = "AAAAAA" | |
end | |
client = Rescuegroups::Client.new :object_type => "animals", :object_action => "publicSearch" | |
client.set_fields ['animalName', 'animalID', 'animalBreed'] | |
AnimalsData.limit(500).skip(100).each do |animal| | |
sleep(0.5) # Please suggest value to put here | |
client.clear_filters | |
client.set_filter 'animalStatus', :eq, "Available" |
diff --git a/workspace.bzl b/workspace.bzl | |
index 13f29c1..d0cb97a 100644 | |
--- a/workspace.bzl | |
+++ b/workspace.bzl | |
@@ -76,7 +76,7 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""): | |
native.new_http_archive( | |
name = "gmock_archive", | |
- url = "https://archive.openswitch.net/gmock-1.7.0.zip", | |
+ url = "http://52.230.1.181:8000/gmock-1.7.0.zip", |
मैं रोजाना नाश्ते के लिए पास्ता खाना खा रहा हूं |
from PIL import Image, ImageFont, ImageDraw | |
FONT_SIZE = 40 | |
MAX_PADDING = 4 | |
font_path = "~/Downloads/Roboto.ttf" | |
font_object = ImageFont.truetype(font_path, FONT_SIZE) # Font has to be a .ttf file | |
word = "hello" | |
fg = "#000000" # black foreground |
""" | |
This will read through the Google Fonts repo and make unified JSON of it | |
""" | |
import os | |
import sys | |
import io | |
from collections import defaultdict | |
import json |
You are given a text file as input.
Each line contains 2 words separated by a space. Both the words will have the same number of letters and are lowercase. You are required to find linear and circular distances between them.
Linear is when the alphabet in arranged in a list understood. abc....xyz Circular is when we assume after ...xyz we again have abc.... So in some cases, going in a circle might be shorter.